* src/editfns.c (Finsert_char): Make the error message more informative.
[bpt/emacs.git] / src / ChangeLog
1 2012-12-08 Chong Yidong <cyd@gnu.org>
2
3 * editfns.c (Finsert_char): Make the error message more
4 informative (Bug#12992).
5
6 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
7
8 Simplify get_lim_data.
9 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
10 Remove USG and vlimit methods; no longer used these days.
11 Add #error catchall just in case.
12
13 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
14 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
15 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
16 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
17 (deleted_pid_list, Fdelete_process, create_process)
18 (record_child_status_change, handle_child_signal, deliver_child_signal)
19 (init_process_emacs, syms_of_process):
20 Assume SIGCHLD is defined.
21 (parse_signal): Remove. All uses removed.
22 (abbr_to_signal): New static function.
23 (Fsignal_process): Use it to convert signal names to ints.
24 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
25 kill (getpgrp (), ...).
26 (emacs_sigaction_init): Assume SIGCHLD is defined.
27 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
28 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
29 * syssignal.h (EMACS_KILLPG): Remove.
30 All uses replaced by 'kill' with a negative pid.
31 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
32 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
33
34 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
35
36 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
37 This will cause a production Emacs to dump core instead of
38 infinite-looping.
39
40 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
41
42 * frame.c (make_frame): Do not set window's buffer to t.
43 * window.c (Fsplit_window_internal): Likewise. Previously it was
44 used to indicate that the window is being set up. Now we use
45 set_window_buffer for all new windows, so the condition in ...
46 (Fset_window_buffer): ... is always true and can be removed.
47
48 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
49
50 Convenient macro to check whether the buffer is hidden.
51 * buffer.h (BUFFER_HIDDEN_P): New macro.
52 * frame.c (make_frame): Use it. Adjust comment.
53 * buffer.c (candidate_buffer): New function.
54 (Fother_buffer, other_buffer_safely): Use it.
55
56 2012-12-06 Eli Zaretskii <eliz@gnu.org>
57
58 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
59 if the child process is still running. Instead, exit the wait
60 loop and return zero. (Bug#13086)
61
62 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
63
64 * frame.h (x_char_width, x_char_height): Remove prototypes.
65 * w32term.h (x_char_width, x_char_height): Likewise.
66 * xfns.c (x_char_width, x_char_height): Remove.
67 * w32fns.c (x_char_width, x_char_height): Likewise.
68 * nsfns.c (x_char_width, x_char_height): Likewise.
69 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
70 all window frames.
71 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
72 * keyboard.c (command_loop_1): Remove prototype.
73 (command_loop_2, top_level_1): Add static to match prototype.
74
75 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
76
77 Fix a recently-introduced delete-process race condition.
78 * callproc.c, process.h (record_kill_process):
79 New function, containing part of the old call_process_kill.
80 (call_process_kill): Use it.
81 This does not change call_process_kill's behavior.
82 * process.c (Fdelete_process): Use record_kill_process to fix a
83 race condition that could cause Emacs to lose track of a child.
84
85 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
86
87 Avoid code duplication between prev_frame and next_frame.
88 * frame.c (candidate_frame): New function. Add comment.
89 (prev_frame, next_frame): Use it. Adjust comment.
90
91 2012-12-06 Eli Zaretskii <eliz@gnu.org>
92
93 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
94 fails, signal an error instead of continuing with an empty
95 string. (Bug#13079)
96 Encode expanded temp file pattern before passing it to mkstemp or
97 mktemp.
98
99 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
100 Encode the file name before passing it to dostounix_filename, in
101 case it will downcase it (under w32-downcase-file-names).
102 (Bug#12933)
103
104 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
105
106 Minor call-process cleanups.
107 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
108 at the same time as other platforms, to simplify analysis.
109 No need for fd0_volatile since we have synch_process_fd.
110 Avoid needless emacs_close; arg is always negative.
111
112 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
113
114 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
115 processes.
116
117 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
118
119 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
120 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
121 and mouse_face_hidden members to a bitfields.
122 * frame.h (struct frame): Remove set-but-not-used space_width member.
123 (FRAME_SPACE_WIDTH): Remove.
124 * nsterm.m, w32term.c, xterm.c: Adjust users.
125 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
126 member. Adjust users. Convert term_initted, delete_in_insert_mode,
127 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
128 members to a bitfields.
129
130 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
131
132 Don't let call-process be a zombie factory (Bug#12980).
133 Fixing this bug required some cleanup of the signal-handling code.
134 As a side effect, this change also fixes a longstanding rare race
135 condition whereby Emacs could mistakenly kill unrelated processes,
136 and it fixes a bug where a second C-g does not kill a recalcitrant
137 synchronous process in GNU/Linux and similar platforms.
138 The patch should also fix the last vestiges of Bug#9488,
139 a bug which has mostly been fixed on the trunk by other changes.
140 * callproc.c, process.h (synch_process_alive, synch_process_death)
141 (synch_process_termsig, sync_process_retcode):
142 Remove. All uses removed, to simplify analysis and so that
143 less consing is done inside critical sections.
144 * callproc.c (call_process_exited): Remove. All uses replaced
145 with !synch_process_pid.
146 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
147 These take the role of what used to be in unwind-protect arg.
148 All uses changed.
149 (block_child_signal, unblock_child_signal):
150 New functions, to avoid races that could kill innocent-victim processes.
151 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
152 (call_process_kill): Record killed processes as deleted, so that
153 zombies do not clutter up the system. Do this inside a critical
154 section, to avoid a race that would allow the clutter.
155 (call_process_cleanup): Fix code so that the second C-g works again
156 on common platforms such as GNU/Linux.
157 (Fcall_process): Create the child process in a critical section,
158 to fix a race condition. If creating an asynchronous process,
159 record it as deleted so that zombies do not clutter up the system.
160 Do unwind-protect for WINDOWSNT too, as that's simpler in the
161 light of these changes. Omit unnecessary call to emacs_close
162 before failure, as the unwind-protect code does that.
163 * callproc.c (call_process_cleanup):
164 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
165 * process.c (record_deleted_pid): New function, containing
166 code refactored out of Fdelete_process.
167 (Fdelete_process): Use it.
168 (process_status_retrieved): Remove. All callers changed to use
169 child_status_change.
170 (record_child_status_change): Remove, folding its contents into ...
171 (handle_child_signal): ... this signal handler. Now, this
172 function is purely a handler for SIGCHLD, and is not called after
173 a synchronous waitpid returns; the synchronous code is moved to
174 wait_for_termination. There is no need to worry about reaping
175 more than one child now.
176 * sysdep.c (get_child_status, child_status_changed): New functions.
177 (wait_for_termination): Now takes int * status and bool
178 interruptible arguments, too. Do not record child status change;
179 that's now the caller's responsibility. All callers changed.
180 Reimplement in terms of get_child_status.
181 (wait_for_termination_1, interruptible_wait_for_termination):
182 Remove. All callers changed to use wait_for_termination.
183 * syswait.h: Include <stdbool.h>, for bool.
184 (record_child_status_change, interruptible_wait_for_termination):
185 Remove decls.
186 (record_deleted_pid, child_status_changed): New decls.
187 (wait_for_termination): Adjust to API changes noted above.
188
189 * bytecode.c, lisp.h (Qbytecode): Remove.
190 No longer needed after 2012-11-20 interactive-p changes.
191
192 2012-12-03 Eli Zaretskii <eliz@gnu.org>
193
194 * xdisp.c (redisplay_window): If the cursor is visible, but inside
195 the scroll margin, move point outside the margin. (Bug#13055)
196
197 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
198
199 * gtkutil.c (my_log_handler): New function.
200 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
201
202 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
203
204 * lisp.h (modify_region): Rename to...
205 (modify_region_1): ...new prototype.
206 * textprop.c (modify_region): Now static. Adjust users.
207 * insdel.c (modify_region): Rename to...
208 (modify_region_1): ...new function to work with current buffer.
209 Adjust comment and users. Use true and false for booleans.
210
211 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
212
213 * alloc.c (free_save_value): New function.
214 (safe_alloca_unwind): Use it.
215 * lisp.h (free_save_value): New prototype.
216 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
217 Add comment.
218 (save_excursion_restore): Adjust to match saved data structure.
219 Use free_save_value to offload some work from GC. Drop obsolete
220 #if 0 code.
221
222 2012-12-03 Chong Yidong <cyd@gnu.org>
223
224 * fileio.c (Vauto_save_list_file_name): Doc fix.
225
226 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
227
228 * w32fns.c: Remove prototype of atof.
229 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
230 builds.
231 (file_dialog_callback): Declared UINT_PTR.
232
233 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
234 with 64-bit builds.
235
236 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
237 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
238 defined.
239
240 2012-12-03 Glenn Morris <rgm@gnu.org>
241
242 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
243
244 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
245
246 Fix xpalloc confusion after memory is exhausted.
247 * alloc.c (xpalloc): Comment fix.
248 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
249 and signals an error, do not clear charset_table_size, as
250 charset_table is still valid.
251 * doprnt.c (evxprintf): Clear *BUF after freeing it.
252
253 Use execve to avoid need to munge environ (Bug#13054).
254 * callproc.c (Fcall_process):
255 * process.c (create_process):
256 Don't save and restore environ; no longer needed.
257 * callproc.c (child_setup):
258 Use execve, not execvp, to preserve environ.
259
260 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
261
262 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
263
264 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
265
266 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
267 display for sliced images (Bug#10500).
268
269 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
270
271 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
272
273 * doc.c (Fdocumentation): Re-add handling of function-documentation,
274 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
275
276 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
277
278 * xdisp.c (window_outdated): Remove eassert since it hits
279 some suspicious corner cases (see Bug#13007 and Bug#13012).
280 (mode_line_update_needed): New function.
281 (redisplay_internal, redisplay_window): Use it.
282 (ensure_selected_frame): New function.
283 (redisplay_internal, unwind_redisplay): Use it.
284 (redisplay_internal): Move comment about buffer_shared...
285 (buffer_shared_and_changed): ...near to its real use.
286
287 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
288
289 * callproc.c (Fcall_process): Don't misreport vfork failure.
290
291 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
292
293 * callproc.c (Fcall_process): Fix vfork portability problems.
294 Do not assume that fd[0], count, filefd, and save_environ survive
295 vfork. Fix bug whereby wrong errno value could be reported for
296 pipe failure. Some minor cleanups, too, as follows. Move buf and
297 bufsize to the context where they're needed. Change new_argv to
298 be of type char **, as this is more convenient and avoids casts.
299 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
300 Now local constants, not macros.
301
302 2012-11-18 Kenichi Handa <handa@gnu.org>
303
304 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
305 for the variable "f".
306
307 2012-11-13 Kenichi Handa <handa@gnu.org>
308
309 * font.c (font_unparse_xlfd): Exclude special characters from the
310 generating XLFD name.
311
312 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
313
314 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
315 * dired.c (stat_uname, stat_gname):
316 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
317
318 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
319 * dired.c (directory_files_internal, file_name_completion):
320 Assume EAGAIN and EINTR are defined.
321
322 * fileio.c (Fcopy_file): Assume EISDIR is defined.
323 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
324 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
325 * lread.c (readbyte_from_file): Assume EINTR is defined.
326 * process.c (wait_reading_process_output, send_process) [subprocesses]:
327 Assume EIO and EAGAIN are defined.
328 * unexcoff.c (write_segment): Assume EFAULT is defined.
329
330 2012-11-27 Eli Zaretskii <eliz@gnu.org>
331
332 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
333 (Bug#11964)
334
335 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
336 highlighting on the frame was cleared. Prevents assertion
337 violations when repeatedly clicking on the "Top" link of the
338 "bread-crumbs" in Info buffers.
339
340 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
341
342 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
343
344 2012-11-24 Ken Brown <kbrown@cornell.edu>
345
346 * keyboard.c (HAVE_MOUSE):
347 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
348 were always defined.
349
350 2012-11-24 Eli Zaretskii <eliz@gnu.org>
351
352 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
353 between bpos_covered and bpos_max. This fixes cursor display when
354 several display strings follow each other.
355
356 * .gdbinit (pgx): If the glyph's object is a string, display the
357 pointer to string data, rather than the value of the string object
358 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
359
360 * indent.c (Fvertical_motion): If the starting position is covered
361 by a display string, return to one position before that, to avoid
362 overshooting it inside move_it_to. (Bug#12930)
363
364 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
365
366 * frame.h (struct frame): Remove display_preempted member
367 since all users are dead long ago.
368 * nsterm.h (struct x_output): Use the only dummy member.
369 * w32menu.c (pending_menu_activation): Remove since not
370 really used.
371 (set_frame_menubar): Adjust user.
372 * w32term.h (struct x_output): Drop outdated #if 0 code.
373 (struct w32_output): Use bitfields for explicit_parent,
374 asked_for_visible and menubar_active members. Drop
375 unused pending_menu_activation member.
376 * xterm.h (struct x_output): Drop outdated #if 0 code.
377 Use bitfields for explicit_parent, asked_for_visible,
378 has_been_visible and net_wm_state_hidden_seen members.
379
380 2012-11-23 Eli Zaretskii <eliz@gnu.org>
381
382 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
383 of a literal "/". (Bug#12955)
384 (gl-stamp): Invoke fc.exe directly, not through cmd.
385
386 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
387
388 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
389 * dired.c: Assume HAVE_DIRENT_H.
390 (NAMLEN): Remove, replacing with ...
391 (dirent_namelen): New function. All uses changed. Use the GNU macro
392 _D_EXACT_NAMELEN if available, as it's faster than strlen.
393 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
394 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
395 * makefile.w32-in (DIR_H): Remove. All uses replaced with
396 $(NT_INC)/dirent.h.
397 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
398 * ndir.h: Rename to ../nt/inc/dirent.h.
399 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
400 Do not include <dirent.h>; no longer needed.
401 * w32.c: Include <dirent.h> rather than "ndir.h".
402
403 2012-11-23 Chong Yidong <cyd@gnu.org>
404
405 * xftfont.c (xftfont_open): Remove duplicate assignment.
406
407 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
408
409 * alloc.c (Fgarbage_collect): Unblock input after clearing
410 gc_in_progress to avoid note_mouse_highlight glitch with GC.
411 * frame.h (FRAME_MOUSE_UPDATE): New macro.
412 * msdos.c (IT_frame_up_to_date): Use it here...
413 * w32term.c (w32_frame_up_to_date): ...here...
414 * xterm.c (XTframe_up_to_date): ...and here...
415 * nsterm.m (ns_frame_up_to_date): ...but not here.
416 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
417 Adjust users.
418 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
419 Do not check whether GC is in progress.
420
421 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
422
423 * xdisp.c (window_buffer_changed): New function.
424 (update_menu_bar, update_tool_bar): Use it to
425 simplify large 'if' statements.
426 (redisplay_internal): Generalize commonly used
427 'tail' and 'frame' local variables.
428
429 2012-11-22 Eli Zaretskii <eliz@gnu.org>
430
431 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
432 with Windows system header.
433
434 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
435
436 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
437 * alloc.c: Assume unistd.h exists.
438 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
439 * sysdep.c (get_current_dir_name): Assume getcwd exists.
440 (getwd) [USG]: Remove; no longer needed.
441 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
442 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
443 * w32.h (getcwd): Remove decl.
444
445 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
446
447 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
448 Make it set selected_window as well.
449 (update_tool_bar): Use it.
450
451 2012-11-21 Ken Brown <kbrown@cornell.edu>
452
453 * emacs.c (main): Set the G_SLICE environment variable for all
454 Cygwin builds, not just GTK builds. See
455 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
456
457 2012-11-21 Eli Zaretskii <eliz@gnu.org>
458
459 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
460 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
461 Define for the MSVC compiler.
462
463 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
464
465 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
466 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
467 dostounix_filename. Prevents crashes down the road, because
468 dostounix_filename assumes it gets a unibyte string. Reported by
469 Michel de Ruiter <michel@sentient.nl>, see
470 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
471
472 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
473
474 Conflate Qnil and Qunbound for `symbol-function'.
475 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
476 * lread.c (init_obarray): Set `function' fields to Qnil.
477 * eval.c (Fcommandp): Ignore Qunbound.
478 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
479 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
480 Test NILP rather than Qunbound.
481 (Ffmakunbound): Set to Qnil.
482 (Fsymbol_function): Never signal an error.
483 (Finteractive_form): Ignore Qunbound.
484
485 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
486
487 * eval.c (interactive_p): Remove no-longer-used decl.
488
489 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
490
491 * xdisp.c (buffer_shared): Adjust comment.
492 (buffer_shared_and_changed): New function.
493 (prepare_menu_bars, redisplay_internal): Use it to
494 decide whether all windows or frames should be updated.
495 (window_outdated): New function.
496 (text_outside_line_unchanged_p, redisplay_window): Use it.
497 (redisplay_internal): Likewise. Fix indentation.
498
499 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
500
501 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
502 (syms_of_eval): Remove corresponding defsubr.
503 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
504
505 2012-11-19 Daniel Colascione <dancol@dancol.org>
506
507 * w32fns.c (Fx_file_dialog):
508 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
509 cygwin_convert_file_name*.
510
511 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
512 Rename cygwin_convert_path* to cygwin_convert_file_name*.
513
514 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
515
516 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
517
518 2012-11-18 Eli Zaretskii <eliz@gnu.org>
519
520 * w32select.c: Include w32common.h before w32term.h, so that
521 windows.h gets included before w32term.h uses some of its
522 features, see below.
523
524 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
525 New typedefs.
526 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
527 New prototypes.
528 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
529
530 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
531
532 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
533 (ns_select): Return at once if events are held (Bug#12834).
534
535 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
536
537 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
538 Needed following 2012-10-20 change. (Bug#12902)
539
540 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
541
542 * w32proc.c (waitpid): Remove unused label get_result.
543
544 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
545
546 * makefile.w32-in (SYSWAIT_H): New macro.
547 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
548 ($(BLD)/sysdep.$(O)): Update dependencies.
549
550 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
551
552 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
553 * callproc.c (relocate_fd): Assume F_DUPFD.
554 * emacs.c, term.c (O_RDWR): Remove.
555 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
556 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
557 * nsterm.m: Assume <fcntl.h> exists.
558 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
559 (create_pty, Fmake_network_process, server_accept_connection)
560 (wait_reading_process_output, init_process_emacs):
561 Assume O_NONBLOCK.
562 (wait_reading_process_output): Put in a special case for WINDOWSNT
563 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
564 It's not clear this is needed, but it's a more-conservative change.
565 (create_process): Assume FD_CLOEXEC.
566 (create_process, create_pty): Assume O_NOCTTY.
567 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
568 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
569 Omit if not DOS_NT, since F_GETFL is not defined there.
570 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
571 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
572 (O_NOCTTY): Remove.
573 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
574 lack it, since gnulib guarantees this.
575 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
576
577 2012-11-17 Eli Zaretskii <eliz@gnu.org>
578
579 * w32.c (faccessat): Pretend that directories have the execute bit
580 set. Emacs expects that, e.g., in files.el:cd-absolute.
581
582 * w32proc.c (create_child): Don't clip the PID of the child
583 process to fit into an Emacs integer, as this is no longer a
584 restriction.
585 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
586 reaping only the process specified by PID argument, if that is
587 positive. Use PID instead of dead_child to know which process to
588 reap. Wait for the child to die only if WNOHANG is not in
589 OPTIONS.
590 (sys_select): Don't set dead_child.
591
592 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
593 as it is no longer needed.
594
595 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
596 no longer needed.
597 (record_child_status_change): Remove the setting of
598 record_at_most_one_child for the !WNOHANG case.
599
600 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
601
602 Fix problems in ns port found by static checking.
603 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
604 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
605 not to process group.
606 (ns_select): Use emacs_write, not write, as that's more robust
607 in the presence of signals.
608 (fd_handler:): Check for read errors.
609
610 2012-11-16 Glenn Morris <rgm@gnu.org>
611
612 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
613
614 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
615
616 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
617
618 2012-11-16 Eli Zaretskii <eliz@gnu.org>
619
620 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
621 use the same value of thread handle.
622 (start_timer_thread): If the timer thread exited (due to error),
623 clean up by closing the two handles it used. Duplicate the caller
624 thread's handle here, so it gets duplicated only once, when
625 launching the timer thread. Set priority of the timer thread, not
626 the caller thread.
627 (getitimer): Don't duplicate the caller thread's handle here.
628 (Bug#12832)
629
630 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
631
632 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
633 called (Bug#12834).
634
635 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
636
637 Remove no-longer-used pty_max_bytes variable.
638 * process.c (pty_max_bytes): Remove; unused.
639 (send_process): Do not set it.
640
641 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
642
643 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
644 Update dependencies.
645
646 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
647
648 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
649 This follows up on the 2012-09-29 patch that removed indirection
650 for the 'function' field. Reported by Sergey Vinokurov in
651 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
652
653 2012-11-14 Eli Zaretskii <eliz@gnu.org>
654
655 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
656 different name, as the MS runtime does not have such a function,
657 and probably never will.) All callers changed. Ignore DIRFD
658 value if PATH is an absolute file name, to match Posix spec
659 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
660 symlinks.
661
662 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
663
664 * xdisp.c (echo_area_display, redisplay_internal):
665 Omit redundant check whether frame_garbaged is set.
666
667 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
668
669 Use faccessat, not access, when checking file permissions (Bug#12632).
670 This fixes a bug that has been present in Emacs since its creation.
671 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
672 which must set some sort of record. (Torek's bug report was against
673 a predecessor of GNU Emacs, but GNU Emacs happened to have the
674 same common flaw.) See Torek's Usenet posting
675 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
676 Posted: Fri Apr 8 14:18:56 1983.
677 * Makefile.in (LIB_EACCESS): New macro.
678 (LIBES): Use it.
679 * callproc.c (init_callproc):
680 * charset.c (init_charset):
681 * fileio.c (check_existing, check_executable, check_writable)
682 (Ffile_readable_p):
683 * lread.c (openp, load_path_check):
684 * process.c (allocate_pty):
685 * xrdb.c (file_p):
686 Use effective UID when checking permissions, not real UID.
687 * callproc.c (init_callproc):
688 * charset.c (init_charset):
689 * lread.c (load_path_check, init_lread):
690 Test whether directories are accessible, not merely whether they exist.
691 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
692 * fileio.c (check_existing, check_executable, check_writable)
693 (Ffile_readable_p):
694 Use symbolic names instead of integers for the flags, as they're
695 portable now.
696 (check_writable): New arg AMODE. All uses changed.
697 Set errno on failure.
698 (Ffile_readable_p): Use faccessat, not stat + open + close.
699 (Ffile_writable_p): No need to call check_existing + check_writable.
700 Just call check_writable and then look at errno. This saves a syscall.
701 dir should never be nil; replace an unnecessary runtime check
702 with an eassert. When checking the parent directory of a nonexistent
703 file, check that the directory is searchable as well as writable, as
704 we can't create files in unsearchable directories.
705 (file_directory_p): New function, which uses 'stat' on most platforms
706 but faccessat with D_OK (for efficiency) if WINDOWSNT.
707 (Ffile_directory_p, Fset_file_times): Use it.
708 (file_accessible_directory_p): New function, which uses a single
709 syscall for efficiency.
710 (Ffile_accessible_directory_p): Use it.
711 * xrdb.c (file_p): Use file_directory_p.
712 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
713 * lread.c (openp): When opening a file, use fstat rather than
714 stat, as that avoids a permissions race. When not opening a file,
715 use file_directory_p rather than stat.
716 (dir_warning): First arg is now a usage string, not a format.
717 Use errno. All uses changed.
718 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
719 that merely introduced a race.
720 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
721 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
722 and similarly for the other O_* flags.
723 * w32.c (sys_faccessat): Rename from sys_access and switch to
724 faccessat's API. All uses changed.
725 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
726 (magic_db): Rename from magic_file_p.
727 (magic_db, search_magic_path): Return an XrmDatabase rather than a
728 char *, so that we don't have to test for file existence
729 separately from opening the file for reading. This removes a race
730 fixes a permission-checking problem, and simplifies the code.
731 All uses changed.
732 (file_p): Remove; no longer needed.
733
734 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
735
736 Omit glyphs initialization at startup.
737 * dispnew.c (glyphs_initialized_initially_p): Remove.
738 (adjust_frame_glyphs_initially): Likewise. Adjust users.
739 (Fredraw_frame): Move actual code from here...
740 (redraw_frame): ...to here. Add eassert. Adjust comment.
741 (Fredraw_display): Use redraw_frame.
742 * xdisp.c (clear_garbaged_frames): Likewise.
743
744 2012-11-13 Eli Zaretskii <eliz@gnu.org>
745
746 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
747 passed to pint2str and pint2hrstr to be at most the size of the
748 frame's decode_mode_spec_buffer. This avoids crashes with very
749 large values of FIELD_WIDTH argument to decode_mode_spec.
750 (Bug#12867)
751
752 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
753
754 Fix a race with verify-visited-file-modtime (Bug#12863).
755 Since at least 1991 Emacs has ignored an mtime difference of no
756 more than one second, but my guess is that this was to work around
757 file system bugs that were fixed long ago. Since the race is
758 causing problems now, let's remove that code.
759 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
760 whose time stamp is off by no more than a second. Insist that the
761 file time stamps match exactly.
762
763 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
764
765 * frame.h (struct frame): Convert external_tool_bar member to
766 1-bit unsigned bitfield.
767 * termhooks.h (struct terminal): Remove mouse_moved member since
768 all users are long dead. Adjust comment on mouse_position_hook.
769
770 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Simplify by using FOR_EACH_FRAME here and there.
773 * frame.c (next_frame, prev_frame, other_visible_frames)
774 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
775 * w32term.c (x_window_to_scroll_bar): Likewise.
776 * window.c (window_list): Likewise.
777 * xdisp.c (x_consider_frame_title): Likewise.
778 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
779 * xfns.c (x_window_to_frame, x_any_window_to_frame)
780 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
781 * xmenu.c (menubar_id_to_frame): Likewise.
782 * xselect.c (frame_for_x_selection): Likewise.
783 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
784 (x_window_to_menu_bar): Likewise.
785 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
786
787 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
788
789 * data.c (Qdefalias_fset_function): Now static.
790
791 Another tweak to vectorlike_header change.
792 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
793 Remove, and replace all uses with ...
794 (next_in_free_list, set_next_in_free_list):
795 New functions, which respect C's aliasing rules better.
796
797 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
798
799 * window.c (list4i): Rename from 'quad'. All uses changed.
800 Needed because <sys/types.h> defines 'quad' on Solaris 10.
801
802 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
803
804 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
805 warning about mixing declarations and code in ISO C90.
806
807 2012-11-10 Martin Rudalics <rudalics@gmx.at>
808
809 * window.c (Fsplit_window_internal): Set combination limit of
810 new parent window to t iff Vwindow_combination_limit is t;
811 fixing a regression introduced with the change from 2012-09-22.
812 (Fset_window_combination_limit): Fix doc-string.
813
814 2012-11-10 Eli Zaretskii <eliz@gnu.org>
815
816 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
817 amount when the scroll margins are too large. When scrolling
818 backwards in the buffer, give up if cannot reach point or the
819 scroll margin within a reasonable number of screen lines.
820 Fixes point position in window under scroll-up/down-aggressively when
821 point is positioned many lines beyond the window top/bottom.
822 (Bug#12811)
823
824 * ralloc.c (relinquish): If real_morecore fails to return memory
825 to the system, don't crash; instead, leave the last heap
826 unchanged and return. (Bug#12774)
827
828 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
829
830 * lisp.h (AUTOLOADP): New macro.
831 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
832 * data.c (Ffset): Remove special ad-advice-info handling.
833 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
834 (Fsubr_arity): CSE.
835 (Finteractive_form): Simplify.
836 (Fquo): Don't insist on having at least 2 arguments.
837 (Qdefalias_fset_function): New var.
838
839 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
840
841 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
842
843 * nsfont.m (Qcondensed, Qexpanded): New variables.
844 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
845 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
846
847 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
848
849 Fix recently introduced crash on MS-Windows (Bug#12839).
850 * w32term.h (struct scroll_bar): Use convenient header.
851 (SCROLL_BAR_VEC_SIZE): Remove.
852 * w32term.c (x_scroll_bar_create): Use VECSIZE.
853
854 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
855
856 Tweak last vectorlike_header change.
857 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
858 vectorlike object on the free list. This is introduced to avoid
859 some (but not all) pointer casting and aliasing problems, see
860 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
861 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
862 objects.
863 (xvectype, xvecsize): Use them to examine Lisp_Object values.
864
865 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
866
867 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
868 been removed, so remove them here also.
869
870 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
871
872 * doc.c (Fdocumentation): Handle new property
873 dynamic-docstring-function to replace the old ad-advice-info.
874
875 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
876
877 * fns.c (Qeql, hashtest_eq): Now static.
878
879 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
880
881 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
882 * fns.c (hashfn_eq, hashfn_eql, sxhash):
883 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
884 * buffer.c (compare_overlays): Use XLI rather than XHASH.
885
886 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
887
888 Use same hash function for hashfn_profiler as for hash_string etc.
889 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
890 * lisp.h (sxhash_combine): New inline function, with the contents
891 of the old SXHASH_COMBINE.
892 * profiler.c (hashfn_profiler): Use it, instead of having a
893 special hash function containing a comparison that always yields 1.
894
895 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
896
897 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
898 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
899 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
900 Remove unused vars.
901
902 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
903
904 * image.c (xpm_make_color_table_h): Fix compiler error because
905 make_hash_table changed.
906
907 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
908
909 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
910
911 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
912
913 Use ad-hoc comparison function for the profiler's hash-tables.
914 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
915 (make_log): Use them.
916 (handle_profiler_signal): Don't inhibit quit any longer since we don't
917 call Fequal any more.
918 (Ffunction_equal): New function.
919 (cmpfn_profiler, hashfn_profiler): New functions.
920 (syms_of_profiler): Initialize them.
921 * lisp.h (struct hash_table_test): New struct.
922 (struct Lisp_Hash_Table): Use it.
923 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
924 * fns.c (make_hash_table): Take a struct to describe the test.
925 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
926 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
927 (hash_lookup, hash_remove_from_table): Move assertion checking of
928 hashfn result here. Check hash-equality before calling cmpfn.
929 (Fmake_hash_table): Adjust call to make_hash_table.
930 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
931 (syms_of_fns): Initialize them.
932 * emacs.c (main): Move syms_of_fns earlier.
933 * xterm.c (syms_of_xterm):
934 * category.c (hash_get_category_set): Adjust call to make_hash_table.
935 * print.c (print_object): Adjust to new hash-table struct.
936 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
937
938 2012-11-08 Eli Zaretskii <eliz@gnu.org>
939
940 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
941 value of w32-scroll-lock-modifier is neither nil nor one of the
942 known key modifiers. (Bug#12806)
943
944 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
945
946 Shrink struct vectorlike_header to the only size field.
947 * lisp.h (enum pvec_type): Avoid explicit enum member values.
948 Adjust comment.
949 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
950 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
951 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
952 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
953 information from the vector header. Adjust comment.
954 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
955 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
956 layout.
957 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
958 (struct vectorlike_header): Remove next member. Adjust comment.
959 (struct Lisp_Subr): Add convenient header. Adjust comment.
960 (allocate_pseudovector): Adjust prototype.
961 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
962 (sweep_string, lisp_malloc): Remove useless prototypes.
963 (enum mem_type): Adjust comment.
964 (NEXT_IN_FREE_LIST): New macro.
965 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
966 (Fmake_bool_vector): Likewise.
967 (struct large_vector): New type to represent allocation unit for
968 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
969 (large_vectors): Change type to struct large_vector.
970 (allocate_vector_from_block): Simplify.
971 (PSEUDOVECTOR_NBYTES): Replace with...
972 (vector_nbytes): ...new function. Adjust users.
973 (sweep_vectors): Adjust processing of large vectors.
974 (allocate_vectorlike): Likewise.
975 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
976 Add easserts. Adjust XSETPVECTYPESIZE usage.
977 (allocate_buffer): Use BUFFER_PVEC_INIT.
978 (live_vector_p): Adjust to match large vector.
979 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
980 * buffer.h (struct buffer): Add next member.
981 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
982 New macros.
983 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
984 * fns.c (internal_equal): Adjust to match enum pvec_type change.
985 (copy_hash_table): Adjust to match vector header change.
986 * lread.c (defsubr): Use XSETPVECTYPE.
987 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
988 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
989 (xvecsize): New command.
990
991 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
992
993 * keyboard.c (event_to_kboard): Do not dereference
994 frame_or_window field of SELECTION_REQUEST_EVENT
995 and SELECTION_CLEAR_EVENT events (Bug#12814).
996 * xterm.h (struct selection_input_event): Adjust comment.
997
998 2012-11-07 Eli Zaretskii <eliz@gnu.org>
999
1000 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1001 such as Scroll Lock, if the respective keys are treated as
1002 function keys, not as modifiers. This avoids destroying non-ASCII
1003 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1004
1005 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1006
1007 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1008
1009 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1010
1011 Restore some duplicate definitions (Bug#12814).
1012 This undoes part of the 2012-11-03 changes. Some people build
1013 with plain -g rather than with -g3, and they need the duplicate
1014 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1015 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1016 Define as macros, as well as as enums or as constants.
1017
1018 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1019
1020 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1021 to keypad keys (Bug#12816).
1022
1023 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1024
1025 Minor adjustments of recently-changed frame functions.
1026 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1027 known to be a frame (we're in the FRAMEP branch).
1028 * lisp.h (Qframep): Remove decl. frame.h declares this.
1029 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1030 since they're meant for Lisp fixnum values.
1031
1032 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1033
1034 * window.c (Fwindow_combination_limit): Revert to the only
1035 required argument and adjust docstring as suggested in
1036 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1037 by Martin Rudalics <rudalics@gmx.at>.
1038
1039 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 Widely used frame validity and checking functions.
1042 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1043 * frame.c (decode_live_frame, decode_any_frame): New functions.
1044 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1045 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1046 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1047 (Fframe_pointer_visible_p): Use decode_any_frame.
1048 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1049 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1050 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1051 (Fframe_focus): Likewise. Allow zero number of arguments.
1052 Adjust docstring.
1053 (frame_buffer_list, frame_buffer_predicate): Remove.
1054 * lisp.h (frame_buffer_predicate): Remove prototype.
1055 * buffer.c (Fother_buffer): Use decode_any_frame.
1056 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1057 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1058 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1059 (Fclose_font, Ffont_info): Use decode_live_frame.
1060 * fontset.c (check_fontset_name): Likewise.
1061 * terminal.c (Fframe_terminal): Likewise.
1062 * w32fns.c (check_x_frame): Likewise.
1063 * window.c (Fminibuffer_window, Fwindow_at)
1064 (Fcurrent_window_configuration): Likewise.
1065 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1066 Likewise. Allow zero number of arguments. Adjust docstring.
1067 * dispnew.c (Fredraw_frame): Likewise.
1068 * xfaces.c (frame_or_selected_frame): Remove.
1069 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1070 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1071 (Fframe_face_alist): Use decode_live_frame.
1072 * xfns.c (check_x_frame): Likewise.
1073
1074 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 * window.c (quad): New function.
1077 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1078 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1079 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1080 (Fwindow_line_height): Use it.
1081 (Fwindow_fringes): Use list3.
1082 (Fwindow_scroll_bars): Use list4.
1083 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1084 (Fwindow_combination_limit): Allow zero number of arguments.
1085
1086 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1087
1088 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1089
1090 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1091 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1092 file descriptor 2 for standard error. (Bug#12805)
1093
1094 2012-11-05 Chong Yidong <cyd@gnu.org>
1095
1096 * process.c (wait_reading_process_output): Revert previous change.
1097
1098 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1099
1100 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1101 This removes code that has been obsolete since around 1990.
1102 * callproc.c (Fcall_process):
1103 * emacs.c (main):
1104 * process.c (create_process):
1105 * term.c (dissociate_if_controlling_tty):
1106 Assume setsid exists.
1107 * callproc.c (child_setup): Assume setpgid exists and behaves as
1108 per POSIX.1-1988 or later.
1109 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1110 * emacs.c (shut_down_emacs):
1111 * sysdep.c (sys_suspend, init_foreground_group):
1112 Assume getpgrp behaves as per POSIX.1-1998 or later.
1113 * msdos.c (setpgrp): Remove.
1114 (tcgetpgrp, setpgid, setsid): New functions.
1115 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1116 * term.c (no_controlling_tty): Remove; unused.
1117 * w32proc.c (setpgrp): Remove.
1118 (setsid, tcgetpgrp): New functions.
1119
1120 Simplify by assuming __fpending.
1121 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1122 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1123 Do not assume that __fpending's result fits in int.
1124
1125 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 Remove EMACS_OUTQSIZE+sleep hack.
1128 * dispnew.c (update_frame_1): Remove hack for terminals slower
1129 than 2400 bps, which throttled Emacs by having it sleep.
1130 This code hasn't worked since at least 2007, when the multi-tty stuff
1131 was added, and anyway those old terminals are long dead.
1132 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1133 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1134
1135 Fix data-loss with --version (Bug#9574).
1136 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1137 as we can't assume that emacs_strerror is initialized, and strerror
1138 is good enough here.
1139 (main): Invoke atexit earlier, to catch earlier instances of
1140 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1141
1142 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1143
1144 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1145 (keyDown): Remap keypad keys to X11 virtual key codes.
1146
1147 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 Fix data-loss with --batch (Bug#9574).
1150 * emacs.c: Include <close-stream.h>.
1151 (close_output_streams): New function.
1152 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1153 and handles errors appropriately.
1154 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1155 does that now.
1156
1157 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1158 The symptom is a diagnostic "GLib-WARNING **: In call to
1159 g_spawn_sync(), exit status of a child process was requested but
1160 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1161 waitpid(), so exit status can't be returned." The diagnostic
1162 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1163 The real bug is a race condition between Emacs and glib: Emacs
1164 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1165 so that glib can't find it. Work around the bug by invoking
1166 waitpid only on subprocesses that Emacs itself creates.
1167 * process.c (create_process, record_child_status_change):
1168 Don't use special value -1 in pid field, as the caller now must
1169 know the pid rather than having the callee infer it.
1170 The inference was sometimes incorrect anyway, due to another race.
1171 (create_process): Set new 'alive' member if child is created.
1172 (process_status_retrieved): New function.
1173 (record_child_status_change): Use it.
1174 Accept negative 1st argument, which means to wait for the
1175 processes that Emacs already knows about. Move special-case code
1176 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1177 processes that have already been waited for, by testing and
1178 clearing new 'alive' member.
1179 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1180 now does this internally.
1181 (handle_child_signal): Let record_child_status_change do all
1182 the work, since we do not want to reap all exited child processes,
1183 only the child processes that Emacs itself created.
1184 * process.h (Lisp_Process): New boolean member 'alive'.
1185
1186 Omit duplicate definitions no longer needed with gcc -g3.
1187 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1188 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1189 Define only as macros. There's no longer any need to also define
1190 these symbols as enums or as constants, since we now assume
1191 gcc -g3 when debugging.
1192
1193 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1194
1195 * lisp.mk: Adjust comments to the fact that term/internal is now
1196 loaded from loadup.el.
1197
1198 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1199 (msdos_fatal_signal): New function.
1200 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1201 its argument list.
1202
1203 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1204 for GCC versions before 4.
1205 (emacs_raise): Define to call msdos_fatal_signal.
1206
1207 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1208 iterator when starting in the middle of a display or overlay
1209 string. (Bug#12745)
1210
1211 2012-11-03 Chong Yidong <cyd@gnu.org>
1212
1213 * process.c (wait_reading_process_output): Clean up the last
1214 change.
1215
1216 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1217
1218 * process.c (wait_reading_process_output): Avoid a race condition
1219 with SIGIO delivery (Bug#11536).
1220
1221 2012-11-03 Chong Yidong <cyd@gnu.org>
1222
1223 * buffer.c (cursor_type): Untabify docstring.
1224
1225 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1226
1227 * frame.h (struct frame): Drop can_have_scroll_bars member
1228 which is meaningless for a long time. Adjust comments.
1229 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1230 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1231
1232 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1233
1234 * window.c (decode_next_window_args): Update window arg after
1235 calling decode_live_window and so fix crash reported at
1236 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1237 by Juanma Barranquero <lekktu@gmail.com>.
1238 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1239 * font.c (Ffont_at): Likewise.
1240
1241 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1242
1243 * widget.c (resize_cb): New function.
1244 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1245 (EmacsFrameResize): Check if all is up to date before changing frame
1246 size.
1247
1248 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1249
1250 Implement backtrace output for fatal errors on MS-Windows.
1251 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1252 (BACKTRACE_LIMIT_MAX): New macro.
1253 (w32_backtrace): New function.
1254 (emacs_abort): Use w32_backtrace when the user chooses not to
1255 attach a debugger. Update the text of the abort dialog.
1256
1257 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1258
1259 Window-related stuff cleanup here and there.
1260 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1261 Use decode_any_window.
1262 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1263 * xdisp.c (Fformat_mode_line): Likewise.
1264 * font.c (Ffont_at): Use decode_live_window.
1265 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1266 * window.c (decode_next_window_args): Likewise.
1267 (decode_any_window): Remove static.
1268 * window.h (decode_any_window): Add prototype.
1269 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1270 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1271 respectively.
1272
1273 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1274
1275 Remove pad from struct input_event.
1276 * termhooks.h (struct input_event): Remove padding field.
1277 Adjust comment.
1278 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1279 member is never cons for a long time. Adjust comment.
1280 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1281 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1282 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1283 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1284
1285 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1286
1287 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1288
1289 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1290
1291 Fix crash when using Emacs as commit editor for git (Bug#12697).
1292 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1293 and it is configured in conf_post.h.
1294 (Fcall_process): Don't invoke both setsid and setpgid; the former
1295 is enough, if it exists.
1296 * callproc.c (Fcall_process, child_setup):
1297 * process.c (create_process): Use setpgid.
1298 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1299 for the real thing.
1300 * dispnew.c (init_display): Initialize the foreground group
1301 if we are running a tty display.
1302 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1303 * lisp.h (init_foreground_group): New decl.
1304 * sysdep.c (inherited_pgroup): New static var.
1305 (init_foreground_group, tcsetpgrp_without_stopping)
1306 (narrow_foreground_group, widen_foreground_group): New functions.
1307 (init_sys_modes): Narrow foreground group.
1308 (reset_sys_modes): Widen foreground group.
1309
1310 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1311
1312 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1313
1314 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1315
1316 * minibuf.c (read_minibuf): Restore current buffer since
1317 choose_minibuf_frame calling Fset_frame_selected_window may
1318 change it (Bug#12766).
1319
1320 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1321
1322 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1323
1324 2012-10-30 Kenichi Handa <handa@gnu.org>
1325
1326 * font.c (Ffont_at): If WINDOW is specified and it is not
1327 displaying the current buffer, signal an error.
1328
1329 2012-10-29 Daniel Colascione <dancol@dancol.org>
1330
1331 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1332 In preparation for fixing bug#12739, move these functions from
1333 here...
1334
1335 * coding.h, coding.c: ... to here, and compile them only when
1336 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1337 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1338
1339 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1340
1341 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1342 (timer_loop, getitimer, setitimer): Use it instead of
1343 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1344 'clock'.
1345 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1346 literal 10000.
1347
1348 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1349
1350 * nsterm.m (NO_APPDEFINED_DATA): New define.
1351 (last_appdefined_event_data): New variable
1352 (last_appdefined_event): Remove.
1353 (ns_select): Initialize t from last_appdefined_event_data instead
1354 of [last_appdefined_event data1].
1355 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1356 remove last_appdefined_event (Bug#12698).
1357
1358 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1359
1360 * frame.c (x_set_font): Catch internal error.
1361
1362 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1363
1364 Avoid overflow in w32 implementation of interval timers.
1365 When possible, for ITIMER_PROF count only times the main thread
1366 actually executes.
1367 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1368 'volatile ULONGLONG' types. All the other data which was
1369 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1370 (GetThreadTimes_Proc): New typedef.
1371 (w32_get_timer_time): New function, returns a suitable time value
1372 for the timer.
1373 (timer_loop): Enter critical section when accessing ULONGLONG
1374 values of the itimer_data struct, as these accesses are no longer
1375 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1376 Remove unused variable.
1377 (init_timers): Initialize s_pfn_Get_Thread_Times.
1378 (start_timer_thread): Don't assign itimer->caller_thread here.
1379 (getitimer): Assign itimer->caller_thread here.
1380 (setitimer): Always call getitimer to get the value of ticks_now.
1381 (sys_spawnve): Avoid compiler warning about format mismatch.
1382
1383 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1384
1385 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1386 mouse movement events if the menu bar is active. This avoids
1387 producing a busy "hour-glass" cursor by Windows if the mouse
1388 pointer is positioned over a tooltip shown for some menu item.
1389
1390 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1391
1392 Don't assume process IDs fit in int.
1393 * emacs.c (shut_down_emacs) [!DOS_NT]:
1394 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1395 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1396 Use pid_t, not int, to store process IDs, as 'int'
1397 is not wide enough on a few platforms (e.g., AIX and IRIX).
1398
1399 2012-10-23 Kenichi Handa <handa@gnu.org>
1400
1401 The following change is to make face-font-rescale-alist work
1402 correctly for non-ASCII fonts.
1403
1404 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1405 (font_open_for_lface): Handle Vface_font_rescale_alist.
1406
1407 2012-10-23 Chong Yidong <cyd@gnu.org>
1408
1409 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1410
1411 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1412
1413 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1414 for screen font.
1415 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1416
1417 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1418 event (Bug#12681).
1419
1420 2012-10-21 Glenn Morris <rgm@gnu.org>
1421
1422 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1423
1424 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1425
1426 Port to OpenBSD 5.1.
1427 * frame.c (Fmouse_position, Fmouse_pixel_position):
1428 * xdisp.c (produce_stretch_glyph):
1429 Declare local vars only when they're needed.
1430 This is clearer and avoids a warning on OpenBSD about unused vars.
1431 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1432 This is safer, and avoids OpenBSD warnings about unused vars.
1433 * keyboard.c (record_menu_key): Remove unnecessary decl.
1434 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1435 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1436 as our definition clashes with OpenBSD's.
1437 * xfaces.c (load_face_colors, check_lface_attrs)
1438 (get_lface_attributes_no_remap, get_lface_attributes)
1439 (lface_fully_specified_p, x_supports_face_attributes_p)
1440 (tty_supports_face_attributes_p, face_fontset, realize_face)
1441 (realize_x_face, realize_tty_face):
1442 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1443 merely Lisp_Object *. This is more informative and avoids
1444 a warning on OpenBSD about accessing beyond an object's size.
1445
1446 2012-10-20 Chong Yidong <cyd@gnu.org>
1447
1448 * lread.c (Fload): Doc fix (Bug#12592).
1449
1450 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1451
1452 * font.c (Ffont_at): Fix previous change.
1453
1454 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1455
1456 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1457 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1458 for the reasons.
1459
1460 * alloc.c (NSTATICS): Decrease to 0x800.
1461
1462 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1463
1464 * fns.c (Fnreverse): Include the problem element when signalling an
1465 error (bug#12677).
1466
1467 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1468
1469 * nsterm.m (ns_select): Check writefds before call to
1470 FD_ISSET (Bug#12668).
1471
1472 2012-10-18 Daniel Colascione <dancol@dancol.org>
1473
1474 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1475 (staticpro): If we run out of staticpro slots, die with an
1476 informative error instead of just calling emacs_abort.
1477
1478 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1479
1480 Fix two flaws reported by Dmitry Antipov.
1481 * window.c (Ftemp_output_buffer_show): Remove.
1482 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1483 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1484
1485 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1486
1487 * makefile.w32-in ($(BLD)/w32.$(O)):
1488 ($(BLD)/vm-limit.$(O)):
1489 ($(BLD)/term.$(O)):
1490 ($(BLD)/unexw32.$(O)):
1491 ($(BLD)/fileio.$(O)):
1492 ($(BLD)/dispnew.$(O)): Update dependencies.
1493
1494 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1495 Add prototypes.
1496
1497 * w32proc.c: Include ctype.h.
1498
1499 * w32.h (init_environment, check_windows_init_file)
1500 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1501 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1502 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1503 (sys_link): Add prototypes.
1504
1505 * w32.c: Include w32select.h.
1506 (sys_access, e_malloc, sys_select): Add prototypes.
1507 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1508
1509 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1510
1511 * unexw32.c: Include lisp.h and w32.h.
1512
1513 * term.c [WINDOWSNT]: Include w32term.h.
1514
1515 * process.c [WINDOWSNT]: Add prototype of sys_select.
1516
1517 * fileio.c [WINDOWSNT]: Include w32.h.
1518
1519 * dispnew.c [WINDOWSNT]: Include w32.h.
1520
1521 * cygw32.c (Fcygwin_convert_path_to_windows)
1522 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1523 Lisp_Object values. (Bug#12661)
1524
1525 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1526 to Lisp_Object. (Bug#12661)
1527
1528 2012-10-17 Kenichi Handa <handa@gnu.org>
1529
1530 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1531 invalidate.
1532
1533 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1534
1535 * buffer.c (Fkill_buffer): When unchaining the marker,
1536 reset its buffer pointer to NULL (Bug#12652).
1537
1538 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1539
1540 Do not verify indirection counters of killed buffers (Bug#12579).
1541 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1542 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1543
1544 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1545
1546 * alloc.c (Fmake_byte_code): Fix typo in comment.
1547 * print.c (print_interval): Define as static to match prototype.
1548 * indent.c (disptab_matches_widthtab, recompute_width_table):
1549 Convert to eassert.
1550
1551 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1552
1553 * editfns.c (get_system_name): Remove.
1554 * lisp.h (get_system_name): Remove prototype.
1555 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1556 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1557
1558 2012-10-15 Daniel Colascione <dancol@dancol.org>
1559
1560 * dbusbind.c: Add comment explaining reason for previous change.
1561
1562 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1563
1564 * window.c (Fwindow_end): Rewrite check whether cached position
1565 can be used (Bug#12600).
1566 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1567 Set windows_or_buffers_changed.
1568
1569 2012-10-15 Daniel Colascione <dancol@dancol.org>
1570
1571 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1572 enabled by undefining the symbol "interface", which the platform
1573 headers define to something incompatible.
1574
1575 2012-10-14 Daniel Colascione <dancol@dancol.org>
1576
1577 * image.c (init_tiff_functions, init_imagemagick_functions)
1578 (init_svg_functions): Fix cygw32 build break by using these
1579 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1580
1581 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1582
1583 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1584
1585 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1586
1587 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1588
1589 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1590
1591 * coding.c (detect_coding): Set coding->id before calling
1592 this->detector.
1593
1594 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1595
1596 * fileio.c: Formatting fixes.
1597
1598 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1599
1600 Fix some stat-related races.
1601 * fileio.c (Fwrite_region): Avoid race condition if a file is
1602 removed or renamed by some other process immediately after Emacs
1603 writes it but before Emacs stats it. Do not assume that stat (or
1604 fstat) succeeds.
1605 * image.c (slurp_file): Resolve the file name with fopen + fstat
1606 rather than stat + fopen.
1607 (pbm_read_file) [0]: Remove unused code with stat race.
1608 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1609 Remove ineffective code with stat race.
1610
1611 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1612
1613 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1614
1615 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1616
1617 * nsterm.m (hold_event_q): New static variable.
1618 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1619 ! q_event_ptr.
1620 (hold_event): New function.
1621 (ns_read_socket): If hold_event_q have events, store them and
1622 return (Bug#12384).
1623 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1624 is zero (Bug#12384).
1625
1626 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1627
1628 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1629
1630 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1631
1632 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1633
1634 * fileio.c (check_existing): New function.
1635 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1636 instead of calling 'stat', when what's needed is to check whether
1637 a file exists. This avoids expensive system calls on MS-Windows.
1638 (Bug#12587)
1639
1640 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1641
1642 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1643 determine whether a file exists and is not a directory.
1644
1645 * lisp.h (check_existing): Add prototype.
1646
1647 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1648
1649 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1650
1651 2012-10-12 Glenn Morris <rgm@gnu.org>
1652
1653 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1654
1655 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1656
1657 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1658
1659 * eval.c (Fautoload): Remember previous autoload status in load-history.
1660
1661 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1662
1663 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1664 * lread.c (load_each_byte, new_backquote_flag, readchar)
1665 (read_filtered_event, lisp_file_lexically_bound_p)
1666 (safe_to_load_version, Fload, complete_filename_p, openp)
1667 (build_load_history, readevalloop, read_escape, read1)
1668 (string_to_number, read_vector, read_list):
1669 * macros.c (Fstart_kbd_macro):
1670 * marker.c (CONSIDER):
1671 * menu.c (parse_single_submenu, digest_single_submenu)
1672 (find_and_return_menu_selection, Fx_popup_menu):
1673 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1674 (Ftry_completion):
1675 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1676 (ns_menu_show):
1677 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1678 (xmenu_show, xdialog_show):
1679 Use bool for booleans.
1680 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1681 as it's not a predicate. All uses changed. Omit unnecessary
1682 buffer termination.
1683
1684 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1685
1686 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1687 (save_excursion_restore): Do not restore mark if it was not saved.
1688
1689 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 * marker.c (cached_modiff): EMACS_INT, not int.
1692
1693 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1694 instead of having a wrong decl.
1695 * nsmenu.m (waiting_for_input): Remove wrong decl.
1696
1697 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1698
1699 keyboard.c, keymap.c: Use bool for booleans.
1700 * dispnew.c (sit_for): Distinguish between 3-way display_option
1701 and boolean do_display.
1702 * keyboard.c (single_kboard, this_command_key_count_reset)
1703 (waiting_for_input, echoing, immediate_quit, input_pending)
1704 (interrupt_input, interrupts_deferred, pop_kboard)
1705 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1706 (command_loop_1, adjust_point_for_property)
1707 (safe_run_hooks_error, input_polling_used, read_char):
1708 (help_char_p, readable_events, kbd_buffer_events_waiting)
1709 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1710 (lucid_event_type_list_p, get_input_pending):
1711 (gobble_input, menu_separator_name_p, menu_bar_item)
1712 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1713 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1714 (keyremap_step, test_undefined, read_key_sequence)
1715 (detect_input_pending, detect_input_pending_ignore_squeezables)
1716 (detect_input_pending_run_timers, requeued_events_pending_p)
1717 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1718 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1719 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1720 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1721 (accessible_keymaps_1, Fkey_description, push_key_description):
1722 (shadow_lookup, struct where_is_internal_data)
1723 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1724 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1725 (describe_map, describe_vector):
1726 * menu.c (single_menu_item):
1727 * nsmenu.m (ns_update_menubar):
1728 * process.c (wait_reading_process_output):
1729 * search.c (scan_buffer, scan_newline):
1730 Use bool for boolean.
1731 * keyboard.c (timers_run, swallow_events)
1732 (detect_input_pending_run_timers):
1733 * process.c (wait_reading_process_output):
1734 Use unsigned for counter where wraparound-on-overflow is desired,
1735 since unsigned is guaranteed to have that behavior and signed is not.
1736 (read_char): Use ptrdiff_t for string length.
1737 (get_input_pending): Remove first argument, since it was always
1738 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1739 and behave as if it had that value. Return new value of
1740 input_pending. All callers changed.
1741 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1742 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1743 a string length.
1744 * keymap.c (push_key_description): Omit last arg, which was always 1.
1745 All callers changed.
1746
1747 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1748
1749 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1750
1751 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1752 ($(BLD)/term.$(O)): Update dependencies.
1753
1754 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1755
1756 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1757 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1758 initializer for PVEC_NORMAL_VECTOR.
1759
1760 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1761
1762 Clean out old termopts cruft.
1763 * termopts.h (flow_control, meta_key): Remove unused decls.
1764 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1765 Don't include termopts.h.
1766
1767 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1768
1769 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1770
1771 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1772
1773 * commands.h (immediate_quit): Remove duplicate decl.
1774
1775 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1776
1777 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1778 caching.
1779 (nsfont_open): Remove setting of Vfonts_in_cache.
1780 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1781
1782 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1783
1784 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1785 match what GetLastError returns. Explain why the function is
1786 needed.
1787
1788 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1789 'is_tooltip_frame', to avoid confusion with its global namesake.
1790
1791 2012-10-08 Daniel Colascione <dancol@dancol.org>
1792
1793 * xdisp.c (start_hourglass): Call w32_note_current_window when
1794 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1795 build that caused Emacs to display the hourglass cursor forever.
1796
1797 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1798 which is broken under remote desktop, calculate the number of
1799 colors available for a display based on the display's number of
1800 planes and number of bits per pixel per plane. (bug#10397).
1801
1802 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1803
1804 * nsfont.m (Vfonts_in_cache): New variable.
1805 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1806 are used. Add cached fonts to Vfonts_in_cache.
1807 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1808
1809 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1810
1811 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1812 in nt/config.nt.
1813 (FONT_H): Define after FRAME_H.
1814 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1815 Update dependencies.
1816
1817 * w32term.c: Remove leftover declaration of keyboard_codepage.
1818
1819 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1820
1821 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1822 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1823 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1824 (GLOBAL_SOURCES): Add cygw32.c.
1825 ($(BLD)/unexw32.$(O)):
1826 ($(BLD)/w32.$(O)):
1827 ($(BLD)/w32console.$(O)):
1828 ($(BLD)/w32fns.$(O)):
1829 ($(BLD)/w32heap.$(O)):
1830 ($(BLD)/w32menu.$(O)):
1831 ($(BLD)/w32proc.$(O)): Add w32common.h.
1832
1833 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1834 'const char *'.
1835 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1836
1837 2012-10-08 Daniel Colascione <dancol@dancol.org>
1838
1839 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1840 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1841 accidental message numbering hole. Change other messages to
1842 match.
1843
1844 * w32select.h (HAVE_W32SELECT): Remove.
1845
1846 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1847 w32common.h instead of w32heap.h.
1848
1849 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1850 (get_allocation_unit, get_processor_type, get_w32_major_version)
1851 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1852 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1853 (OS_NT, os_subtype, cache_system_info): Move declarations to
1854 w32common.
1855
1856 * w32heap.c: Include w32common.h.
1857 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1858 (w32_minor_version, w32_build_number, w32_subtype):
1859 Remove duplicate definitions.
1860
1861 * w32fns.c: Include w32common.h; include w32heap.h only in
1862 WINDOWSNT.
1863
1864 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1865 Use `report_file_error' instead of `error' in order to better
1866 inform users of what went wrong. Increase NTGUI_UNICODE file
1867 dialog box file name length to 32k, the maximum allowed by the NT
1868 kernel.
1869
1870 * w32common.h: New file.
1871 (ROUND_UP, ROUND_DOWN, get_page_size)
1872 (get_allocation_unit, get_processor_type, get_w32_major_version)
1873 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1874 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1875 (OS_NT, os_subtype, cache_system_info): Move here.
1876
1877 * unexw32.c, unexcw.c: Include w32common.h.
1878
1879 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1880 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1881 to call syms_of_w32select.
1882
1883 * cygw32.h: Remove obsolete EXFUN declarations.
1884
1885 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1886
1887 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1888 of w32inevt.o from SOME_MACHINE_OBJECTS.
1889
1890 2012-10-08 Daniel Colascione <dancol@dancol.org>
1891
1892 * image.c: Permanent fix for JPEG compilation issue --- limit
1893 jpeglib `boolean' redefinition to Cygwin builds.
1894
1895 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1896
1897 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1898
1899 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1900 Cygwin.
1901
1902 2012-10-08 Daniel Colascione <dancol@dancol.org>
1903
1904 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1905 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1906 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1907 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1908 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1909 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1910 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1911 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1912 now a supported configuration.
1913
1914 * Makefile.in: consolidate image variables into LIBIMAGE; add
1915 W32_OBJ and W32_LIBS. Compile new files.
1916
1917 * conf_post.h:
1918 (_DebPrint) declare tracing facility for W32 debugging. We need
1919 to unify tracing later.
1920
1921 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1922 unconditional use of W32 Unicode functions. Cygwin runs only on
1923 100% Unicode operating systems.
1924
1925 * cygw32.c: New file. Define Cygwin-specific facilities.
1926 (Fcygwin_convert_path_to_windows)
1927 (Fcygwin_convert_path_from_windows): New user functions for
1928 accessing Cygwin path-munging routines.
1929
1930 * cygw32.h: New file.
1931 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1932 UTF-16LE strings temporarily inside non-Lisp-visible string
1933 objects.
1934
1935 (w32_strerror): Just what it says on the tin.
1936
1937 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1938 also run for Cygwin; both systems have the same problem with using
1939 GUI facilities in a forked child. Also call syms_of_cygw32,
1940 syms_of_w32select in correct places.
1941
1942 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1943 needs fork-then-exec for daemon launching.
1944
1945 * font.h: Include frame.h.
1946
1947 * image.c: Use the image library cache machinery only when we're
1948 compiling for native WINDOWSNT; Cygwin can use shared libraries
1949 like any other Unixlike system.
1950
1951 * keyboard.c: Clarify a comment regarding the input loop.
1952
1953 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1954 functions directly instead of trying to detect at runtime that our
1955 host operating system supports them. We make this change for two
1956 reasons: Cygwin lacks support for the multibyte character
1957 conversion functions used by the legacy menu code, and Cygwin
1958 never needs to rely on non-Unicode APIs.
1959
1960 * unexw32.c (hinst): Declare extern.
1961
1962 * w32.c: Change header order;
1963 (w32_strerror): Move to w32fns.c because we need it for
1964 non-WINDOWSNT builds.
1965
1966 * w32.h: Add #error macro to make sure we don't include w32.h for
1967 Cygwin builds. Remove w32select declarations.
1968
1969 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1970 w32fns.c. w32console.c is WINDOWSNT-only.
1971
1972 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1973 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1974 POSIXy alternative.
1975 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1976 (w32_major_version, w32_minor_version, w32_build_number)
1977 (os_subtype, sound_type): Define here
1978 (w32_defined_color): Make color parameter const for consistency
1979 with other _defined_color functions.
1980 (w32_createwindow): Unconditionally call w32_init_class instead of
1981 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1982 through the code is complex and unnecessary because class
1983 registration is practically free.
1984 (w32_name_of_message): New EMACSDEBUG-only function.
1985 (Fset_message_beep): Move here
1986 (Fx_open_connection): Require that the display name for Windows be
1987 "w32" for consistency, emacsclient disambiguation, and maybe, one
1988 day, multi-window-system support.
1989 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1990 Cygwin files for W32 GUI facilities, since these clearly don't
1991 expect Cygwin names.
1992 (_DebPrint): Define.
1993 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1994 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1995 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1996 (w32_last_error): Remove.
1997
1998 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1999
2000 * w32heap.c (syspage_mask): Declare here.
2001 (cache_system_info): Remove.
2002
2003 * w32inevt.c (faked_key): Define globally, not statically.
2004 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2005 (w32_console_toggle_lock_key): Move to w32fns.c.
2006
2007 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2008
2009 * w32proc.c (_DebPrint): Move to w32fns.c.
2010 * w32select.c: Include string.h, stdio.h for Cygwin.
2011 * w32select.h: New File.
2012
2013 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2014 get_osfhandle.
2015 (w32_message_fd): New variable. Under Cygwin, holds the file
2016 descriptor the system used to tell us about pending thread
2017 messages.
2018
2019 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2020 that prevented compilation under non-WINDOWSNT systems.
2021
2022 (w32_initialize): Open /dev/windows and assign it to
2023 w32_message_fd. Provide w32 feature.
2024
2025 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2026 (WM_EMACS_INPUT_READY): add.
2027 (prepend_msg, w32_message_fd): Declare globally.
2028
2029 * w32xfns.c:
2030 (keyboard_handle): Use only when WINDOWSNT.
2031 (notify_msg_ready): New function. Posts a message to the main
2032 thread's message queue under CYGWIN, which wakes up the main
2033 thread from select(2) by making the /dev/windows file descriptor
2034 ready. Under WINDOWSNT, it sets an event the same way the old
2035 code did.
2036
2037 (post, prepend_msg): Actually call notify_msg_ready instead of
2038 setting the input event directly.
2039
2040 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2041
2042 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2043 but it still has blocs in it, don't return it to the system,
2044 instead of aborting. (Bug#12402)
2045
2046 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2047
2048 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2049
2050 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2051 MAC_OS_X_VERSION_10_6.
2052 (syms_of_nsterm): Remove comment about Panther and above for
2053 ns-antialias-text.
2054 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2055 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2056 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2057
2058 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2059 MAC_OS_X_VERSION_10_4.
2060
2061 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2062 MAC_OS_X_VERSION_10_2.
2063
2064 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2065
2066 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2067 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2068
2069 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2070 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2071 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2072 Remove ns_in_resize check.
2073 (ns_clear_frame_area): Remove resize handle code.
2074
2075 * nsfns.m (ns_in_resize): Remove.
2076 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2077 Remove ns_in_resize check.
2078
2079 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2080
2081 Improve sys_siglist detection.
2082 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2083 defined as a macro, as is done in Solaris.
2084 (sys_siglist_entries): New macro.
2085 (save_strsignal): Use it.
2086 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2087 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2088
2089 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2090
2091 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2092 fullscreen/Fullscreen.
2093
2094 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2095 tobar_height is new.
2096
2097 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2098 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2099 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2100 (windowDidResize:): Check for correct window if old style fullscreen.
2101 Capitalize word in comment. Remove incorrect comment.
2102 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2103 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2104 error in drawing background.
2105 (toggleFullScreen:): Remove comment. Rearrange calls.
2106 Set toolbar values to zero, save old height in tobar_height.
2107 Restore tool bar height when leaving fullscreen.
2108 (canBecomeMainWindow): New function.
2109
2110 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2111
2112 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2113
2114 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2115
2116 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2117
2118 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2119 that time stamps of directories could also be changed.
2120 Don't request the too broad GENERIC_WRITE, only the more restrictive
2121 FILE_WRITE_ATTRIBUTES access rights.
2122
2123 * fileio.c (Fset_file_times): Special-case ignoring errors for
2124 directories only on MSDOS, not on MS-Windows.
2125
2126 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2127
2128 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2129
2130 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2131
2132 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2133 see whether CreateFile failed.
2134
2135 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2136
2137 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2138 to avoid similar races.
2139 * keyboard.c (pending_signals): Now bool, not int.
2140
2141 Port timers to OpenBSD, plus check for timer failures.
2142 OpenBSD problem reported by Han Boetes.
2143 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2144 and/or setitimer.
2145 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2146 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2147 like OpenBSD, which has timer_settime but does not declare it.
2148 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2149 whether to use itimerspec-related primitives. All uses of
2150 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2151
2152 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2153
2154 * profiler.c (handle_profiler_signal): Fix a malloc race
2155 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2156
2157 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2158
2159 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2160
2161 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2162
2163 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2164 consistent with the change in return value of 'safe_strsignal'.
2165
2166 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2167
2168 Prefer plain 'static' to 'static inline' (Bug#12541).
2169 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2170 (bidi_set_sor_type, bidi_push_embedding_level)
2171 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2172 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2173 (bidi_cache_search, bidi_cache_ensure_space)
2174 (bidi_cache_iterator_state, bidi_cache_find)
2175 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2176 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2177 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2178 Now 'static', not 'static inline'.
2179
2180 Count overruns when profiling; change units to ns.
2181 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2182 Give extra weight to samples after overruns, to attempt to count
2183 the time more accurately.
2184 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2185 the underlying primitives nominally do ns.
2186 (Fprofiler_cpu_start): Document the change. Mention that
2187 the sampling intervals are only approximate.
2188
2189 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2190
2191 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2192
2193 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2194 case for the special 0 coding-system.
2195
2196 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2197 (Fmake_overlay): Remove redundant tests.
2198 (fix_start_end_in_overlays): Remove redundant recentering.
2199
2200 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2201
2202 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2203 Update dependencies.
2204
2205 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 Fix a malloc race condition involving strsignal.
2208 A signal can arrive in the middle of a malloc, and Emacs's signal
2209 handler can invoke strsignal, which can invoke malloc, which is
2210 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2211 Fix it by altering the signal handler so that it does not invoke
2212 strsignal.
2213 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2214 * process.c (status_message): Use const pointer, in case strsignal
2215 is #defined to safe_strsignal.
2216 * sysdep.c (sys_siglist, init_signals): Always define and
2217 initialize a substitute sys_siglist if the system does not define
2218 one, even if HAVE_STRSIGNAL.
2219 (safe_strsignal): Rename from strsignal. Always define,
2220 using sys_siglist. Return a const pointer.
2221 * syssignal.h (safe_strsignal): New decl.
2222 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2223
2224 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2225
2226 * w32proc.c (timer_loop): Fix code that waits for timer
2227 expiration, to avoid high CPU usage.
2228
2229 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2230
2231 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2232 (sweep_weak_table): Remove redundant prototypes.
2233
2234 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2235
2236 * emacs.c: Move the inclusion of TERM_HEADER after including
2237 windows.h on WINDOWSNT. This avoids compilation problems with
2238 MSVC.
2239
2240 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2241
2242 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2243 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2244 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2245 as the previous version used 'void *'.
2246
2247 * ralloc.c (ROUNDUP): Fix last change.
2248 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2249 'size_t'.
2250
2251 * w32proc.c <disable_itimers>: New static flag.
2252 (init_timers): Initialize it to zero, after creating the critical
2253 sections used by the timer threads.
2254 (term_timers): Set to 1 before deleting the critical sections.
2255 (getitimer, setitimer): If disable_itimers is non-zero, return an
2256 error indication without doing anything. Reported by Fabrice
2257 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2258 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2259 return results.
2260 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2261 support timers.
2262
2263 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2264 term_ntproc after all the other bookkeeping, to get timers working
2265 as long as possible.
2266
2267 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2268
2269 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2270 Suggested by Juri Linkov in
2271 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2272
2273 Prefer plain 'static' to 'static inline' (Bug#12541).
2274 With static functions, modern compilers inline pretty well by
2275 themselves; advice from programmers often hurts as much as it helps.
2276 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2277 this change shrinks the text size of the Emacs executable by 1.1%
2278 without affecting CPU significantly in my benchmark.
2279 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2280 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2281 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2282 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2283 (bset_auto_fill_function, bset_auto_save_file_format)
2284 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2285 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2286 (bset_cache_long_line_scans, bset_case_fold_search)
2287 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2288 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2289 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2290 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2291 (bset_header_line_format, bset_indicate_buffer_boundaries)
2292 (bset_indicate_empty_lines, bset_invisibility_spec)
2293 (bset_left_fringe_width, bset_major_mode, bset_mark)
2294 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2295 (bset_name, bset_overwrite_mode, bset_pt_marker)
2296 (bset_right_fringe_width, bset_save_length)
2297 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2298 (bset_scroll_up_aggressively, bset_selective_display)
2299 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2300 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2301 (set_buffer_overlays_after):
2302 * category.c (bset_category_table):
2303 * charset.c (read_hex):
2304 * coding.c (produce_composition, produce_charset)
2305 (handle_composition_annotation, handle_charset_annotation)
2306 (char_encodable_p):
2307 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2308 (assign_row, set_frame_matrix_frame, make_current)
2309 (add_row_entry):
2310 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2311 * fns.c (maybe_resize_hash_table):
2312 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2313 * gmalloc.c (register_heapinfo):
2314 * image.c (lookup_image_type):
2315 * intervals.c (set_interval_object, set_interval_left)
2316 (set_interval_right, copy_interval_parent, rotate_right)
2317 (rotate_left, balance_possible_root_interval):
2318 * keyboard.c (kset_echo_string, kset_kbd_queue)
2319 (kset_keyboard_translate_table, kset_last_prefix_arg)
2320 (kset_last_repeatable_command, kset_local_function_key_map)
2321 (kset_overriding_terminal_local_map, kset_real_last_command)
2322 (kset_system_key_syms, clear_event, set_prop):
2323 * lread.c (digit_to_number):
2324 * marker.c (attach_marker, live_buffer, set_marker_internal):
2325 * nsterm.m (ns_compute_glyph_string_overhangs):
2326 * process.c (pset_buffer, pset_command)
2327 (pset_decode_coding_system, pset_decoding_buf)
2328 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2329 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2330 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2331 * syntax.c (bset_syntax_table, dec_bytepos):
2332 * terminal.c (tset_param_alist):
2333 * textprop.c (interval_has_some_properties)
2334 (interval_has_some_properties_list):
2335 * window.c (wset_combination_limit, wset_dedicated)
2336 (wset_display_table, wset_hchild, wset_left_fringe_width)
2337 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2338 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2339 (wset_right_fringe_width, wset_right_margin_cols)
2340 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2341 (wset_vertical_scroll_bar_type, wset_window_parameters):
2342 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2343 (wset_column_number_displayed, wset_region_showing)
2344 (window_box_edges, run_window_scroll_functions)
2345 (append_glyph_string_lists, prepend_glyph_string_lists)
2346 (append_glyph_string, set_glyph_string_background_width)
2347 (append_glyph, append_composite_glyph)
2348 (take_vertical_position_into_account):
2349 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2350 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2351 (lface_hash, lface_same_font_attributes_p, lookup_face):
2352 * xml.c (libxml2_loaded_p):
2353 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2354 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2355 Now 'static', not 'static inline'.
2356
2357 * bidi.c: Tune.
2358 (bidi_copy_it): Do the whole copy with a single memcpy.
2359 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2360
2361 Revert the FOLLOW-SYMLINKS change for file-attributes.
2362 Doing it right would require several changes to Tramp, and there's
2363 not enough time to get that tested before the freeze today.
2364 * dired.c (directory_files_internal, Ffile_attributes):
2365 Undo last change.
2366
2367 * frame.c (x_report_frame_params): Port better to wider ints.
2368 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2369 or that pointers can be printed in 15 decimal digits.
2370 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2371
2372 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2373
2374 Support x64 build on MS-Windows.
2375 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2376 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2377 compatibility with x64.
2378 (x_get_focus_frame): Add prototype.
2379
2380 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2381 defining an XRectangle structure.
2382
2383 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2384 arithmetics for compatibility with x64.
2385
2386 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2387 compatibility with x64.
2388
2389 * w32heap.h: Adjust prototypes and declarations.
2390
2391 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2392 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2393 DWORD, long, and unsigned long, for compatibility with x64.
2394 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2395 (sbrk): Argument is now of type ptrdiff_t.
2396
2397 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2398 less than 0x0500.
2399 (w32_msg_pump): Use WPARAM type for 'result'.
2400
2401 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2402 architecture.
2403 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2404 compatibility with x64.
2405
2406 * vm-limit.c (lim_data): Now size_t.
2407 (check_memory_limits): Adjust prototypes of real_morecore and
2408 __morecore to receive argument of type ptrdiff_t. Use size_t for
2409 five_percent and data_size.
2410
2411 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2412 variables, for compatibility with x64.
2413 (rva_to_section, offset_to_section, relocate_offset)
2414 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2415 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2416 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2417 for compatibility with x64.
2418
2419 * sysdep.c (STDERR_FILENO): Define if not already defined.
2420
2421 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2422 (__morecore): Argument type is now ptrdiff_t.
2423 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2424 (relinquish): Use ptrdiff_t type for 'excess'.
2425 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2426
2427 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2428 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2429 instead of a literal number.
2430
2431 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2432 (min): Define only if not already defined.
2433
2434 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2435 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2436 hosts.
2437
2438 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2439 'bitmaps' is a pointer.
2440
2441 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2442
2443 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2444
2445 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2446
2447 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2448 * dired.c (directory_files_internal, Ffile_attributes):
2449 New arg follow_symlinks. All uses changed.
2450
2451 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2452
2453 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2454
2455 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2456
2457 Support atimers and CPU profiler via profile.c on MS-Windows.
2458 * w32proc.c (sig_mask, crit_sig): New static variables.
2459 (sys_signal): Support SIGALRM and SIGPROF.
2460 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2461 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2462 sigfillset, and sigprocmask are no longer no-ops.
2463 (sigismember): New function.
2464 (struct itimer_data): New definition.
2465 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2466 (crit_prof): New static variables.
2467 (MAX_SINGLE_SLEEP): New definition.
2468 (timer_loop, stop_timer_thread, term_timers, init_timers)
2469 (start_timer_thread, getitimer, setitimer): New functions.
2470 (alarm): No longer a no-op, calls setitimer.
2471
2472 * w32.c (term_ntproc): Call term_timers.
2473 (init_ntproc): Make sure all signals are unblocked at startup, to
2474 erase any traces of dumping. Call init_timers.
2475
2476 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2477 Windows-specific code to display the hourglass mouse pointer is no
2478 longer used.
2479 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2480 to hourglass timer expiration.
2481 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2482 Remove, no longer used.
2483 (w32_note_current_window, show_hourglass, hide_hourglass):
2484 New functions, in support of hourglass cursor display similar to other
2485 window systems.
2486 (syms_of_w32fns): Don't initialize hourglass_timer.
2487
2488 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2489 WINDOWSNT as well.
2490 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2491
2492 * w32.h (init_timers, term_timers): Add prototypes.
2493
2494 2012-09-30 Kenichi Handa <handa@gnu.org>
2495
2496 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2497 to the buffer relocation which may be caused by ccl_driver.
2498
2499 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2500
2501 * xfns.c (Fx_file_dialog): Update comment.
2502
2503 * w32fns.c (Fx_file_dialog): Update comment.
2504
2505 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2506 Initialize panel name field if OSX >= 10.6.
2507
2508 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2509
2510 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2511
2512 * nsterm.m (NEW_STYLE_FS): New define.
2513 (ns_fullscreen_hook, windowWillEnterFullScreen)
2514 (windowDidEnterFullScreen, windowWillExitFullScreen)
2515 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2516 (setFSValue): New functions.
2517 (EmacsFSWindow): New implementation.
2518 (canBecomeKeyWindow): New function for EmacsFSWindow.
2519 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2520 (dealloc): Release nonfs_window if in fullscreen.
2521 (updateFrameSize:): Call windowDidMove to update top/left.
2522 (windowWillResize:toSize:): Check if frame is still maximized.
2523 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2524 next_maximized, maximized_width, maximized_height and nonfs_window.
2525 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2526 tbar_height.
2527 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2528 fullscreen. Set maximized_width/height. Act on next_maximized.
2529
2530 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2531 (EmacsView): Add variables for fullscreen.
2532 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2533 (EmacsFSWindow): New interface for fullscreen.
2534
2535 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2536
2537 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2538
2539 2012-09-30 Chong Yidong <cyd@gnu.org>
2540
2541 * fns.c (Frandom): Doc fix.
2542
2543 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2544
2545 * window.c (Vwindow_combination_limit): New default value.
2546 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2547
2548 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2551 Suggested by Eli Zaretskii in
2552 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2553
2554 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2555
2556 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2557 HAVE_TIMER_SETTIME is defined.
2558
2559 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2560
2561 Profiler improvements: more-accurate timers, overflow checks.
2562 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2563 signal.h, setjmp.h. Include systime.h instead.
2564 (saturated_add): New function.
2565 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2566 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2567 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2568 New static vars.
2569 (enum profiler_cpu_running): New enum.
2570 (profiler_cpu_running): Now of that enum type, not bool.
2571 All uses changed to store the new value.
2572 (handle_profiler_signal): Rename from sigprof_handler_1,
2573 for consistency with other handlers. Do not check whether
2574 cpu_log is a hash-table if garbage collecting, since it
2575 doesn't matter in that case.
2576 (deliver_profiler_signal): Rename from sigprof_handler,
2577 for consistency with other handlers.
2578 (setup_cpu_timer): New function, with much of what used to be in
2579 Fprofiler_cpu_start. Check for out-of-range argument.
2580 Prefer timer_settime if available, and prefer
2581 thread cputime clocks, then process cputime clocks, then
2582 monotonic clocks, to the old realtime clock. Use make_timeval
2583 to round more-correctly when falling back to setitimer.
2584 (Fprofiler_cpu_start): Use it.
2585 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2586 Don't assume that passing NULL as the 2nd argument of setitimer
2587 is the same as passing a pointer to all-zero storage.
2588 Ignore SIGPROF afterwards.
2589 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2590 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2591 non-fatal signal handlers. Ignore SIGPROF on startup.
2592 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2593 in profiler.c, since sysdep.c now uses it.
2594
2595 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2596 Suggested by Eli Zaretskii in
2597 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2598
2599 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2600
2601 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2602
2603 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2604
2605 * lisp.h (struct backtrace): Remove indirection for `function' field.
2606 * xdisp.c (redisplay_internal):
2607 * profiler.c (record_backtrace, sigprof_handler_1):
2608 * alloc.c (Fgarbage_collect):
2609 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2610 (Fbacktrace_frame): Adjust accordingly.
2611
2612 2012-09-28 Glenn Morris <rgm@gnu.org>
2613
2614 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2615 (Frun_hook_with_args_until_failure): Doc fixes.
2616
2617 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2618
2619 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2620 Qautomatic_redisplay and change the symbol name. All users changed.
2621
2622 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2623
2624 * profiler.c (sigprof_handler): Fix race condition.
2625
2626 2012-09-28 Glenn Morris <rgm@gnu.org>
2627
2628 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2629
2630 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2631
2632 Check more robustly for timer_settime.
2633 * Makefile.in (LIB_TIMER_TIME): New macro.
2634 (LIBES): Add it.
2635 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2636 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2637 call timer_settime.
2638
2639 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2640
2641 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2642
2643 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2644
2645 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2646
2647 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 * character.h (MAYBE_UNIFY_CHAR): Remove.
2650 * charset.c, charset.h (maybe_unify_char): Now static.
2651 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2652 Since this stuff is now private to charset.c, there's no need for
2653 a public macro and no need to inline by hand.
2654
2655 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2656 Stefan Monnier <monnier@iro.umontreal.ca>
2657 Juanma Barranquero <lekktu@gmail.com>
2658
2659 * profiler.c: New file.
2660 * Makefile.in (base_obj): Add profiler.o.
2661 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2662 ($(BLD)/profiler.$(O)): New target.
2663 * emacs.c (main): Call syms_of_profiler.
2664 * alloc.c (Qautomatic_gc): New constant.
2665 (MALLOC_PROBE): New macro.
2666 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2667 (total_bytes_of_live_objects): New function.
2668 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2669 Call malloc_probe for the memory profiler.
2670 (syms_of_alloc): Define Qautomatic_gc.
2671 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2672 race condition.
2673 (struct backtrace): Move definition...
2674 * lisp.h (struct backtrace): ..here.
2675 (Qautomatic_gc, profiler_memory_running): Declare vars.
2676 (malloc_probe, syms_of_profiler): Declare functions.
2677 * xdisp.c (Qautomatic_redisplay): New constant.
2678 (redisplay_internal): Record itself in backtrace_list.
2679 (syms_of_xdisp): Define Qautomatic_redisplay.
2680
2681 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2682 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2683
2684 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2685
2686 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2687
2688 Prefer POSIX timers if available.
2689 They avoid a race if the timer is too close to the current time.
2690 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2691 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2692 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2693
2694 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2695
2696 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2697 CHAR_STRING_ADVANCE.
2698 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2699 STRING_CHAR_ADVANCE.
2700
2701 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2702
2703 Move Vlibrary_cache to emacs.c and reset before dumping.
2704
2705 * lisp.h (reset_image_types): Declare.
2706 [WINDOWSNT] (Vlibrary_cache): Declare.
2707
2708 * image.c (reset_image_types): New function.
2709
2710 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2711 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2712 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2713
2714 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2715 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2716
2717 * w32.h (Vlibrary_cache): Do not declare.
2718
2719 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2720
2721 * w32proc.c (sys_signal): Handle all signals defined by the
2722 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2723 handlers for signals supported by Windows. Don't override
2724 term_ntproc as the handler for SIGABRT.
2725 (sigaction): Rewrite to call sys_signal instead of duplicating its
2726 code.
2727 (sys_kill): Improve commentary.
2728
2729 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2730 consistency with a signature of a signal handler. All callers
2731 changed.
2732 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2733 install term_ntproc as a signal handler for SIGABRT, as that
2734 should be done by the dumped Emacs.
2735
2736 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2737
2738 * w32select.c (term_w32select): Protect against repeated
2739 invocation by setting clipboard_owner to NULL after calling
2740 DestroyWindow.
2741
2742 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2743 and term_ntproc to their modified signatures.
2744
2745 * character.c (char_string, string_char): Remove calls to
2746 MAYBE_UNIFY_CHAR. See the discussion starting at
2747 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2748 for the details.
2749
2750 2012-09-25 Chong Yidong <cyd@gnu.org>
2751
2752 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2753
2754 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2755
2756 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2757 when encountering an unknown bytecode.
2758
2759 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2760
2761 image.c, indent.c: Use bool for booleans.
2762 * dispextern.h (struct image_type): Members valid_p, load, init
2763 now return bool, not int. All uses changed.
2764 * image.c: Omit unnecessary static decls.
2765 (x_create_bitmap_mask, x_build_heuristic_mask):
2766 Return void, not int, since callers don't care about the return value.
2767 (x_create_bitmap_mask, define_image_type, valid_image_p)
2768 (struct image_keyword, parse_image_spec, image_spec_value)
2769 (check_image_size, image_background)
2770 (image_background_transparent, x_clear_image_1)
2771 (postprocess_image, lookup_image, x_check_image_size)
2772 (x_create_x_image_and_pixmap, xbm_image_p)
2773 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2774 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2775 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2776 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2777 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2778 (png_image_p, init_png_functions, png_load_body, png_load)
2779 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2780 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2781 (init_gif_functions, gif_load, imagemagick_image_p)
2782 (imagemagick_load_image, imagemagick_load, svg_image_p)
2783 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2784 (gs_load):
2785 * nsimage.m (ns_load_image):
2786 * nsterm.m (ns_defined_color):
2787 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2788 * xfns.c (x_defined_color):
2789 * xterm.c (x_alloc_lighter_color_for_widget)
2790 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2791 (x_alloc_lighter_color):
2792 * indent.c (disptab_matches_widthtab, current_column)
2793 (scan_for_column, string_display_width, indented_beyond_p)
2794 (compute_motion, vmotion, Fvertical_motion):
2795 Use bool for booleans.
2796
2797 2012-09-24 Chong Yidong <cyd@gnu.org>
2798
2799 * chartab.c (Fset_char_table_default): Obsolete function removed.
2800
2801 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2802
2803 Move pid_t related decls out of lisp.h.
2804 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2805 (interruptible_wait_for_termination):
2806 Move these decls from lisp.h to syswait.h, since they use pid_t.
2807 Needed on FreeBSD; see Herbert J. Skuhra in
2808 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2809 * callproc.c: Include syswait.h.
2810
2811 gnutls.c, gtkutil.c: Use bool for boolean.
2812 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2813 (emacs_gnutls_handle_error):
2814 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2815 (xg_hide_tooltip, xg_create_frame_widgets)
2816 (create_dialog, xg_uses_old_file_dialog)
2817 (xg_get_file_with_chooser, xg_get_file_with_selection)
2818 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2819 (xg_item_label_same_p, xg_update_menubar)
2820 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2821 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2822 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2823 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2824 (update_frame_tool_bar, free_frame_tool_bar):
2825 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2826 * nsmenu.m (ns_update_menubar):
2827 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2828 * xfns.c (Fx_show_tip) [USE_GTK]:
2829 Use bool for boolean.
2830 * gtkutil.c (xg_update_frame_menubar):
2831 * xmenu.c (update_frame_menubar):
2832 Return void, not int, since caller ignores return value.
2833 * gtkutil.c (xg_change_toolbar_position):
2834 Return void, not 1.
2835
2836 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2837
2838 * makefile.w32-in (BLOCKINPUT_H): Remove.
2839 (SYSSIGNAL_H): New macro.
2840 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2841 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2842 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2843 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2844 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2845 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2846 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2847 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2848 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2849 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2850 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2851 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2852 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2853 ($(BLD)/w32xfns.$(O)): Update dependencies.
2854
2855 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2856
2857 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2858 fatal_error_backtrace.
2859
2860 * w32proc.c (sys_kill): Undo last change: don't do anything when
2861 invoked to deliver SIGABRT to our own process. This is now
2862 handled by emacs_raise.
2863
2864 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2865
2866 * w32term.c (w32_read_socket): Remove leftover reference to
2867 interrupt_input_pending.
2868
2869 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 Do not use SA_NODEFER.
2872 Problem reported by Dani Moncayo in
2873 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2874 * alloc.c (die):
2875 * sysdep.c (emacs_abort): Do not reset signal handler.
2876 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2877 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2878 wanted even on POSIXish hosts, and it doesn't work on Windows.
2879
2880 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2881
2882 * xterm.c (x_term_init): Call fixup_locale before and after calling
2883 gtk_init (Bug#12392).
2884
2885 2012-09-23 Chong Yidong <cyd@gnu.org>
2886
2887 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2888 Vdynamic_library_alist.
2889
2890 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2891 (Fgnutls_available_p): Caller changed.
2892
2893 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2894 (Flibxml_parse_xml_region): Likewise.
2895
2896 * dispextern.h (struct image_type): Remove arg from init function.
2897
2898 * image.c (Finit_image_library, lookup_image_type)
2899 (define_image_type): Remove now-unneeded second arg.
2900 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2901 (init_tiff_functions, init_gif_functions, init_svg_functions):
2902 Arglist and w32_delayed_load calling convention changed.
2903 (gs_type): Remove init_gs_functions; there is no such function.
2904 (valid_image_p, make_image): Fix caller to lookup_image_type.
2905
2906 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 Simplify and avoid signal-handling races (Bug#12471).
2909 * alloc.c (die):
2910 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2911 Avoid recursive loop if there's a fatal error in the function itself.
2912 * atimer.c (pending_atimers):
2913 * blockinput.h: Don't include "atimer.h"; no longer needed.
2914 (interrupt_input_pending): Remove. All uses removed.
2915 pending_signals now counts both atimers and ordinary interrupts.
2916 This is less racy than having three separate pending-signal flags.
2917 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2918 (input_blocked_p):
2919 Rename from their upper-case counterparts BLOCK_INPUT,
2920 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2921 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2922 This makes it easier to access volatile variables more accurately.
2923 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2924 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2925 that's more reliable if the code is buggy and sets
2926 interrupt_input_blocked to a negative value. All uses changed.
2927 * atimer.c (deliver_alarm_signal):
2928 Remove. No need to deliver this to the parent; any thread can
2929 handle this signal now. All uses replaced by underlying handler.
2930 * atimer.c (turn_on_atimers):
2931 * dispnew.c (handle_window_change_signal):
2932 * emacs.c (handle_danger_signal):
2933 * keyboard.c (kbd_buffer_get_event):
2934 Don't reestablish signal handler; not needed with sigaction.
2935 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2936 (UNBLOCK_INPUT_TO):
2937 Rework to avoid unnecessary accesses to volatile variables.
2938 (UNBLOCK_INPUT_TO): Now a function.
2939 (totally_unblock_input, unblock_input): New decls.
2940 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2941 (init_data): Remove. Necessary stuff now done in init_signal.
2942 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2943 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2944 (fatal_error_code): Remove; no longer needed.
2945 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2946 it doesn't always backtrace. All uses changed. No need to reset
2947 signal to default, since sigaction and/or die does that for us now.
2948 Use emacs_raise (FOO), not kill (getpid (), FOO).
2949 (main): Check more-accurately whether we're dumping.
2950 Move fatal-error setup to sysdep.c
2951 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2952 * gtkutil.c (xg_get_file_name, xg_get_font):
2953 Remove no-longer-needed signal-mask manipulation.
2954 * keyboard.c, process.c (POLL_FOR_INPUT):
2955 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2956 * keyboard.c (read_avail_input): Remove.
2957 All uses replaced by gobble_input.
2958 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2959 (kbd_buffer_store_event_hold, gobble_input):
2960 (record_asynch_buffer_change) [USABLE_SIGIO]:
2961 (store_user_signal_events):
2962 No need to mess with signal mask.
2963 (gobble_input): If blocking input and there are terminals, simply
2964 set pending_signals to 1 and return. All hooks changed to not
2965 worry about whether input is blocked.
2966 (process_pending_signals): Clear pending_signals before processing
2967 them, in case a signal comes in while we're processing.
2968 By convention callers now test pending_signals before calling us.
2969 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2970 New functions, to support changes to blockinput.h.
2971 (handle_input_available_signal): Now extern.
2972 (reinvoke_input_signal): Remove. All uses replaced by
2973 handle_async_input.
2974 (quit_count): Now volatile, since a signal handler uses it.
2975 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2976 All callers changed. Block SIGINT only if not already blocked.
2977 Clear sigmask reliably, even if Fsignal returns, which it can.
2978 Omit unnecessary accesses to volatile var.
2979 (quit_throw_to_read_char): No need to restore sigmask.
2980 * keyboard.c (gobble_input, handle_user_signal):
2981 * process.c (wait_reading_process_output):
2982 Call signal-handling code rather than killing ourselves.
2983 * lisp.h: Include <float.h>, for...
2984 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2985 (pending_signals): Now volatile.
2986 (syms_of_data): Now const if IEEE floating point.
2987 (handle_input_available_signal) [USABLE_SIGIO]:
2988 (terminate_due_to_signal, record_child_status_change): New decls.
2989 * process.c (create_process): Avoid disaster if memory is exhausted
2990 while we're processing a vfork, by tightening the critical section
2991 around the vfork.
2992 (send_process_frame, process_sent_to, handle_pipe_signal)
2993 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2994 ignores SIGPIPE.
2995 (send_process): No need for setjmp/longjmp any more, since the
2996 SIGPIPE stuff is now gone. Instead, report an error if errno
2997 is EPIPE.
2998 (record_child_status_change): Now extern. PID and W are now args.
2999 Return void, not bool. All callers changed.
3000 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3001 Remove. All uses removed. This bug should be fixed now in a
3002 different way.
3003 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3004 and record the child status change directly. This avoids the
3005 need to futz with the signal mask.
3006 (process_fatal_action): Move here from emacs.c.
3007 (emacs_sigaction_flags): New function, containing
3008 much of what used to be in emacs_sigaction_init.
3009 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3010 caught by emacs, to make races less likely.
3011 (deliver_process_signal): Rename from handle_on_main_thread.
3012 All uses changed.
3013 (BACKTRACE_LIMIT_MAX): Now at top level.
3014 (thread_backtrace_buffer, threadback_backtrace_pointers):
3015 New static vars.
3016 (deliver_thread_signal, deliver_fatal_thread_signal):
3017 New functions, for more-accurate delivery of thread-specific signals.
3018 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3019 (deliver_arith_signal): Handle in this thread, not
3020 in the main thread, since it's triggered by this thread.
3021 (maybe_fatal_sig): New function.
3022 (init_signals): New arg DUMPING so that we can be more accurate
3023 about whether we're dumping. Caller changed.
3024 Treat thread-specific signals differently from process-general signals.
3025 Block all signals while handling fatal error; that's safer.
3026 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3027 on IEEE hosts.
3028 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3029 Ignore SIGPIPE unless batch.
3030 (emacs_backtrace): Output backtrace for the appropriate thread,
3031 which is not necessarily the main thread.
3032 * syssignal.h: Include <stdbool.h>.
3033 (emacs_raise): New macro.
3034 * xterm.c (x_connection_signal): Remove; no longer needed
3035 now that we use sigaction.
3036 (x_connection_closed): No need to mess with sigmask now.
3037 (x_initialize): No need to reset SIGPIPE handler here, since
3038 init_signals does this for us now.
3039
3040 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3041
3042 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3043 background rect may be larger (Bug#12245).
3044
3045 2012-09-23 Chong Yidong <cyd@gnu.org>
3046
3047 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3048
3049 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * .gdbinit: Just stop at fatal_error_backtrace.
3052 See Stefan Monnier's request in
3053 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3054 Remove no-longer-used query of system type.
3055
3056 2012-09-22 Chong Yidong <cyd@gnu.org>
3057
3058 * search.c (Freplace_match): Doc fix (Bug#12325).
3059
3060 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3061
3062 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3063 (Fline_end_position): Doc fix.
3064
3065 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3066
3067 2012-09-22 Chong Yidong <cyd@gnu.org>
3068
3069 * dispextern.h (struct image_type): Add new slot, storing a type
3070 initialization function.
3071
3072 * image.c (define_image_type): Call the image initializer function
3073 if it is defined. Arguments and return value changed.
3074 (valid_image_p, make_image): Callers changed.
3075 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3076 (gif_type, imagemagick_type, svg_type, gs_type):
3077 Add initialization functions.
3078 (Finit_image_library): Call lookup_image_type.
3079 (CHECK_LIB_AVAILABLE): Macro deleted.
3080 (lookup_image_type): Call define_image_type here, rather than via
3081 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3082 (syms_of_image): Move define_image_type calls for xbm_type and
3083 pbm_type to lookup_image_type.
3084
3085 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3086
3087 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3088 'idle_timers' from here ...
3089 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3090 lists, to avoid infloops when the timer does something stupid,
3091 like reinvoke itself with the same or smaller time-out.
3092 (Bug#12447)
3093
3094 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3095
3096 * window.c (Fsplit_window_internal): Handle only Qt value of
3097 Vwindow_combination_limit separately.
3098 (Qtemp_buffer_resize): New symbol.
3099 (Vwindow_combination_limit): New default value.
3100 Rewrite doc-string.
3101
3102 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3103
3104 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3105 the new overlay string. (Bug#10159)
3106
3107 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3110 or that fprintf is async-signal-safe. POSIX doesn't require
3111 either assumption.
3112
3113 2012-09-22 Chong Yidong <cyd@gnu.org>
3114
3115 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3116 (Bug#8207).
3117
3118 2012-09-22 Kenichi Handa <handa@gnu.org>
3119
3120 * composite.c (composition_reseat_it): Handle the case that a
3121 grapheme cluster is not covered by a single font (Bug#12352).
3122
3123 2012-09-21 Chong Yidong <cyd@gnu.org>
3124
3125 * image.c (define_image_type): Avoid adding duplicate types to
3126 image_types (Bug#12463). Suggested by Jörg Walter.
3127
3128 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3129
3130 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3131 (print_load_command_name): Add case LC_DATA_IN_CODE.
3132 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3133
3134 2012-09-21 Glenn Morris <rgm@gnu.org>
3135
3136 * eval.c (Frun_hook_with_args_until_success)
3137 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3138
3139 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3140
3141 * fileio.c (Ffile_selinux_context): Only call freecon when
3142 lgetfilecon succeeded.
3143 (Fset_file_selinux_context): Likewise. (Bug#12444)
3144
3145 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3146
3147 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3148 reordering, locate the cursor by calling set_cursor_from_row; if
3149 that fails, clear the desired glyph matrix before returning a
3150 failure indication to the caller. Fixes leaving garbled display
3151 when fast scrolling with a down-key. (Bug#12403)
3152 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3153 scrolling through multibyte text.
3154
3155 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3156
3157 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3158 calling mark_vectorlike since that's the one that marks the window.
3159 (mark_discard_killed_buffers): Mark the final cdr.
3160 * window.h (struct window): Move prev/next_buffers to the
3161 non-standard fields.
3162 * window.c (make_window): Initialize prev/next_buffers manually.
3163
3164 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3165
3166 Omit unused arg EXPECTED from socket hooks.
3167 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3168 * nsterm.m (ns_term_init):
3169 * termhooks.h (struct terminal.read_socket_hook):
3170 * w32inevt.c (w32_console_read_socket):
3171 * w32term.c (w32_read_socket):
3172 * xterm.c (XTread_socket):
3173 Omit unused arg EXPECTED. All callers changed.
3174 (store_user_signal_events): Return void, not int, since callers no
3175 longer care about the return value. All uses changed.
3176
3177 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3178
3179 * w32gui.h (XParseGeometry): Do not declare.
3180
3181 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3182
3183 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3184 Ignore 'expected'. See Eli Zaretskii in
3185 <http://bugs.gnu.org/12471#8> (last line).
3186
3187 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3188 (XParseGeometry): Now static. Substitute extremal values for
3189 values that are out of range.
3190
3191 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3192
3193 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3194
3195 * nsfns.m (XParseGeometry): Remove.
3196 (Fx_create_frame): Call x_set_offset to correctly interpret
3197 top_pos in geometry.
3198
3199 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3200 (Fx_parse_geometry): If there is a space in string, call
3201 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3202
3203 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3204
3205 * search.c (scan_buffer): Use character positions in calls to
3206 region_cache_forward and region_cache_backward, not byte
3207 positions. (Bug#12196)
3208
3209 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3210 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3211
3212 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3213 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3214 emacs_blocked_malloc, now deleted.
3215
3216 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3217
3218 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3219 The workaround was for improving performance on Solaris 2.4, but
3220 is getting in the way now. Emacs will still work if someone is
3221 still running Solaris 2.4 in a museum somewhere; Sun dropped
3222 support for Solaris 2.4 in 2003.
3223 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3224 * process.c (create_process) [HAVE_WORKING_VFORK]:
3225 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3226 since Emacs no longer uses vfork on that platform.
3227
3228 2012-09-17 Glenn Morris <rgm@gnu.org>
3229
3230 * emacs.c: Use COPYRIGHT.
3231
3232 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3233
3234 Remove configure's --without-sync-input option (Bug#12450).
3235 When auditing signal-handling in preparation for cleaning it up,
3236 I found that SYNC_INPUT has race conditions and would be a real
3237 pain to fix. Since it's an undocumented and deprecated
3238 configure-time option, now seems like a good time to remove it.
3239 Also see <http://bugs.gnu.org/11080#16>.
3240 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3241 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3242 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3243 (malloc_hysteresis):
3244 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3245 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3246 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3247 (dont_register_blocks, bytes_used_when_reconsidered)
3248 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3249 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3250 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3251 Remove. All uses removed.
3252 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3253 implementation, one that depends on whether the new macro
3254 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3255 is defined.
3256 * atimer.c (run_timers, handle_alarm_signal):
3257 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3258 (handle_async_input, process_pending_signals)
3259 (handle_input_available_signal, init_keyboard):
3260 * nsterm.m (ns_read_socket):
3261 * process.c (wait_reading_process_output):
3262 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3263 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3264 (emacs_write):
3265 * xterm.c (XTread_socket):
3266 Assume SYNC_INPUT.
3267 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3268 * eval.c (handling_signal): Remove. All uses removed.
3269 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3270 All uses replaced with the SYNC_INPUT version.
3271 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3272 Remove decls.
3273 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3274 Now static.
3275
3276 * font.c (Ffont_shape_gstring): Remove unused local.
3277
3278 2012-09-16 Glenn Morris <rgm@gnu.org>
3279
3280 * Makefile.in (clean): No longer run nextstep's clean.
3281
3282 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3283 (ns_frag): Remove.
3284 (ns-app): Move here from ns.mk, and simplify.
3285 (clean): Simplify nextstep entry.
3286 * ns.mk: Remove file.
3287
3288 2012-09-17 Kenichi Handa <handa@gnu.org>
3289
3290 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3291 not covert the last few charactes.
3292
3293 2012-09-16 Kenichi Handa <handa@gnu.org>
3294
3295 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3296 here, but just check the validity of glyphs in the glyph-string.
3297
3298 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3299
3300 * window.c (Fwindow_parameter, Fset_window_parameter):
3301 Accept any window as argument (Bug#12452).
3302
3303 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3304
3305 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3306 to ns_term_init to avoid memory leak.
3307
3308 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3309 explicit retain/release.
3310 (ns_term_init): Only allow one display. Initialize outerpool and
3311 ns_*_types.
3312
3313 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3316 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3317 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3318 the Microsoft problem in a different way, by altering ../nt/config.nt.
3319
3320 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3321
3322 * w32xfns.c:
3323 * w32uniscribe.c:
3324 * w32term.c:
3325 * w32select.c:
3326 * w32reg.c:
3327 * w32proc.c:
3328 * w32menu.c:
3329 * w32inevt.c:
3330 * w32heap.c:
3331 * w32font.c:
3332 * w32fns.c:
3333 * w32console.c:
3334 * w32.c:
3335 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3336 by lisp.h. This completes removal of setjmp.h inclusion
3337 erroneously announced in the previous commit. (Bug#12446)
3338
3339 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3340 more accurate.
3341
3342 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3343 not defined as a macro. The latter happens on MS-Windows.
3344 (Bug#12446)
3345
3346 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3347
3348 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3349 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3350 Some instances of '#include <setjmp.h>' removed, if the
3351 only reason for the instance was because "lisp.h" was included.
3352 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3353 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3354 and _longjmp with the new symbols. Emacs already uses _setjmp if
3355 available, so this change affects only POSIXish hosts that have
3356 sigsetjmp but not _setjmp, such as some versions of Solaris and
3357 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3358 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3359 (png_load_body) [HAVE_PNG]:
3360 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3361 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3362 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3363 since PNG requires jmp_buf. This is the only exception to the
3364 general rule that we now use sys_setjmp and sys_longjmp.
3365 This exception is OK since this code does not change the signal
3366 mask or longjmp out of a signal handler.
3367
3368 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3369
3370 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3371 Include "syssignal.h", for 'main_thread'.
3372
3373 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3374
3375 Avoid out-of-range marker position (Bug#12426).
3376 * insdel.c (replace_range, replace_range_2):
3377 Adjust markers before overlays, as suggested by comments.
3378 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3379 Remove redundant check before calling offset_intervals.
3380
3381 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3382
3383 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3384 current buffer (Bug#12387).
3385
3386 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3387
3388 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3389
3390 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3391
3392 Use a more backwards-compatible timer format (Bug#12430).
3393 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3394 vector element, not from the 4th, since PSECS is now at the end.
3395 (Fcurrent_idle_time): Doc fix.
3396
3397 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3398
3399 Function to mark objects and remove killed buffers at once.
3400 * alloc.c (discard_killed_buffers): Rename to ...
3401 (mark_discard_killed buffers) ... new name. Add marking
3402 of remaining objects. Fix comment. Adjust users.
3403 (mark_object): Do not touch frame buffer lists here.
3404 * frame.c (delete_frame): Reset frame buffer lists here.
3405
3406 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3407
3408 Better workaround for GNOME bug when --enable-gcc-warnings.
3409 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3410 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3411 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3412
3413 Simplify SIGIO usage (Bug#12408).
3414 The code that dealt with SIGIO was crufty and confusing, e.g., it
3415 played tricks like "#undef SIGIO" but these tricks were not used
3416 consistently. Simplify mostly by not #undeffing standard symbols,
3417 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3418 or not as we please) rather than "defined SIGIO" (standard symbol
3419 that we probably shouldn't #undef).
3420 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3421 Modules that need it can include it.
3422 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3423 * dispextern.h (ignore_sigio): New decl.
3424 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3425 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3426 * emacs.c (shut_down_emacs):
3427 * keyboard.c (kbd_buffer_store_event_hold):
3428 Use ignore_sigio rather than invoking 'signal' directly.
3429 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3430 for FIONREAD.
3431 (FIONREAD, SIGIO): Do not #undef.
3432 (tty_read_avail_input): Use #error rather than a syntax error.
3433 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3434 for I_PIPE, used by SETUP_SLAVE_PTY.
3435 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3436 * sysdep.c (croak): Remove; no longer needed. This bit of
3437 temporary code, with Fred N. Fish's comment that it's temporary,
3438 has been in Emacs since at least 1992!
3439 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3440 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3441 * syssignal.h (croak): Remove decl.
3442 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3443 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3444 now that we're termios-only.
3445 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3446 * term.c (dissociate_if_controlling_tty): Use #error rather than
3447 a run-time error.
3448
3449 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3450 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3451 to work around GNOME bug 683906.
3452 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3453 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3454 This works around GCC bug 54561.
3455
3456 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3457
3458 More fixes for 'volatile' and setjmp/longjmp.
3459 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3460 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3461 (png_load_body) [HAVE_PNG]:
3462 (jpeg_load_body) [HAVE_JPEG]:
3463 New function, with most of the old parent function's body.
3464 (png_load) [HAVE_PNG]:
3465 (jpeg_load) [HAVE_JPEG]:
3466 Invoke the new function, to avoid longjmp munging our locals.
3467 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3468 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3469 longjmp is passed 2, as the C standard doesn't guarantee this.
3470 Instead, store the failure code into mgr->failure_code.
3471
3472 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3473
3474 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3475 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3476 (syms_of_keyboard): Remove support for unread-command-char.
3477
3478 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3479
3480 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3481 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3482 violation. (Bug#12426)
3483
3484 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3485
3486 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3487
3488 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3489
3490 * eval.c: Add `inhibit-debugger'.
3491 (Qinhibit_debugger): New symbol.
3492 (call_debugger): Bind it instead of Qdebug_on_error.
3493 (maybe_call_debugger): Test Vinhibit_debugger.
3494 (syms_of_eval): Define inhibit-debugger.
3495 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3496 (syms_of_xdisp): Remove inhibit-debug-on-message.
3497
3498 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3499
3500 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3501 If a nonvolatile local variable is written before a _longjmp to
3502 the frame containing the variable, and is read after the _longjmp,
3503 the value read is indeterminate. Some local variables of type
3504 'struct handler' and 'struct catchtag' are used in this way, so
3505 mark each of their slots as volatile if the slot can be set before
3506 _longjmp and read afterwards.
3507 * lisp.h (struct handler): var and chosen_clause are now volatile.
3508 (struct catchtag): val, next, and pdlcount are now volatile.
3509
3510 * bidi.c (bidi_push_it, bidi_pop_it):
3511 * fns.c (copy_hash_table):
3512 * image.c (define_image_type):
3513 * keyboard.c (kbd_buffer_store_event_hold):
3514 * process.c (Fprocess_send_eof):
3515 * xfaces.c (x_create_gc) [HAVE_NS]:
3516 * xgselect.c (xg_select):
3517 Prefer assignment to memcpy when either will do.
3518
3519 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3520 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3521 time an item is removed. No need to mark this function 'inline';
3522 the compiler knows better than we do.
3523
3524 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3525
3526 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3527 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3528 to change_frame_size (Bug#12388).
3529 (windowDidResize:): Pass YES to updateFrameSize.
3530
3531 * nsterm.h: Add delay parameter to updateFrameSize.
3532
3533 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3534
3535 Discard killed buffers from deleted window and frame objects.
3536 This reduces an amount of references to killed buffers and
3537 helps GC to reclaim them faster.
3538 * alloc.c (discard_killed_buffers): New function.
3539 (mark_object): Use it for deleted windows and frames.
3540 (mark_object): If symbol's value is set up for a killed buffer
3541 or deleted frame, restore its global binding.
3542 * data.c (swap_in_global_binding): Add GC notice.
3543 (swap_in_symval_forwarding): Use convenient set_blv_where.
3544 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3545 * window.h: ... to here.
3546
3547 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3548
3549 Convenient macro to check whether the buffer is live.
3550 * buffer.h (BUFFER_LIVE_P): New macro.
3551 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3552 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3553
3554 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3555
3556 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3557 composition cases (Bug#12364).
3558
3559 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3560 overhang of succeeding glyphs overlapping box cursor.
3561
3562 * w32term.c (x_draw_glyph_string): Likewise.
3563
3564 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3565
3566 Simplify, document, and port floating-point (Bug#12381).
3567 The porting part of this patch fixes bugs on non-IEEE platforms
3568 with frexp, ldexp, logb.
3569 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3570 Now static.
3571 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3572 support, by removing commented-out code and briefly listing the
3573 C89 functions excluded. The commented-out stuff was confusing
3574 maintenance, e.g., we thought we needed cbrt but it was commented out.
3575 (logb): Remove decl; no longer needed.
3576 (isfinite): New macro, if not already supplied.
3577 (isnan): Don't replace any existing macro.
3578 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3579 are present on all C89 platforms.
3580 (Ffrexp): Do not special-case zero, as frexp does the right thing
3581 for that case.
3582 (Flogb): Do not use logb, as it doesn't have the desired meaning
3583 on hosts that use non-base-2 floating point. Instead, stick with
3584 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3585 frexp, to avoid getting an unspecified result.
3586
3587 * xdisp.c (Qinhibit_debug_on_message): Now static.
3588
3589 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3590
3591 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3592 NSBezierPath (Bug#12131).
3593
3594 2012-09-10 Chong Yidong <cyd@gnu.org>
3595
3596 * fns.c (Fdelq, Fdelete): Doc fix.
3597
3598 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3599
3600 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3601 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3602
3603 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3604
3605 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3606 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3607 Use it.
3608
3609 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3610
3611 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3612 left fringe if the window has a left margin. This avoids leaving
3613 traces of the cursor because its leftmost pixel is not drawn over.
3614
3615 * dispnew.c (update_window_line): When the left margin area of a
3616 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3617 that screen line. (Bug#12277)
3618
3619 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3620
3621 Assume C89 or later for math functions (Bug#12381).
3622 This simplifies the code, and makes it a bit smaller and faster,
3623 and (most important) makes it easier to clean up signal handling
3624 since we can stop worring about floating-point exceptions in
3625 library code. That was a problem before C89, but the problem
3626 went away many years ago on all practical Emacs targets.
3627 * data.c, image.c, lread.c, print.c:
3628 Don't include <math.h>; no longer needed.
3629 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3630 might be autoconfigured, as that never happens.
3631 * data.c (fmod):
3632 * doprnt.c (DBL_MAX_10_EXP):
3633 * print.c (DBL_DIG):
3634 Remove. C89 or later always defines these.
3635 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3636 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3637 (arith_error, domain_error, domain_error2):
3638 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3639 no longer needed -- we simply return what C returns. All uses removed.
3640 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3641 the wrapped code.
3642 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3643 Remove. All uses expanded, as these macros are no longer used
3644 more than once and are now more trouble than they're worth.
3645 (Ftan): Use tan, not sin / cos.
3646 (Flogb): Assume C89 frexp.
3647 (fmod_float): Assume C89 fmod.
3648 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3649 (init_floatfns): Remove. All uses removed.
3650
3651 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3652
3653 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3654 compositeToPoint for OSX < 10.6 (Bug#12390).
3655
3656 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3657
3658 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3659 This produces more-accurate results.
3660
3661 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3662
3663 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3664 changes (Bug#12088).
3665
3666 2012-09-08 Chong Yidong <cyd@gnu.org>
3667
3668 * syntax.c (Fstring_to_syntax): Doc fix.
3669
3670 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3671
3672 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3673 in the internal border.
3674 (x_set_window_size): Remove static variables and their usage.
3675 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3676 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3677 Remove fringe/internal border adjustment (Bug#11052).
3678 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3679 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3680 (ns_fix_rect_ibw): Remove.
3681 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3682 (ns_dumpglyphs_box_or_relief): Ditto.
3683 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3684 adjustment.
3685 (ns_dumpglyphs_image): Ditto.
3686 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3687 border adjustment.
3688 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3689 their usage. Add fringe_extended_p and its use as in other terms.
3690 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3691 scroll bar was removed.
3692 (updateFrameSize): New function.
3693 (windowDidResize): Move code to updateFrameSize and call it.
3694
3695 * nsterm.h (EmacsView): Add updateFrameSize.
3696
3697 2012-09-07 Chong Yidong <cyd@gnu.org>
3698
3699 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3700
3701 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3702
3703 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 More signal-handler cleanup (Bug#12327).
3706 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3707 Problem introduced when merging patches. Noted by Eli Zaretskii in
3708 <http://bugs.gnu.org/12327#67>.
3709 * floatfns.c: Comment fix.
3710 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3711 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3712 and anyway the declaration is harmless even if SIGDANGER is not defined.
3713 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3714 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3715 source files not surprisingly expected syssignal.h to define, or
3716 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3717 Include <sys/ioctl.h>, for FIONREAD.
3718 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3719 This eliminates a problem whereby other files mysteriously had
3720 to include "syssignal.h" before including "systty.h" if they
3721 wanted to use "#ifdef SIGIO".
3722
3723 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3724
3725 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3726
3727 * w32.c (sigemptyset): Empty the set.
3728 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3729
3730 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3731
3732 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3733
3734 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3735 (mark_object): Likewise for frame objects.
3736
3737 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 * syssignal.h (handle_on_main_thread): Always declare,
3740 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3741 This ports to platforms without HAVE_PTHREAD.
3742
3743 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 Signal-handler cleanup (Bug#12327).
3746 Emacs's signal handlers were written in the old 4.2BSD style with
3747 sigblock and sigmask and so forth, and this led to some
3748 inefficiencies and confusion. Rewrite these to use
3749 pthread_sigmask etc. without copying signal sets around. Also,
3750 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3751 'signal', and instead use functions that do not attempt to take
3752 over the system name space. This patch causes Emacs's text
3753 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3754 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3755 Do not include <signal.h> or "syssignal.h", as these
3756 modules do not use signals.
3757 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3758 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3759 Do not include <signal.h>, as "syssignal.h" does that for us now.
3760 * atimer.c (sigmask_atimers): New function.
3761 (block_atimers, unblock_atimers): New functions,
3762 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3763 All uses replaced.
3764 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3765 no longer needed here.
3766 * emacs.c (main): Inspect existing signal handler with sigaction,
3767 so that there's no need to block and unblock SIGHUP.
3768 * sysdep.c (struct save_signal): New member 'action', replacing
3769 old member 'handler'.
3770 (save_signal_handlers, restore_signal_handlers):
3771 Use sigaction instead of 'signal' to save and restore.
3772 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3773 New function. All users of 'signal' modified to use set_sighandler
3774 if they're writeonly, and to use sys_signal if they're read+write.
3775 (emacs_sigaction_init, forwarded_signal): New functions.
3776 (sys_signal): Remove. All uses replaced by calls to sigaction
3777 and emacs_sigaction_init, or by direct calls to 'signal'.
3778 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3779 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3780 all uses replaced by pthread_sigmask etc. calls.
3781 * syssignal.h: Include <signal.h>.
3782 (emacs_sigaction_init, forwarded_signal): New decls.
3783 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3784 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3785 (sigmask, sys_sigmask): Remove; no longer needed.
3786 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3787 (sigblock, sigunblock, sigfree):
3788 (sigsetmask) [!defined sigsetmask]:
3789 Remove. All uses replaced by pthread_sigmask.
3790 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3791 no longer need to be replaced, and its typical old uses
3792 are now done via emacs_sigaction_init and sigaction.
3793 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3794 (sys_sigdel): Remove; unused.
3795 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3796
3797 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3798
3799 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3800 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3801
3802 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3803
3804 Explicitly mark buffer_defaults and buffer_local_symbols.
3805 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3806 mark_local_symbols here.
3807 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3808 since special buffers aren't marked here any more.
3809 (allocate_buffer): Chain new buffer with all_buffers here...
3810 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3811 not here.
3812 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3813 (syms_of_buffer): Remove staticpro of the above.
3814 (init_buffer_once): Set names for buffer_defaults and
3815 buffer_local_symbols.
3816
3817 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3818
3819 Use bool for booleans in font-related modules.
3820 * font.c (font_intern_prop, font_style_to_value)
3821 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3822 (generate_otf_features, font_check_otf_features, font_check_otf)
3823 (font_match_p, font_list_entities, font_at):
3824 * fontset.c (fontset_id_valid_p, reorder_font_vector
3825 (fontset_find_font, Fset_fontset_font)
3826 (face_suitable_for_char_p) [0]:
3827 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3828 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3829 (m17n_flt_initialized, ftfont_shape_by_flt):
3830 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3831 * nsfont.m (nsfont_draw):
3832 * w32font.c (w32font_draw):
3833 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3834 Use bool for booleans.
3835 * font.h: Adjust to above API changes.
3836 (struct font, struct font_driver, struct font_driver_list):
3837 Use bool for booleans.
3838 (struct font): Remove useless member encoding_type.
3839 All users removed.
3840 * fontset.c, xftfont.c: Omit unnecessary static decls.
3841
3842 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3843
3844 * alloc.c (mark_object): Revert window marking code
3845 since it's unsafe for the Fset_window_configuration.
3846
3847 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3848
3849 Fix race conditions with signal handlers and errno (Bug#12327).
3850 Be more systematic about preserving errno whenever a signal
3851 handler returns, even if it's not in the main thread. Do this by
3852 renaming signal handlers to distinguish between signal delivery
3853 and signal handling. All uses changed.
3854 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3855 * data.c (deliver_arith_signal): Rename from arith_error.
3856 * dispnew.c (deliver_window_change_signal): Rename from
3857 window_change_signal.
3858 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3859 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3860 * keyboard.c (deliver_input_available_signal): Rename from
3861 input_available_signal.
3862 (deliver_user_signal): Rename from handle_user_signal.
3863 (deliver_interrupt_signal): Rename from interrupt_signal.
3864 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3865 (deliver_child_signal): Rename from sigchld_handler.
3866 * atimer.c (handle_alarm_signal):
3867 * data.c (handle_arith_signal):
3868 * dispnew.c (handle_window_change_signal):
3869 * emacs.c (handle_fatal_signal, handle_danger_signal):
3870 * keyboard.c (handle_input_available_signal):
3871 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3872 * process.c (handle_pipe_signal, handle_child_signal):
3873 New functions, with the actual signal-handling code taken from the
3874 original respective signal handlers, sans the sporadic attempts to
3875 preserve errno, since that's now done by handle_on_main_thread.
3876 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3877 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3878 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3879 Move to sysdep.c.
3880 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3881 Move initialization of main_thread to sysdep.c's init_signals.
3882 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3883 our usage, and simplifies the mainline code.
3884 (record_child_status_change): New static function, as a helper
3885 for handle_child_signal, and with most of the old child handler's
3886 contents.
3887 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3888 (handle_child_signal): Use the above.
3889 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3890 Moved here from emacs.c.
3891 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3892 code moved here from emacs.c's main function.
3893 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3894 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3895 This lets callers save and restore errno properly.
3896
3897 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3898
3899 Remove redundant or unused things here and there.
3900 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3901 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3902 * editfns.c (Fcompare_buffer_substrings): Likewise.
3903 * frame.h (struct terminal, struct font_driver_list):
3904 Remove redundant declarations.
3905 * window.h (Qleft, Qright): Likewise.
3906
3907 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3908
3909 Do not mark objects from deleted buffers, windows and frames.
3910 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3911 (mark_object): Likewise for windows and frames.
3912
3913 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3914
3915 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3916 buffer_defaults and buffer_local_symbols as valid objects.
3917 Return special value to denote them.
3918
3919 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3920
3921 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3922 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3923 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3924 (file_name_absolute_p, Fsubstitute_in_file_name):
3925 (check_executable, check_writable, Ffile_accessible_directory_p)
3926 (Fset_file_selinux_context, Fdefault_file_modes)
3927 (Finsert_file_contents, choose_write_coding_system)
3928 (Fwrite_region, build_annotations, a_write, e_write)
3929 (Fdo_auto_save):
3930 * filelock.c (boot_time_initialized, get_boot_time)
3931 (get_boot_time_1, lock_file_1, within_one_second):
3932 * floatfns.c (in_float):
3933 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3934 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3935 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3936 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3937 * window.c (compare_window_configurations):
3938 Use bool for booleans.
3939 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3940 (Fdefault_file_modes): Now mode_t, not int, for modes.
3941 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3942 (internal_delete_file): Now returns void, not a (boolean) int,
3943 since nobody was looking at the return value.
3944 * lisp.h, window.h: Adjust to above API changes.
3945
3946 * xdisp.c (set_message): Simplify and reindent last change.
3947
3948 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3949
3950 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3951
3952 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3953
3954 * eval.c (call_debugger): Make the function non-static so that we
3955 can call it from set_message.
3956
3957 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3958 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3959
3960 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3961
3962 Give more-useful info on a fatal error (Bug#12328).
3963 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3964 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3965 of doing the work ourselves.
3966 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3967 do most of the work.
3968 (fatal_error_backtrace): New function, taken from the guts
3969 of the old fatal_error_signal, but with a new option to output
3970 a backtrace.
3971 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3972 info about the signal than just its number.
3973 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3974 * sysdep.c: Include <execinfo.h>
3975 (emacs_backtrace): New function, taken partly from the previous
3976 code of the 'die' function.
3977 (emacs_abort): Call fatal_error_backtrace rather than abort.
3978
3979 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3980
3981 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3982 eager (load-time) macro-expansion.
3983 * lisp.mk (lisp): Add macroexp.
3984
3985 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3986
3987 Simplify redefinition of 'abort' (Bug#12316).
3988 Do not try to redefine the 'abort' function. Instead, redo
3989 the code so that it calls 'emacs_abort' rather than 'abort'.
3990 This removes the need for the NO_ABORT configure-time macro
3991 and makes it easier to change the abort code to do a backtrace.
3992 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3993 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3994 Remove; sysdep.c's emacs_abort now takes its place.
3995 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3996 'abort' changed to use 'emacs_abort'.
3997 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3998 (abort) [!defined abort]: Rename to ...
3999 (emacs_abort): ... new name.
4000 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4001 the place of the old 'abort' in emacs.c.
4002 * w32.c, w32fns.c (abort): Do not #undef.
4003 * w32.c (emacs_abort): Rename from w32_abort.
4004
4005 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4006
4007 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4008 offsets[j].dv, since the y axis of the screen coordinates points
4009 down, while the y axis of the font definition coordinates points
4010 up. This fixes display of Arabic diacritics such as KASRA and
4011 KASRATAN. (Bug#11860)
4012
4013 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4014
4015 Be more systematic about _setjmp vs setjmp.
4016 * alloc.c (test_setjmp, mark_stack):
4017 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4018 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4019 (png_load, my_error_exit, jpeg_load):
4020 * process.c (send_process_trap, send_process):
4021 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4022 The underscored versions are up to 30x faster on some hosts.
4023 Formerly, the code used setjmp+longjmp sometimes and
4024 _setjmp+_longjmp at other times, with no particular reason to
4025 prefer setjmp+longjmp.
4026
4027 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4028
4029 Fix minor problem found by static checking.
4030 * buffer.c (Fdelete_all_overlays): Return nil.
4031
4032 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4033
4034 * buffer.c (Fdelete_all_overlays): New function.
4035
4036 2012-09-03 Chong Yidong <cyd@gnu.org>
4037
4038 * gtkutil.c: Add extern decl for Qxft.
4039
4040 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * emacs.c, eval.c: Use bool for boolean.
4043 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4044 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4045 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4046 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4047 (main, decode_env_path, Fdaemon_initialized):
4048 * eval.c (call_debugger, Finteractive_p, interactive_p):
4049 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4050 (maybe_call_debugger, Fbacktrace):
4051 * process.c (read_process_output, exec_sentinel):
4052 Use bool for booleans.
4053 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4054 All callers changed.
4055 * eval.c (interactive_p): Omit always-true boolean argument
4056 EXCLUDE_SUBRS_P. All callers changed.
4057 * dispextern.h, lisp.h: Reflect above API changes.
4058 * firstfile.c (dummy): Use the address of 'main', whose signature
4059 won't change, instead of the address of 'initialize', whose
4060 signature just changed from int to bool.
4061 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4062 * msdos.c (fatal_error_in_progress): ... from here.
4063 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4064 of incrementing it.
4065 (redisplay_internal, unwind_redisplay): Simply clear
4066 REDISPLAYING_P when unwinding, instead of saving its previous,
4067 always-false value and then restoring it.
4068
4069 Clean up some extern decls.
4070 Mostly, this hoists extern decls out of .c files and into .h files.
4071 That way, we're more likely to catch errors if the interfaces change.
4072 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4073 declare xg_mark_data.
4074 * dispextern.h (x_frame_parm_handlers):
4075 * font.h (Qxft):
4076 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4077 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4078 (Qultra_bold, Qoblique, Qitalic):
4079 Move extern decl here from .c file.
4080 * alloc.c (xg_mark_data) [USE_GTK]:
4081 * doc.c (Qclosure):
4082 * eval.c (Qlexical_binding):
4083 * fns.c (time) [!HAVE_UNISTD_H]:
4084 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4085 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4086 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4087 * lread.c (Qinternal_interpreter_environment):
4088 * minibuf.c (Qbuffer):
4089 * process.c (QCfamily, QCfilter):
4090 * widget.c (free_frame_faces):
4091 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4092 * xfont.c (x_clear_errors):
4093 * xterm.c (x_frame_parm_handlers):
4094 Remove now-redundant extern decls.
4095 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4096 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4097 Now static.
4098 * xfaces.c: Remove unnecessary static decls.
4099 * xterm.c (updating_frame): Remove decl of nonexistent object.
4100
4101 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4102 when building globals.h, as the objects that are not built on
4103 this host are not needed to compile C files on this host.
4104
4105 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4106
4107 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4108
4109 * frame.h: Add missing prototype for x_wm_set_size_hint.
4110
4111 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4114 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4115 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4116 (Fsubstitute_command_keys):
4117 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4118 (save_excursion_save, save_excursion_restore)
4119 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4120 (format_time_string, general_insert_function)
4121 (make_buffer_string, make_buffer_string_both)
4122 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4123 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4124 (copy_text, insert_1, insert_1_both, insert_from_string)
4125 (insert_from_string_before_markers, insert_from_string_1)
4126 (insert_from_buffer, insert_from_buffer_1, replace_range)
4127 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4128 (del_range_2, modify_region):
4129 * intervals.c (intervals_equal, balance_possible_root_interval)
4130 (adjust_intervals_for_insertion, merge_properties_sticky)
4131 (graft_intervals_into_buffer, lookup_char_property)
4132 (adjust_for_invis_intang, set_point_both)
4133 (get_property_and_range, compare_string_intervals)
4134 (set_intervals_multibyte_1, set_intervals_multibyte):
4135 * keyboard.c (decode_timer):
4136 Use bool for boolean.
4137 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4138 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4139
4140 2012-09-02 Chong Yidong <cyd@gnu.org>
4141
4142 * keymap.c (push_key_description): Print M-TAB as C-M-i
4143 (Bug#11758).
4144
4145 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4146
4147 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4148 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4149 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4150 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4151 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4152 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4153 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4154
4155 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4156
4157 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4158 more than one grapheme cluster passed to the shaper: compute the
4159 offset adjustment values separately for each cluster. (Bug#11860)
4160
4161 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4162 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4163 about implicit conversions from integer to pointer.
4164
4165 2012-09-01 Daniel Colascione <dancol@dancol.org>
4166
4167 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4168 system used too early.
4169
4170 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4171
4172 Better seed support for (random).
4173 * emacs.c (main): Call init_random.
4174 * fns.c (Frandom): Set the seed from a string argument, if given.
4175 Remove long-obsolete Gentzel cruft.
4176 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4177 (init_random): New function.
4178
4179 2012-09-01 Daniel Colascione <dancol@dancol.org>
4180
4181 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4182 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4183 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4184 x_wm_set_size_hint, x_query_colors, x_real_positions,
4185 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4186 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4187 all of which have been moved to common code.
4188
4189 * xfaces.c: Include TERM_HEADER instead of listing all possible
4190 window-system headers.
4191
4192 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4193 to match header.
4194
4195 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4196 directly accessing frame internals.
4197
4198 * w32font.h: Include font.h. Define syms_of_w32font and
4199 globals_of_w32font.
4200
4201 * process.c: Include TERM_HEADER instead of listing all possible
4202 window-system headers.
4203
4204 * nsterm.h: Remove declarations now in frame.h.
4205 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4206
4207 * menu.c: Include TERM_HEADER instead of listing all possible
4208 window-system headers.
4209
4210 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4211 window system.
4212
4213 * keyboard.c: Include TERM_HEADER instead of listing all possible
4214 window-system headers.
4215
4216 * image.c: Include TERM_HEADER instead of listing all possible
4217 window-system headers. Declare Vlibrary_cache when compiling for
4218 Windows.
4219
4220 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4221 window system declarations.
4222
4223 * frame.h: Move common functions here: set_frame_menubar,
4224 x_set_window_size, x_sync, x_get_focus_frame,
4225 x_set_mouse_position, x_set_mouse_pixel_position,
4226 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4227 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4228 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4229 x_activate_menubar, x_real_positions, x_bitmap_icon,
4230 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4231 and x_query_colors.
4232
4233 * frame.c: Include TERM_HEADER instead of listing all possible
4234 window-system headers.
4235
4236 * font.c: Include TERM_HEADER instead of listing all possible
4237 window-system headers.
4238
4239 * emacs.c: Include TERM_HEADER.
4240
4241 * dispnew.c: Include TERM_HEADER instead of listing all possible
4242 window-system headers.
4243
4244 * ccl.h: Include character.h.
4245
4246 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4247 the current window system; include in list of objects to link into
4248 Emacs.
4249
4250 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Remove mark_ttys function and fix tty_display_info initialization.
4253 * lisp.h (mark_ttys): Remove prototype.
4254 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4255 to mark_ttys because all possible values of 'top_frame' slot are
4256 the frames which are reachable from Vframe_list.
4257 * term.c (mark_ttys): Remove.
4258 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4259
4260 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4261
4262 Change struct frame bitfields from unsigned char to unsigned.
4263 * frame.h (struct frame): Change type of 'display_preempted',
4264 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4265 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4266 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4267 bitfields from unsigned char to unsigned.
4268
4269 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4270
4271 Remove unused member of struct x_output and struct w32_output.
4272 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4273 * w32term.h (struct w32_output): Likewise.
4274
4275 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4276
4277 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4278 does not become zero (Bug#12234).
4279
4280 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4281
4282 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4283 for GCC 4.7.1 x86-64.
4284
4285 2012-08-30 Glenn Morris <rgm@gnu.org>
4286
4287 * lread.c (init_lread): For out-of-tree builds, only add the
4288 source directory's site-lisp dir to the load-path if it exists,
4289 consistent with in-tree builds. (Bug#12302)
4290
4291 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4292
4293 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4294 button_values to NULL. Call setStykeMask so dialogs get a close button.
4295 (windowShouldClose:): Set window_closed.
4296 (dealloc): New member, free button_values.
4297 (process_dialog:): Make member function. Remove window argument,
4298 replace window with self. Count buttons and allocate and store values
4299 in button_values.
4300 (addButton:value:row:): value is int with the name tag. Call setTag
4301 with tag. Remove return self, declare return value as void.
4302 (addString:row:): Remove return self, declare return value as void.
4303 (addSplit): Remove return self, declare return value as void.
4304 (clicked:): Remove return self, declare return value as void.
4305 Set dialog_return to button_values[seltag]. Code formatting change.
4306 (initFromContents:isQuestion:): Adjust call to process_dialog.
4307 Code formatting change.
4308 (timeout_handler:): Set timer_fired to YES.
4309 (runDialogAt:): Set timer_fired to NO.
4310 Handle click on close button as quit.
4311
4312 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4313 Add window_closed and button_values. Add void as return value for
4314 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4315 Add process_dialog as new member.
4316
4317 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4318
4319 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4320 is not one of the heaps we manage. (Bug#12242)
4321
4322 2012-08-28 Glenn Morris <rgm@gnu.org>
4323
4324 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4325
4326 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4327
4328 * window.c (Fset_window_configuration): Remove handling of
4329 auto-buffer-name window parameter. Install revision of reverted
4330 fix.
4331
4332 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4333
4334 Do not allow to set major mode for a dead buffer.
4335 * buffer.c (Fset_buffer_major_mode): Signal an error
4336 if the buffer is dead.
4337 (Fother_buffer, other_buffer_safely): Remove redundant
4338 nested declaration.
4339
4340 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4341
4342 Always use set_buffer_if_live to restore original buffer at unwind.
4343 * buffer.h (record_unwind_current_buffer): New function.
4344 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4345 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4346 * undo.c, window.c: Adjust users.
4347 * buffer.c (set_buffer_if_live): Fix comment.
4348
4349 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4350
4351 Fix usage of set_buffer_internal.
4352 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4353 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4354 * coding.c (decode_coding): Omit redundant test.
4355 * fileio.c (decide_coding_unwind): Likewise.
4356 * fns.c (secure_hash): Likewise.
4357 * insdel.c (modify_region): Likewise.
4358 * keyboard.c (command_loop_1): Likewise.
4359 * print.c (PRINTFINISH): Likewise.
4360 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4361
4362 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4363
4364 * dispnew.c: Use bool for boolean.
4365 (frame_garbaged, display_completed, delayed_size_change)
4366 (fonts_changed_p, add_window_display_history)
4367 (add_frame_display_history, verify_row_hash)
4368 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4369 (row_equal_p, realloc_glyph_pool)
4370 (allocate_matrices_for_frame_redisplay)
4371 (showing_window_margins_p)
4372 (adjust_frame_glyphs_for_frame_redisplay)
4373 (build_frame_matrix_from_leaf_window, make_current)
4374 (mirrored_line_dance, mirror_line_dance, update_frame)
4375 (update_window_tree, update_single_window)
4376 (check_current_matrix_flags, update_window, update_text_area)
4377 (update_window_line, set_window_update_flags, scrolling_window)
4378 (update_frame_1, scrolling, buffer_posn_from_coords)
4379 (do_pending_window_change, change_frame_size)
4380 (change_frame_size_1, sit_for):
4381 Use bool for boolean.
4382 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4383 and remove last int (actually boolean) argument, which was always 0.
4384 All callers changed.
4385 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4386 * dispextern.h (struct composition_it): Use bool for boolean.
4387 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4388 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4389 * dired.c (file_name_completion):
4390 Use bool for boolean. (This was missed in an earlier change.)
4391
4392 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4393
4394 * window.c (Fset_window_configuration): Revert first part of
4395 last change.
4396
4397 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4398
4399 * nsterm.h (NSPanel): New class variable dialog_return.
4400
4401 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4402 Initialize dialog_return.
4403 (windowShouldClose:): Use stop instead of stopModalWithCode.
4404 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4405 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4406 event.
4407 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4408 modal loop returns.
4409
4410 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4411
4412 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4413 * composite.c (find_composition, composition_gstring_p)
4414 (composition_reseat_it, find_automatic_composition):
4415 * data.c (let_shadows_buffer_binding_p)
4416 (let_shadows_global_binding_p, set_internal, make_blv)
4417 (Fmake_variable_buffer_local, Fmake_local_variable)
4418 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4419 (cons_to_signed, arith_driver):
4420 * dbusbind.c (xd_in_read_queued_messages):
4421 * dired.c (directory_files_internal, file_name_completion):
4422 Use bool for booleans.
4423 * dired.c (file_name_completion):
4424 * process.h (fd_callback):
4425 Omit int (actually boolean) argument. It wasn't being used.
4426 All uses changed.
4427 * composite.h, lisp.h: Reflect above API changes.
4428
4429 * cmds.c, coding.c: Use bool for booleans.
4430 * cmds.c (move_point, Fself_insert_command):
4431 * coding.h (struct composition status, struct coding_system):
4432 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4433 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4434 (emacs_mule_char, decode_coding_emacs_mule)
4435 (encode_coding_emacs_mule, detect_coding_iso_2022)
4436 (decode_coding_iso_2022, encode_invocation_designation)
4437 (encode_designation_at_bol, encode_coding_iso_2022)
4438 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4439 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4440 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4441 (encode_coding_raw_text, detect_coding_charset)
4442 (decode_coding_charset, encode_coding_charset, detect_eol)
4443 (detect_coding, get_translation_table, produce_chars)
4444 (consume_chars, reused_workbuf_in_use)
4445 (make_conversion_work_buffer, code_conversion_save)
4446 (decode_coding_object, encode_coding_object)
4447 (detect_coding_system, char_encodable_p)
4448 (Funencodable_char_position, code_convert_region)
4449 (code_convert_string, code_convert_string_norecord)
4450 (Fset_coding_system_priority):
4451 * fileio.c (Finsert_file_contents):
4452 Use bool for booleans.
4453 * coding.h, lisp.h: Reflect above API changes.
4454 * coding.c: Remove unnecessary static function decls.
4455 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4456 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4457 not a boolean 'int', since callers never look at the return value.
4458 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4459 * coding.h (decoding_buffer_size, encoding_buffer_size)
4460 (emacs_mule_string_char): Remove unused extern decls.
4461 (struct iso_2022_spec, struct coding_system):
4462 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4463 (struct emacs_mule_spec): Remove unused field 'full_support'.
4464 All initializations removed.
4465 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4466
4467 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4468
4469 Fix spare memory change (Bug#12286).
4470 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4471 (valid_lisp_object_p): Likewise.
4472
4473 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4474
4475 * window.c (Fset_window_configuration): Record any window's old
4476 buffer if it's replaced (see Bug#8789). If the new current
4477 buffer doesn't appear in the selected window, go to its old
4478 point (Bug#12208).
4479
4480 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 Special MEM_TYPE_SPARE to denote reserved memory.
4483 * alloc.c (enum mem_type): New memory type.
4484 (refill_memory_reserve): Use new type for spare memory.
4485 This prevents live_cons_p and live_string_p from incorrect
4486 detection of uninitialized objects from spare memory as live.
4487
4488 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4489
4490 Spelling fixes.
4491 * Makefile.in (.PHONY): versioclean -> versionclean.
4492
4493 Remove unused external symbols.
4494 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4495 * window.c (Qwindow_valid_p, decode_valid_window):
4496 Now static, not extern.
4497 * data.c (Qinterval): Remove; unused.
4498 (syms_of_data): Do not define 'interval'.
4499 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4500 * window.h (decode_valid_window):
4501 Remove decls.
4502
4503 * character.c, charset.c, chartab.c: Use bool for booleans.
4504 * character.c (lisp_string_width, string_count_byte8)
4505 (string_escape_byte8):
4506 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4507 (load_charset_map_from_file, map_charset_chars)
4508 (Fdefine_charset_internal, define_charset_internal)
4509 (Fdeclare_equiv_charset, find_charsets_in_text)
4510 (Ffind_charset_region, char_charset, Fiso_charset):
4511 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4512 (sub_char_table_set, sub_char_table_set_range)
4513 (char_table_set_range, optimize_sub_char_table)
4514 (map_sub_char_table):
4515 Use bool for boolean.
4516 * character.c (str_to_unibyte): Omit last boolean argument; it was
4517 always 0. All callers changed.
4518 * character.h, charset.h: Adjust to match previous changes.
4519 * character.h (char_printable_p): Remove decl of nonexistent function.
4520 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4521 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4522 are all boolean, so make them single-bit bitfields.
4523
4524 * lisp.h (ASET): Remove attempt to detect side effects.
4525 It was meant to be temporary and it often doesn't work,
4526 because when IDX has side effects the behavior of IDX==IDX
4527 is undefined. See Stefan Monnier in
4528 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4529
4530 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4531
4532 * lisp.h (functionp): New function (extracted from Ffunctionp).
4533 (FUNCTIONP): Use it.
4534 * eval.c (Ffunctionp): Use it.
4535
4536 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4537
4538 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4539 as that's faster and simpler than static storage. Don't bother
4540 with the g_main_context_query overhead if g_main_context_pending
4541 says no events are pending.
4542 (gfds, gfds_size): Remove these static vars.
4543 (xgselect_initialize): Remove; no longer needed.
4544 All uses and decls removed.
4545
4546 * emacs.c (fatal_error_signal_hook): Remove.
4547 All uses removed. This leftover from old code was always 0.
4548
4549 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4550 * casefiddle.c (casify_object, casify_region):
4551 * casetab.c (set_case_table):
4552 * category.c, category.h (word_boundary_p):
4553 * category.h (CHAR_HAS_CATEGORY):
4554 Use bool for booleans, instead of int.
4555
4556 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4557
4558 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4559
4560 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 On assertion failure, print backtrace if available.
4563 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4564 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4565 * Makefile.in (LIB_EXECINFO): New macro.
4566 (LIBES): Use it.
4567
4568 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4569 * bytecode.c (exec_byte_code):
4570 * callint.c (check_mark, Fcall_interactively):
4571 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4572 (getenv_internal, sync_process_alive, call_process_exited):
4573 * lisp.h (USE_SAFE_ALLOCA):
4574 Use bool for booleans, instead of int.
4575 * lisp.h, process.h: Adjust prototypes to match above changes.
4576 * callint.c (Fcall_interactively): Don't assume the mark's
4577 offset fits in 'int'.
4578
4579 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 * buffer.c, buffer.h: Use bool for boolean.
4582 * buffer.c (reset_buffer_local_variables)
4583 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4584 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4585 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4586 (overlay_touches_p, overlay_strings, Foverlay_put)
4587 (report_overlay_modification, call_overlay_mod_hooks):
4588 (mmap_enlarge, mmap_set_vars):
4589 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4590 Use bool for booleans, instead of int.
4591 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4592 since the 1-or-0 return value is always ignored anyway.
4593 (mmap_initialized_p):
4594 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4595 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4596
4597 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4598
4599 * bidi.c: Use bool for boolean.
4600 This is a bit more readable, and makes the text segment of bidi.o
4601 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4602 Presumably it's faster too.
4603 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4604 Now bool.
4605 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4606 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4607 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4608 (bidi_explicit_dir_char, bidi_level_of_next_char)
4609 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4610 Use bool for booleans, instead of int.
4611 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4612 (bidi_unshelve_cache): Adjust decls to match code.
4613
4614 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4615
4616 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4617 argument.
4618
4619 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4622 * atimer.h: Include <stdbool.h>.
4623
4624 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4625
4626 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4627 compile time tests instead of run time tests on systems that do
4628 not use them.
4629 (FRAME_MAC_P): Remove leftover from deleted code.
4630 * frame.c (syms_of_frame): Remove leftover from deleted code.
4631
4632 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4633
4634 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4635
4636 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4637
4638 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4639 Otherwise, the compiler complains about (A?B:C) where B is void
4640 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4641 (fontset_add): Return void, for FONTSET_ADD.
4642
4643 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4644
4645 * alloc.c: Use bool for booleans.
4646 (gc_in_progress, abort_on_gc)
4647 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4648 (dont_register_blocks) [GC_MALLOC_CHECK]:
4649 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4650 (check_string_bytes, make_specified_string, memory_full)
4651 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4652 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4653 (mark_stack, valid_pointer_p, make_pure_string)
4654 (Fgarbage_collect, survives_gc_p, gc_sweep):
4655 Use bool for booleans, instead of int.
4656 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4657 Remove unused local.
4658 * alloc.c (PURE_POINTER_P):
4659 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4660 * editfns.c (Fformat):
4661 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4662 (Fdo_auto_save):
4663 * fns.c (sweep_weak_table):
4664 * lisp.h (suppress_checking, push_message, survives_gc_p)
4665 (make_pure_string, gc_in_progress, abort_on_gc):
4666 * lread.c (readchar, read1):
4667 * print.c (Fprin1_to_string):
4668 * xdisp.c (push_message):
4669 Use bool for booleans affected directly or indirectly by
4670 alloc.c's changes.
4671
4672 Make recently-introduced setters macros.
4673 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4674 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4675 (set_fontset_default, set_fontset_fallback): Rename from their
4676 upper-case counterparts, and make them functions rather than macros.
4677 This is more consistent with the other recently-introduced setters.
4678 These don't need to be inline, since they're local.
4679
4680 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4681
4682 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4683 the loop (Bug#12247).
4684
4685 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4686
4687 * lisp.h (vcopy): Use memcpy rather than our own loop.
4688 This fixes a performance regression introduced by the recent
4689 addition of vcopy. This means 'vcopy' will need to be modified
4690 for a copying collector, but that's OK. Also, tighten the
4691 checking in the assertion.
4692
4693 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4694
4695 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4696 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4697 non-base glyph for the width of the base character, according to
4698 what x_draw_composite_glyph_string_foreground expects.
4699 Generate WADJUST value according to composition_gstring_width's
4700 expectations, to produce correct width of the composed character.
4701 Reverse the sign of the DU offset produced by ScriptPlace.
4702
4703 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4704
4705 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4706
4707 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4708
4709 Avoid direct writes to contents member of struct Lisp_Vector.
4710 * lisp.h (vcopy): New function to copy data into vector.
4711 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4712 * fns.c (Ffillarray): Use ASET.
4713 * keyboard.c (timer_check_2): Use AREF and ASET.
4714 (append_tool_bar_item, Frecent_keys): Use vcopy.
4715 * lread.c (read_vector): Use ASET.
4716 * msdos.c (Frecent_doskeys): Use vcopy.
4717 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4718 (Finternal_merge_in_global_face): Use ASET and vcopy.
4719 * xfont.c (xfont_list_pattern): Likewise.
4720
4721 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4722
4723 * window.c (Fwindow_point): For the selected window always return
4724 the position of its buffer's point.
4725 (Fset_window_point): For the selected window always go in its
4726 buffer to the specified position.
4727
4728 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Setter macros for fontsets.
4731 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4732 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4733 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4734 Adjust users.
4735
4736 2012-08-20 Glenn Morris <rgm@gnu.org>
4737
4738 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4739 Don't assume that `ln -f' works.
4740
4741 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4742
4743 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4744 and later about non-assignments with no effect. See discussion at
4745 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4746 details.
4747
4748 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4749
4750 Inline setter functions for Lisp_Objects slots of struct specbinding.
4751 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4752 Adjust users.
4753
4754 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4755
4756 * window.c (select_window): Always make selected window's buffer
4757 current.
4758
4759 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4760
4761 Use AREF and ASET for docstrings of category tables.
4762 * category.h (CATEGORY_DOCSTRING): Use AREF.
4763 (SET_CATEGORY_DOCSTRING): Use ASET.
4764 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4765
4766 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4767
4768 Inline setter functions for hash table members.
4769 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4770 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4771 (set_hash_key_and_value, set_hash_index, set_hash_next)
4772 (set_hash_hash): New functions.
4773 * charset.c, fns.c: Adjust users.
4774
4775 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 Inline getter and setter functions for per-buffer values.
4778 * buffer.h (per_buffer_default, set_per_buffer_default)
4779 (per_buffer_value, set_per_buffer_value): New functions.
4780 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4781 * buffer.c, data.c: Adjust users.
4782
4783 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4784
4785 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4786
4787 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4788
4789 Rely on <config.h> + <unistd.h> to declare 'environ',
4790 as gnulib does this if the system doesn't.
4791 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4792 Remove declaration. MS-Windows declares it on stdlib.h which is
4793 included by conf_post.h.
4794 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4795 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4796 * vm-limit.c: Include <unistd.h>, for 'environ'.
4797
4798 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4799 (start_of_data): Remove decl; mem-limits.h provides it.
4800
4801 * xdisp.c (handle_invisible_prop): Make it a bit faster
4802 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4803
4804 2012-08-19 Chong Yidong <cyd@gnu.org>
4805
4806 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4807 ends (Bug#3874).
4808
4809 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4810
4811 * .gdbinit: Use call instead of set when calling a function in the
4812 inferior.
4813
4814 * data.c (set_internal): Don't use set_blv_found.
4815 (Fkill_local_variable): Likewise.
4816
4817 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4818
4819 * nsfont.m (ns_ascii_average_width): Ensure the string
4820 ascii_printable is initialized with a null-terminated character
4821 array. Otherwise, it can contain undesired extra characters.
4822
4823 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 port new setting code to Sun C 5.8 2005/10/13
4826 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4827 Return void, not Lisp_Object. Otherwise, the compiler
4828 complains about (A?B:C) where B is void and C is Lisp_Object
4829 when compiling CHAR_TABLE_SET, due to the recent change to
4830 the API of sub_char_table_set_contents.
4831
4832 2012-08-18 Chong Yidong <cyd@gnu.org>
4833
4834 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4835 for the string case (Bug#3874).
4836
4837 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 * buffer.h (BSET): Remove (Bug#12215).
4840 Replace all uses with calls to new setter functions.
4841 (bset_bidi_paragraph_direction, bset_case_canon_table)
4842 (bset_case_eqv_table, bset_directory, bset_display_count)
4843 (bset_display_time, bset_downcase_table)
4844 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4845 (bset_last_selected_window, bset_local_var_alist)
4846 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4847 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4848 (bset_width_table):
4849 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4850 (bset_auto_fill_function, bset_auto_save_file_format)
4851 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4852 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4853 (bset_cache_long_line_scans, bset_case_fold_search)
4854 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4855 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4856 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4857 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4858 (bset_header_line_format, bset_indicate_buffer_boundaries)
4859 (bset_indicate_empty_lines, bset_invisibility_spec)
4860 (bset_left_fringe_width, bset_major_mode, bset_mark)
4861 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4862 (bset_name, bset_overwrite_mode, bset_pt_marker)
4863 (bset_right_fringe_width, bset_save_length)
4864 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4865 (bset_scroll_up_aggressively, bset_selective_display)
4866 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4867 (bset_word_wrap, bset_zv_marker):
4868 * category.c (bset_category_table):
4869 * syntax.c (bset_syntax_table):
4870 New setter functions.
4871
4872 * process.h (PSET): Remove (Bug#12215).
4873 Replace all uses with calls to new setter functions.
4874 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4875 (PROCESS_INLINE): New macro.
4876 (pset_childp): New setter function.
4877 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4878 * process.c (PROCESS_INLINE):
4879 Define to EXTERN_INLINE, so that the corresponding functions
4880 are compiled into code.
4881 (pset_buffer, pset_command, pset_decode_coding_system)
4882 (pset_decoding_buf, pset_encode_coding_system)
4883 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4884 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4885 (pset_type, pset_write_queue): New setter functions.
4886
4887 * window.h (WSET): Remove (Bug#12215).
4888 Replace all uses with calls to new setter functions.
4889 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4890 (WINDOW_INLINE): New macro.
4891 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4892 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4893 (wset_total_lines, wset_vertical_scroll_bar)
4894 (wset_window_end_pos, wset_window_end_valid)
4895 (wset_window_end_vpos): New setter functions.
4896 * window.c (WINDOW_INLINE):
4897 Define to EXTERN_INLINE, so that the corresponding functions
4898 are compiled into code.
4899 (wset_combination_limit, wset_dedicated, wset_display_table)
4900 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4901 (wset_new_normal, wset_new_total, wset_next_buffers)
4902 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4903 (wset_prev_buffers, wset_right_fringe_width)
4904 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4905 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4906 (wset_window_parameters):
4907 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4908 (wset_column_number_displayed, wset_region_showing):
4909 New setter functions.
4910
4911 * termhooks.h (TSET): Remove (Bug#12215).
4912 Replace all uses with calls to new setter functions.
4913 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4914 (TERMHOOKS_INLINE): New macro.
4915 (tset_charset_list, tset_selection_alist): New setter functions.
4916 * terminal.c (TERMHOOKS_INLINE):
4917 Define to EXTERN_INLINE, so that the corresponding functions
4918 are compiled into code.
4919 (tset_param_alist): New setter function.
4920
4921 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * keyboard.h (KSET): Remove (Bug#12215).
4924 Replace all uses with calls to new setter functions.
4925 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4926 (KEYBOARD_INLINE): New macro.
4927 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4928 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4929 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4930 New setter functions.
4931 * keyboard.c (KEYBOARD_INLINE):
4932 Define to EXTERN_INLINE, so that the corresponding functions
4933 are compiled into code.
4934 (kset_echo_string, kset_kbd_queue)
4935 (kset_keyboard_translate_table, kset_last_prefix_arg)
4936 (kset_last_repeatable_command, kset_local_function_key_map)
4937 (kset_overriding_terminal_local_map, kset_real_last_command)
4938 (kset_system_key_syms): New setter functions.
4939
4940 * frame.h (FSET): Remove (Bug#12215).
4941 Replace all uses with calls to new setter functions.
4942 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4943 (FRAME_INLINE): New macro.
4944 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4945 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4946 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4947 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4948 (fset_param_alist, fset_root_window, fset_scroll_bars)
4949 (fset_selected_window, fset_title, fset_tool_bar_items)
4950 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4951 * frame.c (FRAME_INLINE):
4952 Define to EXTERN_INLINE, so that the corresponding functions
4953 are compiled into code.
4954 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4955
4956 A few more naming-convention fixes for getters and setters.
4957 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4958 and rename from buffer_overlays_set_before.
4959 (set_buffer_overlays_after): Move here from buffer.h, and rename
4960 from buffer_overlays_set_after.
4961 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4962 All uses changed.
4963 (set_buffer_intervals): Rename from buffer_set_intervals.
4964 * intervals.c (set_interval_object): Move here from intervals.h,
4965 and rename from interval_set_object.
4966 (set_interval_left): Move here from intervals.h, and rename from
4967 interval_set_left.
4968 (set_interval_right): Move here from intervals.h, and rename from
4969 interval_set_right.
4970 (copy_interval_parent): Move here from intervals.h, and rename from
4971 interval_copy_parent.
4972 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4973 (set_interval_plist): Rename from interval_set_plist.
4974 Return void, not Lisp_Object, since no caller uses the result.
4975 * lisp.h (string_intervals): Rename from string_get_intervals.
4976 (set_string_intervals): Rename from string_set_intervals.
4977
4978 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4979 (set_char_table_contents): Rename from char_table_set_contents.
4980 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4981 All uses changed. See the end of
4982 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4983
4984 * lisp.h (CSET): Remove (Bug#12215).
4985 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4986 (set_char_table_purpose): New functions,
4987 replacing CSET. All uses changed. For example, replace
4988 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4989 "set_char_table_parent (char_table, parent);".
4990 The old version was confusing because it used the same name
4991 'parent' for two different things.
4992
4993 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4994
4995 Functions to get and set Lisp_Object fields of buffer-local variables.
4996 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4997 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4998 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4999 * data.c, eval.c, frame.c: Adjust users.
5000
5001 2012-08-17 Chong Yidong <cyd@gnu.org>
5002
5003 * xfaces.c (merge_face_vectors): If the target font specfies a
5004 font spec, make the font's attributes take precedence over
5005 directly-specified attributes.
5006 (merge_face_ref): Recognize :font.
5007
5008 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 Do not use memcpy for copying intervals.
5011 * intervals.c (reproduce_interval): New function.
5012 (reproduce_tree, reproduce_tree_obj): Use it.
5013 (reproduce_tree_obj): Remove prototype.
5014
5015 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 * lisp.h (duration_to_sec_usec): Remove unused decl.
5018
5019 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5020
5021 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5022 to an allocated instance of NSString, not to the class itself.
5023
5024 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5025
5026 * makefile.w32-in (C_CTYPE_H): New macro.
5027 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5028 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5029 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5030
5031 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 Use ASCII tests for character types.
5034 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5035 * xfns.c, xterm.c:
5036 Don't include <ctype.h>; was not needed.
5037 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5038 * sysdep.c, xfaces.c:
5039 Include <c-ctype.h> instead of <ctype.h>.
5040 * nsterm.m: Include <c-ctype.h>.
5041 * charset.c (read_hex):
5042 * doc.c (Fsnarf_documentation):
5043 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5044 (DRIVE_LETTER) [DOS_NT]:
5045 (Ffile_name_directory, Fexpand_file_name)
5046 (Fsubstitute_in_file_name):
5047 * font.c (font_parse_xlfd, font_parse_fcname):
5048 * frame.c (x_set_font_backend):
5049 * gtkutil.c (xg_get_font):
5050 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5051 * nsimage.m (hexchar):
5052 * nsterm.m (ns_xlfd_to_fontname):
5053 * sysdep.c (system_process_attributes):
5054 * xfaces.c (hash_string_case_insensitive):
5055 Use C-locale tests instead of locale-specific tests for character
5056 types, since we want the ASCII interpretation here, not the
5057 interpretation suitable for whatever happens to be the current locale.
5058
5059 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5060
5061 Consistently check windows for validity/liveness
5062 (Bug#11984, Bug#12025, Bug#12026).
5063 * lisp.h (CHECK_VALID_WINDOW): New macro.
5064 * window.c (decode_window): Rename to decode_live_window.
5065 (decode_valid_window, Fwindow_valid_p): New functions.
5066 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5067 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5068 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5069 (Fwindow_prev_sibling, Fwindow_combination_limit)
5070 (Fset_window_combination_limit, Fwindow_use_time)
5071 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5072 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5073 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5074 (Fwindow_hscroll, Fset_window_hscroll)
5075 (Fwindow_redisplay_end_trigger)
5076 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5077 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5078 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5079 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5080 (Fwindow_end, Fset_window_point, Fset_window_start)
5081 (Fpos_visible_in_window_p, Fwindow_line_height)
5082 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5083 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5084 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5085 (Fset_window_parameter, Fwindow_display_table)
5086 (Fset_window_display_table, Fdelete_other_windows_internal)
5087 (Fset_window_buffer, Fset_window_new_total)
5088 (Fset_window_new_normal, Fdelete_window_internal)
5089 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5090 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5091 (Fwindow_scroll_bars): Check whether argument window is a valid or
5092 live window. Update doc-strings.
5093 (syms_of_window): New symbol Qwindow_valid_p.
5094 * keyboard.c (Fposn_at_x_y): Check whether argument
5095 frame_or_window denotes a valid window.
5096
5097 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5098
5099 Fix previous char table change.
5100 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5101 * chartab.c (optimize_sub_char_table): Likewise.
5102
5103 2012-08-16 Chong Yidong <cyd@gnu.org>
5104
5105 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5106
5107 * xfont.c (xfont_open):
5108 * xftfont.c (xftfont_open): Set the font's max_width field.
5109
5110 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5111 min_width to space_width and average_width to the average over
5112 printable ASCII characters.
5113 (ns_char_width): Code cleanup.
5114 (ns_ascii_average_width): New utility function.
5115
5116 * font.h (struct font): Update comments.
5117
5118 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 Simple interface to set Lisp_Object fields of character tables.
5121 * lisp.h (CSET): New macro.
5122 (char_table_set_extras, char_table_set_contents)
5123 (sub_char_table_set_contents): New function.
5124 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5125 * syntax.c: Adjust users.
5126
5127 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5128
5129 * eval.c (eval_sub): Bind lexical-binding.
5130 * lread.c (Qlexical_binding): Make non-static.
5131
5132 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5133
5134 * nsmenu.m (popupSession): Remove.
5135 (pop_down_menu): Remove endModalSession.
5136 (timeout_handler:): New method.
5137 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5138 Call runModalForWindow. Check timer_fired when it returns.
5139 If not set, cancel timer and break out of loop.
5140 Otherwise loop again, with a new timeout.
5141
5142 * nsterm.m: Include fcntl.h if present.
5143 (fd_entry, t_readfds, inNsSelect): Remove.
5144 (select_writefds, select_valid, select_timeout, selfds)
5145 (select_mutex, apploopnr): Add.
5146 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5147 Otherwise call kbd_buffer_store_event.
5148 (ns_send_appdefined): Remove release of fd_entry.
5149 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5150 Increment and decrement apploopnr.
5151 (ns_select): If no file descriptors, just do a NSTimer.
5152 Otherwise copy read/write masks and start select thread (fd_handler).
5153 Start main loop and wait for application defined event.
5154 Inform select thread to stop selecting after main loop is exited.
5155 (ns_term_init): Create selfds pipe and set non-blocking.
5156 Initialize select_mutex. Start the select thread (fd_handler).
5157 (fd_handler:): Loop forever, wait for info from the main thread
5158 to either start or stop selecting. When select returns, send
5159 and appdefined event.
5160 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5161 If not call kbd_buffer_store_event.
5162
5163 * nsterm.h (EmacsApp): fd_handler takes id argument.
5164 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5165
5166 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5167
5168 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5169
5170 * region-cache.c (move_cache_gap): Update gap_len using the actual
5171 growth of the boundaries array. Do not change cache_len.
5172 (Bug#12196)
5173
5174 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5175
5176 Generalize and cleanup font subsystem checks.
5177 * font.h (FONT_DEBUG, font_assert): Remove.
5178 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5179 Change font_assert to eassert. Use eassert where appropriate.
5180
5181 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5184
5185 2012-08-15 Chong Yidong <cyd@gnu.org>
5186
5187 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5188 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5189 extract the font descriptor instead of just the font name.
5190 In that case, return a font spec instead of a string.
5191 (x_last_font_name): Move to this file from xfns.c.
5192
5193 * xfns.c (Fx_select_font): The return value can also be a font
5194 spec. Move x_last_font_name management to gtkutil.c.
5195
5196 * xfaces.c: Make font weight and style symbols non-static.
5197
5198 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5199
5200 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5201 (bug#12117).
5202
5203 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5204
5205 * alloc.c (Fgarbage_collect): Use plural form consistently.
5206
5207 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5208
5209 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5210 iteration through the command loop. Fixes a problem whereby mouse
5211 movements are ignored until the first mouse click.
5212
5213 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5214
5215 Use bool, not int, for Lisp booleans.
5216 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5217 makes Emacs a bit smaller and presumably a bit faster.
5218 * lisp.h: Include <stdbool.h>.
5219 (struct Lisp_Boolfwd, defvar_bool):
5220 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5221 * regex.c [!emacs]: Include <stdbool.h>.
5222 (false, true): Remove; <stdbool.h> does this for us now.
5223
5224 2012-08-14 Chong Yidong <cyd@gnu.org>
5225
5226 * character.c (Fcharacterp): Doc fix (Bug#12076).
5227
5228 * data.c (Findirect_variable): Doc fix (Bug#11040).
5229
5230 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5231
5232 * editfns.c (Fformat): Doc fix (Bug#12059).
5233 (Fsave_current_buffer): Doc fix (Bug#11542).
5234
5235 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5236
5237 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5238 (bug#12022).
5239
5240 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5241
5242 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5243 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5244 * minibuf.c (choose_minibuf_frame, read_minibuf):
5245 * w32fns.c (x_create_tip_frame):
5246 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5247 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5248
5249 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5250
5251 * intervals.c (offset_intervals): Remove obsolete comment.
5252
5253 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5254
5255 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5256
5257 2012-08-14 Gergely Risko <gergely@risko.hu>
5258
5259 * coding.c (decode_coding): Record buffer modification before
5260 disabling undo_list (Bug#11773).
5261
5262 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5263
5264 Revert and cleanup some recent overlay changes.
5265 * buffer.h (enum overlay_type): Remove.
5266 (buffer_get_overlays, buffer_set_overlays): Likewise.
5267 (buffer_set_overlays_before, buffer_set_overlays_after):
5268 New function. Adjust users.
5269 (unchain_both): Add eassert.
5270
5271 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5272
5273 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5274
5275 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * gtkutil.c (xg_mark_data): Don't assume C99.
5278
5279 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5280
5281 * gtkutil.c (xg_frame_tb_info): New struct.
5282 (TB_INFO_KEY): New define.
5283 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5284 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5285 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5286 if not present.
5287 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5288 is up to date. Otherwise store new data.
5289 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5290
5291 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5292
5293 Use KSET for write access to Lisp_Object members of struct kboard.
5294 * keyboard.h (KSET): New macro.
5295 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5296 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5297 * xterm.c: Adjust users.
5298
5299 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5300
5301 Use BSET for write access to Lisp_Object members of struct buffer.
5302 * buffer.h (BSET): New macro.
5303 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5304 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5305 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5306 * window.c, xdisp.c, xfns.c: Adjust users.
5307
5308 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5309
5310 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5311
5312 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5313
5314 * nsterm.m (not_in_argv): New function.
5315 (application:openFile, application:openTempFile:):
5316 (application:openFileWithoutUI:, application:openFiles:): Open file
5317 if not_in_argv returns non-zero (bug#12171).
5318
5319 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5320 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5321 Define for Gtk+ versions less than 3.2.
5322 (xg_get_font_name): Use those functions/macros here.
5323 Reported by Frans Oilinki <moilinki@gmail.com>.
5324
5325 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5326
5327 * unexmacosx.c (copy_data_segment): Copy initialized data in
5328 statically linked libraries from input file rather than memory.
5329
5330 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5331 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5332 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5333
5334 2012-08-10 Glenn Morris <rgm@gnu.org>
5335
5336 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5337 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5338
5339 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5340
5341 Fix last change to allow compilation with low optimization levels.
5342 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5343 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5344
5345 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5346
5347 Use common inline syntax in intervals.h.
5348 * intervals.h (INTERVALS_INLINE): New macro.
5349 Change all users from LISP_INLINE.
5350
5351 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5352
5353 Define Qnone once for all platforms.
5354 * frame.c (Qnone): Define here.
5355 (syms_of_frame): DEFSYM it.
5356 * lisp.h (Qnone): New declaration.
5357 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5358 * xfns.c: Remove duplication. Adjust users.
5359
5360 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5361
5362 Remove unused macros from intervals.h.
5363 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5364 * intervals.c: Adjust comment.
5365
5366 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5367
5368 * w32fns.c <w32_unicode_gui>: New static variable.
5369 (globals_of_w32fns): Initialize it according to os_subtype.
5370 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5371 testing os_subtype.
5372
5373 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5374 Eli Zaretskii <eliz@gnu.org>
5375
5376 Fix bug #10299 with Unicode characters sent by customized
5377 keyboards created by MSKLC.
5378 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5379 (w32_init_class): Use it to initialize the Emacs class with either
5380 ANSI or Unicode API calls.
5381 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5382 later.
5383 (w32_wnd_proc): If the character code sent by WM_CHAR or
5384 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5385 original message. Call DefWindowProcW on NT and later.
5386
5387 2012-08-10 Glenn Morris <rgm@gnu.org>
5388
5389 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5390
5391 * lisp.h (DIRECTORY_SEP): Let configure set it.
5392
5393 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5394
5395 Use TSET for write access to Lisp_Object slots of struct terminal.
5396 * termhooks.h (TSET): New macro.
5397 * coding.c, terminal.c, xselect.c: Adjust users.
5398
5399 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5400
5401 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5402 the failing expression, include them in the error message.
5403 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5404 * lisp.h (internal_condition_case_n): Update declaration.
5405
5406 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 Inline functions to examine and change buffer overlays.
5409 * buffer.c (unchain_both): New function.
5410 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5411 (buffer_has_overlays): New function.
5412 (enum overlay_type): New enum.
5413 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5414 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5415
5416 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5417
5418 Inline functions to examine and change buffer intervals.
5419 * alloc.c (mark_interval_tree): Remove.
5420 (MARK_INTERVAL_TREE): Simplify.
5421 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5422 * intervals.c (buffer_balance_intervals): New function.
5423 (graft_intervals_into_buffer): Adjust indentation.
5424 (set_intervals_multibyte): Simplify.
5425 * buffer.h (BUF_INTERVALS): Remove.
5426 (buffer_get_intervals, buffer_set_intervals): New function.
5427 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5428 * intervals.c, textprop.c: Adjust users.
5429
5430 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5431
5432 Inline functions to examine and change string intervals.
5433 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5434 (string_get_intervals, string_set_intervals): New function.
5435 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5436 * lread.c, print.c, textprop.c: Adjust users.
5437
5438 2012-08-08 Glenn Morris <rgm@gnu.org>
5439
5440 * lisp.mk (lisp): Remove language/persian.elc.
5441
5442 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Cleanup intervals.
5445 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5446 (NULL_INTERVAL_P): Likewise. Adjust users.
5447 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5448 Adjust comment. Move under #if 0.
5449 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5450 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5451
5452 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5453
5454 Check total length of intervals with eassert.
5455 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5456 * intervals.c: Change all users to eassert.
5457
5458 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5459
5460 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5461 Rename fields to match removal of FGET and WGET and disuse of
5462 INTERNAL_FIELD in Lisp_Cons.
5463
5464 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5467 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5468 name since all xname users are fixed long time ago. Do not
5469 use INTERNAL_FIELD.
5470 (set_symbol_name, set_symbol_function, set_symbol_plist):
5471 (set_symbol_next, set_overlay_plist): New function.
5472 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5473 (struct Lisp_Overlay): Likewise.
5474 (CVAR, MVAR, SVAR): Remove.
5475 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5476 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5477 * xterm.c: Adjust users.
5478 * .gdbinit: Change to use name field of struct Lisp_Symbol
5479 where appropriate.
5480
5481 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5482
5483 Basic functions to set Lisp_Object and pointer slots of intervals.
5484 * intervals.h (interval_set_parent, interval_set_object):
5485 (interval_set_left, interval_set_right, interval_set_plist):
5486 (interval_copy_parent): New function.
5487 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5488 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5489 Adjust indentation.
5490 (INTERVAL_SIZE): Remove. Adjust users.
5491 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5492
5493 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5494
5495 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5496 * process.h (PGET): Remove.
5497 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5498 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5499
5500 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5501
5502 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5503 * window.h (WGET): Remove.
5504 (struct window): Do not use INTERNAL_FIELD.
5505 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5506 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5507 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5508 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5509 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5510 Adjust users.
5511
5512 2012-08-07 Chong Yidong <cyd@gnu.org>
5513
5514 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5515 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5516 (Fdelete_window_internal): Signal an error if the window is not on
5517 a live frame (Bug#12025).
5518
5519 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5522 * frame.h (FGET): Remove.
5523 (struct frame): Do not use INTERNAL_FIELD.
5524 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5525 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5526 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5527 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5528
5529 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5530
5531 * w32.c: Silence compiler warnings.
5532 (map_w32_filename): Remove unused variable `is_fat'.
5533 (chase_symlinks): Add parentheses around expression.
5534
5535 2012-08-06 Glenn Morris <rgm@gnu.org>
5536
5537 * sysdep.c: Respect BROKEN_GETWD.
5538
5539 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5540 Let configure handle it.
5541 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5542
5543 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5544
5545 Use GCALIGNMENT where appropriate.
5546 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5547 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5548 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5549
5550 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5551
5552 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5553 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5554
5555 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5556
5557 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5558 that should be sufficient for everyone.
5559
5560 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5561
5562 * keyboard.c (timer_check_2): Add break so timer_check returns next
5563 timeout.
5564
5565 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5566
5567 Fix Windows build errors introduced after converting to WGET and WSET.
5568 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5569 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5570
5571 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5572
5573 * nsterm.m (ns_frame_rehighlight): Use FSET.
5574
5575 * nsmenu.m (ns_update_menubar): Use FSET.
5576
5577 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5578
5579 Separate read and write access to Lisp_Object slots of Lisp_Process.
5580 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5581 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5582
5583 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5584
5585 Separate read and write access to Lisp_Object slots of struct window.
5586 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5587 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5588 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5589 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5590 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5591 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5592 Adjust users.
5593
5594 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 Fix Windows build errors introduced after converting to FGET and FSET.
5597 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5598 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5599 (w32_judge_scroll_bars): Change to use FSET.
5600 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5601
5602 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5603
5604 Fix replacement typo.
5605 * window.c (replace_window): Set root_window instead of
5606 selected_window. This fixes a total window subsystem
5607 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5608
5609 2012-08-06 Glenn Morris <rgm@gnu.org>
5610
5611 * lisp.mk (lisp): Add language/persian.elc.
5612
5613 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5614
5615 Separate read and write access to Lisp_Object slots of struct frame.
5616 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5617 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5618 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5619 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5620 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5621
5622 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5623
5624 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5625
5626 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Generalize common compile-time constants.
5629 * lisp.h (header_size, bool_header_size, word_size): Now here.
5630 (struct Lisp_Vector): Add comment.
5631 (struct Lisp_Bool_Vector): Move up to define handy constants.
5632 (VECSIZE, PSEUDOVECSIZE): Simplify.
5633 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5634 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5635 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5636 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5637 * xfont.c, xmenu.c: Use word_size where appropriate.
5638
5639 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5640
5641 * search.c (Freplace_match): Treat \? in the replacement text
5642 literally (Bug#8161).
5643
5644 2012-08-05 Chong Yidong <cyd@gnu.org>
5645
5646 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5647 * frame.c (Vdelete_frame_functions):
5648 * emacs.c (Vkill_emacs_hook): Doc fix.
5649
5650 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5651
5652 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5653 --with-x-toolkit=no builds.
5654 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5655
5656 2012-08-04 Chong Yidong <cyd@gnu.org>
5657
5658 * syntax.c (Fmodify_syntax_entry): Doc fix.
5659
5660 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5661
5662 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5663 * w32.c (init_environment): Change the default values of many
5664 environment variables in dflt_envvars[] to NULL, to avoid pushing
5665 them into environment when they were not already defined.
5666 Remove the code that deletes site-lisp subdirectories from the default
5667 value of EMACSLOADPATH, as it is no longer needed.
5668 (check_windows_init_file): Now external, not static.
5669 Use Vload_path as is, without adding anything, as this function is now
5670 called when Vload_path is already set up.
5671
5672 * w32.h (check_windows_init_file): Add prototype.
5673
5674 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5675 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5676 compatibility with Posix platforms.
5677 (main): Move the call to check_windows_init_file to here from
5678 w32.c.
5679 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5680 any, in the DEFALT argument into the root of the Emacs build or
5681 installation tree, as appropriate.
5682
5683 * callproc.c (init_callproc_1): Call decode_env_path instead of
5684 doing its equivalent by hand.
5685 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5686 the code that sets Vexec_path run on MS-Windows.
5687
5688 * lread.c (init_lread): Add comments to #ifdef's.
5689
5690 * msdos.c (dos_set_window_size, IT_update_begin)
5691 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5692 instead of direct references.
5693
5694 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5695
5696 Export DEFAULT_REHASH_* to GDB.
5697 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5698 Now constants, not macros.
5699
5700 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 Remove unnecessary casts involving pointers.
5703 These casts are no longer needed now that we assume C89 or later,
5704 since they involve casting to or from void *.
5705 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5706 (make_pure_float, make_pure_vector):
5707 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5708 * macros.c (Fstart_kbd_macro):
5709 * menu.c (find_and_return_menu_selection):
5710 * minibuf.c (read_minibuf_noninteractive):
5711 * sysdep.c (closedir):
5712 * xdisp.c (x_produce_glyphs):
5713 * xfaces.c (compare_fonts_by_sort_order):
5714 * xfns.c (x_real_positions, select_visual):
5715 * xselect.c (x_stop_queuing_selection_requests)
5716 (x_get_window_property, x_get_window_property_as_lisp_data):
5717 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5718 Remove unnecessary pointer casts.
5719 * alloc.c (record_xmalloc): New function.
5720 * lisp.h (record_xmalloc): New decl.
5721 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5722 more like a function. This is because the pointer cast is not
5723 needed. All uses changed.
5724 * print.c (print_string, print_error_message): Avoid length recalc.
5725
5726 Improve fix for macroexp crash with debugging (Bug#12118).
5727 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5728 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5729 not supposed to be invoked from the garbage collector.
5730 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5731 (gc_aset): New function, which is like ASET but can be
5732 used in the garbage collector.
5733 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5734 (set_hash_index): Use it instead of ASET.
5735
5736 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5737
5738 Support symlinks on latest versions of MS-Windows.
5739 * w32.c: Include winioctl.h and aclapi.h.
5740 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5741 (revert_to_self): Forward declarations of static functions.
5742 <static BOOL g_b_init_get_security_info>:
5743 <g_b_init_create_symbolic_link>: New static flags.
5744 (globals_of_w32): Initialize them to zero.
5745 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5746 (map_w32_filename): Improve commentary. Simplify switch.
5747 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5748 headers (most versions of MinGW w32api don't).
5749 (get_security_info, create_symbolic_link)
5750 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5751 New functions.
5752 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5753 in the argument file name.
5754 (sys_access): Call unc_volume_file_attributes only if
5755 GetFileAttributes fails with network-related error codes.
5756 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5757 have the required privileges.
5758 (get_file_security_desc_by_name): Rename from
5759 get_file_security_desc.
5760 (stat_worker): New function, with most of the guts of 'stat', and
5761 with addition of handling of symlinks and support for 'lstat'.
5762 If possible, get file's attributes and security information by
5763 handle, not by name. Produce S_IFLNK bit for symlinks, when
5764 called from 'lstat'.
5765 (stat, lstat): New functions, call 'stat_worker'.
5766 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5767 symlinks when the underlying filesystem supports them.
5768
5769 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5770
5771 Fix macroexp crash on Windows with debugging (Bug#12118).
5772 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5773 checking subscripts; problem introduced with the recent
5774 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5775 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5776 since it's used in non-static inline functions now.
5777
5778 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5779 Don't assume buffer size fits in 'int'. Remove unused local.
5780
5781 Use C99-style 'extern inline' if available.
5782 * buffer.h (BUFFER_INLINE):
5783 * category.h (CATEGORY_INLINE):
5784 * character.h (CHARACTER_INLINE):
5785 * charset.h (CHARSET_INLINE):
5786 * composite.h (COMPOSITE_INLINE):
5787 * dispextern.h (DISPEXTERN_INLINE):
5788 * lisp.h (LISP_INLINE):
5789 * systime.h (SYSTIME_INLINE):
5790 New macro, replacing 'static inline' in this header.
5791 * buffer.h, category.h, character.h, charset.h, composite.h:
5792 * dispextern.h, lisp.h, systime.h:
5793 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5794 * alloc.c (LISP_INLINE):
5795 * buffer.c (BUFFER_INLINE):
5796 * category.c (CATEGORY_INLINE):
5797 * character.c (CHARACTER_INLINE):
5798 * charset.c (CHARSET_INLINE):
5799 * composite.c (COMPOSITE_INLINE):
5800 * dispnew.c (DISPEXTERN_INLINE):
5801 * sysdep.c (SYSTIME_INLINE):
5802 Define to EXTERN_INLINE, so that the corresponding functions
5803 are compiled into code.
5804 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5805 (INLINE_HEADER_END): New macros.
5806 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5807 since it's used in non-static inline functions now.
5808 (VALMASK) [!USE_LSB_TAG]: Likewise.
5809
5810 2012-08-02 Glenn Morris <rgm@gnu.org>
5811
5812 * s/: Remove empty directory.
5813
5814 * s/ms-w32.h: Move to ../nt/inc.
5815 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5816 Update for new ms-w32.h location.
5817
5818 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5819
5820 Port to Solaris 8.
5821 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5822
5823 2012-08-02 Glenn Morris <rgm@gnu.org>
5824
5825 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5826 hard-coding the path separator.
5827
5828 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5831 This how ASET and AREF are supposed to work, and makes
5832 it easier to think about future improvements. See
5833 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5834 * charset.h (set_charset_attr): New function.
5835 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5836 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5837 (aref_addr): New function. All uses of &AREF(...) changed.
5838 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5839 (set_hash_index): New functions. All lvalue-style uses of
5840 HASH_KEY etc. changed.
5841 * keyboard.c (set_prop): New function. All lvalue-style uses
5842 of PROP changed.
5843
5844 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5845
5846 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5847 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5848 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5849 * nsfns.m (ns_set_name_as_filename): Likewise.
5850 * nsmenu.m (ns_update_menubar): Likewise.
5851 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5852
5853 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5854
5855 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5856 Adapt to latest changes in field names of the corresponding Lisp
5857 objects.
5858
5859 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5860
5861 2012-08-01 Glenn Morris <rgm@gnu.org>
5862
5863 * s/msdos.h: Remove file.
5864 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5865 * Makefile.in (S_FILE): Remove.
5866 (config_h): Remove S_FILE.
5867
5868 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5869
5870 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5871 Remove; moved to nt/config.nt.
5872
5873 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5874
5875 Use INTERNAL_FIELD for conses and overlays.
5876 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5877 Remove obsolete comment.
5878 (MVAR): New macro.
5879 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5880 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5881
5882 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5883
5884 Use INTERNAL_FIELD for symbols.
5885 * lisp.h (SVAR): New macro. Adjust users.
5886 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5887 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5888
5889 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5890
5891 Use INTERNAL_FIELD for processes.
5892 * process.h (PVAR): New macro. Adjust style.
5893 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5894 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5895
5896 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5897
5898 Use INTERNAL_FIELD for windows.
5899 * window.h (WVAR): New macro.
5900 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5901 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5902 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5903 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5904 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5905 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5906
5907 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5908
5909 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5910
5911 2012-08-01 Glenn Morris <rgm@gnu.org>
5912
5913 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5914 Move to configure.ac.
5915
5916 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5917
5918 * makefile.w32-in (CONFIG_H): Update dependencies.
5919 (CONF_POST_H): New macro.
5920
5921 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5922
5923 2012-07-31 Glenn Morris <rgm@gnu.org>
5924
5925 * Makefile.in (S_FILE): No longer set by configure.
5926
5927 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5928 is available.
5929 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5930
5931 * process.h (NULL_DEVICE):
5932 * emacs.c (SEPCHAR):
5933 * editfns.c (USER_FULL_NAME): Let configure set them.
5934
5935 * s/README, s/template.h: Remove files.
5936
5937 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5938
5939 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5940 Move to configure.ac.
5941
5942 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5943
5944 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5945 resulting renaming of 'struct frame' members.
5946
5947 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5948
5949 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5950 after introduction of FVAR.
5951
5952 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5953
5954 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5955
5956 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5957 instead of compositeToPoint.
5958 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5959
5960 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5961
5962 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5963
5964 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5965 * lisp.h (INTERNAL_FIELD): New macro.
5966 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5967 (BVAR): Change to use INTERNAL_FIELD.
5968 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5969 (KVAR): Change to use INTERNAL_FIELD.
5970 * frame.h (FVAR): New macro.
5971 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5972 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5973 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5974 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5975 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5976
5977 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5978
5979 Miscellaneous fixes for non-default X toolkits.
5980 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5981 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5982 Move under #ifdef USE_LUCID.
5983 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5984 definition and usage to avoid warnings.
5985
5986 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5987
5988 * nsterm.m (openFiles): Fix previous checkin.
5989
5990 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5991
5992 * indent.c (compute_motion): Remove unused local.
5993
5994 2012-07-31 Glenn Morris <rgm@gnu.org>
5995
5996 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5997
5998 * conf_post.h [USG5_4]:
5999 Move remaining contents of s/usg5-4-common.h here.
6000 * s/usg5-4-common.h: Remove file.
6001
6002 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6003 * s/irix6-5.h: Remove file.
6004
6005 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6006 * s/darwin.h: Remove file.
6007
6008 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6009 * s/hpux10-20.h: Remove file, which is now empty.
6010
6011 2012-07-30 Glenn Morris <rgm@gnu.org>
6012
6013 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6014 * Makefile.in (config_h): Add conf_post.h.
6015 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6016
6017 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6018
6019 * nsterm.m (ns_do_open_file): New variable.
6020 (ns_term_init): Set ns_do_open_file to YES after run returns.
6021 (openFile, openTempFile, openFileWithoutUI, openFiles):
6022 Open files only if ns_do_open_file.
6023
6024 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6025
6026 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6027 This no-op macro hasn't been needed for many years.
6028 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6029
6030 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6031 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6032 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6033 gdb_make_enums_visible.
6034 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6035 (DIRECTORY_SEP): Now a constant, not a macro.
6036
6037 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6038
6039 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6040 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6041
6042 * w32term.c <w32_keyboard_codepage>: Renamed from
6043 keyboard_codepage and now external. All users changed.
6044
6045 * w32term.h: Add declaration of w32_keyboard_codepage.
6046
6047 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6048 the codepage to translate keys to Unicode. If this argument is
6049 -1, use the value returned by GetConsoleCP. All callers changed.
6050
6051 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6052
6053 Update .PHONY listings in makefiles.
6054 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6055 bootstrap-clean, distclean, maintainer-clean, versioclean,
6056 extraclean, frc.
6057
6058 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6059 This is a bit clearer. Fix some commentary typos.
6060
6061 2012-07-30 Glenn Morris <rgm@gnu.org>
6062
6063 * s/netbsd.h: Let configure include signal.h if needed.
6064 Remove file, which is now empty.
6065
6066 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6067 Let configure set them.
6068 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6069 No more need to undefine.
6070
6071 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6072
6073 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6074 non-single-byte char when adding meta modifier. (Bug#12090)
6075
6076 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6077
6078 Convert safe_call to use variable number of arguments.
6079 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6080 (safe_call2): Fix comment.
6081 * lisp.h (safe_call): Adjust prototype.
6082 * coding.c (encode_coding_object): Change to use safe_call2.
6083 * xfaces.c (merge_face_heights): Change to use safe_call1.
6084
6085 2012-07-30 Glenn Morris <rgm@gnu.org>
6086
6087 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6088 does that unconditionally. Remove file, which is now empty.
6089
6090 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6091 Remove empty files.
6092
6093 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 Export to GDB most of lisp.h's remaining object-like macros.
6096 * lisp.h (min, max): Move earlier, because they're used earlier now.
6097 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6098 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6099 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6100 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6101 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6102 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6103 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6104 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6105 Now constants, for GDB. They need not be macros.
6106 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6107 Now constants, for GDB, as well as macros, for static initializers.
6108 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6109 Move to after the definition of struct Lisp_Char_Table,
6110 since the former now needs that type defined.
6111 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6112 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6113 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6114 New enums, for gdb_make_enums_visible.
6115 (GLYPH_MODE_LINE_FACE): Remove; unused.
6116 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6117 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6118 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6119 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6120 enum maxargs, enum MAX_ALLOCA.
6121 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6122 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6123 no longer needed, now that they are done in lisp.h.
6124
6125 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6126
6127 Cleanup string bytes checking.
6128 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6129 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6130 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6131 (check_sblock, compact_small_strings): Simplify.
6132
6133 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6134
6135 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6136 These macros are confusing and no longer need to be defined, as
6137 the enum values now suffice. All uses replaced with definiens.
6138 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6139
6140 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6141
6142 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6143 ($(BLD)/w32console.$(O)): Update dependencies.
6144
6145 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6146
6147 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6148 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6149 time. Adjust users.
6150 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6151
6152 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6153
6154 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6155 setting sitelisp (Bug#12010).
6156
6157 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6158
6159 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6160
6161 * w32heap.c (cache_system_info):
6162 * w32.c (sys_rename):
6163 * w32proc.c (find_child_console, sys_kill): All users changed.
6164
6165 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6168
6169 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6170
6171 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6172
6173 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6174
6175 Cleanup statistics calculation in Fgarbage_collect.
6176 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6177 Fix zombies percentage calculation. Simplify elapsed time calculation.
6178
6179 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6180
6181 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6182 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6183 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6184 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6185 (replace_range, replace_range_2, del_range_2): Change to eassert.
6186 * marker.c (byte_char_debug_check): Adjust style.
6187
6188 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6191 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6192 long-ago-commented-out code that talks about "WIN32".
6193 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6194 All uses changed.
6195
6196 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6197
6198 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6199 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6200 Simplify by using alignof.
6201 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6202 * lisp.h: Include <stdalign.h>.
6203 (GCALIGNMENT): New macro and constant.
6204 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6205 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6206 (stdalign): New macro, if not already defined.
6207
6208 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6209
6210 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6211 * w32inevt.c: Include w32inevt.h.
6212 (w32_read_console_input): New inline function, calls either
6213 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6214 w32_console_unicode_input.
6215 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6216 (w32_kbd_patch_key, key_event): Use the codepage returned by
6217 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6218 (key_event): use uChar.UnicodeChar only if
6219 w32_console_unicode_input is non-zero.
6220
6221 * w32console.c: Include w32heap.h.
6222 <w32_console_unicode_input>: New global variable.
6223 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6224 family of Windows, zero otherwise.
6225
6226 * w32inevt.h: Declare w32_console_unicode_input.
6227
6228 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6229 --without-x. (Bug#11742)
6230
6231 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6232
6233 Adjust GDB to reflect pvec_type changes (Bug#12036).
6234 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6235 2012-07-04 changes to pseudovector representation.
6236 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6237
6238 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6239
6240 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6241 bus address.
6242 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6243
6244 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6245
6246 * alloc.c (listn): Fix the order the arguments are consed onto the
6247 list.
6248
6249 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6250 enumeration constants, as PURE and HEAP are too general, and clash
6251 with other headers and sources, such as gmalloc.c and the
6252 MS-Windows system headers. All users changed.
6253
6254 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6255
6256 Revert last save_excursion_save and save_excursion_restore changes.
6257 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6258 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6259
6260 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6261
6262 Fix recently-introduced typos in Windows port.
6263 Reported by Martin Rudalics <rudalics@gmx.at>.
6264 * w32.c (init_environment): Replace comma with semicolon.
6265 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6266
6267 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6268
6269 Improve GDB symbol export (Bug#12036).
6270 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6271 arms of an 'if', not using conditional expressions; otherwise GDB
6272 complains about the types in the unevaluated arm when the argument
6273 is an integer literal.
6274 (xgetint): Simplify expression.
6275 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6276 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6277 Zaretskii in <http://bugs.gnu.org/12036#13>.
6278 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6279 needed now that we have gdb_make_enums_visible.
6280 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6281 (enum enum_USE_LSB_TAG):
6282 New enum types, packaging up enums that need to be exported to GDB.
6283
6284 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6285
6286 Utility function to make a list from specified amount of objects.
6287 * lisp.h (enum constype): New datatype.
6288 (listn): New prototype.
6289 * alloc.c (listn): New function.
6290 (Fmemory_use_count, syms_of_alloc): Use it.
6291 * buffer.c (syms_of_buffer): Likewise.
6292 * callint.c (syms_of_callint): Likewise.
6293 * charset.c (define_charset_internal): Likewise.
6294 * coding.c (syms_of_coding): Likewise.
6295 * keymap.c (syms_of_keymap): Likewise.
6296 * search.c (syms_of_search): Likewise.
6297 * syntax.c (syms_of_syntax): Likewise.
6298 * w32.c (init_environment): Likewise.
6299 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6300 * xdisp.c (syms_of_xdisp): Likewise.
6301 * xfns.c (syms_of_xfns): Likewise.
6302
6303 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 Fast save_excursion_save and save_excursion_restore.
6306 * lisp.h (struct Lisp_Excursion): New data type.
6307 (PVEC_EXCURSION): New pseudovector type.
6308 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6309 to deal with it. Adjust comments.
6310 (init_marker, attach_marker): New prototype.
6311 (unchain_marker): Adjust prototype.
6312 * marker.c (attach_marker): Change to global.
6313 (init_marker): New function.
6314 * alloc.c (Fmake_marker, build_marker): Use it.
6315 (build_marker): More easserts.
6316 (mark_object): Handle struct Lisp_Excursion.
6317 * editfns.c (save_excursion_save, save_excursion_restore):
6318 Reimplement to use struct Lisp_Excursion. Add comments.
6319
6320 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6321
6322 Fix export of symbols to GDB (Bug#12036).
6323 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6324 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6325 emacs.c, as this is a more-suitable home. Had this been done earlier
6326 the fix for 12036 would have avoided some of the problems noted in
6327 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6328 would have been more obvious.
6329 * emacs.c: Do not include <verify.h>; no longer needed.
6330 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6331 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6332 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6333 Remove; now done in lisp.h.
6334 * lisp.h (PUBLISH_TO_GDB): New macro.
6335 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6336 (DATA_SEG_BITS): Use it.
6337 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6338 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6339 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6340 not be usable in #if. This simplifies things.
6341
6342 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6343
6344 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6345
6346 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6347
6348 Simplify export of symbols to GDB (Bug#12036).
6349 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6350 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6351 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6352 Adjust to changes in lisp.h and emacs.c, by using
6353 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6354 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6355 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6356 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6357 instead of gdb_valbits.
6358 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6359 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6360 instead of gdb_array_mark_flag.
6361 (xboolvector): Get size from $->size, not $->header.size.
6362 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6363 (xreload, hook-run, hookpost-run): Remove.
6364 * emacs.c: Include <verify.h>.
6365 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6366 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6367 Remove.
6368 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6369 (gdb_USE_LSB_TAG): New enum constants.
6370 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6371 Also define these as enum constants, so they're visible to GDB.
6372 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6373 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6374 as constants, so they're visible to GDB.
6375 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6376 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6377 Now enum constants, not macros, so they're visible to GDB.
6378 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6379 more convenient now. All uses changed.
6380 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6381 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6382
6383 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6384
6385 Explicitly free restriction data that are not needed anymore.
6386 * editfns.c (save_restriction_restore): Free restriction data.
6387
6388 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6389
6390 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6391 add argument, tune behavior, and adjust all callers.
6392
6393 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6394
6395 Use typedef for EMACS_INT, EMACS_UINT.
6396 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6397 than macros. This simplifies debugging in the usual case, since
6398 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6399 and it allows expressions involving EMACS_INT casts.
6400 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6401
6402 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6403
6404 * nsterm.m (ns_read_socket): Return early if there is a modal
6405 window (Bug#12043).
6406
6407 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6408
6409 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6410 that FOCUS-FRAME can be omitted.
6411
6412 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6413
6414 Adjust buffer text indirection counters at the end of Fkill_buffer.
6415 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6416 buffer is definitely dead. This should really fix an issue reported
6417 by Christoph Scholtes again. (Bug#12007).
6418 (init_buffer_once): Initialize indirection counters of
6419 buffer_defaults and buffer_local_symbols (for sanity and safety).
6420
6421 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6422
6423 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6424 and continuation glyphs on tooltip frames, leave them at zero.
6425 Avoids continued lines in tooltips. (Bug#11832)
6426
6427 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6428
6429 Simplify copy_overlay.
6430 * buffer.c (copy_overlay): Simplify. Use build_marker.
6431 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6432
6433 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6434
6435 * print.c (print_object): Don't crash when a frame's name is nil
6436 or invalid. (Bug#12025)
6437
6438 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6439 it signals an error when a tooltip frame is being created.
6440
6441 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6442
6443 Cleanup miscellaneous objects allocation and initialization.
6444 * alloc.c (allocate_misc): Change to static. Add argument to
6445 specify the subtype. Adjust comment and users.
6446 (build_overlay): New function.
6447 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6448 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6449 (allocate_misc): Remove prototype.
6450 (build_overlay): Add prototype.
6451
6452 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6453
6454 Swap buffer text indirection counters in Fbuffer_swap_text.
6455 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6456 This avoids crash reported by Christoph Scholtes at
6457 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6458
6459 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6460
6461 * nsmenu.m (Popdown_data): New struct.
6462 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6463 free Popdown_data.
6464 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6465 (initWithContentRect): Make imgView and contentView non-static
6466 and autorelease them. Also autorelease img and matrix (Bug#12005).
6467 (dealloc): Remove (Bug#12005).
6468
6469 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6470
6471 Adjust consing_since_gc when objects are explicitly freed.
6472 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6473 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6474 (free_cons, free_misc): Subtract object size from consing_since_gc.
6475
6476 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6477
6478 Simplify and cleanup markers positioning code.
6479 * marker.c (attach_marker): More useful eassert.
6480 (live_buffer, set_marker_internal): New function.
6481 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6482 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6483
6484 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6487 as it's limited by the amount of memory, not by INT_MAX.
6488
6489 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6490
6491 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6492 in special-event-map. See the discussion at
6493 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6494 for the reasons.
6495
6496 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6497 info.dwItemData. Fixes crashes on 64-bit Windows.
6498 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6499
6500 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6501
6502 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6503 (conversationIdentifier): Return value is NSInteger.
6504 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6505
6506 2012-07-21 Chong Yidong <cyd@gnu.org>
6507
6508 * window.c (decode_any_window): Signal an error if the window is
6509 on a dead frame (Bug#11984).
6510
6511 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6512
6513 Add indirection counting to speed up Fkill_buffer.
6514 * buffer.h (struct buffer): New member.
6515 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6516 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6517 base buffer indirection counter.
6518 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6519 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6520 through buffer list if indirection counter is 0.
6521
6522 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6523
6524 Extend the value returned by Fgarbage_collect with heap statistics.
6525 * alloc.c (Qheap): New symbol.
6526 (syms_of_alloc): DEFSYM it.
6527 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6528 (Fmemory_free): Remove.
6529 (syms_of_alloc): Don't defsubr it.
6530 * buffer.c (Fcompact_buffer): Remove.
6531 (syms_of_buffer): Don't defsubr it.
6532
6533 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6534
6535 Make maybe_gc inline.
6536 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6537 * lisp.h (consing_since_gc, gc_relative_threshold)
6538 (memory_full_cons_threshold): Revert declaration.
6539 (maybe_gc): Remove prototype, define as inline.
6540 * alloc.c: Remove old commented-out code.
6541 (consing_since_gc, gc_relative_threshold)
6542 (memory_full_cons_threshold): Revert to global.
6543 (maybe_gc): Remove.
6544
6545 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6546
6547 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6548 * lisp.h (build_unibyte_string): New function.
6549 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6550 * sysdep.c, w32fns.c, xfns.c: Use it.
6551 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6552 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6553 Adjust users accordingly.
6554 * font.h (font_open_by_name): Adjust prototype.
6555
6556 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6557
6558 Cleanup calls to Fgarbage_collect.
6559 * lisp.h (maybe_gc): New prototype.
6560 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6561 Remove declarations.
6562 * alloc.c (maybe_gc): New function.
6563 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6564 Make them static.
6565 * bytecode.c (MAYBE_GC): Use maybe_gc.
6566 * eval.c (eval_sub, Ffuncall): Likewise.
6567 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6568 to avoid dependency from auto-save feature.
6569
6570 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6573 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6574 'for_each_per_buffer_object_at'.
6575 All uses changed. It's better to use upper-case for macros that
6576 cannot be implemented as functions, to give the reader a clue
6577 that they're special.
6578
6579 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6580
6581 * alloc.c (Fgarbage_collect): Tweak docstring.
6582
6583 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6584
6585 Tweak the value returned from Fgarbage_collect again.
6586 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6587 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6588 Adjust documentation.
6589 (total_vector_bytes): Rename to total_vector_slots, adjust
6590 accounting.
6591 (total_free_vector_bytes): Rename to total_free_vector_slots,
6592 adjust accounting.
6593 (Qstring_bytes, Qvector_slots): New symbols.
6594 (syms_of_alloc): DEFSYM them.
6595
6596 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6597
6598 Buffer compaction primitive which may be used from Lisp.
6599 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6600 (syms_of_buffer): Register Fcompact_buffer.
6601 * alloc.c (Fgarbage_collect): Use compact_buffer.
6602 * buffer.h (compact_buffer): New prototype.
6603 (struct buffer_text): New member.
6604
6605 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6606
6607 New macro to iterate over all buffers, miscellaneous cleanups.
6608 * lisp.h (all_buffers): Remove declaration.
6609 * buffer.h (all_buffers): Add declaration, with comment.
6610 (for_each_buffer): New macro.
6611 * alloc.c (Fgarbage_collect, mark_object): Use it.
6612 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6613 (init_buffer): Likewise.
6614 * data.c (Fset_default): Likewise.
6615 * coding.c (code_conversion_restore): Remove redundant check
6616 for dead buffer.
6617 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6618
6619 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6620
6621 Fix bug that created negative-length intervals.
6622 * intervals.c (merge_interval_right, merge_interval_left):
6623 Do not zero out this interval if it is absorbed by its children,
6624 as this interval's total length doesn't change in that case. See
6625 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6626
6627 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6630 when invoking (make-bool-vector N t) and N is a positive
6631 multiple of 8 -- the last 8 bits were mistakenly cleared.
6632
6633 Remove some struct layout assumptions in bool vectors.
6634 * alloc.c (bool_header_size): New constant.
6635 (header_size, word_size): Move earlier, as they're now used earlier.
6636 Use 'word_size' in a few more places, where it's appropriate.
6637 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6638 padding before the data member of a bool vector.
6639 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6640 than doing the check by hand with an abort ().
6641
6642 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6643
6644 * eval.c (Fdefvar): Don't check constants since we only set the var if
6645 it's not yet defined anyway (bug#11904).
6646
6647 * lisp.h (last_undo_boundary): Declare new var.
6648 * keyboard.c (command_loop_1): Set it.
6649 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6650 were auto-added by the command loop (bug#11774).
6651
6652 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6653
6654 * w32font.c (Qsymbol): Remove local definition.
6655 (syms_of_w32font): Don't DEFSYM it.
6656
6657 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6658
6659 Fix sweep_vectors to handle large bool vectors correctly.
6660 * alloc.c (sweep_vectors): Account total_vector_bytes for
6661 bool vectors larger than VBLOCK_BYTES_MAX.
6662
6663 2012-07-18 Chong Yidong <cyd@gnu.org>
6664
6665 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6666 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6667
6668 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6669
6670 Return more descriptive data from Fgarbage_collect.
6671 Suggested by Stefan Monnier in
6672 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6673 * alloc.c (bounded_number): New function.
6674 (total_buffers, total_vectors): New variable.
6675 (total_string_size): Rename to total_string_bytes, adjust users.
6676 (total_vector_size): Rename to total_vector_bytes, adjust users.
6677 (sweep_vectors): Account total_vectors and total_vector_bytes.
6678 (Fgarbage_collect): New return value. Adjust documentation.
6679 (gc_sweep): Account total_buffers.
6680 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6681 (VECTOR_SIZE): Remove.
6682 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6683 (Qinterval, Qmisc): New symbols.
6684 (syms_of_data): Initialize them.
6685 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6686 (Qcons, Qbuffer): New declarations.
6687
6688 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6689
6690 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6691 Round up, not down. Improve doc.
6692
6693 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6694
6695 Restore old code in allocate_string_data to avoid Faset breakage.
6696 Reported by Julien Danjou <julien@danjou.info> in
6697 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6698 * alloc.c (allocate_string_data): Restore old code with minor
6699 adjustments, fix comment to explain this subtle issue.
6700
6701 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6702
6703 Remove FILE_SYSTEM_CASE.
6704 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6705
6706 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6707 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6708 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6709 call-process-region passes it through expand-file-name.
6710
6711 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6712
6713 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6714
6715 Fix crash when creating indirect buffer (Bug#11917)
6716 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6717 Don't handle unbound variables specially if non-zero.
6718 (Fbuffer_local_variables): Pass zero.
6719 (clone_per_buffer_values): Pass non-zero.
6720
6721 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6722
6723 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6724 to make the loop interruptible.
6725
6726 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6727
6728 * gnutls.c (emacs_gnutls_handshake): Only retry if
6729 GNUTLS_E_INTERRUPTED.
6730
6731 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6732
6733 Cleanup and convert miscellaneous checks to eassert.
6734 * alloc.c (mark_interval): Fix comment, partially rephrase
6735 old comment from intervals.h (see below).
6736 * intervals.c (find_interval, adjust_intervals_for_insertion)
6737 (delete_interval, adjust_intervals_for_deletion)
6738 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6739 Convert to eassert.
6740 (adjust_intervals_for_insertion, make_new_interval):
6741 Remove obsolete and unused code.
6742 * intervals.h (struct interval): Remove obsolete comment.
6743 * textprotp.c (erase_properties): Remove unused code.
6744 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6745 (Fremove_list_of_text_properties): Convert to eassert.
6746
6747 2012-07-17 Chong Yidong <cyd@gnu.org>
6748
6749 * editfns.c (Finsert_char): Doc fix.
6750
6751 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6752
6753 Fix previous change to make Fmemory_free always accurate.
6754 * alloc.c (make_interval): Update total_free_intervals.
6755 (make_float): Likewise for total_free_floats.
6756 (free_cons, Fcons): Likewise for total_free_conses.
6757 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6758 Likewise for total_free_vector_bytes.
6759 (Fmake_symbol): Likewise for total_free_symbols.
6760 (bytes_free): Remove.
6761
6762 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6763
6764 Simple free memory accounting feature.
6765 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6766 (sweep_vectors): Accumulate size of free vectors.
6767 (Fgarbage_collect): Setup bytes_free.
6768 (Fmemory_free): New function.
6769 (syms_of_alloc): Register it.
6770
6771 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6772
6773 Cleanup overlays checking.
6774 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6775 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6776 eassert and OVERLAYP.
6777 (sort_overlays): Change to use OVERLAYP.
6778
6779 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6780
6781 * editfns.c (Finsert_char): Make it interactive, and make the
6782 second arg optional. Copy interactive spec and docstring from
6783 ucs-insert.
6784
6785 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6786
6787 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6788 Unlike the other wrapped functions, fabs has an unspecified
6789 effect on errno.
6790
6791 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6792
6793 * nsterm.m (keyDown): Interpret flags without left/right bits
6794 as the left key (Bug#11670).
6795
6796 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6797
6798 Remove empty and useless init functions.
6799 * lisp.h (init_character_once, init_fns, init_image)
6800 (init_filelock, init_sound): Remove prototype.
6801 * character.c (init_character_once): Remove.
6802 * filelock.c (init_filelock): Likewise.
6803 * fns.c (init_fns): Likewise.
6804 * image.c (init_image): Likewise.
6805 * sound.c (init_sound): Likewise.
6806 * emacs.c (main): Adjust accordingly.
6807
6808 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6809
6810 * gtkutil.h: Tiny cleanups.
6811 (use_old_gtk_file_dialog): Remove useless declaration.
6812 (xg_uses_old_file_dialog): Add suggested const attribute.
6813
6814 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6815
6816 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6817 (bidi_paragraph_init): Use it to limit search forward for a strong
6818 directional character in abnormally large paragraphs full of
6819 neutral or weak characters. (Bug#11943)
6820
6821 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6822
6823 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6824 the toolbar (Bug#9451).
6825 (xg_make_tool_item): Give the widget event box a transparent
6826 background.
6827
6828 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6829
6830 Cleanup basic allocation variables and functions.
6831 * alloc.c (ignore_warnings, init_intervals, init_float)
6832 (init_cons, init_symbol, init_marker): Remove.
6833 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6834 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6835 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6836 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6837 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6838 (staticidx, init_alloc_once, init_strings, free_ablock):
6839 Remove redundant initialization.
6840 * fns.c (init_weak_hash_tables): Remove.
6841 * lisp.h (init_weak_hash_tables): Remove prototype.
6842
6843 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6844
6845 Use zero_vector where appropriate.
6846 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6847 accordingly.
6848 * lisp.h (zero_vector): New declaration.
6849 * font.c (null_vector): Remove.
6850 (syms_of_font): Remove initialization and staticpro.
6851 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6852 * keymap.c (Faccessible_keymaps): Likewise.
6853
6854 2012-07-15 Leo Liu <sdl.web@gmail.com>
6855
6856 * fringe.c: Fix typo in comments.
6857
6858 2012-07-14 Leo Liu <sdl.web@gmail.com>
6859
6860 * fringe.c: Add a new bitmap exclamation-mark.
6861
6862 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6863
6864 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6865
6866 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6867 (HAVE_MENUS): Don't define, defined by editing config.in with
6868 msdos/sed2v2.inp.
6869 (GMALLOC_INHIBIT_VALLOC): Don't define.
6870 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6871
6872 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6873
6874 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6875
6876 2012-07-14 Glenn Morris <rgm@gnu.org>
6877
6878 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6879 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6880 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6881
6882 2012-07-13 Glenn Morris <rgm@gnu.org>
6883
6884 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6885
6886 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6887 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6888
6889 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6890
6891 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6892 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6893 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6894 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6895 where appropriate.
6896 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6897 as boolean expression.
6898 (x_set_window_size): Remove unused variable toolbar.
6899 (ns_get_color_default, ns_mod_to_lisp): Remove.
6900 (ns_mouse_position): Remove unused variables xchar and ychar.
6901 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6902 (ns_set_vertical_scroll_bar): Remove unused variable count.
6903 (ns_delete_terminal): Remove unused variable i.
6904 (ns_term_init): Remove unused variables r, g and b.
6905 (mouseDown): Remove unused variable window.
6906 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6907 (initFrameFromEmacs): Remove unused variable vbextra.
6908 (mouseEntered): Remove unused variables p and dpyinfo.
6909 (mouseExited): Remove unused variables p and r.
6910 (ns_define_frame_cursor, ns_clear_frame_area)
6911 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6912 (menuDown): Assign [sender tag] to variable and cast the variable.
6913
6914 * nsterm.h (menuDown): Add id as type to argument sender.
6915 (ns_display_info_for_name): Add Lisp_Object argument.
6916 (ns_term_init): Add Lisp_Object argument.
6917 (ns_map_event_to_object): Add void argument.
6918 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6919 prototype with arguments and only declare if __OBJC__.
6920 (nxatoms_of_nsselect): Add void argument.
6921 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6922 (ns_alloc_autorelease_pool): Add void argument.
6923 (ns_release_autorelease_pool): Add void* argument.
6924 (ns_get_defaults_value): Add const char* argument.
6925
6926 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6927 (initFromContents): Use SSDATA where appropriate.
6928 (ns_update_menubar): Add braces to ambigous if-else.
6929 (initWithTitle): Put () around assignment in if statement.
6930 (ns_menu_show): Remove unused variables window and keymap.
6931 (update_frame_tool_bar): Remove unused variable selected_p.
6932 (initWithContentRect): Remove unused variable this_cmd_name.
6933
6934 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6935 appropriate.
6936 (setXBMColor): Remove unused variable len.
6937 (setPixmapData): Put () around assignment in loop statement.
6938
6939 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6940 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6941 where appropriate.
6942 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6943 around assignment in loop statement.
6944 (nsfont_open): Remove unused variable i.
6945 (nsfont_open): Remove unused variable len.
6946 (nsfont_draw): Remove unused variable cs.
6947
6948 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6949 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6950 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6951 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6952 (Fns_font_name, Fns_perform_service)
6953 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6954 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6955 (ns_set_name): Remove unused variable view.
6956 (x_set_menu_bar_lines): Remove unused variable olines.
6957 (x_set_tool_bar_lines): Remove unused variable root_window.
6958 (Fns_list_colors): Put () around assignment in while statement.
6959 (Fns_perform_service): Remove unused variable len.
6960 (Fns_display_usable_bounds): Remove unused variable top.
6961 (syms_of_nsfns): Remove unused variable i.
6962
6963 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6964 memcpy (Bug#11907).
6965
6966 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6967
6968 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6969 and free it with DestroyExceptionInfo (Bug#11558).
6970
6971 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6972
6973 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6974 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6975 Set here, not in nt/config.nt.
6976
6977 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6978
6979 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6980 cursor overflow into the last glyph on display line when the right
6981 fringe is off. (Bug#11832)
6982
6983 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6984
6985 * xdisp.c (produce_special_glyphs): Now static.
6986 * dispextern.h (produce_special_glyphs): Remove decl.
6987
6988 2012-07-13 Glenn Morris <rgm@gnu.org>
6989
6990 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6991 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6992
6993 * s/usg5-4-common.h (USG, USG5):
6994 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6995 * s/sol2-6.h (SOLARIS2):
6996 * s/irix6-5.h (IRIX6_5):
6997 * s/hpux10-20.h (USG, USG5, HPUX):
6998 * s/gnu-linux.h (USG, GNU_LINUX):
6999 * s/freebsd.h (BSD_SYSTEM):
7000 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7001 * s/cygwin.h (CYGWIN):
7002 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7003 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7004
7005 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7006
7007 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7008
7009 2012-07-13 Glenn Morris <rgm@gnu.org>
7010
7011 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7012
7013 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7014
7015 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7016 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7017
7018 2012-07-12 Glenn Morris <rgm@gnu.org>
7019
7020 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7021
7022 * process.c (init_process_emacs): Rename from init_process.
7023 The old name is also the name of a Mach system call.
7024 * lisp.h, emacs.c: Update for this name change.
7025 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7026 longer needed.
7027
7028 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7029
7030 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7031 memmove call that removes glyphs covered by the left truncation
7032 glyph. Improve commentary.
7033 (display_line): Fix display of continuation glyphs on GUI frames
7034 when the right fringe is turned off and variable-size fonts are
7035 used in the window. Move the code that appends a stretch glyph to
7036 produce_special_glyphs, so that it could be used for truncation
7037 and continuation glyphs alike.
7038 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7039 glyph of a suitably computed width, to align the special glyphs at
7040 the window margin. Code moved from display_line. (Bug#11832)
7041
7042 2012-07-12 Glenn Morris <rgm@gnu.org>
7043
7044 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7045
7046 * s/gnu-linux.h, s/hpux10-20.h:
7047 Do not unconditionally define HAVE_XRMSETDATABASE.
7048
7049 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7050
7051 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7052
7053 Fix typos that broke OS X build.
7054 Reported by Randal L. Schwartz in
7055 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7056 * nsterm.m (ns_timeout): Add missing local decl.
7057 (ns_get_color): snprintf -> sprintf, to fix typo.
7058
7059 2012-07-12 Glenn Morris <rgm@gnu.org>
7060
7061 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7062 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7063 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7064 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7065
7066 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7067 Move PTY_OPEN to configure.
7068
7069 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7070 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7071 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7072
7073 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7074
7075 Use empty_unibyte_string where applicable.
7076 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7077 * lread.c (read1): Likewise.
7078 * xsettings.c (syms_of_xsettings): Likewise.
7079
7080 2012-07-12 Glenn Morris <rgm@gnu.org>
7081
7082 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7083 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7084 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7085 * s/hpux10-20.h (RUN_TIME_REMAP):
7086 * s/bsd-common.h (TABDLY): Move to configure.
7087
7088 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7089
7090 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7091
7092 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7093 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7094
7095 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7096
7097 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7098 * s/template.h: Move NARROWPROTO to configure.
7099
7100 2012-07-11 Glenn Morris <rgm@gnu.org>
7101
7102 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7103 unused since 2011-01-17 change to systty.h.
7104
7105 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7106 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7107 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7108
7109 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7112
7113 2012-07-11 Glenn Morris <rgm@gnu.org>
7114
7115 * s/darwin.h, s/gnu-linux.h, s/template.h:
7116 Move INTERRUPT_INPUT to configure.
7117
7118 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7119
7120 Minor adjustments to interning code.
7121 * lisp.h (intern, intern_c_string): Redefine as static inline
7122 wrappers for intern_1 and intern_c_string_1, respectively.
7123 (intern_1, intern_c_string_1): Rename prototypes.
7124 * lread.c (intern_1, intern_c_string_1, oblookup):
7125 Simplify Vobarray checking.
7126 * font.c (font_intern_prop): Likewise. Adjust comment.
7127 * w32font.c (intern_font_name): Likewise.
7128
7129 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7130
7131 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7132
7133 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7134 of Fcar/Fcdr if possible.
7135 * font.c (check_otf_features): Likewise.
7136 * fontset.c (Fnew_fontset): Likewise.
7137 * gnutls.c (Fgnutls_boot): Likewise.
7138 * minibuf.c (read_minibuf): Likewise.
7139 * msdos.c (IT_set_frame_parameters): Likewise.
7140 * xmenu.c (Fx_popup_dialog): Likewise.
7141 * w32menu.c (Fx_popup_dialog): Likewise.
7142
7143 2012-07-11 Glenn Morris <rgm@gnu.org>
7144
7145 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7146 since nothing has defined it on these platforms.
7147
7148 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7149 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7150
7151 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7152 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7153 Move CLASH_DETECTION to configure.
7154
7155 * s/gnu.h: Remove file, which is now empty.
7156
7157 * s/gnu.h, s/gnu-linux.h:
7158 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7159
7160 2012-07-11 John Wiegley <johnw@newartisans.com>
7161
7162 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7163 function attribute, so we only use it if it exists in the
7164 compiler.
7165
7166 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7167
7168 Avoid call to strlen in fast_c_string_match_ignore_case.
7169 * search.c (fast_c_string_match_ignore_case): Change to use
7170 length argument. Adjust users accordingly.
7171 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7172
7173 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7174
7175 Assume mkdir, rmdir.
7176 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7177 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7178
7179 Assume rename.
7180 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7181
7182 Assume perror.
7183 * s/hpux10-20.h (HAVE_PERROR): Remove.
7184 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7185 Remove dummy definition, as this problem was obsolete long ago.
7186
7187 Assume strerror.
7188 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7189
7190 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7191
7192 Avoid calls to strlen in font processing functions.
7193 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7194 (font_open_by_name): Change to use length argument.
7195 Adjust users accordingly.
7196 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7197 Adjust prototypes.
7198 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7199 Change to return ptrdiff_t.
7200 (xfont_list_pattern, xfont_match): Use length returned by
7201 xfont_decode_coding_xlfd.
7202 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7203
7204 2012-07-11 Glenn Morris <rgm@gnu.org>
7205
7206 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7207 Move DONT_REOPEN_PTY to configure.
7208
7209 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7210 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7211
7212 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7213
7214 Remove "#define unix" that is no longer needed (Bug#11905).
7215 * s/aix4-2.h (unix): Remove; no longer needed.
7216
7217 EMACS_TIME simplification (Bug#11875).
7218 This replaces macros (which typically do not work in GDB)
7219 with functions, typedefs and enums, making the code easier to debug.
7220 The functional style also makes code easier to read and maintain.
7221 * systime.h: Include <sys/time.h> on all hosts, not just if
7222 WINDOWSNT, since 'struct timeval' is needed in general.
7223 (EMACS_TIME): Now a typedef, not a macro.
7224 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7225 not macros.
7226 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7227 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7228 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7229 (EMACS_TIME_LE): Now functions, not macros.
7230 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7231 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7232 which are not functions. All uses rewritten to use:
7233 (make_emacs_time): New function.
7234 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7235 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7236 not functions. All uses rewritten to use the following, respectively:
7237 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7238 (add_emacs_time, sub_emacs_time): New functions.
7239 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7240 * fileio.c (Fcopy_file):
7241 * xterm.c (XTflash): Get the current time closer to when it's used.
7242 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7243
7244 * bytecode.c (targets): Suppress -Woverride-init warnings.
7245
7246 Simplify by avoiding confusing use of strncpy etc.
7247 * doc.c (Fsnarf_documentation):
7248 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7249 * frame.c (Fmake_terminal_frame):
7250 * gtkutil.c (get_utf8_string):
7251 * lread.c (openp):
7252 * nsmenu.m (ns_update_menubar):
7253 * regex.c (regerror):
7254 Prefer memcpy to strncpy and strncat when either will do.
7255 * fileio.c (Fsubstitute_in_file_name):
7256 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7257 (menu_separator_name_p):
7258 * nsmenu.m (ns_update_menubar):
7259 Prefer memcmp to strncmp when either will do.
7260 * nsterm.m: Include <ftoastr.h>.
7261 (ns_get_color):
7262 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7263 Prefer snprintf to strncpy.
7264 * nsterm.m (ns_term_init):
7265 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7266 * nsterm.m (ns_term_init):
7267 Avoid the need for strncpy, by using build_string or
7268 make_unibyte_string directly. Use dtoastr, not snprintf.
7269 * process.c (Fmake_network_process): Diagnose service names that
7270 are too long, rather than silently truncating them or creating
7271 non-null-terminated names.
7272 (Fnetwork_interface_info): Likewise, for interface names.
7273 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7274 Prefer sprintf to strncat.
7275 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7276 Prefer vsnprintf to vsprintf + strncpy.
7277
7278 2012-07-10 Glenn Morris <rgm@gnu.org>
7279
7280 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7281 Clarify fallback case.
7282
7283 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7284
7285 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7286 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7287 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7288 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7289 where argument type is known to be a Lisp_Cons.
7290
7291 2012-07-10 Tom Tromey <tromey@redhat.com>
7292
7293 * bytecode.c (BYTE_CODE_THREADED): New macro.
7294 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7295 (enum byte_code_op): New type.
7296 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7297 (exec_byte_code): Use them. Use token threading when applicable.
7298
7299 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7300
7301 Optimize pure C strings initialization.
7302 * lisp.h (make_pure_string): Fix prototype.
7303 (build_pure_c_string): New function, defined as static inline. This
7304 provides a better opportunity to optimize away calls to strlen when
7305 the function is called with compile-time constant argument.
7306 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7307 argument, adjust users accordingly. Use build_pure_c_string where
7308 appropriate.
7309 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7310 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7311 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7312
7313 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7314
7315 Avoid calls to strlen in miscellaneous functions.
7316 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7317 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7318 * lread.c (openp): Likewise.
7319
7320 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7321
7322 Avoid calls to strlen in path processing functions.
7323 * fileio.c (file_name_as_directory): Add comment. Change to add
7324 srclen argument and return the length of result. Adjust users
7325 accordingly.
7326 (directory_file_name): Fix comment. Change to add srclen argument,
7327 swap 1st and 2nd arguments to obey the common convention.
7328 Adjust users accordingly.
7329 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7330
7331 2012-07-10 Glenn Morris <rgm@gnu.org>
7332
7333 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7334 Move PENDING_OUTPUT_COUNT definition to configure.
7335
7336 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7337 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7338 * s/gnu.h (DATA_START): Move definitions to configure.
7339
7340 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7341 We include usg5-4-common.h, which defines them both.
7342
7343 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7344 O_RDONLY already includes it).
7345
7346 Stop ns builds setting the EMACSLOADPATH environment variable.
7347 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7348 Now it does not set EMACSLOADPATH, just returns the load-path string.
7349 * nsterm.h: Update accordingly.
7350 * lread.c [HAVE_NS]: Include nsterm.h.
7351 (init_lread) [HAVE_NS]: Use ns_load_path.
7352 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7353
7354 2012-07-09 Glenn Morris <rgm@gnu.org>
7355
7356 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7357 since the included bsd-common.h does so.
7358
7359 Stop ns builds setting the EMACSPATH environment variable.
7360 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7361 (ns_init_paths): Do not set EMACSPATH.
7362 * nsterm.h (ns_exec_path): Add it.
7363 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7364 Use ns_exec_path.
7365
7366 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7367
7368 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * process.c (wait_reading_process_output): 'waitchannels' was unset
7371 when read_kbd || !NILP (wait_for_cell); fix this.
7372
7373 Add GCC-style 'const' attribute to functions that can use it.
7374 * character.h (char_resolve_modifier_mask):
7375 * keyboard.h (make_ctrl_char):
7376 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7377 (init_character_once, next_almost_prime, init_fns, init_image)
7378 (flush_pending_output, init_sound):
7379 * mem-limits.h (start_of_data):
7380 * menu.h (finish_menu_items):
7381 Add ATTRIBUTE_CONST.
7382 * emacs.c (DEFINE_DUMMY_FUNCTION):
7383 Declare the dummy function with ATTRIBUTE_CONST.
7384 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7385 Add decls with ATTRIBUTE_CONST.
7386
7387 Minor improvements to make_formatted_string.
7388 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7389 where int is good enough, as vsprintf returns an int.
7390 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7391
7392 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7393
7394 Use make_formatted_string to avoid double length calculation.
7395 * lisp.h (make_formatted_string): New prototype.
7396 * alloc.c (make_formatted_string): New function.
7397 * buffer.c (Fgenerate_new_buffer_name): Use it.
7398 * dbusbind.c (syms_of_dbusbind): Likewise.
7399 * editfns.c (Fcurrent_time_zone): Likewise.
7400 * filelock.c (get_boot_time): Likewise.
7401 * frame.c (make_terminal_frame, set_term_frame_name)
7402 (x_report_frame_params): Likewise.
7403 * image.c (gs_load): Likewise.
7404 * minibuf.c (get_minibuffer): Likewise.
7405 * msdos.c (dos_set_window_size): Likewise.
7406 * process.c (make_process): Likewise.
7407 * xdisp.c (ensure_echo_area_buffers): Likewise.
7408 * xsettings.c (apply_xft_settings): Likewise.
7409
7410 2012-07-09 Glenn Morris <rgm@gnu.org>
7411
7412 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7413 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7414 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7415 * nsterm.h (ns_etc_directory): Add it.
7416 * callproc.c [HAVE_NS]: Include nsterm.h.
7417 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7418
7419 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7420
7421 Move marker debugging code under MARKER_DEBUG.
7422 * marker.c (MARKER_DEBUG): Move marker debugging code under
7423 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7424 for bootstrap with --enable-checking (~3x slowdown reported
7425 by Juanma Barranquero <lekktu@gmail.com>).
7426 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7427
7428 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7429
7430 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7431 See <http://bugs.gnu.org/11825#29>.
7432
7433 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7434
7435 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7436 has no font, use the frame's font. (Bug#11813)
7437 (display_line): Add commentary about displaying truncation glyphs
7438 on GUI frames.
7439 (produce_special_glyphs): Move here from term.c.
7440
7441 * term.c (produce_special_glyphs): Move to xdisp.c.
7442
7443 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7444 section.
7445
7446 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7447
7448 * xdisp.c (display_line): Avoid warning about implicit declaration
7449 of FRAME_FONT.
7450
7451 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7452
7453 * lisp.h: Remove empty conditional.
7454
7455 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7456
7457 * lread.c (load_path_check): Now static.
7458
7459 Fix some minor --with-ns problems found by static checking.
7460 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7461 (x_set_font) [!HAVE_X_WINDOWS]:
7462 * image.c (xpm_load_image) [HAVE_NS]:
7463 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7464 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7465 Remove unused local.
7466 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7467 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7468 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7469 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7470 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7471 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7472 Fix pointer signedness problem.
7473 * xfaces.c (FRAME_X_FONT_TABLE):
7474 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7475
7476 2012-07-07 Glenn Morris <rgm@gnu.org>
7477
7478 * lread.c (load_path_check): New function, split from init_lread.
7479 (init_lread): Reorganize. Motivation:
7480 If EMACSLOADPATH is set, check/warn about that rather than the
7481 defaults, which we are not going to use. Hence we can remove
7482 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7483 Don't warn if site-lisp directories are missing.
7484 If not installed, start from a blank load-path, since
7485 PATH_LOADSEARCH refers to the eventual installation directories.
7486
7487 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7488
7489 Support truncation and continuation glyphs on GUI frames, when
7490 fringes are disabled. (Bug#11832)
7491 * xdisp.c (init_iterator): Get dimensions of truncation and
7492 continuation glyphs even if on GUI frames.
7493 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7494 or both, are absent.
7495 (start_display, move_it_in_display_line_to): Handle the case of a
7496 GUI frame without a fringe to display continuation or truncation
7497 glyphs.
7498 (insert_left_trunc_glyphs): Support GUI frames: make sure
7499 truncation glyphs overwrite enough glyphs from the current line to
7500 have sufficient space in pixels.
7501 (display_line): Support truncation and continuation glyphs on GUI
7502 frames. If some spare pixels are left on the line after inserting
7503 the truncation glyphs, fill that space with a stretch glyph of a
7504 suitably computed width.
7505
7506 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7507 produce_glyphs, to support GUI sessions.
7508
7509 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7512
7513 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7514
7515 Do not require float-time's arg to fit in time_t (Bug#11825).
7516 This works better on hosts where time_t is unsigned, and where
7517 float-time is applied to the (negative) difference between two times.
7518 * editfns.c (decode_time_components): Last arg is now double *,
7519 not int *, and means to store all the result as a double, without
7520 worrying about whether the seconds part fits in time_t.
7521 All callers changed.
7522 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7523 All callers changed.
7524 (Ffloat_time): Do not fail merely because the specified time falls
7525 outside of time_t range.
7526
7527 2012-07-07 Glenn Morris <rgm@gnu.org>
7528
7529 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7530 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7531 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7532
7533 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7534
7535 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7536 Update dependencies.
7537
7538 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7539
7540 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7543 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7544 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7545 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7546 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7547 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7548
7549 * xfont.c (compare_font_names): Redo to omit the need for casts.
7550
7551 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7552
7553 * xfns.c (Fx_change_window_property): Doc fix.
7554 * w32fns.c (Fx_change_window_property): Doc fix.
7555
7556 * w32fns.c (Fx_window_property): Accept the same arguments as the
7557 X Windows version. Doc fix.
7558 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7559
7560 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7561 Eli Zaretskii <eliz@gnu.org>
7562
7563 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7564 Windows-specific code from nt/config.nt moved here.
7565 Obsolete settings removed.
7566
7567 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7568
7569 * process.c: Avoid unnecessary calls to gettime.
7570 (wait_reading_process_output): Don't get the time of day
7571 when gobbling data immediately and not waiting, as there's no need
7572 for it in that case. This removes a FIXME.
7573
7574 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7575
7576 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7577 is defined (Bug#11768).
7578
7579 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7580
7581 Fix marker debugging code.
7582 * marker.c (byte_char_debug_check): Do not perform the check
7583 if buffer is not multibyte.
7584 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7585 Call byte_char_debug_check with correct arguments.
7586
7587 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7588
7589 Compile marker debugging code only if ENABLE_CHECKING is defined.
7590 * marker.c (byte_char_debug_check, count_markers):
7591 Use only if ENABLE_CHECKING is defined.
7592 (byte_debug_flag): Remove.
7593 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7594 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7595
7596 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7597
7598 Avoid code repetition in marker-related functions.
7599 * marker.c (attach_marker): New function.
7600 (Fset_marker, set_marker_restricted, set_marker_both)
7601 (set_marker_restricted_both): Use it.
7602 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7603 Consistently rename charno to charpos.
7604 (marker_position): Add eassert.
7605 (marker_byte_position): Convert to eassert.
7606
7607 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7608
7609 Simplify list operations in unchain_overlay and unchain_marker.
7610 * buffer.c (unchain_overlay): Simplify. Add comment.
7611 * marker.c (unchain_marker): Simplify. Fix comments.
7612
7613 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7614
7615 Introduce fast path for the widely used marker operation.
7616 * alloc.c (build_marker): New function.
7617 * lisp.h (build_marker): New prototype.
7618 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7619 * composite.c (autocmp_chars): Likewise.
7620 * editfns.c (buildmark): Remove.
7621 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7622 (save_restriction_save): Use build_marker.
7623 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7624 * window.c (save_window_save): Likewise.
7625
7626 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7627
7628 Do not use Fdelete_overlay in delete_all_overlays
7629 to avoid redundant calls to unchain_overlay.
7630 * buffer.c (drop_overlay): New function.
7631 (delete_all_overlays, Fdelete_overlay): Use it.
7632 * minibuf.c (get_minibuffer): Fix comment.
7633
7634 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7635
7636 Port to OpenBSD 5.1 amd64.
7637 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7638 This is needed for OpenBSD, and should be harmless on all BSD systems.
7639 Also, include <sys/sysctl.h>, as it should be available on all
7640 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7641 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7642 use p_pid member, not kp_proc.pid.
7643
7644 2012-07-06 Glenn Morris <rgm@gnu.org>
7645
7646 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7647
7648 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7649
7650 More xmalloc and related cleanup.
7651 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7652 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7653 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7654 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7655 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7656 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7657 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7658 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7659 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7660 * xterm.c:
7661 Omit needless casts involving void * pointers and allocation.
7662 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7663 as the former is more robust if P's type is changed.
7664 Prefer xzalloc to xmalloc + memset 0.
7665 Simplify malloc-or-realloc to realloc.
7666 Don't worry about xmalloc returning a null pointer.
7667 Prefer xstrdup to xmalloc + strcpy.
7668 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7669 growing it.
7670 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7671 alloca of a constant.
7672
7673 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7674
7675 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7676 hscroll is larger than the line width. Fixes long and futile
7677 looping inside extend_face_to_end_of_line (on a TTY) producing
7678 glyphs that are not needed and thrown away.
7679
7680 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7681
7682 * marker.c (set_marker_restricted_both): Simplify by using
7683 clip_to_bounds.
7684
7685 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7686
7687 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7688
7689 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7690
7691 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7692 not defined (Bug#11768).
7693 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7694 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7695 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7696 followed by gtk_box_set_homogeneous (Bug#11768).
7697 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7698 (update_theme_scrollbar_width, xg_create_scroll_bar):
7699 Use gtk_scrollbar_new (Bug#11768).
7700 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7701 (is_box_type): New function (Bug#11768).
7702 (xg_tool_item_stale_p): Call is_box_type.
7703 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7704 with default display (Bug#11768).
7705
7706 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7707
7708 * xdisp.c (window_hscroll_limited): New function.
7709 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7710 coordinates when window's hscroll is set to insanely large
7711 values. (Bug#11857)
7712
7713 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7714
7715 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7716 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7717
7718 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7719
7720 Cleanup xmalloc.
7721 * lisp.h (xzalloc): New prototype. Omit needless casts.
7722 * alloc.c (xzalloc): New function. Omit needless casts.
7723 * charset.c: Omit needless casts. Convert all calls to
7724 xmalloc with following memset to xzalloc.
7725 * dispnew.c: Likewise.
7726 * fringe.c: Likewise.
7727 * image.c: Likewise.
7728 * sound.c: Likewise.
7729 * term.c: Likewise.
7730 * w32fns.c: Likewise.
7731 * w32font.c: Likewise.
7732 * w32term.c: Likewise.
7733 * xfaces.c: Likewise.
7734 * xfns.c: Likewise.
7735 * xterm.c: Likewise.
7736 * atimer.c: Omit needless casts.
7737 * buffer.c: Likewise.
7738 * callproc.c: Likewise.
7739 * ccl.c: Likewise.
7740 * coding.c: Likewise.
7741 * composite.c: Likewise.
7742 * doc.c: Likewise.
7743 * doprnt.c: Likewise.
7744 * editfns.c: Likewise.
7745 * emacs.c: Likewise.
7746 * eval.c: Likewise.
7747 * filelock.c: Likewise.
7748 * fns.c: Likewise.
7749 * gtkutil.c: Likewise.
7750 * keyboard.c: Likewise.
7751 * lisp.h: Likewise.
7752 * lread.c: Likewise.
7753 * minibuf.c: Likewise.
7754 * msdos.c: Likewise.
7755 * print.c: Likewise.
7756 * process.c: Likewise.
7757 * region-cache.c: Likewise.
7758 * search.c: Likewise.
7759 * sysdep.c: Likewise.
7760 * termcap.c: Likewise.
7761 * terminal.c: Likewise.
7762 * tparam.c: Likewise.
7763 * w16select.c: Likewise.
7764 * w32.c: Likewise.
7765 * w32reg.c: Likewise.
7766 * w32select.c: Likewise.
7767 * w32uniscribe.c: Likewise.
7768 * widget.c: Likewise.
7769 * xdisp.c: Likewise.
7770 * xmenu.c: Likewise.
7771 * xrdb.c: Likewise.
7772 * xselect.c: Likewise.
7773
7774 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 * fileio.c (time_error_value): Check the right error number.
7777 Problem reported by Troels Nielsen in
7778 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7779
7780 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7783 This should be fixed in a better way; see Eli Zaretskii in
7784 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7785 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7786
7787 * fileio.c (time_error_value): Rename from special_mtime.
7788 The old name's problems were noted by Eli Zaretskii in
7789 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7790
7791 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7792 This variable's comment says Emacs needs at least one GDB-visible
7793 symbol of type enum pvec_type, to work around GDB problems.
7794 The symbol's value doesn't matter.
7795
7796 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7797 that causes compilation to fail on pre-C99 compilers.
7798
7799 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7800
7801 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7802 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7803
7804 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7805
7806 * buffer.c (init_buffer_once): Fix initialization of
7807 headers for buffer_defaults and buffer_local_symbols.
7808 Reported by Juanma Barranquero <lekktu@gmail.com>.
7809
7810 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7811
7812 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7813 * lisp.h (enum pvec_type): Use fewer bits.
7814 (PSEUDOVECTOR_SIZE_BITS): New constant.
7815 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7816 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7817 change in pvec_type.
7818 (PSEUDOVECTOR_TYPEP): New macro.
7819 (TYPED_PSEUDOVECTORP): Use it.
7820 * fns.c (internal_equal): Adapt code to extract pvectype.
7821 * emacs.c (gdb_pvec_type): Update type.
7822 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7823 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7824 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7825 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7826 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7827 abusing vector->header.next.nbytes.
7828 (live_vector_p): Use PVEC_TYPE.
7829 (mark_object): Adapt code to extract pvectype. Use switch.
7830
7831 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7832
7833 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7834 Tighten new eassert a bit.
7835
7836 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7837
7838 Fix compilation with --enable-gcc-warnings and -O1
7839 optimization level.
7840 * doprnt.c (doprnt): Change type of tem to int, initialize
7841 to avoid compiler warning. Add eassert.
7842 * search.c (simple_search): Initialize match_byte to avoid
7843 compiler warning. Add eassert.
7844
7845 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7846
7847 Avoid weird behavior with large horizontal scrolls.
7848 Without this change, for example, large hscroll values would
7849 mess up Emacs's display on Fedora 15 x86, presumably due to
7850 overflows in int calculations in the display code.
7851 Also, if buffers had long lines, Emacs would freeze.
7852 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7853 (set_window_hscroll): New function, containing the old guts of
7854 Fset_window_hscroll. Return the clipped value.
7855 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7856 This avoids the need to check against PTRDIFF_MAX.
7857
7858 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7859
7860 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7861
7862 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7863
7864 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7865
7866 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7867 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7868 since GCC 4.4.6 issues a bogus warning for them.
7869
7870 Fix bugs in file timestamp newness comparisons.
7871 * fileio.c (Ffile_newer_than_file_p):
7872 * lread.c (Fload): Use full timestamp resolution of files,
7873 not just the 1-second resolution, so that files that are only
7874 slightly newer still count as newer.
7875 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7876 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7877
7878 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 * fileio.c: Improve handling of file time marker. (Bug#11852)
7881 (special_mtime): New function.
7882 (Finsert_file_contents, Fverify_visited_file_modtime):
7883 Use it to set special mtime values consistently.
7884
7885 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7886
7887 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7888 marker for non-existing file. (Bug#11852)
7889
7890 2012-07-03 Glenn Morris <rgm@gnu.org>
7891
7892 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7893 and did not make it into globals.h).
7894
7895 2012-07-03 Tom Tromey <tromey@redhat.com>
7896
7897 * window.c (Fset_window_margins, Fset_window_fringes)
7898 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7899 * textprop.c (Fprevious_property_change): No longer static.
7900 * syntax.c (Fsyntax_table_p): No longer static.
7901 * process.c (Fget_process, Fprocess_datagram_address): No longer
7902 static.
7903 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7904 * keyboard.c (Fcommand_execute): No longer static.
7905 Remove EXFUN.
7906 * insdel.c (Fcombine_after_change_execute): No longer static.
7907 * image.c (Finit_image_library): No longer static.
7908 * fileio.c (Fmake_symbolic_link): No longer static.
7909 * eval.c (Ffetch_bytecode): No longer static.
7910 * editfns.c (Fuser_full_name): No longer static.
7911 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7912 No longer static.
7913 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7914 static.
7915 * dired.c (Ffile_attributes): No longer static.
7916 * composite.c (Fcomposition_get_gstring): No longer static.
7917 * callproc.c (Fgetenv_internal): No longer static.
7918
7919 * ccl.h: Remove EXFUNs.
7920 * buffer.h: Remove EXFUNs.
7921 * dispextern.h: Remove EXFUNs.
7922 * intervals.h: Remove EXFUNs.
7923 * fontset.h: Remove EXFUN.
7924 * font.h: Remove EXFUNs.
7925 * dosfns.c (system_process_attributes): Remove EXFUN.
7926 * keymap.h: Remove EXFUNs.
7927 * lisp.h: Remove EXFUNs.
7928 * w32term.h: Remove EXFUNs.
7929 * window.h: Remove EXFUNs.
7930 * xsettings.h: Remove EXFUN.
7931 * xterm.h: Remove EXFUN.
7932
7933 2012-07-03 Glenn Morris <rgm@gnu.org>
7934
7935 * lisp.h (Frandom): Make it visible to C.
7936 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7937 buffer for invisible buffers. (Bug#1229)
7938
7939 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7940
7941 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7942 values which aren't power of 2.
7943 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7944 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7945 accordingly.
7946
7947 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7948
7949 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7950
7951 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7952
7953 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7954
7955 * alloc.c (allocate_vector_block): Remove redundant
7956 calls to mallopt if DOUG_LEA_MALLOC is defined.
7957 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7958 avoid calls to mallopt if zero_vector is returned.
7959
7960 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7961
7962 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7963 is enabled, avoid dereferencing NULL current_sblock if
7964 running undumped.
7965
7966 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7967
7968 Cleanup basic buffer management.
7969 * buffer.h (struct buffer): Change layout to use generic vector
7970 marking code. Fix some comments. Change type of 'clip_changed'
7971 to bitfield. Remove unused #ifndef old.
7972 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7973 (GET_OVERLAYS_AT): Fix indentation.
7974 (for_each_per_buffer_object_at): New macro.
7975 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7976 (Fbuffer_local_variables): Use it.
7977 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7978 * alloc.c (allocate_buffer): Adjust to match new layout of
7979 struct buffer. Fix comment.
7980 (mark_overlay): New function.
7981 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7982 Lisp area of struct buffer.
7983 (mark_object): Use it. Adjust marking of misc objects
7984 and related comments.
7985
7986 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7987
7988 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7989 wrapper that is not needed because the wrapped code is a no-op (zero
7990 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7991 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7992
7993 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7994
7995 * alloc.c (mark_buffer): Simplify. Remove prototype.
7996 (mark_object): Add comment. Reorganize marking of vector-like
7997 objects. Use CHECK_LIVE for all vector-like objects except buffers
7998 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7999 Avoid redundant calls to mark_vectorlike for bool vectors.
8000
8001 2012-06-30 Glenn Morris <rgm@gnu.org>
8002
8003 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8004
8005 * epaths.in (PATH_SITELOADSEARCH): New.
8006 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8007 This is rather than relying on --enable-locallisppath elements
8008 having "site-lisp" in their names. (Bug#10208#25, 11658)
8009
8010 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8011
8012 * w32proc.c (sys_select): Accept and ignore one more argument.
8013
8014 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8015
8016 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8017 (pselect) [!MS_DOS]: Redirect to sys_select.
8018
8019 * sysdep.c: Don't include dos.h and dosfns.h.
8020
8021 * process.c (sys_select):
8022 * msdos.c (sys_select): Accept one more argument and ignore it.
8023
8024 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8025 adapt data types and code to that.
8026
8027 * dosfns.c:
8028 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8029 which clashes with the gnulib function of the same name.
8030
8031 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8032
8033 * font.c (font_style_to_value, font_style_symbolic)
8034 (font_prop_validate_style): Add type checks for values in
8035 font_style_table.
8036
8037 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8038 argument.
8039 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8040 uses.
8041
8042 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8043
8044 * xdisp.c (try_window_id): Undo last change.
8045
8046 * w32.c (getwd): Adjust commentary about startup_dir.
8047 (init_environment): Always call sys_access, even in non-MSVC
8048 builds. Don't chdir to the directory of the Emacs executable.
8049 This undoes code from 1997 which was justified by the need to
8050 "avoid conflicts when removing and renaming directories". But its
8051 downside was that every relative file name was being interpreted
8052 relative to the directory of the Emacs executable, which can never
8053 be TRT. In particular, it broke sys_access when called with
8054 relative file names.
8055 (sys_access): Map GetLastError to errno.
8056
8057 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8058
8059 * window.h (struct window): Change type of 'fringes_outside_margins'
8060 to bitfield. Fix comment. Adjust users accordingly.
8061 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8062 Adjust comment.
8063 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8064 to ptrdiff_t.
8065
8066 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8067
8068 * gnutls.c (emacs_gnutls_handshake):
8069 Add QUIT to make the loop interruptible.
8070
8071 2012-06-29 Glenn Morris <rgm@gnu.org>
8072
8073 * charset.c (init_charset): Make lack of etc/charsets fatal.
8074
8075 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8076
8077 * editfns.c (region_limit): Fix type mismatch.
8078
8079 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8080
8081 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8082 undefined. Convert from xassert to eassert.
8083 * nsmenu.m: Convert from xassert to eassert.
8084 * nsterm.m: Likewise.
8085
8086 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8087
8088 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8089
8090 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8091
8092 Avoid integer overflow on scroll-left and scroll-right.
8093 * window.c (HSCROLL_MAX): New macro.
8094 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8095 overflow when requested scroll falls outside ptrdiff_t range.
8096
8097 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8098
8099 * window.h (struct window): Change type of 'hscroll',
8100 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8101 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8102 Adjust users accordingly.
8103 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8104 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8105 from EMACS_INT to ptrdiff_t.
8106 (make_window): Omit redundant initialization.
8107
8108 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8109
8110 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8111
8112 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8113
8114 * window.h (struct window): Change type of 'use_time' and
8115 'sequence_number' from Lisp_Object to int.
8116 * frame.c (make_frame): Adjust users accordingly.
8117 * print.c (print_object): Likewise.
8118 * window.c (select_window, Fwindow_use_time, make_parent_window)
8119 (make_window): Likewise.
8120
8121 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8122
8123 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8124 enabled with --enable-checking=[all,glyphs] configure option.
8125 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8126 adjust comments accordingly.
8127 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8128 undefined, adjust comments accordingly.
8129 * image.c: Likewise.
8130 * scroll.c: Likewise.
8131 * w32fns.c: Likewise.
8132 * w32term.c: Likewise.
8133 * xdisp.c: Likewise.
8134 * xfaces.c: Likewise.
8135 * xfns.c: Likewise.
8136 * xterm.c: Likewise.
8137
8138 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8139
8140 Generalize run-time debugging checks.
8141 * dispextern.h (XASSERTS): Remove.
8142 * fontset.c (xassert): Remove.
8143 Convert from xassert to eassert.
8144 * alloc.c: Convert from xassert to eassert.
8145 * bidi.c: Likewise.
8146 * dispnew.c: Likewise.
8147 * fns.c: Likewise.
8148 * fringe.c: Likewise.
8149 * ftfont.c: Likewise.
8150 * gtkutil.c: Likewise.
8151 * image.c: Likewise.
8152 * keyboard.c: Likewise.
8153 * menu.c: Likewise.
8154 * process.c: Likewise.
8155 * scroll.c: Likewise.
8156 * sound.c: Likewise.
8157 * term.c: Likewise.
8158 * w32console.c: Likewise.
8159 * w32fns.c: Likewise.
8160 * w32term.c: Likewise.
8161 * window.c: Likewise.
8162 * xdisp.c: Likewise.
8163 * xfaces.c: Likewise.
8164 * xfns.c: Likewise.
8165 * xselect.c: Likewise.
8166 * xterm.c: Likewise.
8167
8168 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8169
8170 * fns.c (maybe_resize_hash_table): Output message when growing the
8171 purify-hashtable.
8172
8173 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8174
8175 * alloc.c (allocate_string_data): Remove dead code.
8176 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8177 avoid GCC warning about unused macro.
8178
8179 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8180
8181 * alloc.c (allocate_string): Omit intervals initialization.
8182 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8183 as in make_pure_string and make_pure_c_string.
8184
8185 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8186
8187 * alloc.c (allocate_string): Fix last change.
8188
8189 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8190
8191 * alloc.c (allocate_string): Remove two redundant calls
8192 to memset, add explicit initialization where appropriate.
8193
8194 2012-06-27 Glenn Morris <rgm@gnu.org>
8195
8196 * lisp.mk (lisp): Remove paths.elc.
8197
8198 2012-06-27 Chong Yidong <cyd@gnu.org>
8199
8200 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8201
8202 2012-06-26 John Wiegley <johnw@newartisans.com>
8203
8204 * unexmacosx.c (copy_data_segment): Add two section names used
8205 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8206
8207 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8208 when building with Clang.
8209
8210 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8211
8212 * eval.c (Fapply): Allow calling it with a single argument.
8213
8214 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8215
8216 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8217 _stricmp and _strnicmp.
8218 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8219
8220 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8221
8222 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8223 allocated window.
8224 (allocate_process): Likewise for new process.
8225 (allocate_terminal): Change to use offsetof.
8226 (allocate_frame): Likewise.
8227 * frame.c (make_frame): Omit redundant initialization.
8228 * window.c (make_parent_window): Use memset.
8229 (make_window): Omit redundant initialization.
8230 * process.c (make_process): Omit redundant initialization.
8231 * terminal.c (create_terminal): Likewise.
8232
8233 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8234
8235 * term.c (delete_tty): Remove redundant call to memset.
8236
8237 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8238
8239 * alloc.c: Remove build_string.
8240 * lisp.h: Define build_string as static inline. This provides
8241 a better opportunity to optimize away calls to strlen when the
8242 function is called with compile-time constant argument.
8243 * image.c (imagemagick_error): Convert to build_string.
8244 * w32proc.c (sys_spawnve): Likewise.
8245 * xterm.c (x_term_init): Likewise.
8246
8247 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8248
8249 Use sprintf return value instead of invoking strlen on result.
8250 In the old days this wasn't portable, since some sprintf
8251 implementations returned char *. But they died out years ago and
8252 Emacs already assumes sprintf returns int.
8253 Similarly for float_to_string.
8254 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8255 * ccl.c (ccl_driver):
8256 * character.c (string_escape_byte8):
8257 * data.c (Fnumber_to_string):
8258 * doprnt.c (doprnt):
8259 * print.c (print_object):
8260 * xdisp.c (message_dolog):
8261 * xfns.c (syms_of_xfns):
8262 Use sprintf or float_to_string result to avoid need to call strlen.
8263 * data.c (Fnumber_to_string):
8264 Use make_unibyte_string, since the string must be ASCII.
8265 * lisp.h, print.c (float_to_string): Now returns int length.
8266 * term.c (produce_glyphless_glyph):
8267 Use sprintf result rather than recomputing it.
8268
8269 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8270 * Makefile.in (ALL_CFLAGS):
8271 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8272 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8273
8274 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8275
8276 * dispextern.h (xstrcasecmp): Define to library function
8277 strcasecmp if available.
8278 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8279
8280 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8281
8282 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8283 Avoid comma operator.
8284 * menu.c (push_submenu_start, push_submenu_end)
8285 (push_left_right_boundary, push_menu_pane): Likewise.
8286 * msdos.c (dos_rawgetc): Likewise.
8287
8288 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8289
8290 * xfns.c (xic_create_fontsetname): Remove redundant calls
8291 to memset.
8292
8293 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8294
8295 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8296 sprintf already null-terminates its output.
8297
8298 * xfns.c (x_window): Remove redundant cast.
8299
8300 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8301
8302 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8303 `const char *' to `char *' to avoid compiler warning.
8304
8305 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8308 instead of truncating it to 63 (admittedly a generous limit).
8309
8310 * process.c: Fix spelling and caps in comments.
8311
8312 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8313
8314 * emacs.c (setpgrp): Remove definition, unused.
8315 * sysdep.c (setpgrp): Remove definition, not used in this file.
8316
8317 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8318
8319 * makefile.w32-in: Update dependencies.
8320
8321 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8322
8323 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8324 (SYSTIME_H): Add nt/inc/sys/time.h.
8325
8326 * systime.h [WINDOWSNT]: Include sys/time.h.
8327
8328 * s/ms-w32.h (struct timespec): Definition moved from
8329 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8330
8331 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8334 * buffer.h (buffer_slot_type_mismatch):
8335 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8336 * eval.c (unwind_to_catch):
8337 * image.c (my_png_error, my_error_exit):
8338 * keyboard.c (quit_throw_to_read_char, user_error)
8339 (Fexit_recursive_edit, Fabort_recursive_edit):
8340 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8341 (wrong_type_argument, buffer_overflow, __executable_start)
8342 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8343 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8344 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8345 (fatal):
8346 (child_setup) [!DOS_NT]:
8347 * lread.c (end_of_file_error, invalid_syntax):
8348 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8349 * puresize.h (pure_write_error):
8350 * search.c (matcher_overflow):
8351 * sound.c (sound_perror, alsa_sound_perror):
8352 * sysdep.c, syssignal.h (croak):
8353 * term.c (maybe_fatal, vfatal):
8354 * textprop.c (text_read_only):
8355 * undo.c (user_error):
8356 * unexmacosx.c (unexec_error):
8357 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8358 Use _Noreturn rather than NO_RETURN.
8359 No need for separate decl merely because of _Noreturn.
8360 * sound.c (sound_warning, parse_sound):
8361 Remove unnecessary forward decls.
8362
8363 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8366 * lisp.h (WAIT_READING_MAX): New macro.
8367 * dispnew.c (Fsleep_for, sit_for):
8368 * keyboard.c (kbd_buffer_get_event):
8369 * process.c (Faccept_process_output):
8370 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8371 This improves on the previous patch, which introduced a bug
8372 when time_t is unsigned and as wide as intmax_t.
8373 See <http://bugs.gnu.org/9000#51>.
8374
8375 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8376
8377 * dispnew.c (sit_for, Fsleep_for):
8378 * keyboard.c (kbd_buffer_get_event):
8379 * process.c (Faccept_process_output): Avoid compiler warnings when
8380 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8381
8382 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8383
8384 * makefile.w32-in: Update dependencies.
8385
8386 * w32.c (ltime): Add return type and declare static.
8387 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8388
8389 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8390
8391 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8392 Privately reported by Herbert J. Skuhra.
8393 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8394 All uses changed.
8395 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8396 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8397
8398 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8399
8400 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8401 last argument of make_unibyte_string.
8402
8403 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8404 language ID in the event parameters.
8405
8406 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8407 event.code, not the obscure "character set ID".
8408
8409 2012-06-23 Chong Yidong <cyd@gnu.org>
8410
8411 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8412
8413 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8414
8415 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8416 * w32.c (fdutimens): New function.
8417
8418 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8419
8420 * s/ms-w32.h (pselect): Redirect to sys_select.
8421
8422 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8423
8424 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8425 in the logic of incrementing and decrementing the value of
8426 use_relocatable_buffers.
8427
8428 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8429
8430 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8431 Privately reported by Herbert J. Skuhra.
8432 [__FreeBSD__]: Remove "*/" typo after "#include".
8433 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8434 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8435 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8436 Don't assume EMACS_TIME and struct timeval are the same type.
8437
8438 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 Support higher-resolution time stamps (Bug#9000).
8441 The time stamps are only nanosecond-resolution at the C level,
8442 since that's the best that any real-world system supports now.
8443 But they are picosecond-resolution at the Lisp level, as that's
8444 easy, and leaves room for future OS improvements.
8445
8446 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8447 (LIBES): Use it.
8448
8449 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8450 Don't get current time unless it's needed.
8451
8452 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8453 now provides it if it's absent.
8454 (start_atimer): Port to higher-res time stamps.
8455 Check for time stamp overflow. Don't get current time more
8456 often than is needed.
8457
8458 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8459 Include systime.h, not time.h.
8460 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8461
8462 * dired.c: Include stat-time.h.
8463 (Ffile-attributes): File times now have higher resolution.
8464
8465 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8466 (struct image): Timestamp now has higher resolution.
8467
8468 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8469 has at least microseconds now. All uses removed.
8470 (update_frame, update_single_window, update_window, update_frame_1)
8471 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8472 (duration_to_sec_usec): Remove; no longer needed.
8473
8474 * editfns.c (time_overflow): Now extern.
8475 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8476 (float-time, Fformat_time_string, Fcurrent_time_string)
8477 (Fcurrent_time_zone): Accept and generate higher-resolution
8478 time stamps.
8479 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8480 (decode_time_components, lisp_seconds_argument): New functions.
8481 (make_time): Now static.
8482 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8483 Report an error if the time is invalid, rather than having the caller
8484 do that.
8485
8486 * fileio.c: Include <stat-time.h>
8487 (Fcopy_file): Copy higher-resolution time stamps.
8488 Prefer to set the time stamp via a file descriptor if that works.
8489 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8490 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8491 (Fvisited_file_modtime, Fset_visited_file_modtime):
8492 Support higher-resolution time stamps.
8493
8494 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8495
8496 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8497
8498 * image.c (prepare_image_for_display, clear_image_cache)
8499 (lookup_image): Port to higer-resolution time stamps.
8500
8501 * keyboard.c (start_polling, bind_polling_period):
8502 Check for time stamp overflow.
8503 (read_char, kbd_buffer_get_event, timer_start_idle)
8504 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8505 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8506 Port to higher-resolution time stamps. Do not assume time_t is signed.
8507 (decode_timer): New function. Timers are now vectors of length 9,
8508 not 8, to accommodate the picosecond component.
8509 (timer_check_2): Use it.
8510
8511 * nsterm.m (select_timeout, timeval_subtract): Remove.
8512 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8513 as they're a bit more accurate and handle overflow better.
8514 (ns_select): Change prototype to be compatible with pselect.
8515 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8516 * nsterm.h (ns_select): Adjust prototype.
8517
8518 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8519 us-resolution time stamps.
8520 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8521
8522 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8523
8524 * lisp.h (time_overflow): New decl.
8525 (wait_reading_process_output): First arg is now intmax_t, not int,
8526 to accommodate larger waits.
8527
8528 * process.h (struct Lisp_Process.read_output_delay):
8529 Now counts nanoseconds, not microseconds.
8530 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8531 EMACS_HAS_USECS.
8532 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8533 (wait_reading_process_output):
8534 Port to ns-resolution time stamps.
8535 (Faccept_process_output, wait_reading_process_output):
8536 Check for time stamp overflow. Do not assume time_t is signed.
8537 (select_wrapper): Remove; we now use pselect.
8538 (Fprocess_attributes): Now generates ns-resolution time stamps.
8539
8540 * sysdep.c: Include utimens.h. Don't include utime.h
8541 or worry about struct utimbuf; gnulib does that for us now.
8542 (gettimeofday): Remove; gnulib provides a substitute.
8543 (make_timeval): New function.
8544 (set_file_times): Now sets ns-resolution time stamps.
8545 New arg FD; all uses changed.
8546 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8547 (system_process_attributes):
8548 Now returns ns-resolution time stamp. All uses changed.
8549 Check for time stamp overflow.
8550
8551 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8552 provides a substitute now.
8553
8554 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8555 since it guarantees struct timespec.
8556 (EMACS_TIME): Now struct timespec, so that we can support
8557 ns-resolution time stamps.
8558 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8559 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8560 (EMACS_USECS): Remove.
8561 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8562 so multiply the arg by 1000 before storing it.
8563 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8564 New macros.
8565 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8566 Port to ns-resolution time stamps.
8567 (EMACS_TIME_NEG_P): Remove; replaced by....
8568 (EMACS_TIME_SIGN): New macro.
8569 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8570 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8571 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8572 (make_timeval, make_lisp_time, decode_time_components): New decls.
8573 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8574 that it mishandled time_t overflow. You can't compare by subtracting!
8575 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8576 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8577
8578 * term.c: Include <sys/time.h>.
8579 (timeval_to_Time): New function, for proper overflow wraparound.
8580 (term_mouse_position, term_mouse_click): Use it.
8581
8582 * undo.c (record_first_change): Support higher-resolution time stamps
8583 in the undo buffer.
8584 (Fprimitive_undo): Use them when restoring time stamps.
8585
8586 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8587 (w32_get_internal_run_time):
8588 Port to higher-resolution Emacs time stamps.
8589 (ltime): Now accepts single 64-bit integer, as that's more convenient
8590 for callers.
8591
8592 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8593
8594 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8595 for compatibility with pselect. Support ns-resolution time stamps.
8596
8597 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8598
8599 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8600 Check for time stamp overflow, and support ns-resolution time stamps.
8601
8602 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8603 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8604 (timeval_subtract): Remove; no longer needed.
8605 (XTflash, XTring_bell, x_wait_for_event):
8606 Port to ns-resolution time stamps. Don't assume time_t is signed.
8607
8608 2012-06-22 Chong Yidong <cyd@gnu.org>
8609
8610 * xdisp.c (x_consider_frame_title): Revert last change.
8611
8612 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8613
8614 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8615 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8616 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8617 staticidx goes up to 1597 out of 1600 = 0x640.)
8618
8619 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8620
8621 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8622 Otherwise, the umask might be mistakenly 0 while handling input signals.
8623
8624 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8625
8626 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8627
8628 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8629
8630 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8631 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8632 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8633 access to `contents' member of Lisp_Vector objects with AREF and ASET
8634 where appropriate.
8635
8636 2012-06-19 Chong Yidong <cyd@gnu.org>
8637
8638 * frame.c (delete_frame): When selecting a frame on a different
8639 text terminal, do not alter the terminal's top-frame.
8640
8641 * xdisp.c (format_mode_line_unwind_data): Record the target
8642 frame's selected window and its terminal's top-frame.
8643 (unwind_format_mode_line): Restore them.
8644 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8645 Callers changed.
8646 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8647 since tty frames can be explicitly named.
8648 (prepare_menu_bars): Likewise.
8649
8650 * term.c (Ftty_top_frame): New function.
8651
8652 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 Port byte-code-meter to modern targets.
8655 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8656 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8657 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8658 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8659 (METER_1, METER_2): Simplify.
8660
8661 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8662
8663 * data.c (Fdefalias): Return `symbol' (bug#11686).
8664
8665 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8666
8667 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8668 gets killed during executing of this function (Bug#11665).
8669 Try to always return Qt when the buffer has been actually killed.
8670 (Vkill_buffer_query_functions): In doc-string say that functions
8671 run by this hook should not change the current buffer.
8672
8673 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8674
8675 Fix recently-introduced process.c problems found by static checking.
8676 * process.c (write_queue_push, write_queue_pop, send_process):
8677 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8678 (write_queue_pop): Fix pointer signedness problem.
8679 (send_process): Remove unused local.
8680
8681 2012-06-17 Chong Yidong <cyd@gnu.org>
8682
8683 * xdisp.c (redisplay_internal): No need to redisplay terminal
8684 frames that are not on top.
8685
8686 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8687
8688 * process.c (make_process): Initialize write_queue.
8689 (write_queue_push, write_queue_pop): New functions.
8690 (send_process): Use them to maintain correct ordering of process
8691 writes (Bug#10815).
8692
8693 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8694
8695 * lisp.h (eassert): Assume C89 or later.
8696 This removes the need for CHECK.
8697 (CHECK): Remove. Its comments about always evaluating its
8698 argument were confusing, as 'eassert' typically does not evaluate
8699 its argument.
8700
8701 * coding.c (produce_chars): Use ptrdiff_t, not int.
8702
8703 * xterm.c (x_draw_underwave): Check for integer overflow.
8704 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8705
8706 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8707
8708 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8709 referenced (Bug#11583).
8710
8711 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8712
8713 Implement wave-style variant of underlining.
8714 * dispextern.h (face_underline_type): New enum.
8715 (face): Add field for underline type.
8716 * nsterm.m (ns_draw_underwave): New function.
8717 (ns_draw_text_decoration): Use it.
8718 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8719 New functions.
8720 (x_draw_glyph_string): Use them.
8721 * xfaces.c (Qline, Qwave): New Lisp objects.
8722 (check_lface_attrs, merge_face_ref)
8723 (Finternal_set_lisp_face_attribute, realize_x_face):
8724 Handle wave-style underline face attributes.
8725 * xterm.c (x_draw_underwave): New function.
8726 (x_draw_glyph_string): Use it.
8727
8728 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8729
8730 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8731 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8732 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8733 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8734 ($(BLD)/w32select.$(O)): Update dependencies.
8735
8736 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8737
8738 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8739 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8740 * character.c (_fetch_multibyte_char_p): Remove.
8741 * alloc.c: Include "character.h" before "buffer.h".
8742 * bidi.c: Likewise.
8743 * buffer.c: Likewise.
8744 * bytecode.c: Likewise.
8745 * callint.c: Likewise.
8746 * callproc.c: Likewise.
8747 * casefiddle.c: Likewise.
8748 * casetab.c: Likewise.
8749 * category.c: Likewise.
8750 * cmds.c: Likewise.
8751 * coding.c: Likewise.
8752 * composite.c: Likewise.
8753 * dired.c: Likewise.
8754 * dispnew.c: Likewise.
8755 * doc.c: Likewise.
8756 * dosfns.c: Likewise.
8757 * editfns.c: Likewise.
8758 * emacs.c: Likewise.
8759 * fileio.c: Likewise.
8760 * filelock.c: Likewise.
8761 * font.c: Likewise.
8762 * fontset.c: Likewise.
8763 * fringe.c: Likewise.
8764 * indent.c: Likewise.
8765 * insdel.c: Likewise.
8766 * intervals.c: Likewise.
8767 * keyboard.c: Likewise.
8768 * keymap.c: Likewise.
8769 * lread.c: Likewise.
8770 * macros.c: Likewise.
8771 * marker.c: Likewise.
8772 * minibuf.c: Likewise.
8773 * nsfns.m: Likewise.
8774 * nsmenu.m: Likewise.
8775 * print.c: Likewise.
8776 * process.c: Likewise.
8777 * regex.c: Likewise.
8778 * region-cache.c: Likewise.
8779 * search.c: Likewise.
8780 * syntax.c: Likewise.
8781 * term.c: Likewise.
8782 * textprop.c: Likewise.
8783 * undo.c: Likewise.
8784 * unexsol.c: Likewise.
8785 * w16select.c: Likewise.
8786 * w32fns.c: Likewise.
8787 * w32menu.c: Likewise.
8788 * window.c: Likewise.
8789 * xdisp.c: Likewise.
8790 * xfns.c: Likewise.
8791 * xmenu.c: Likewise.
8792 * xml.c: Likewise.
8793 * xselect.c: Likewise.
8794
8795 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8796
8797 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8798 If all the glyphs of the glyph row came from strings, and we have no
8799 cursor positioning clues, put the cursor on the first glyph of the
8800 row.
8801 (handle_face_prop): Use chunk-relative overlay string index when
8802 indexing into it->string_overlays array. (Bug#11653)
8803 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8804 the rightmost. (Bug#11720)
8805
8806 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8807
8808 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8809 (CATEGORY_MEMBER): Enforce 1/0 value.
8810 * category.c (_temp_category_set): Remove.
8811
8812 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8813
8814 * window.c (Fdelete_other_windows_internal)
8815 (Fdelete_window_internal): Don't access frame's mouse highlight
8816 info of the initial frame. (Bug#11677)
8817
8818 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8819
8820 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8821 Assume USE_2_TAGS_FOR_INTS.
8822 (xreload): Adjust $tagmask width to match recent lisp.h change.
8823
8824 Simplify lisp.h in minor ways that should not affect code.
8825 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8826 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8827 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8828 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8829 (INTTYPEBITS): New macro, for clarity.
8830 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8831 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8832 Simplify now that USE_LSB_TAG is always defined.
8833 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8834 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8835
8836 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8837
8838 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8839
8840 2012-06-13 Glenn Morris <rgm@gnu.org>
8841
8842 * s/bsd-common.h (BSD4_3):
8843 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8844
8845 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8846
8847 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8848 instead of union.
8849 (XLI, XIL): Define.
8850 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8851 Use them.
8852 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8853 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8854 * alloc.c (widen_to_Lisp_Object): Remove.
8855 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8856 * frame.c (delete_frame): Remove outdated comment.
8857 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8858 USE_LISP_UNION_TYPE.
8859 (Fw32_unregister_hot_key): Likewise.
8860 (Fw32_toggle_lock_key): Likewise.
8861 * w32menu.c (add_menu_item): Likewise.
8862 (w32_menu_display_help): Use XIL instead of checking
8863 USE_LISP_UNION_TYPE.
8864 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8865 (init_heap): Likewise.
8866 * w32term.c (w32_read_socket): Update comment.
8867
8868 2012-06-13 Glenn Morris <rgm@gnu.org>
8869
8870 * s/usg5-4-common.h, src/s/unixware.h:
8871 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8872
8873 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8874
8875 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8876
8877 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8878 * alloc.c (make_number) [!defined make_number]:
8879 Remove, as lisp.h always defines this now.
8880 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8881 (roundup_size): Verify that it is a power of 2.
8882 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8883 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8884 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8885 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8886 USE_LSB_TAG now is always defined to be either 0 or 1.
8887 All uses changed.
8888 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8889 code works fine either way, and efficiency is not a concern here,
8890 as the union type is for debugging, not for production.
8891 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8892 Use an inline function on all platforms when using the union type,
8893 since this is simpler and 'static inline' can be used portably
8894 within Emacs now.
8895 (LISP_INITIALLY_ZERO): New macro.
8896 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8897 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8898
8899 2012-06-12 Glenn Morris <rgm@gnu.org>
8900
8901 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8902
8903 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8904
8905 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8906 Move BROKEN_SIGIO to configure.
8907
8908 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8909 Move NO_TERMIO to configure.
8910
8911 2012-06-12 Chong Yidong <cyd@gnu.org>
8912
8913 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8914 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8915 MagickExportImagePixels is undefined.
8916
8917 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 * image.c (imagemagick_load_image): Remove unused label.
8920
8921 2012-06-11 Glenn Morris <rgm@gnu.org>
8922
8923 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8924 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8925 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8926 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8927
8928 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8929
8930 * alloc.c (make_byte_code): New function.
8931 (Fmake_byte_code): Use it. Don't purify here.
8932 * lread.c (read1): Use it as well to avoid extra allocation.
8933
8934 2012-06-11 Chong Yidong <cyd@gnu.org>
8935
8936 * image.c (imagemagick_load_image): Implement transparency.
8937
8938 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8939
8940 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8941 account for preceding backslashes. (Bug#11663)
8942
8943 2012-06-09 Chong Yidong <cyd@gnu.org>
8944
8945 * term.c: Support italics in capable terminals (Bug#9652).
8946 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8947 (turn_on_face): Output using TS_enter_italic_mode if available.
8948 Don't handle unused blinking and alt-charset cases.
8949 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8950 and tty_alt_charset_p cases.
8951 (tty_capable_p, init_tty): Support italics.
8952
8953 * termchar.h (struct tty_display_info): Add field for italics.
8954 Remove unused blink field.
8955
8956 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8957 Handle slant.
8958
8959 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8960 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8961 tty_alt_charset_p. Add tty_italic_p.
8962
8963 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8964
8965 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8966 dbus_type_is_basic if available.
8967 (xd_extract_signed, xd_extract_unsigned): Rename from
8968 extract_signed and extract_unsigned, respectively. Adapt callers.
8969
8970 2012-06-09 Chong Yidong <cyd@gnu.org>
8971
8972 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8973
8974 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8975 case (Bug#9752).
8976
8977 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 * xdisp.c (vmessage): Treat frame message as multibyte.
8980 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8981 would generate the diagnostic "Making \302\247 buffer-local while
8982 let-bound!".
8983
8984 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8985
8986 * dispnew.c (showing_window_margins_p): Undo last change, which
8987 was done due to an inadvertent commit.
8988 (adjust_frame_glyphs_for_frame_redisplay): Do call
8989 showing_window_margins_p.
8990
8991 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8992
8993 * eval.c (Fmake_var_non_special): New primitive.
8994 (syms_of_eval): Defsubr it.
8995 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8996
8997 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8998
8999 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9000 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9001
9002 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9003
9004 * alloc.c (allocate_vectorlike): Fix last change.
9005
9006 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9007
9008 Block-based vector allocation of small vectors.
9009 * lisp.h (struct vectorlike_header): New field `nbytes',
9010 adjust comment accordingly.
9011 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9012 to denote vector blocks. Adjust users (live_vector_p,
9013 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9014 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9015 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9016 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9017 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9018 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9019 (roundup_size): New constant.
9020 (struct vector_block): New data type.
9021 (vector_blocks, vector_free_lists, zero_vector): New variables.
9022 (all_vectors): Rename to `large_vectors'.
9023 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9024 (sweep_vectors): New functions.
9025 (allocate_vectorlike): Return `zero_vector' as the only vector of
9026 0 items. Allocate new vector from block if vector size is less than
9027 or equal to VBLOCK_BYTES_MAX.
9028 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9029 (init_alloc_once): Add call to init_vectors.
9030
9031 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9032
9033 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9034
9035 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9036
9037 * doprnt.c (doprnt): Truncate multibyte char correctly.
9038 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9039 would mishandle a string argument "Xc" if X was a multibyte
9040 character of length 2: it would truncate after X's first byte
9041 rather than including all of X.
9042
9043 2012-06-06 Chong Yidong <cyd@gnu.org>
9044
9045 * buffer.c (word_wrap): Doc fix.
9046
9047 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9050
9051 2012-06-03 Glenn Morris <rgm@gnu.org>
9052
9053 * xdisp.c (tool-bar-style): Doc fix.
9054
9055 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9056
9057 * Makefile.in (PAXCTL): Define.
9058 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9059 binary via PaX flags if the paxctl utility is available.
9060 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9061 Restore PaX flags to their default. (Bug#11398)
9062
9063 2012-06-03 Chong Yidong <cyd@gnu.org>
9064
9065 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9066 buffer (Bug#11226).
9067
9068 2012-06-03 Chong Yidong <cyd@gnu.org>
9069
9070 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9071 (note_mode_line_or_margin_highlight): If there is no help echo,
9072 use mode-line-default-help-echo. Handle the case where the mouse
9073 position is past the end of the mode line string.
9074
9075 * buffer.c (buffer_local_value_1): New function, split from
9076 Fbuffer_local_value; can return Qunbound.
9077 (Fbuffer_local_value): Use it.
9078 (Vmode_line_format): Docstring tweaks.
9079
9080 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * sysdep.c (system_process_attributes): Improve comment.
9083
9084 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9085
9086 * keyboard.c: Export real-this-command to Elisp.
9087 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9088 and DEFVAR it. Update all users.
9089
9090 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9093
9094 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9095 Convert pctcpu and pctmem to Lisp float properly.
9096 Let the compiler fold better, as 100.0/0x8000 is exact.
9097
9098 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9099
9100 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9101 cons_block.
9102
9103 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9106
9107 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9108
9109 For a 'struct window', replace some Lisp_Object fields to
9110 bitfields where appropriate, remove unused fields.
9111 * window.h (struct window): Remove unused 'last_mark_x' and
9112 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9113 change its type from Lisp_Object to bitfield.
9114 Change type of 'force_start', 'optional_new_start',
9115 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9116 fields from Lisp_Object to bitfield. Adjust users accordingly.
9117
9118 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9119
9120 Pacify gcc -Wdouble-precision when using Xaw.
9121 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9122 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9123 Use 'float' consistently, rather than 'float' in most places
9124 and 'double' in a couple of places.
9125
9126 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9127
9128 * xdisp.c (handle_stop): Detect whether we have overlay strings
9129 loaded by testing it->current.overlay_string_index to be
9130 non-negative, instead of checking whether n_overlay_strings is
9131 positive. (Bug#11587)
9132
9133 2012-05-31 Chong Yidong <cyd@gnu.org>
9134
9135 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9136
9137 * doc.c (Fsubstitute_command_keys): Doc fix.
9138
9139 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9140
9141 * search.c (search_buffer): Remove calls to
9142 r_alloc_inhibit_buffer_relocation, as it is now called by
9143 maybe_unify_char, which was the cause of relocation of buffer text
9144 in bug#11519.
9145
9146 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9147
9148 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9149 for the duration of call to load_charset, to avoid problems with
9150 callers of maybe_unify_char that access buffer text through C
9151 pointers.
9152
9153 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9154 decrement the inhibition flag, instead of just setting or
9155 resetting it.
9156
9157 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 Remove obsolete '#define static' cruft.
9160 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9161 This #undef was "temporary" in 2000; it is no longer needed
9162 now that '#define static' has gone away.
9163 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9164 (gray_bitmap_bits): Remove; no longer needed.
9165 All uses replaced with definiens.
9166 * xterm.c: Include "bitmaps/gray.xbm".
9167
9168 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 Clean up __executable_start, monstartup when --enable-profiling.
9171 The following changes affect the code only when profiling.
9172 * dispnew.c (__executable_start): Rename from safe_bcopy.
9173 Define only on platforms that need it.
9174 * emacs.c: Include <sys/gmon.h> when profiling.
9175 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9176 (__executable_start): Remove decl, since lisp.h does it now.
9177 (safe_bcopy): Remove decl; no longer has that name.
9178 (main): Coalesce #if into single bit of code, for simplicity.
9179 Cast pointers to uintptr_t, since standard libraries want integers
9180 and not pointers.
9181 * lisp.h (__executable_start): New decl.
9182
9183 2012-05-31 Glenn Morris <rgm@gnu.org>
9184
9185 * image.c (Fimagemagick_types): Doc fix.
9186
9187 2012-05-30 Jim Meyering <meyering@redhat.com>
9188
9189 * callproc.c (Fcall_process_region): Include directory component
9190 in mkstemp error message (Bug#11586).
9191
9192 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9193
9194 * alloc.c, lisp.h (make_pure_vector): Now static.
9195
9196 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9197
9198 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9199 Move to byte-run.el.
9200 (Fautoload): Do the hash-doc more carefully.
9201 * data.c (Fdefalias): Purify definition, except for keymaps.
9202 (Qdefun): Move from eval.c.
9203 * lisp.h (Qdefun): Remove.
9204 * lread.c (read1): Tiny simplification.
9205
9206 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9207
9208 Do not create empty overlays with the evaporate property (Bug#9642).
9209 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9210 Bug#9642, but explicitly check that the buffer the overlay would
9211 be moved to is live and rearrange lines to make sure that errors
9212 will not put the overlay in an inconsistent state.
9213 (Fdelete_overlay): Cosmetics.
9214
9215 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9216
9217 * w32term.c (my_bring_window_to_top): New function.
9218 (x_raise_frame): Use handle returned by DeferWindowPos, which
9219 could be different from the original one.
9220 Call my_bring_window_to_top instead of my_set_foreground_window.
9221 (Bug#11513)
9222
9223 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9224 by calling BringWindowToTop.
9225
9226 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9227 (WM_EMACS_END): Increase by one.
9228
9229 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9230
9231 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9232 This avoids undefined behavior that might cause the eassert
9233 to not catch an out-of-range value.
9234
9235 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9236
9237 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9238 Update dependencies.
9239
9240 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9241
9242 * bidi.c (bidi_mirror_char): Fix last change.
9243
9244 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9245
9246 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9247 when referring to sectname field in printf format.
9248
9249 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9252 Only r_alloc_inhibit_buffer_relocation needed to be added;
9253 the others were already declared.
9254
9255 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9256 before checking whether it's out of range. Put the check inside
9257 eassert. See
9258 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9259
9260 2012-05-27 Ken Brown <kbrown@cornell.edu>
9261
9262 * callproc.c (Fcall_process): Restore a line that was accidentally
9263 commented out in the 2011-02-13 change (bug#11547).
9264
9265 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9266
9267 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9268 defined on ralloc.c.
9269
9270 * buffer.c [REL_ALLOC]: Remove prototypes of
9271 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9272 they are now on lisp.h.
9273
9274 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9275
9276 * search.c (search_buffer): Use it to inhibit relocation of buffer
9277 text while re_search_2 is doing its job, because re_search_2 is
9278 passed C pointers to buffer text. (Bug#11519)
9279
9280 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9281 Update value to 24.
9282
9283 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9284 state after an additional call to move_it_in_display_line_to, keep
9285 the values of it->max_ascent and it->max_descent found for the
9286 entire line.
9287 (pos_visible_p): Revert the comparison against bottom_y to what it
9288 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9289 (Bug#11464)
9290
9291 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9292
9293 Fix coding-related core dumps with gcc -ftrapv.
9294 The code was computing A - B, where A and B are pointers, and B is
9295 random garbage. This can lead to core dumps on platforms that
9296 have special pointer registers, and it also leads to core dumps on
9297 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9298 A - B only when B is initialized properly.
9299 * coding.c (coding_set_source, coding_set_destination): Return void.
9300 (coding_change_source, coding_change_destinations): New functions,
9301 with the old behaviors of coding_set_source and coding_set_destination.
9302 All callers that need an offset changed to use these new functions.
9303
9304 2012-05-26 Glenn Morris <rgm@gnu.org>
9305
9306 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9307
9308 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9309
9310 Extend mouse support on W32 text-mode console.
9311 * xdisp.c (draw_row_with_mouse_face):
9312 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9313
9314 * w32console.c: Include window.h.
9315 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9316 New functions.
9317 (initialize_w32_display): Initialize mouse-highlight data.
9318
9319 * w32inevt.c: Include termchar.h and window.h.
9320 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9321 moves, call note_mouse_highlight. If help_echo changed, call
9322 gen_help_event to produce help-echo message in the echo area.
9323 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9324 highlight info.
9325
9326 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9327
9328 * lread.c (read1): Simplify slightly to avoid an overflow warning
9329 with GCC 4.7.0 on x86-64.
9330
9331 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9332
9333 * bidi.c (bidi_mirror_char): Revert last change: an int is
9334 definitely wide enough here.
9335
9336 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9337
9338 Fix integer width and related bugs (Bug#9874).
9339 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9340 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9341 (string_bytes, check_sblock, allocate_string_data):
9342 (compact_small_strings, Fmake_bool_vector, make_string)
9343 (make_unibyte_string, make_multibyte_string)
9344 (make_string_from_bytes, make_specified_string)
9345 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9346 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9347 (mark_vectorlike):
9348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9349 (allocate_pseudovector):
9350 Use int, not EMACS_INT, where int is wide enough.
9351 (inhibit_garbage_collection, Fgarbage_collect):
9352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9353 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9354 int might not be wide enough.
9355 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9356 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9357 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9358 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9359 (bidi_level_of_next_char, bidi_move_to_visually_next):
9360 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9361 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9362 (Fkill_buffer, Fset_buffer_major_mode)
9363 (advance_to_char_boundary, Fbuffer_swap_text)
9364 (Fset_buffer_multibyte, overlays_at, overlays_in)
9365 (overlay_touches_p, struct sortvec, record_overlay_string)
9366 (overlay_strings, recenter_overlay_lists)
9367 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9368 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9369 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9370 (Foverlay_recenter, last_overlay_modification_hooks_used)
9371 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9373 (validate_region): Omit unnecessary test for b <= e,
9374 since that's guaranteed by the previous test.
9375 (adjust_overlays_for_delete): Avoid pos + length overflow.
9376 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9377 (report_overlay_modification):
9378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9379 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9380 Omit pointer cast, which isn't needed anyway, and doesn't work
9381 after the EMACS_INT -> ptrdiff_t change.
9382 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9383 * buffer.h: Adjust decls to match defn changes elsewhere.
9384 (struct buffer_text, struct buffer):
9385 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9386 Use EMACS_INT, not int, where int might not be wide enough.
9387 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9388 not int, to avoid needless 32-bit limit on 64-bit hosts.
9389 (exec_byte_code): Use tighter memory-full test, one that checks
9390 for alloca overflow. Don't compute the address of the object just
9391 before an array, as that's not portable. Use EMACS_INT, not
9392 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9393 * callint.c (Fcall_interactively):
9394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9395 * callproc.c (call_process_kill, Fcall_process):
9396 Don't assume pid_t fits into an Emacs fixnum.
9397 (call_process_cleanup, Fcall_process, child_setup):
9398 Don't assume pid_t fits into int.
9399 (call_process_cleanup, Fcall_process, delete_temp_file)
9400 (Fcall_process_region):
9401 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9402 (Fcall_process): Simplify handling of volatile integers.
9403 Use int, not EMACS_INT, where int will do.
9404 * casefiddle.c (casify_object, casify_region, operate_on_word)
9405 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9407 (casify_object): Avoid integer overflow when overallocating buffer.
9408 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9409 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9410 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9411 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9412 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9413 integers are now checked earlier. All uses replaced with XINT.
9414 (ccl_driver):
9415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9416 For CCL_MapSingle, check that content and value are in int range.
9417 (ccl_driver, Fregister_code_conversion_map):
9418 Check that Vcode_version_map_vector is a vector.
9419 (resolve_symbol_ccl_program): Check that vector header is in range.
9420 Always copy the vector, so that we can check its contents reliably
9421 now rather than having to recheck each instruction as it's being
9422 executed. Check that vector words fit in 'int'.
9423 (ccl_get_compiled_code, Fregister_ccl_program)
9424 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9425 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9426 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9427 contents are in range.
9428 (Fccl_execute_on_string): Check that status is in range.
9429 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9430 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9431 Accept and return EMACS_INT, not int, because callers can pass values
9432 out of 'int' range.
9433 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9434 (multibyte_chars_in_text, parse_str_as_multibyte)
9435 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9436 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9437 (string_escape_byte8, Fget_byte):
9438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9439 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9440 avoid mishandling large integers.
9441 * character.h: Adjust decls to match defn changes elsewhere.
9442 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9443 (Ffind_charset_region):
9444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9445 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9446 (load_charset_map_from_vector, Fdefine_charset_internal):
9447 Don't assume fixnum fits in int.
9448 (load_charset_map_from_vector, Fmap_charset_chars):
9449 Remove now-unnecessary CHECK_NATNUMs.
9450 (Fdefine_charset_internal): Check ranges here, more carefully.
9451 Don't rely on undefined behavior with signed left shift overflow.
9452 Don't assume unsigned int fits into fixnum, or that fixnum fits
9453 into unsigned int. Don't require max_code to be a valid fixnum;
9454 that's not true for gb10830 4-byte on a 32-bit host. Allow
9455 invalid_code to be a cons, for the same reason. Require code_offset
9456 to be a character. Avoid int overflow if max_char is close
9457 to INT_MAX.
9458 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9459 this is intended anyway and avoids some undefined behavior.
9460 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9461 INDEX_TO_CODE_POINT, as that's what it expects.
9462 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9463 * charset.h (DECODE_CHAR): Return int, not unsigned;
9464 this is what was intended anyway, and it avoids undefined behavior.
9465 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9466 integer-overflow issues.
9467 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9468 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9469 where the argument is EMACS_INT, and this behavior is not intended.
9470 * chartab.c (Fmake_char_table, Fset_char_table_range)
9471 (uniprop_get_decoder, uniprop_get_encoder):
9472 Don't assume fixnum fits in int.
9473 * cmds.c (move_point): New function, that does the gist of
9474 Fforward_char and Fbackward_char, but does so while checking
9475 for integer overflow more accurately.
9476 (Fforward_char, Fbackward_char): Use it.
9477 (Fforward_line, Fend_of_line, internal_self_insert)
9478 (internal_self_insert):
9479 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9480 Fix a FIXME, by checking for integer overflow when calculating
9481 target_clm and actual_clm.
9482 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9483 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9484 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9485 (coding_alloc_by_making_gap, alloc_destination)
9486 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9487 (encode_coding_utf_16, detect_coding_emacs_mule)
9488 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9489 (detect_coding_iso_2022, decode_coding_iso_2022)
9490 (encode_invocation_designation, encode_designation_at_bol)
9491 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9492 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9493 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9494 (encode_coding_ccl, encode_coding_raw_text)
9495 (detect_coding_charset, decode_coding_charset)
9496 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9497 (produce_composition, produce_charset, produce_annotation)
9498 (decode_coding, handle_composition_annotation)
9499 (handle_charset_annotation, consume_chars, decode_coding_gap)
9500 (decode_coding_object, encode_coding_object, detect_coding_system)
9501 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9502 (code_convert_region, code_convert_string)
9503 (Fdefine_coding_system_internal)
9504 (coding_set_source, coding_set_destination):
9505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9506 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9507 (Fdefine_coding_system_internal):
9508 Don't assume fixnums fit in int.
9509 (decode_coding_gap, decode_coding_object, encode_coding_object)
9510 (Fread_coding_system, Fdetect_coding_region)
9511 (Funencodable_char_position, Fcheck_coding_systems_region)
9512 (get_translation, handle_composition_annotation, consume_chars):
9513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9514 (consume_chars): Rewrite to not calculate an address outside buffer.
9515 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9516 Don't access memory outside of the args array.
9517 (Fdefine_coding_system_internal): Check for charset-id overflow.
9518 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9519 result of ENCODE_CHAR.
9520 * coding.h: Adjust decls to match defn changes elsewhere.
9521 (struct coding_system):
9522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9523 * composite.c (get_composition_id, find_composition)
9524 (run_composition_function, update_compositions)
9525 (compose_text, composition_gstring_put_cache)
9526 (composition_gstring_p, composition_gstring_width)
9527 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9528 (composition_compute_stop_pos, composition_reseat_it)
9529 (composition_update_it, struct position_record)
9530 (find_automatic_composition, composition_adjust_point)
9531 (Fcomposition_get_gstring, Ffind_composition_internal):
9532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9533 (update_compositions):
9534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9535 * composite.h: Adjust decls to match defn changes elsewhere.
9536 (struct composition):
9537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9538 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9539 Do not attempt to compute the address of the object just before a
9540 buffer; this is not portable.
9541 (Faref, Faset):
9542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9543 (Faset): Use int, not EMACS_INT, where int is wide enough.
9544 (Fstring_to_number): Don't assume fixnums fit in int.
9545 (Frem): Don't assume arg is nonnegative.
9546 * dbusbind.c (xd_append_arg): Check for integers out of range.
9547 (Fdbus_call_method): Don't overflow the timeout int.
9548 (extract_signed, extract_unsigned): New functions.
9549 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9550 (xd_get_connection_references): Return ptrdiff_t, not int.
9551 All uses changed.
9552 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9553 (xd_read_message_1):
9554 Use int, not unsigned, where the dbus API uses int.
9555 (Fdbus_message_internal): Don't overflow mtype.
9556 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9557 * dired.c (directory_files_internal, file_name_completion, scmp)
9558 (file_name_completion_stat):
9559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9560 (file_name_completion): Don't overflow matchcount.
9561 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9562 * dispextern.h: Adjust decls to match defn changes elsewhere.
9563 (struct text_pos, struct glyph, struct bidi_saved_info)
9564 (struct bidi_string_data, struct bidi_it, struct composition_it)
9565 (struct it):
9566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9567 (struct display_pos, struct composition_it, struct it):
9568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9569 * dispnew.c (increment_matrix_positions)
9570 (increment_row_positions, mode_line_string)
9571 (marginal_area_string):
9572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9573 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9575 (duration_to_sec_usec): New function, to check for overflow better.
9576 (Fsleep_for, sit_for): Use it.
9577 * doc.c (get_doc_string, store_function_docstring):
9578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9579 (get_doc_string, Fsnarf_documentation):
9580 Use int, not EMACS_INT, where int is wide enough.
9581 (get_doc_string):
9582 Use SAFE_ALLOCA, not alloca.
9583 Check for overflow when converting EMACS_INT to off_t.
9584 * doprnt.c (doprnt):
9585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9586 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9587 Don't assume uid_t fits into fixnum.
9588 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9589 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9590 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9591 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9592 (general_insert_function)
9593 (Finsert_char, make_buffer_string, make_buffer_string_both)
9594 (update_buffer_properties, Fbuffer_substring)
9595 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9596 (Fsubst_char_in_region, check_translation)
9597 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9598 (transpose_markers, Ftranspose_regions):
9599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9600 (clip_to_bounds): Move to lisp.h as an inline function).
9601 (Fconstrain_to_field): Don't assume integers are nonnegative.
9602 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9603 (Fsubst_char_in_region, Fsave_restriction):
9604 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9605 (Femacs_pid): Don't assume pid_t fits into fixnum.
9606 (lo_time): Use int, not EMACS_INT, when int suffices.
9607 (lisp_time_argument): Check for usec out of range.
9608 (Fencode_time): Don't assume fixnum fits in int.
9609 (Fuser_login_name, Fuser_full_name): Signal an error
9610 if a uid argument is out of range, rather than relying on
9611 undefined behavior.
9612 (Fformat_time_string): Remove now-unnecessary check.
9613 lisp_time_argument checks for out-of-range usec now.
9614 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9615 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9616 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9617 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9618 (init_cmdargs, Fdump_emacs):
9619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9620 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9621 the bottom (typically) 32 bits of the fixnum.
9622 * eval.c (specpdl_size, call_debugger):
9623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9624 (when_entered_debugger, Fbacktrace_debug):
9625 Don't assume fixnum can fit in int.
9626 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9627 the object just before a buffer; this is not portable.
9628 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9629 (grow_specpdl, unbind_to):
9630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9631 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9632 (grow_specpdl): Simplify allocation by using xpalloc.
9633 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9634 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9635 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9637 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9638 (a_write, e_write):
9639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9640 (Fcopy_file, non_regular_nbytes, read_non_regular)
9641 (Finsert_file_contents):
9642 Use int, not EMACS_INT, where int is wide enough.
9643 (READ_BUF_SIZE): Verify that it fits in int.
9644 (Finsert_file_contents): Check that counts are in proper range,
9645 rather than assuming fixnums fit into ptrdiff_t etc.
9646 Don't assume fixnums fit into int.
9647 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9648 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9649 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9650 (string_char_to_byte, string_byte_to_char)
9651 (string_make_multibyte, string_to_multibyte)
9652 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9653 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9654 (substring_both, Fdelete, internal_equal, Ffillarray)
9655 (Fclear_string, mapcar1)
9656 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9657 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9658 (larger_vector, make_hash_table, maybe_resize_hash_table)
9659 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9660 (Fmaphash, secure_hash):
9661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9662 (concat): Check for string index and length overflow.
9663 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9664 (Frequire):
9665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9666 (larger_vector): New API (vec, incr_min, size_max) replaces old
9667 one (vec, new_size, init). This catches size overflow.
9668 INIT was removed because it was always Qnil.
9669 All callers changed.
9670 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9671 the upper bound on a hash table index size.
9672 (make_hash_table, maybe_resize_hash_table): Use it.
9673 (secure_hash): Computer start_byte and end_byte only after
9674 they're known to be in ptrdiff_t range.
9675 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9676 (Ffont_get_glyphs, Ffont_at):
9677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9678 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9679 (Flist_fonts, Fopen_font):
9680 Don't assume fixnum can fit in int.
9681 (check_gstring): Don't assume index can fit in int.
9682 (font_match_p): Check that fixnum is a character, not a nonnegative
9683 fixnum, since the later code needs to stuff it into an int.
9684 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9685 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9686 conversion overflow issues.
9687 (Fopen_font): Check for integer out of range.
9688 (Ffont_get_glyphs): Don't assume index can fit in int.
9689 * font.h: Adjust decls to match defn changes elsewhere.
9690 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9691 integer overflow.
9692 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9693 printmax_t, where ptrdiff_t is wide enough.
9694 (Finternal_char_font):
9695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9696 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9697 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9698 (Fset_frame_position, x_set_frame_parameters)
9699 (x_set_line_spacing, x_set_border_width)
9700 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9701 Check that fixnums are in proper range for system types.
9702 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9704 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9705 Use SAFE_ALLOCA_LISP, not alloca.
9706 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9707 intptr_t is wide enough.
9708 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9709 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9710 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9711 Check for fixnum out of range.
9712 * ftfont.c (ftfont_list): Don't assume index fits in int.
9713 Check that fixnums are in proper range for system types.
9714 (ftfont_shape_by_flt):
9715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9716 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9718 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9719 Check that fixnums are in proper range for system types.
9720 * gnutls.h: Adjust decls to match defn changes elsewhere.
9721 * gtkutil.c (xg_dialog_run):
9722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9723 (update_frame_tool_bar):
9724 Check that fixnums are in proper range for system types.
9725 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9726 (lookup_image): Check that fixnums are in range for system types.
9727 * indent.c (last_known_column, last_known_column_point):
9728 (current_column_bol_cache):
9729 (skip_invisible, current_column, check_display_width):
9730 (check_display_width, scan_for_column, current_column_1)
9731 (Findent_to, Fcurrent_indentation, position_indentation)
9732 (indented_beyond_p, Fmove_to_column, compute_motion):
9733 (Fcompute_motion, Fvertical_motion):
9734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9735 (last_known_column_modified): Use EMACS_INT, not int.
9736 (check_display_width):
9737 (Fcompute_motion):
9738 Check that fixnums and floats are in proper range for system types.
9739 (compute_motion): Don't assume index or fixnum fits in int.
9740 (compute_motion, Fcompute_motion):
9741 Use int, not EMACS_INT, when it is wide enough.
9742 (vmotion): Omit local var start_hpos that is always 0; that way
9743 we don't need to worry about overflow in expressions involving it.
9744 * indent.h: Adjust decls to match defn changes elsewhere.
9745 (struct position):
9746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9747 Use int, not EMACS_INT, where int is wide enough.
9748 Remove unused members ovstring_chars_done and tab_offset;
9749 all uses removed.
9750 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9751 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9752 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9753 (make_gap, copy_text, insert, insert_and_inherit)
9754 (insert_before_markers, insert_before_markers_and_inherit)
9755 (insert_1, count_combining_before, count_combining_after)
9756 (insert_1_both, insert_from_string)
9757 (insert_from_string_before_markers, insert_from_string_1)
9758 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9759 (adjust_after_replace, adjust_after_insert, replace_range)
9760 (replace_range_2, del_range, del_range_1, del_range_byte)
9761 (del_range_both, del_range_2, modify_region)
9762 (prepare_to_modify_buffer, signal_before_change)
9763 (signal_after_change, Fcombine_after_change_execute):
9764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9765 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9766 (balance_an_interval, split_interval_right, split_interval_left)
9767 (find_interval, next_interval, update_interval)
9768 (adjust_intervals_for_insertion, delete_node, delete_interval)
9769 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9770 (static_offset_intervals, offset_intervals)
9771 (merge_interval_right, merge_interval_left, make_new_interval)
9772 (graft_intervals_into_buffer, temp_set_point_both)
9773 (temp_set_point, set_point, adjust_for_invis_intang)
9774 (set_point_both, move_if_not_intangible, get_property_and_range)
9775 (get_local_map, copy_intervals, copy_intervals_to_string)
9776 (compare_string_intervals, set_intervals_multibyte_1):
9777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9778 * intervals.h: Adjust decls to match defn changes elsewhere.
9779 (struct interval):
9780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9781 * keyboard.c (this_command_key_count, this_single_command_key_start)
9782 (before_command_key_count, before_command_echo_length, echo_now)
9783 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9784 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9785 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9786 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9788 (last_non_minibuf_size, last_point_position, echo_truncate)
9789 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9790 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9791 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9792 (stuff_buffered_input):
9793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9794 (last_auto_save, command_loop_1, read_char):
9795 Use EMACS_INT, not int, to avoid integer overflow.
9796 (record_char): Avoid overflow in total_keys computation.
9797 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9798 * keyboard.h: Adjust decls to match defn changes elsewhere.
9799 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9800 (Fkey_description, Fdescribe_vector, Flookup_key):
9801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9802 (click_position): New function, to check that positions are in range.
9803 (Fcurrent_active_maps):
9804 (describe_command):
9805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9806 (Faccessible_keymaps, Fkey_description):
9807 (preferred_sequence_p):
9808 Don't assume fixnum can fit into int.
9809 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9810 Check for integer overflow in size calculations.
9811 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9812 avoid mishandling large integers.
9813 * lisp.h: Adjust decls to match defn changes elsewhere.
9814 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9815 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9816 (struct Lisp_Marker):
9817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9818 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9819 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9820 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9821 All callers changed.
9822 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9823 Assume the arg has valid form, since it always does.
9824 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9825 unsigned integer system type.
9826 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9827 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9829 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9830 (duration_to_sec_usec): New decl.
9831 * lread.c (read_from_string_index, read_from_string_index_byte)
9832 (read_from_string_limit, readchar, unreadchar, openp)
9833 (read_internal_start, read1, oblookup):
9834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9835 (Fload, readevalloop, Feval_buffer, Feval_region):
9836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9837 (openp): Check for out-of-range argument to 'access'.
9838 (read1): Use int, not EMACS_INT, where int is wide enough.
9839 Don't assume fixnum fits into int.
9840 Fix off-by-one error that can read outside a buffer.
9841 (read_filtered_event): Use duration_to_sec_usec
9842 to do proper overflow checking on durations.
9843 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9844 in size calculation.
9845 (Fexecute_kbd_macro):
9846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9847 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9848 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9849 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9850 (set_marker_both, set_marker_restricted_both, marker_position)
9851 (marker_byte_position, Fbuffer_has_markers_at):
9852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9853 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9854 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9855 It now merely ensures that the menu is large enough, without
9856 necessarily growing it, as this avoids some integer overflow issues.
9857 All callers changed.
9858 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9859 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9860 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9861 Use SAFE_ALLOCA_LISP, not alloca.
9862 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9863 to EMACS_INT. Check that fixnums are in proper range for system types.
9864 * minibuf.c (minibuf_prompt_width, string_to_object)
9865 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9866 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9867 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9868 (get_minibuffer, read_minibuf_unwind):
9869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9870 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9871 this simplifies overflow checking. All callers changed.
9872 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9873 (Ftest_completion):
9874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9875 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9876 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9877 Check that fixnums are in proper range for system types.
9878 (Fx_create_frame, Fx_show_tip):
9879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9880 * nsfont.m (ns_findfonts, nsfont_list_family):
9881 Don't assume fixnum fits in long.
9882 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9884 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9885 wide enough.
9886 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9887 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9888 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9889 (PRINTDECLARE, PRINTPREPARE):
9890 (strout, print_string):
9891 (print, print_preprocess, print_check_string_charset_prop)
9892 (print_object):
9893 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9894 (PRINTDECLARE):
9895 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9897 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9898 (printchar, strout): Use xpalloc to catch size calculation overflow.
9899 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9900 (print_error_message): Use SAFE_ALLOCA, not alloca.
9901 (print_object): Use int, not EMACS_INT, where int is wide enough.
9902 (print_depth, new_backquote_output, print_number_index):
9903 Use ptrdiff_t, not int, where int might not be wide enough.
9904 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9905 (Fset_process_window_size, Fformat_network_address)
9906 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9907 (sigchld_handler):
9908 Check that fixnums are in proper range for system types.
9909 (Fsignal_process): Simplify by avoiding a goto.
9910 Check for process-ids out of pid_t range rather than relying on
9911 undefined behavior.
9912 (process_tick, update_tick): Use EMACS_INT, not int.
9913 (Fformat_network_address, read_process_output, send_process)
9914 (Fprocess_send_region, status_notify):
9915 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9916 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9917 (wait_reading_process_output, read_process_output, exec_sentinel):
9918 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9919 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9920 (Faccept_process_output): Use duration_to_sec_usec to do proper
9921 overflow checking on durations.
9922 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9923 Don't assume pid_t fits in int.
9924 * process.h (struct Lisp_Process): Members tick and update_tick
9925 are now of type EMACS_INT, not int.
9926 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9927 configured --with-wide-int.
9928 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9929 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9930 * search.c (looking_at_1, string_match_1):
9931 (fast_string_match, fast_c_string_match_ignore_case)
9932 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9933 (scan_newline, find_before_next_newline, search_command)
9934 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9935 (set_search_regs, wordify):
9936 (Freplace_match):
9937 (Fmatch_data):
9938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9939 (string_match_1, search_buffer, set_search_regs):
9940 (Fmatch_data):
9941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9942 (wordify): Check for overflow in size calculation.
9943 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9944 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9945 Check that fixnums are in proper range for system types.
9946 * sound.c (struct sound_device)
9947 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9949 (Fplay_sound_internal):
9950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9951 * syntax.c (struct lisp_parse_state, find_start_modiff)
9952 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9953 (Fparse_partial_sexp):
9954 Don't assume fixnums can fit in int.
9955 (struct lisp_parse_state, find_start_pos, find_start_value)
9956 (find_start_value_byte, find_start_begv)
9957 (update_syntax_table, char_quoted, dec_bytepos)
9958 (find_defun_start, prev_char_comend_first, back_comment):
9959 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9960 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9962 (Finternal_describe_syntax_value): Check that match_lisp is a
9963 character, not an integer, since the code stuffs it into int.
9964 (scan_words, scan_sexps_forward):
9965 Check that fixnums are in proper range for system types.
9966 (Fforward_word):
9967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9968 (scan_sexps_forward):
9969 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9970 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9971 * syntax.h: Adjust decls to match defn changes elsewhere.
9972 (struct gl_state_s):
9973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9974 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9975 MOST_POSITIVE_FIXNUM.
9976 * sysdep.c (wait_for_termination_1, wait_for_termination)
9977 (interruptible_wait_for_termination, mkdir):
9978 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9979 (emacs_read, emacs_write):
9980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9981 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9982 and double all fit in int.
9983 * term.c (set_tty_color_mode):
9984 Check that fixnums are in proper range for system types.
9985 * termhooks.h (struct input_event):
9986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9987 * textprop.c (validate_interval_range, interval_of)
9988 (Fadd_text_properties, set_text_properties_1)
9989 (Fremove_text_properties, Fremove_list_of_text_properties)
9990 (Ftext_property_any, Ftext_property_not_all)
9991 (copy_text_properties, text_property_list, extend_property_ranges)
9992 (verify_interval_modification):
9993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9994 (Fnext_single_char_property_change)
9995 (Fprevious_single_char_property_change):
9996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9997 (copy_text_properties):
9998 Check for integer overflow in index calculation.
9999 * undo.c (last_boundary_position, record_point, record_insert)
10000 (record_delete, record_marker_adjustment, record_change)
10001 (record_property_change):
10002 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10003 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10005 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10006 (Fx_hide_tip, Fx_file_dialog):
10007 * w32menu.c (set_frame_menubar):
10008 Use ptrdiff_t, not int, for consistency with rest of code.
10009 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10010 (select_window, Fdelete_other_windows_internal)
10011 (window_scroll_pixel_based, window_scroll_line_based)
10012 (Frecenter, Fset_window_configuration):
10013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10014 (Fset_window_hscroll, run_window_configuration_change_hook)
10015 (set_window_buffer, temp_output_buffer_show, scroll_command)
10016 (Fscroll_other_window, Frecenter):
10017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10018 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10019 Don't assume fixnum fits in int.
10020 (Fset_window_scroll_bars):
10021 Check that fixnums are in proper range for system types.
10022 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10023 (string_pos, c_string_pos, number_of_chars, init_iterator)
10024 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10025 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10026 (compute_display_string_end, handle_face_prop)
10027 (face_before_or_after_it_pos, handle_invisible_prop)
10028 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10029 (display_prop_intangible_p, string_buffer_position_lim)
10030 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10031 (get_overlay_strings_1, get_overlay_strings)
10032 (iterate_out_of_display_property, forward_to_next_line_start)
10033 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10034 (get_next_display_element, set_iterator_to_next)
10035 (get_visually_first_element, compute_stop_pos_backwards)
10036 (handle_stop_backwards, next_element_from_buffer)
10037 (move_it_in_display_line_to, move_it_in_display_line)
10038 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10039 (add_to_log, message_dolog, message_log_check_duplicate)
10040 (message2, message2_nolog, message3, message3_nolog
10041 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10042 (current_message_1, truncate_echo_area, truncate_message_1)
10043 (set_message, set_message_1, store_mode_line_noprop)
10044 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10045 (text_outside_line_unchanged_p, check_point_in_composition)
10046 (reconsider_clip_changes)
10047 (redisplay_internal, set_cursor_from_row, try_scrolling)
10048 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10049 (redisplay_window, find_last_unchanged_at_beg_row)
10050 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10051 (trailing_whitespace_p, find_row_edges, display_line)
10052 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10053 (display_mode_element, store_mode_line_string)
10054 (pint2str, pint2hrstr, decode_mode_spec)
10055 (display_count_lines, display_string, draw_glyphs)
10056 (x_produce_glyphs, x_insert_glyphs)
10057 (rows_from_pos_range, mouse_face_from_buffer_pos)
10058 (fast_find_string_pos, mouse_face_from_string_pos)
10059 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10061 (safe_call, init_from_display_pos, handle_fontified_prop)
10062 (handle_single_display_spec, load_overlay_strings)
10063 (with_echo_area_buffer, setup_echo_area_for_printing)
10064 (display_echo_area, echo_area_display)
10065 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10066 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10067 (redisplay_window, dump_glyph_row, display_mode_line)
10068 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10069 (handle_display_spec, display_prop_string_p):
10070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10071 (handle_single_display_spec, build_desired_tool_bar_string)
10072 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10073 (get_specified_cursor_type):
10074 Check that fixnums are in proper range for system types.
10075 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10076 (Flookup_image_map):
10077 Don't assume fixnums fit in int.
10078 (compare_overlay_entries):
10079 Avoid mishandling comparisons due to subtraction overflow.
10080 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10081 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10082 (handle_tool_bar_click):
10083 Use int, not unsigned, since we prefer signed and the signedness
10084 doesn't matter here.
10085 (get_next_display_element, next_element_from_display_vector):
10086 Use int, not EMACS_INT, when int is wide enough.
10087 (start_hourglass): Use duration_to_sec_usec to do proper
10088 overflow checking on durations.
10089 * xfaces.c (Fbitmap_spec_p):
10090 Check that fixnums are in proper range for system types.
10091 (compare_fonts_by_sort_order):
10092 Avoid mishandling comparisons due to subtraction overflow.
10093 (Fx_family_fonts, realize_basic_faces):
10094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10095 (Fx_family_fonts):
10096 Don't assume fixnum fits in int.
10097 Use SAFE_ALLOCA_LISP, not alloca.
10098 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10099 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10100 (face_at_buffer_position, face_for_overlay_string)
10101 (face_at_string_position):
10102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10103 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10104 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10105 (Fx_show_tip):
10106 Check that fixnums are in proper range for system types.
10107 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10108 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10109 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10110 (Fx_change_window_property): Don't assume fixnums fit in int.
10111 * xfont.c (xfont_chars_supported):
10112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10113 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10114 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10116 * xml.c (parse_region):
10117 * xrdb.c (magic_file_p):
10118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10119 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10120 (x_get_local_selection, x_reply_selection_request)
10121 (x_handle_selection_request, wait_for_property_change):
10122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10123 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10124 short is wide enough.
10125 (x_send_client_event): Don't assume fixnum fits in int.
10126 * xterm.c (x_x_to_emacs_modifiers):
10127 Don't assume EMACS_INT overflows nicely into int.
10128 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10129 may come from Lisp.
10130 (handle_one_xevent): NATNUMP can eval its arg twice.
10131 (x_connection_closed):
10132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10133 * xterm.h: Adjust decls to match defn changes elsewhere.
10134 (struct scroll_bar): Use struct vectorlike_header
10135 rather than rolling our own approximation.
10136 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10137
10138 2012-05-25 Glenn Morris <rgm@gnu.org>
10139
10140 * lisp.mk (lisp): Update for more files being compiled now.
10141
10142 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10143
10144 * lread.c: Remove `read_pure' which makes no difference.
10145 (read_pure): Remove var.
10146 (unreadpure): Remove function.
10147 (readevalloop): Don't call read_list with -1 flag.
10148 (read1, read_vector): Don't test read_pure any more.
10149 (read_list): Simplify.
10150
10151 * fileio.c, character.h: Minor style tweaks.
10152
10153 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10154
10155 * window.h (clip_changed): Remove useless declaration.
10156
10157 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10158
10159 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10160 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10161
10162 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10163
10164 Remove src/m/*.
10165 This directory predates autoconf and is no longer needed nowadays.
10166 Move its few remaining bits of functionality to where they're needed.
10167 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10168 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10169 * m/template.h: Remove.
10170 * Makefile.in (M_FILE): Remove. All uses removed.
10171 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10172 * lisp.h (USE_LSB_TAG):
10173 * mem-limits.h (EXCEEDS_LISP_PTR):
10174 Use VAL_MAX, not VALBITS, in #if.
10175 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10176 (EMACS_UINT): Define unconditionally now.
10177 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10178 (BITS_PER_EMACS_INT): New constants, replacing
10179 what used to be in config.h, but not useful in #if.
10180 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10181 define them any more.
10182 (VAL_MAX): New macro.
10183 (VALMASK): Use it.
10184 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10185 BITS_PER_EMACS_INT, in #if.
10186 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10187 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10188 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10189 * s/ms-w32.h (DATA_START):
10190 Move here from removed file m/intel386.h.
10191 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10192 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10193
10194 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10195
10196 Assume C89 or later.
10197 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10198 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10199 (xrealloc):
10200 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10201 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10202 * textprop.c, tparam.c (NULL): Remove.
10203 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10204 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10205 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10206 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10207 * xterm.c (input_signal_count): Assume volatile works.
10208
10209 2012-05-21 Ken Brown <kbrown@cornell.edu>
10210
10211 * xgselect.c (xg_select): Fix first argument in call to 'select'
10212 (bug#11508).
10213
10214 2012-05-20 Ken Brown <kbrown@cornell.edu>
10215
10216 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10217 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10218
10219 2012-05-19 Ken Brown <kbrown@cornell.edu>
10220
10221 * xfns.c (x_in_use): Remove `static' qualifier.
10222 * xterm.h (x_in_use): Declare.
10223 * xgselect.c: Include xterm.h.
10224 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10225 and `display_arg' (bug#9754).
10226
10227 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10228
10229 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10230
10231 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10232 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10233
10234 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10235
10236 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10237
10238 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10239 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10240
10241 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10242 reference to image_cache->refcount.
10243 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10244
10245 2012-05-17 Juri Linkov <juri@jurta.org>
10246
10247 * search.c (Fword_search_regexp, Fword_search_backward)
10248 (Fword_search_forward, Fword_search_backward_lax)
10249 (Fword_search_forward_lax): Move functions to isearch.el
10250 (bug#10145, bug#11381).
10251
10252 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10253
10254 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10255
10256 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10257
10258 * lread.c (init_obarray): Declare Qt and Qnil as special.
10259
10260 2012-05-14 Glenn Morris <rgm@gnu.org>
10261
10262 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10263 Put "libexec" before "bin", for the sake of init_callproc_1.
10264
10265 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10268
10269 * unexaix.c: Port to more-recent AIX compilers.
10270 (report_error, report_error_1, make_hdr, copy_sym)
10271 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10272 Make arguments const char *, not char *, to avoid violations of C
10273 standard and to fix some AIX warnings reported by Gilles Pion.
10274
10275 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10276
10277 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10278 already have overlays loaded.
10279 (handle_single_display_spec): Before returning without displaying
10280 fringe bitmap, synchronize the bidi iterator with the main display
10281 iterator, by calling iterate_out_of_display_property.
10282 (iterate_out_of_display_property): Detect buffer iteration by
10283 testing that it->string is a Lisp string.
10284 (get_next_display_element): When the current object is exhausted,
10285 and there's something on it->stack, call set_iterator_to_next to
10286 proceed with what's on the stack, instead of returning zero.
10287 (set_iterator_to_next): If called at the end of a Lisp string,
10288 proceed to consider_string_end without incrementing string
10289 position. Don't increment display vector index past the end of
10290 the display vector. (Bug#11417)
10291 (pos_visible_p): Don't report a position visible when move_it_to
10292 stopped at the last line of window, which happens to be scanned
10293 backwards by the bidi iteration. (Bug#11464)
10294
10295 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10296
10297 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10298 and right-margin display specs even if the spec is invalid or we
10299 are on a TTY, and thus unable to display on the fringes.
10300 That's because the text with the property will not be displayed anyway,
10301 so we need to signal to the caller that this is a "replacing"
10302 display spec. This fixes display when the spec is invalid or we
10303 are on a TTY.
10304
10305 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10306
10307 * unexaix.c (make_hdr): Fix typo in prototype.
10308 This bug broke the build on AIX. Problem reported by Gilles Pion.
10309
10310 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10311
10312 * keyboard.c (kbd_buffer_get_event): Read special events also in
10313 batch mode. (Bug#11415)
10314
10315 2012-05-12 Glenn Morris <rgm@gnu.org>
10316
10317 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10318
10319 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10320
10321 * lisp.mk (lisp): Add newcomment.elc.
10322
10323 2012-05-12 Glenn Morris <rgm@gnu.org>
10324
10325 * Makefile.in (MKDIR_P): New, set by configure.
10326 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10327
10328 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10329
10330 Remove unused function hourglass_started.
10331 * dispextern.h (hourglass_started):
10332 * w32fns.c (hourglass_started):
10333 * xdisp.c (hourglass_started): Remove.
10334
10335 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10336
10337 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10338 Update dependencies.
10339
10340 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 * xgselect.c (xg_select): Put maxfds+1 into a var.
10343 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10344
10345 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10346
10347 2012-05-10 Dave Abrahams <dave@boostpro.com>
10348
10349 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10350 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10351
10352 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10353
10354 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10355 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10356 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10357 Initialize xd_registered_buses.
10358
10359 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10360
10361 Untag more efficiently if USE_LSB_TAG.
10362 This is based on a proposal by YAMAMOTO Mitsuharu in
10363 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10364 For an admittedly artificial (nth 8000 longlist) benchmark on
10365 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10366 Emacs's overall text size by 1%.
10367 * lisp.h (XUNTAG): New macro.
10368 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10369 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10370 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10371 * eval.c (Fautoload):
10372 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10373 * frame.h (XFRAME): Use XUNTAG.
10374
10375 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10376 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10377 Remove unportable assumptions about print widths of types like
10378 dbus_uint32_t.
10379 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10380 intptr_t when converting between pointer and integer, to avoid GCC
10381 warnings about wrong width.
10382
10383 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10384
10385 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10386 stack for each reader_thread, instead of defaulting to 8MB
10387 determined by the linker. This avoids failures in creating
10388 subprocesses on Windows 7, see the discussion in this thread:
10389 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10390
10391 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10392
10393 Fix up display of the *Minibuf-0* buffer in the mini window.
10394 * keyboard.c (read_char): Don't clear the echo area if there's no
10395 message to clear.
10396 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10397 contents of *Minibuf-0*) if there's no message displayed in its stead.
10398
10399 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10400
10401 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10402 batch mode.
10403
10404 2012-05-06 Chong Yidong <cyd@gnu.org>
10405
10406 * lisp.mk (lisp): Update.
10407
10408 2012-05-05 Jim Meyering <meyering@redhat.com>
10409
10410 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10411
10412 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10413
10414 * data.c (PUT_ERROR): New macro.
10415 (syms_of_data): Use it. Add new error type `user-error'.
10416 * undo.c (user_error): New function.
10417 (Fprimitive_undo): Use it.
10418 * print.c (print_error_message): Adjust print style for `user-error'.
10419 * keyboard.c (user_error): New function.
10420 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10421
10422 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10423
10424 Do not limit current-time-string to years 1000..9999.
10425 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10426 (Fcurrent_time_string): Support any year that is supported by the
10427 underlying localtime representation. Don't use asctime, as it
10428 has undefined behavior for years outside the range -999..9999.
10429
10430 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10431
10432 Fix race conditions involving setenv, gmtime, localtime, asctime.
10433 Without this fix, interrupts could mess up code that uses these
10434 nonreentrant functions, since setting TZ invalidates existing
10435 tm_zone or tzname values, and since most of these functions return
10436 pointers to static storage.
10437 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10438 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10439 Grow the critical sections to include not just invoking
10440 localtime/gmtime, but also accessing these functions' results
10441 including their tm_zone values if any, and any related TZ setting.
10442 (format_time_string): Last arg is now struct tm *, not struct tm **,
10443 so that the struct tm is saved in the critical section.
10444 All callers changed. Simplify allocation of initial buffer, partly
10445 motivated by the fact that memory allocation needs to be outside
10446 the critical section.
10447
10448 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10449
10450 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10451 with RESET_INTERVAL.
10452
10453 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10454 Remove duplicated buffer name initialization.
10455
10456 2012-05-02 Jim Meyering <jim@meyering.net>
10457
10458 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10459
10460 * xfns.c (x_window): Use xstrdup (Bug#11375).
10461
10462 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10463
10464 * xdisp.c (pos_visible_p): If already at a newline from the
10465 display string before the 'while' loop, don't walk back the glyphs
10466 from it3.glyph_row. Solves assertion violation when the display
10467 string begins with a newline (egg.el). (Bug#11367)
10468
10469 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10470
10471 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10472 Move to simple.el.
10473
10474 2012-05-01 Glenn Morris <rgm@gnu.org>
10475
10476 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10477 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10478 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10479 All were removed before 23.1.
10480
10481 * dispnew.c: Remove HAVE_LIBNCURSES test;
10482 it is always true on relevant platforms.
10483
10484 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10485 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10486
10487 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10488
10489 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10490
10491 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10492 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10493 Remove.
10494
10495 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10496
10497 Do not avoid creating empty evaporating overlays (Bug#9642).
10498 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10499 That is, do not delete an evaporating overlay if it becomes
10500 empty after its bounds are adjusted to fit within its buffer.
10501 This fix caused other problems, and I'm reverting it until we get
10502 to the bottom of them.
10503
10504 2012-04-27 Chong Yidong <cyd@gnu.org>
10505
10506 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10507
10508 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10509
10510 * xdisp.c (pos_visible_p): If the window start position is beyond
10511 ZV, start the display from buffer beginning. Prevents assertion
10512 violation in init_iterator when the minibuffer window is scrolled
10513 via the scroll bar.
10514
10515 * window.c (window_scroll_pixel_based): Likewise.
10516
10517 2012-04-27 Chong Yidong <cyd@gnu.org>
10518
10519 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10520
10521 2012-04-27 Glenn Morris <rgm@gnu.org>
10522
10523 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10524 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10525
10526 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10527
10528 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10529 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10530
10531 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10532
10533 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10534 display element, check also the underlying string or buffer
10535 character. (Bug#11341)
10536
10537 * w32menu.c: Include w32heap.h.
10538 (add_menu_item): If the call to AppendMenuW (via
10539 unicode_append_menu) fails, disable Unicode menus only if we are
10540 running on Windows 9X/Me.
10541
10542 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10543
10544 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10545 (xgetint): Add missing shift for LSB tags.
10546
10547 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10548
10549 * keyboard.c (read_char): Don't wipe echo area for select window
10550 events: These might get delayed via `mouse-autoselect-window'
10551 (Bug#11304).
10552
10553 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10554
10555 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10556 manipulation of :loaded-from data.
10557
10558 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10559
10560 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10561 now a cons (bug#11311).
10562
10563 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10564
10565 Do not create empty overlays with the evaporate property (Bug#9642).
10566 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10567 if it becomes empty after its bounds are adjusted to fit within
10568 its buffer. Without this fix, in a nonempty buffer (let ((o
10569 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10570 yields an empty overlay that has the evaporate property, which is
10571 not supposed to happen.
10572
10573 Fix minor GTK3 problems found by static checking.
10574 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10575 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10576 (struct _EmacsFixedClass, emacs_fixed_get_type):
10577 Move decls here from emacsgtkfixed.h, since they needn't be public.
10578 (emacs_fixed_get_type): Now static.
10579 (emacs_fixed_class_init): Omit unused local.
10580 (emacs_fixed_child_type): Remove; unused.
10581 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10582 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10583 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10584 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10585 (EMACS_FIXED_GET_CLASS): Remove; unused.
10586 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10587
10588 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10589 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10590
10591 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10594 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10595 (__malloc_size_t, __malloc_ptrdiff_t):
10596 Remove. All uses removed, replaced by the definiens if needed,
10597 since we can assume C89 or better now.
10598 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10599 (protect_malloc_state, align, get_contiguous_space)
10600 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10601 (malloc_atfork_handler_child, malloc_enable_thread)
10602 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10603 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10604 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10605 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10606 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10607 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10608 Define using prototypes, not old style.
10609 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10610 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10611 (align): Don't assume that signed integer overflow wraps around.
10612 Omit unused local var.
10613 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10614 (_free_internal_nolock, memalign, mallochook, reallochook):
10615 Omit no-longer-needed casts.
10616 (valloc): Use getpagesize, not __getpagesize.
10617 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10618 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10619
10620 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10621
10622 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10623
10624 Move functions from C to Lisp. Make non-blocking method calls
10625 the default. Implement further D-Bus standard interfaces.
10626
10627 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10628 (QCdbus_request_name_allow_replacement)
10629 (QCdbus_request_name_replace_existing)
10630 (QCdbus_request_name_do_not_queue)
10631 (QCdbus_request_name_reply_primary_owner)
10632 (QCdbus_request_name_reply_in_queue)
10633 (QCdbus_request_name_reply_exists)
10634 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10635 (QCdbus_registered_serial, QCdbus_registered_method)
10636 (QCdbus_registered_signal): New Lisp objects.
10637 (XD_DEBUG_MESSAGE): Use sizeof.
10638 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10639 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10640 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10641 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10642 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10643 (xd_signature, xd_append_arg): Allow float for integer types.
10644 (xd_get_connection_references): New function.
10645 (xd_get_connection_address): Rename from xd_initialize.
10646 Return cached address.
10647 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10648 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10649 level.
10650 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10651 Return number of refcounts.
10652 (Fdbus_get_unique_name): Make stronger parameter check.
10653 (Fdbus_message_internal): New defun.
10654 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10655 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10656 (Fdbus_send_signal, Fdbus_register_service)
10657 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10658 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10659 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10660 (Vdbus_compiled_version, Vdbus_runtime_version)
10661 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10662 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10663 (Vdbus_message_type_signal): New defvars.
10664 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10665 Adapt docstring.
10666
10667 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10668
10669 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10670 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10671 Do not assume ptrdiff_t is the same width as 'int'.
10672
10673 * alloc.c: Handle unusual debugging option combinations.
10674 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10675 since the two debugging options are incompatible.
10676 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10677 is defined.
10678 (mem_init, mem_insert, mem_insert_fixup):
10679 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10680 (NEED_MEM_INSERT): Remove; no longer needed.
10681
10682 2012-04-22 Leo Liu <sdl.web@gmail.com>
10683
10684 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10685
10686 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10687
10688 * sysdep.c [__FreeBSD__]: Minor cleanups.
10689 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10690 Use Emacs indenting style more consistently. Avoid some casts.
10691 Use 'double' consistently rather than mixing 'float' and 'double'.
10692
10693 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10694
10695 * sysdep.c (list_system_processes, system_process_attributes):
10696 Add implementation for FreeBSD (Bug#5243).
10697
10698 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10699
10700 * lisp.mk (lisp): Update.
10701
10702 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10703
10704 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10705 It is never used otherwise.
10706
10707 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10708
10709 * print.c (print_preprocess): Only check print_depth if print-circle
10710 is nil.
10711 (print_object): Check for cycles even when print-circle is nil and
10712 print-gensym is t, but only check print_depth if print-circle is nil.
10713
10714 2012-04-20 Chong Yidong <cyd@gnu.org>
10715
10716 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10717 set the status to "failed" and ensure that sentinel is run.
10718
10719 2012-04-20 Glenn Morris <rgm@gnu.org>
10720
10721 * process.c (Fset_process_inherit_coding_system_flag)
10722 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10723 (Fmake_network_process, Fmake_serial_process): Doc fix.
10724
10725 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10726
10727 * xdisp.c (string_buffer_position_lim): Limit starting position to
10728 BEGV.
10729 (set_cursor_from_row): If called for a mode-line or header-line
10730 row, return zero immediately.
10731 (try_cursor_movement): If inside continuation line, don't back up
10732 farther than the first row after the header line, if any.
10733 Don't consider the header-line row as "partially visible", even if
10734 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10735
10736 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10737
10738 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10739 (bug#11238).
10740
10741 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10742 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10743
10744 configure: new option --enable-gcc-warnings (Bug#11207)
10745 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10746 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10747 (ALL_CFLAGS): Use new macros rather than old.
10748 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10749 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10750 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10751 -Wunused-result, -Wunused-variable. This should go away once
10752 the Emacs and Gnulib regex code is merged.
10753 (xmalloc, xrealloc): Now static.
10754
10755 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 * dired.c (Fsystem_groups): Remove unused local.
10758
10759 2012-04-17 Glenn Morris <rgm@gnu.org>
10760
10761 * dired.c (Fsystem_users): Doc fix.
10762
10763 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10764
10765 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10766 (syms_of_dired): Add them.
10767
10768 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 Fix minor alloc.c problems found by static checking.
10771 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10772 New extern decls, to avoid calling undeclared functions.
10773 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10774 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10775 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10776 (NEED_MEM_INSERT): New macro.
10777 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10778 Remove one incorrect comment and fix another.
10779
10780 Fix minor ralloc.c problems found by static checking.
10781 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10782 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10783 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10784 (r_alloc_sbrk): Now static.
10785
10786 Improve ralloc.c interface checking.
10787 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10788 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10789 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10790 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10791 [REL_ALLOC]: ... to here, to check interface.
10792 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10793 Remove decls. This fixes an "It stinks!".
10794
10795 * alloc.c (which_symbols): Fix alignment issue / type clash.
10796
10797 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10798
10799 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10800 (struct Lisp_Misc_Any): Likewise.
10801 (struct Lisp_Free): Likewise.
10802 * alloc.c (union aligned_Lisp_Symbol): Define.
10803 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10804 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10805 (union aligned_Lisp_Misc): Define.
10806 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10807 aligned_Lisp_Misc instead of union Lisp_Misc.
10808 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10809
10810 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10811
10812 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10813 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10814 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10815 * s/netbsd.h, s/sol2-6.h:
10816 Remove definition of GC_MARK_STACK, since the default now works.
10817 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10818 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10819 no longer the default.
10820 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10821
10822 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10823
10824 * lread.c (lisp_file_lexically_bound_p):
10825 Fix hang at ";-*-\n" (bug#11238).
10826
10827 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10828
10829 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10830 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10831
10832 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10833
10834 * nsterm.m (constrainFrameRect): Always constrain when there is only
10835 one screen (Bug#10962).
10836
10837 2012-04-13 Ken Brown <kbrown@cornell.edu>
10838
10839 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10840
10841 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10842
10843 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10844
10845 2012-04-11 Daniel Colascione <dancol@dancol.org>
10846
10847 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10848 against is gone. It's better to use vfork now so that when Cygwin
10849 gains a new, working vfork, we use it automatically (bug#10398).
10850
10851 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10852
10853 * window.c (save_window_save): Obey window-point-insertion-type.
10854
10855 2012-04-11 Glenn Morris <rgm@gnu.org>
10856
10857 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10858
10859 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10860
10861 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10862
10863 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10864
10865 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10866 (force_quit_count): New var.
10867 (handle_interrupt): Use it.
10868
10869 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10870
10871 * w32.c (w32_delayed_load): Record the full path of the library
10872 being loaded (bug#10424).
10873
10874 2012-04-09 Glenn Morris <rgm@gnu.org>
10875
10876 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10877 not just in the obarray, before snarfing them. (Bug#11036)
10878
10879 * Makefile.in ($(leimdir)/leim-list.el):
10880 Pass EMACS rather than BUILT_EMACS.
10881
10882 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10883
10884 * process.c (make_process):
10885 * process.h: Add integer `gnutls_handshakes_tried' member to
10886 process struct.
10887
10888 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10889 Add convenience `GNUTLS_LOG2i' macro.
10890
10891 * gnutls.c (gnutls_log_function2i): Convenience log function.
10892 (emacs_gnutls_read): Use new log functions,
10893 `gnutls_handshakes_tried' process member, and
10894 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10895 attempts per process (connection).
10896
10897 2012-04-09 Chong Yidong <cyd@gnu.org>
10898
10899 * eval.c (Fuser_variable_p, user_variable_p_eh)
10900 (lisp_indirect_variable): Functions deleted.
10901 (Fdefvar): Caller changed.
10902
10903 * callint.c (Finteractive, Fcall_interactively):
10904 * minibuf.c (Fread_variable): Callers changed.
10905
10906 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10907
10908 * xdisp.c (set_cursor_from_row): If the display string appears in
10909 the buffer at position that is closer to point than the position
10910 after the display string, display the cursor on the first glyph of
10911 the display string. Fixes cursor display when a 'display' text
10912 property immediately follows invisible text. (Bug#11094)
10913
10914 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10915
10916 composite.c: use 'double' consistently
10917 * composite.c (get_composition_id): Use 'double' consistently
10918 instead of converting 'float' to 'double' and vice versa; this is
10919 easier to understand and avoids a GCC warning.
10920
10921 2012-04-09 Glenn Morris <rgm@gnu.org>
10922
10923 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10924 preparation for dumping it with emacs. (Bug#4789)
10925 (leimdir): New variable.
10926 ($(leimdir)/leim-list.el): New rule.
10927 (emacs$(EXEEXT)): Depend on leim-list.el.
10928
10929 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10930 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10931 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10932
10933 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10934
10935 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10936 proper alignment.
10937
10938 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10939
10940 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10941 Remove unused local variable.
10942
10943 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10944
10945 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10946 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10947 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10948 objects, as mark_maybe_pointer will catch them otherwise.
10949 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10950 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10951
10952 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 Fix typo that broke non-Windows builds.
10955 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10956
10957 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10958
10959 Support building on MS-Windows with libxml2.
10960
10961 * makefile.w32-in (OBJ2): Add xml.$(O).
10962 (GLOBAL_SOURCES): Add xml.c.
10963 ($(BLD)/xml.$(O)): New dependency list.
10964
10965 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10966 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10967 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10968 [!WINDOWSNT]: New macros.
10969 (init_libxml2_functions, libxml2_loaded_p): New functions.
10970 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10971 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10972 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10973 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10974 linked in).
10975 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10976 Call init_libxml2_functions before calling libxml2 functions.
10977 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10978
10979 * emacs.c: Don't include libxml/parser.h.
10980 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10981 xmlCleanupParser directly.
10982
10983 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10984
10985 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10986
10987 * indent.c (Fvertical_motion): If there is a display string at
10988 point, use it.vpos to compute how many lines to backtrack after
10989 move_it_to point. (Bug#11133)
10990
10991 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10992
10993 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10994 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10995 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10996 macros related to unification of CJK characters. For the details,
10997 see the discussion following the message here:
10998 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10999
11000 2012-04-04 Chong Yidong <cyd@gnu.org>
11001
11002 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11003
11004 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11005
11006 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11007 instead of alloca. (Bug#11138)
11008
11009 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11010
11011 * w32menu.c (is_simple_dialog): Properly check lisp types.
11012 (Bug#11141)
11013
11014 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11015
11016 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11017 position we get to after a call to move_it_to fails the
11018 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11019 only if we wind up in a string from display property. (Bug#11063)
11020
11021 * window.c (Fdelete_other_windows_internal): Invalidate the row
11022 and column information about mouse highlight, so that redisplay
11023 restores it after reallocating the glyph matrices. (Bug#7464)
11024
11025 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11026 string comes from a `display' text property, use the buffer
11027 position of that property as if we actually saw that position in
11028 the row's glyphs.
11029 (move_it_by_lines): Remove the assertion that
11030 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11031 violated when there's a before-string at the beginning of a line.
11032 (Bug#11063)
11033
11034 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11035
11036 * xdisp.c (append_space_for_newline): If the default face was
11037 remapped, use the remapped face for the appended newline.
11038 (extend_face_to_end_of_line): Use the remapped default face for
11039 extending the face to the end of the line.
11040 (display_line): Call extend_face_to_end_of_line when the default
11041 face was remapped. (Bug#11068)
11042
11043 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11044
11045 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11046
11047 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11048
11049 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11050
11051 2012-03-27 Glenn Morris <rgm@gnu.org>
11052
11053 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11054 Doc fixes.
11055
11056 2012-03-26 Kenichi Handa <handa@m17n.org>
11057
11058 * dispextern.h (struct glyph): Fix previous change. Change the
11059 bit length of glyphless.ch to 25 (Bug#11082).
11060
11061 2012-03-26 Chong Yidong <cyd@gnu.org>
11062
11063 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11064 (command_loop_1): Use it; inhibit selection update for
11065 handle-select-window too (Bug#8996).
11066
11067 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11068
11069 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11070
11071 2012-03-25 Kenichi Handa <handa@m17n.org>
11072
11073 * dispextern.h (struct glyph): Change the bit length of
11074 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11075
11076 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11077
11078 * s/ms-w32.h (tzname): Include time.h before redirecting to
11079 _tzname. Fixes the MSVC build. (Bug#9960)
11080
11081 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11082
11083 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11084 characters.
11085
11086 * xterm.c (XTread_socket): Only modify handling_signal if
11087 !SYNC_INPUT. (Bug#11080)
11088
11089 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11090
11091 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11092 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11093 when fetching a multibyte character consumes more bytes than
11094 CHAR_BYTES returns, due to unification of CJK characters in
11095 string_char. (Bug#11073)
11096
11097 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11098
11099 * process.c (wait_reading_process_output): Handle pty disconnect
11100 by refraining from sending oneself a SIGCHLD (bug#10933).
11101
11102 2012-03-22 Chong Yidong <cyd@gnu.org>
11103
11104 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11105
11106 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11107 Mark string as coming from a prefix property.
11108 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11109 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11110
11111 2012-03-21 Chong Yidong <cyd@gnu.org>
11112
11113 * xfaces.c (Vface_remapping_alist): Doc fix.
11114
11115 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11116
11117 * w32proc.c (Fw32_set_console_codepage)
11118 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11119 Doc fixes.
11120
11121 2012-03-20 Chong Yidong <cyd@gnu.org>
11122
11123 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11124 to reflect default non-nil value of redisplay-dont-pause.
11125
11126 2012-03-19 Kenichi Handa <handa@m17n.org>
11127
11128 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11129 it fit in a valid range (Bug#11003).
11130
11131 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11132
11133 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11134 that is not from display property, accept the row as a "cursor
11135 row" if one of the string's character has a non-nil `cursor'
11136 property. Fixes cursor positioning when there are newlines in
11137 overlay strings, e.g. in icomplete.el. (Bug#11035)
11138
11139 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11142
11143 2012-03-12 Chong Yidong <cyd@gnu.org>
11144
11145 * eval.c (inhibit_lisp_code): Rename from
11146 inhibit_window_configuration_change_hook; move from window.c.
11147
11148 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11149 * window.c (run_window_configuration_change_hook)
11150 (syms_of_window): Callers changed.
11151
11152 2012-03-11 Chong Yidong <cyd@gnu.org>
11153
11154 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11155
11156 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11157
11158 2012-03-10 Chong Yidong <cyd@gnu.org>
11159
11160 * frame.c (other_visible_frames): Don't assume the selected frame
11161 is visible (Bug#10955).
11162
11163 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11164
11165 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11166
11167 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11168
11169 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11170 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11171 zero (Bug#10954).
11172
11173 2012-03-03 Glenn Morris <rgm@gnu.org>
11174
11175 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11176
11177 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11178
11179 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11180 position past the first glyph_row that ends at ZV. (Bug#10902)
11181 (redisplay_window, next_element_from_string): Fix typos in
11182 comments.
11183 (redisplay_window): Pass to move_it_vertically the margin in
11184 pixels, not in screen lines.
11185
11186 2012-03-02 Glenn Morris <rgm@gnu.org>
11187
11188 * buffer.c (buffer-list-update-hook): Doc fix.
11189
11190 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11191
11192 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11193 push_it before setting up the iterator for the first overlay
11194 string, even if we have an empty string loaded.
11195 (next_overlay_string): If there's an empty string on the iterator
11196 stack, pop the stack. (Bug#10903)
11197
11198 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11199
11200 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11201 Suggested by Stefan Monnier in
11202 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11203 * alloc.c (widen_to_Lisp_Object): New static function.
11204 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11205 and widening them to Lisp_Objects. This would work even if
11206 USE_LSB_TAG is defined and wide integers are used, which might
11207 happen in a future version of Emacs.
11208
11209 2012-02-25 Chong Yidong <cyd@gnu.org>
11210
11211 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11212 Doc fix.
11213
11214 * xselect.c (Fx_selection_exists_p): Doc fix.
11215 (x_clipboard_manager_save_all): Print an informative message
11216 before saving to clipboard manager.
11217
11218 2012-02-24 Chong Yidong <cyd@gnu.org>
11219
11220 * keyboard.c (process_special_events): Handle all X selection
11221 requests in kbd_buffer, not just the next one (Bug#8869).
11222
11223 2012-02-23 Chong Yidong <cyd@gnu.org>
11224
11225 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11226 call when setting menu-bar-lines and tool-bar-lines parameters.
11227 (unwind_create_frame_1): New helper function.
11228
11229 * window.c (inhibit_window_configuration_change_hook): New var.
11230 (run_window_configuration_change_hook): Obey it.
11231 (syms_of_window): Initialize it.
11232
11233 2012-02-22 Chong Yidong <cyd@gnu.org>
11234
11235 * xterm.c (x_draw_image_relief): Add missing type check for
11236 Vtool_bar_button_margin (Bug#10743).
11237
11238 2012-02-21 Chong Yidong <cyd@gnu.org>
11239
11240 * fileio.c (Vfile_name_handler_alist): Doc fix.
11241
11242 * buffer.c (Fget_file_buffer): Protect against invalid file
11243 handler return value.
11244
11245 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11246
11247 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11248 when computing $valmask.
11249
11250 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11251 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11252 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11253 It's useless in that case, and it can cause problems on hosts
11254 that allocate halves of EMACS_INT values separately.
11255 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11256 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11257 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11258 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11259 it avoids undefined behavior on hosts where shifting right by more
11260 than the word width has undefined behavior.
11261
11262 2012-02-19 Chong Yidong <cyd@gnu.org>
11263
11264 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11265 (Funhandled_file_name_directory, Ffile_name_as_directory)
11266 (Fdirectory_file_name, Fexpand_file_name)
11267 (Fsubstitute_in_file_name): Protect against invalid file handler
11268 return values (Bug#10845).
11269
11270 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11271
11272 * .gdbinit (pitx): Fix incorrect references to fields of the
11273 iterator stack.
11274
11275 2012-02-17 Chong Yidong <cyd@gnu.org>
11276
11277 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11278
11279 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11280
11281 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11282 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11283
11284 2012-02-15 Chong Yidong <cyd@gnu.org>
11285
11286 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11287 marked as special. Also, starting docstrings with * is obsolete.
11288
11289 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11290
11291 * gnutls.c (emacs_gnutls_write): Fix last change.
11292
11293 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11294
11295 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11296 send_process.
11297
11298 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11299
11300 * keymap.c (Fsingle_key_description): Handle char ranges.
11301
11302 2012-02-12 Chong Yidong <cyd@gnu.org>
11303
11304 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11305 as that creates a dangerous corner case.
11306
11307 * window.c (Fdelete_window_internal): Invalidate the mouse
11308 highlight (Bug#9904).
11309
11310 2012-02-12 Glenn Morris <rgm@gnu.org>
11311
11312 * xselect.c (Fx_own_selection_internal)
11313 (Fx_get_selection_internal, Fx_disown_selection_internal)
11314 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11315 * nsselect.m (Fx_own_selection_internal)
11316 (Fx_disown_selection_internal, Fx_selection_exists_p)
11317 (Fx_selection_owner_p, Fx_get_selection_internal):
11318 Sync docs and argument specs with the xselect.c versions.
11319
11320 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11321
11322 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11323
11324 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11325
11326 * w32select.c (Fx_selection_exists_p): Sync doc string and
11327 argument list with xselect.c. (Bug#10783)
11328
11329 * w16select.c (Fx_selection_exists_p): Sync doc string and
11330 argument list with xselect.c. (Bug#10783)
11331
11332 2012-02-10 Glenn Morris <rgm@gnu.org>
11333
11334 * fns.c (Fsecure_hash): Doc fix.
11335
11336 2012-02-09 Kenichi Handa <handa@m17n.org>
11337
11338 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11339
11340 2012-02-07 Chong Yidong <cyd@gnu.org>
11341
11342 * buffer.c (Fbuffer_local_variables)
11343 (buffer_lisp_local_variables): Handle unbound vars correctly;
11344 don't let Qunbound leak into Lisp.
11345
11346 2012-02-07 Glenn Morris <rgm@gnu.org>
11347
11348 * image.c (Fimagemagick_types): Doc fix.
11349
11350 * image.c (imagemagick-render-type): Change it from a lisp object
11351 to an integer. Move the doc here from the lisp manual.
11352 Treat all values not equal to 0 the same.
11353
11354 2012-02-06 Chong Yidong <cyd@gnu.org>
11355
11356 * doc.c (store_function_docstring): Avoid applying docstring of
11357 alias to base function (Bug#2603).
11358
11359 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11360
11361 * .gdbinit (pp1, pv1): Remove redundant defines.
11362 (pr): Use pp.
11363
11364 2012-02-04 Chong Yidong <cyd@gnu.org>
11365
11366 * nsterm.m: Declare a global (Bug#10694).
11367
11368 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11369
11370 * w32.c (get_emacs_configuration_options):
11371 Include --enable-checking, if specified, in the return value.
11372
11373 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11374
11375 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11376 after rounding frame sizes. (Bug#9723)
11377
11378 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11379
11380 * keyboard.c (adjust_point_for_property): Don't position point
11381 before BEGV. (Bug#10696)
11382
11383 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11384
11385 Handle overflow when computing char display width (Bug#9496).
11386 * character.c (char_width): Return EMACS_INT, not int.
11387 (char_width, c_string_width): Check for overflow when
11388 computing the width; this is possible now that individual
11389 characters can have unbounded width. Problem introduced
11390 by merge from Emacs 23 on 2012-01-19.
11391
11392 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11393
11394 * dbusbind.c (Fdbus_register_method): Mention the return value
11395 :ignore in the docstring.
11396
11397 2012-02-02 Glenn Morris <rgm@gnu.org>
11398
11399 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11400
11401 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11402 Unconditionally set to t. (Bug#10673)
11403 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11404 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11405 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11406
11407 2012-02-02 Kenichi Handa <handa@m17n.org>
11408
11409 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11410 0, do not call append_composite_glyph.
11411
11412 2012-02-02 Kenichi Handa <handa@m17n.org>
11413
11414 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11415 NULL (Bug#6988).
11416 (x_produce_glyphs): If the component of a composition is a null
11417 string, set it->pixel_width to 1 to avoid zero-width glyph.
11418
11419 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11420
11421 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11422 first 2 arguments are identical. This makes inserting large
11423 output from a subprocess an order of magnitude faster on
11424 MS-Windows, where all sbrk'ed memory is always contiguous.
11425
11426 2012-01-31 Glenn Morris <rgm@gnu.org>
11427
11428 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11429 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11430 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11431
11432 2012-01-29 Glenn Morris <rgm@gnu.org>
11433
11434 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11435
11436 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11437
11438 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11439
11440 2012-01-28 Chong Yidong <cyd@gnu.org>
11441
11442 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11443
11444 2012-01-26 Chong Yidong <cyd@gnu.org>
11445
11446 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11447
11448 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11449 repeat counts (Bug#10507).
11450
11451 2012-01-26 Glenn Morris <rgm@gnu.org>
11452
11453 * lread.c (syms_of_lread): Doc fix.
11454
11455 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11456
11457 * coding.c (encode_designation_at_bol): Change return value to
11458 EMACS_INT.
11459
11460 2012-01-25 Chong Yidong <cyd@gnu.org>
11461
11462 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11463
11464 2012-01-21 Chong Yidong <cyd@gnu.org>
11465
11466 * floatfns.c (Fcopysign): Make the second argument non-optional,
11467 since nil is not allowed anyway.
11468
11469 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11470
11471 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11472 (send_process): Likewise.
11473
11474 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11475
11476 * window.c (save_window_save, Fcurrent_window_configuration)
11477 (Vwindow_persistent_parameters): Do not use Qstate.
11478 Rewrite doc-strings.
11479
11480 2012-01-19 Kenichi Handa <handa@m17n.org>
11481
11482 * character.c (char_width): New function.
11483 (Fchar_width, c_string_width, lisp_string_width):
11484 Use char_width (Bug#9496).
11485
11486 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11487
11488 * window.c (Vwindow_persistent_parameters): New variable.
11489 (Fset_window_configuration, save_window_save): Handle persistent
11490 window parameters.
11491
11492 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11493
11494 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11495 thrashing the stack of the thread. (Bug#9087)
11496
11497 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11498
11499 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11500
11501 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11502
11503 * xdisp.c (rows_from_pos_range): Handle the case where the
11504 highlight ends on a newline. (Bug#10464)
11505 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11506 he end column for display of highlight that ends on a newline
11507 before a R2L line.
11508
11509 2012-01-11 Glenn Morris <rgm@gnu.org>
11510
11511 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11512 from load-path also when installation-directory is nil. (Bug#10208)
11513
11514 2012-01-10 Glenn Morris <rgm@gnu.org>
11515
11516 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11517
11518 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11519 Update template values to be closer to their typical values these days.
11520
11521 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11522
11523 * xdisp.c (rows_from_pos_range): Accept additional argument
11524 DISP_STRING, and accept any glyph in a row whose object is that
11525 string as eligible for mouse highlight. Fixes mouse highlight of
11526 display strings from overlays. (Bug#10464)
11527
11528 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11529
11530 emacs: fix an auto-save permissions race condition (Bug#10400)
11531 * fileio.c (auto_saving_dir_umask): New static var.
11532 (Fmake_directory_internal): Use it.
11533 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11534 creating the directory. The old code temporarily assigns
11535 too-generous permissions to the directory.
11536 (do_auto_save_eh): Clear it.
11537 (Fdo_auto_save): Catch all errors, not just file errors, so
11538 that the var is always cleared.
11539
11540 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11541
11542 * search.c (scan_buffer): Pass character positions to
11543 know_region_cache, not byte positions. (Bug#6540)
11544
11545 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11546
11547 * w32.c (sys_rename): Report EXDEV when rename of a directory
11548 fails because the target is on another logical disk. (Bug#10284)
11549
11550 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11551
11552 * xterm.c (x_embed_request_focus): New function.
11553
11554 * xterm.h: Add prototype.
11555
11556 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11557
11558 2012-01-05 Glenn Morris <rgm@gnu.org>
11559
11560 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11561
11562 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11563
11564 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11565 Load gnutls_transport_set_lowat only if GnuTLS version is below
11566 2.11.1.
11567 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11568 GnuTLS versions below 2.11.1.
11569
11570 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11571
11572 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11573 to the doc string advising against its use for altering the way
11574 windows are scrolled.
11575
11576 2011-12-28 Kenichi Handa <handa@m17n.org>
11577
11578 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11579 coding-system ASCII compatible only when it does not produce BOM
11580 on encoding (Bug#10383).
11581
11582 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11583
11584 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11585 can scroll.
11586 (create_and_show_popup_menu): Always use menu_position_func for
11587 Gtk3 (Bug#10361).
11588
11589 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11590
11591 * callint.c (Fcall_interactively): Don't truncate prompt string.
11592
11593 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11594
11595 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11596 property that ends at ZV, so that the bidi iteration could be
11597 resumed from there (after widening). (Bug#10360)
11598
11599 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11600
11601 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11602
11603 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11604
11605 * nsterm.m (x_free_frame_resources):
11606 Release f->output_data.ns->miniimage.
11607 (ns_index_color): Fix indentation. Do not retain
11608 color_table->colors[i].
11609
11610 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11611 before returning.
11612
11613 * nsfns.m (x_set_background_color): Assign return value from
11614 ns_index_color to face-background instead of NSColor*.
11615 (ns_implicitly_set_icon_type): Fix indentation.
11616 Change assignment in for loop to comparison.
11617
11618 * emacs.c (ns_pool): New variable.
11619 (main): Assign ns_pool.
11620 (Fkill_emacs): Call ns_release_autorelease_pool.
11621
11622 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11623 autorelease fdesc, release fdAttrs and tdict.
11624 (ns_get_covering_families): Release charset.
11625 (ns_findfonts): Release NSFontDescriptor created with new.
11626 (ns_uni_to_glyphs): Fix indentation.
11627 (setString): Release attrStr before assigning new value.
11628
11629 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11630
11631 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11632 and NS_IMPL_COCOA.
11633 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11634 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11635
11636 2011-12-18 David Reitter <reitter@cmu.edu>
11637
11638 * nsterm.m (ns_term_init): Subscribe for notifications
11639 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11640 to method trackingNotification in EmacsMenu.
11641
11642 * nsmenu.m (trackingMenu): New variable.
11643 (trackingNotification): New method (from Aquamacs).
11644 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11645 from Aquamacs (Bug#7030).
11646
11647 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11648
11649 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11650 (symbol_to_nsstring): Fix indentation.
11651 (ns_symbol_to_pb): New function.
11652 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11653 (Fns_rotate_cut_buffers_internal): Remove.
11654 (Fns_store_selection_internal): Rename from
11655 Fns_store_cut_buffer_internal.
11656 (ns_get_foreign_selection, Fx_own_selection_internal)
11657 (Fx_disown_selection_internal, Fx_selection_exists_p)
11658 (Fns_get_selection_internal, Fns_store_selection_internal):
11659 Use ns_symbol_to_pb and check if return value is nil.
11660 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11661 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11662 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11663 renamed to Sns_store_selection_internal.
11664 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11665 and remove this function.
11666 (ns_handle_selection_clear): Remove, never used.
11667 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11668 here.
11669
11670 2011-12-17 Ken Brown <kbrown@cornell.edu>
11671
11672 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11673 GID is unknown (Bug#10257).
11674
11675 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11676
11677 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11678 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11679 which caused a build failure on GNU/Linux IA-64. This problem was
11680 introduced by my 2011-10-07 patch.
11681
11682 2011-12-15 Juri Linkov <juri@jurta.org>
11683
11684 * image.c (imagemagick_error): New function. (Bug#10112)
11685 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11686 Use `imagemagick_error' where ImageMagick functions return
11687 `MagickFalse'.
11688 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11689 proper order.
11690
11691 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11692
11693 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11694 fill background (Bug#8992).
11695
11696 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11697
11698 * window.c (Vwindow_combination_resize)
11699 (Vwindow_combination_limit): Use t instead of non-nil in
11700 doc-strings.
11701 (Vrecenter_redisplay): Add first sentence of doc-string on
11702 separate line.
11703 (Frecenter): Fix doc-string typo.
11704
11705 2011-12-11 Kenichi Handa <handa@m17n.org>
11706
11707 * coding.c (Funencodable_char_position): Pay attention to the
11708 buffer text relocation (Bug#9389).
11709
11710 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11711
11712 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11713 gtk_init (Bug#10100).
11714
11715 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11716
11717 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11718 IT->string is nil. (Bug#10263)
11719
11720 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11721
11722 * nsterm.h (x_free_frame_resources): Declare.
11723
11724 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11725 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11726
11727 * nsterm.h (ns_get_defaults_value): Declare.
11728
11729 * nsterm.m (ns_default): Call ns_get_defaults_value.
11730
11731 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11732
11733 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11734 (Bug#10170)
11735
11736 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11737
11738 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11739 that where the value of an _OBJC_* symbol points to is in the .bss
11740 section (Bug#10240).
11741
11742 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11743
11744 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11745 after the loop to call ccl_driver at least once (Bug#8619).
11746
11747 2011-12-08 Kenichi Handa <handa@m17n.org>
11748
11749 * ftfont.c (get_adstyle_property): Fix previous change
11750 (Bug#10233).
11751
11752 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11753
11754 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11755 dirs from the default value of EMACSLOADPATH (bug#10208).
11756
11757 2011-12-07 Glenn Morris <rgm@gnu.org>
11758
11759 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11760 installation and source directories as well. (Bug#10208)
11761
11762 2011-12-06 Chong Yidong <cyd@gnu.org>
11763
11764 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11765
11766 2011-12-06 Glenn Morris <rgm@gnu.org>
11767
11768 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11769 as an error, not just -1. (Bug#10217)
11770
11771 2011-12-05 Chong Yidong <cyd@gnu.org>
11772
11773 * keyboard.c (process_special_events): New function.
11774 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11775
11776 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11777
11778 * coding.c (encode_designation_at_bol): Don't use uninitialized
11779 local variable (Bug#9318).
11780
11781 2011-12-05 Kenichi Handa <handa@m17n.org>
11782
11783 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11784 return Qnil (Bug#8046, Bug#10193).
11785
11786 2011-12-05 Kenichi Handa <handa@m17n.org>
11787
11788 * coding.c (encode_designation_at_bol): New args charbuf_end and
11789 dst. Return the number of produced bytes. Callers changed.
11790 (coding_set_source): Return how many bytes coding->source was
11791 relocated.
11792 (coding_set_destination): Return how many bytes
11793 coding->destination was relocated.
11794 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11795 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11796
11797 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11798
11799 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11800 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11801 macro (Bug#9318).
11802
11803 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11804
11805 The following changes are to fix Bug#9318.
11806
11807 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11808 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11809 (encode_coding_iso_2022, encode_coding_sjis)
11810 (encode_coding_big5, encode_coding_charset): Use the above macros.
11811
11812 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11813
11814 * lisp.h (process_quit_flag): Fix external declaration.
11815
11816 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11817
11818 Don't macro-inline non-performance-critical code.
11819 * eval.c (process_quit_flag): New function.
11820 * lisp.h (QUIT): Use it.
11821
11822 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11823
11824 * nsfns.m (get_geometry_from_preferences): New function.
11825 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11826
11827 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11828
11829 * emacs.c (Qkill_emacs): Define.
11830 (syms_of_emacs): Initialize it.
11831 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11832 Qquit_flag to `kill-emacs' instead.
11833 (quit_throw_to_read_char): Add parameter `from_signal'.
11834 All callers changed. Call Fkill_emacs if requested and safe.
11835 * lisp.h (QUIT): Call Fkill_emacs if requested.
11836
11837 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11838
11839 * widget.c (update_wm_hints): Return if wmshell is null.
11840 (widget_update_wm_size_hints): New function.
11841
11842 * widget.h (widget_update_wm_size_hints): Declare.
11843
11844 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11845 widget_update_wm_size_hints (Bug#10104).
11846
11847 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11848
11849 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11850 before a newline, prepare the bidi iterator for consuming the
11851 newline, and keep the current paragraph direction. (Bug#10183)
11852 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11853
11854 2011-12-02 Juri Linkov <juri@jurta.org>
11855
11856 * search.c (Fword_search_regexp): New Lisp function created from
11857 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11858 (Fword_search_backward, Fword_search_forward)
11859 (Fword_search_backward_lax, Fword_search_forward_lax):
11860 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11861 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11862
11863 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11864
11865 * fileio.c (Finsert_file_contents): Move after-change-function call
11866 to before the "handled:" label, since all "goto handled" appear in
11867 cases where the *-change-functions have already been properly called
11868 (bug#10117).
11869
11870 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11871
11872 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11873 waiting for input. (Bug#10169)
11874
11875 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11876
11877 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11878 verifies glyph row's hash code--we have just reallocated the
11879 glyphs, so their contents can be complete garbage. (Bug#10164)
11880
11881 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11882
11883 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11884
11885 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11886
11887 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11888 attributes are tested _before_ calling verify_row_hash, to protect
11889 against GCC re-ordering of the tests. (Bug#10164)
11890
11891 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11892
11893 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11894
11895 * xterm.c (handle_one_xevent): Only set async_visible and friends
11896 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11897 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11898 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11899
11900 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11901
11902 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11903 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11904 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11905 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11906 All uses changed to use GCPRO1 etc.
11907 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11908 Revert to old implementation (i.e., before 2011-03-11).
11909
11910 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11911
11912 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11913 of scroll runs so as to avoid assigning disabled bogus rows and
11914 unnecessary graphics copy operations.
11915
11916 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11917
11918 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11919 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11920 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11921 (malloc, free, realloc, calloc): Redirect to e_* only when
11922 compiling Emacs.
11923
11924 * lisp.h (GCTYPEBITS): Move before first use.
11925 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11926 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11927 this macro definition.
11928
11929 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11930 _MSC_VER.
11931
11932 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11933
11934 * gtkutil.c (xg_create_frame_widgets):
11935 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11936 present with Gtk+ 2.0.
11937
11938 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 * fileio.c (Finsert_file_contents): Undo previous change; see
11941 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11942
11943 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11944
11945 Rename locals to avoid shadowing.
11946 * fileio.c (Finsert_file_contents):
11947 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11948 * process.c (wait_reading_process_output):
11949 Rename inner 'proc' to 'p' to avoid shadowing.
11950 Indent for consistency with usual Emacs style.
11951
11952 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11953
11954 * xdisp.c (redisplay_window): If cursor row is not fully visible
11955 after recentering, and scroll-conservatively is set to a large
11956 number, scroll window by a few more lines to make the cursor fully
11957 visible and out of scroll-margin. (Bug#10105)
11958 (start_display): Don't move to the next line if the display should
11959 start at a newline that is part of a display vector or an overlay
11960 string. (Bug#10119)
11961
11962 2011-11-24 Juri Linkov <juri@jurta.org>
11963
11964 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11965 after the `MagickPingImage' call. (Bug#10112)
11966
11967 2011-11-23 Chong Yidong <cyd@gnu.org>
11968
11969 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11970
11971 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11972
11973 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11974 making another buffer current. (Bug#10114)
11975
11976 2011-11-23 Glenn Morris <rgm@gnu.org>
11977
11978 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11979
11980 2011-11-23 Chong Yidong <cyd@gnu.org>
11981
11982 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11983 using it (Bug#5984).
11984
11985 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11986
11987 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11988 and header-lines, as they don't have one computed for them.
11989 (Bug#10098)
11990
11991 * .gdbinit (prow): Make displayed values more self-explaining.
11992 Add row's hash code.
11993
11994 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11995
11996 * process.c (wait_reading_process_output): Fix asynchrounous
11997 GnuTLS socket handling on some versions of the GnuTLS library.
11998 (wait_reading_process_output): Add comment and URL.
11999
12000 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12001
12002 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12003
12004 2011-11-21 Chong Yidong <cyd@gnu.org>
12005
12006 * window.c (Fnext_window, Fprevious_window): Doc fix.
12007
12008 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12009
12010 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12011
12012 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12013
12014 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12015
12016 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12017
12018 * window.c (Fset_window_combination_limit): Rename argument
12019 STATUS to LIMIT.
12020 (Vwindow_combination_limit): Remove "status" from doc-string.
12021
12022 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12023
12024 * m/ibms390.h: Remove.
12025 * m/ibms390x.h: Don't include "ibms390.h".
12026
12027 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12028
12029 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12030 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12031
12032 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12033
12034 * casetab.c (Fset_case_table):
12035 * charset.c (Fcharset_after): Fix typos.
12036
12037 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12038
12039 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12040 Otherwise, valgrind does not work on some platforms.
12041 Problem reported by Andreas Schwab in
12042 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12043 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12044 is set, removing the need for VIRT_ADDRESS_VARIES.
12045 (PURE_P): Use a more-efficient implementation that needs just one
12046 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12047 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12048 to 4 (xorl, subq, cmpq, setbe).
12049 * alloc.c (pure): Always extern now, since that's the
12050 VIRT_ADDR_VARIES behavior.
12051 (PURE_POINTER_P): Use a single comparison, not two, for
12052 consistency with the new puresize.h.
12053 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12054 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12055 Remove VIRT_ADDR_VARIES no longer needed.
12056
12057 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12058
12059 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12060 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12061 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12062 behave as if the cursor position were at the window margin.
12063
12064 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12065 and the cursor position is out of bounds, behave as if the cursor
12066 position were at the window margin. (Bug#10075)
12067
12068 2011-11-18 Chong Yidong <cyd@gnu.org>
12069
12070 * window.c (Fwindow_combination_limit): Make first argument
12071 non-optional, since it is meaningless for live windows like the
12072 selected window.
12073
12074 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12075
12076 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12077
12078 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12079
12080 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12081 (graft_intervals_into_buffer): Simplify.
12082
12083 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12084
12085 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12086 hash values of the two rows.
12087 (copy_row_except_pointers): Preserve the used[] arrays and the
12088 hash values of the two rows. (Bug#10035)
12089 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12090
12091 * xdisp.c (row_hash): New function, body extracted from
12092 compute_line_metrics.
12093 (compute_line_metrics): Call row_hash, instead of computing the
12094 hash code inline.
12095
12096 * dispnew.c (verify_row_hash): Call row_hash for computing the
12097 hash code of a row, instead of duplicating code from xdisp.c.
12098
12099 * dispextern.h (row_hash): Add prototype.
12100
12101 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12102
12103 * frame.c (delete_frame): Don't delete the terminal when the last
12104 X frame is closed if emacs is built with GTK toolkit.
12105
12106 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12107
12108 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12109
12110 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12111
12112 * window.c (Vwindow_splits): Rename to
12113 Vwindow_combination_resize. Suggested by Juri Linkov.
12114 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12115 of Vwindow_splits.
12116
12117 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12118
12119 * nsfns.m (Fns_font_name):
12120 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12121
12122 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12123
12124 * window.h (window): Rename slot "nest" to "combination_limit".
12125 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12126 (Fset_window_nest): Rename to Fset_window_combination_limit.
12127 (Vwindow_nest): Rename to Vwindow_combination_limit.
12128 (recombine_windows, make_parent_window, make_window)
12129 (Fsplit_window_internal, saved_window)
12130 (Fset_window_configuration, save_window_save): Rename all
12131 occurrences of window_nest to window_combination_limit.
12132
12133 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12134
12135 * image.c (imagemagick_load_image): Fix typo.
12136
12137 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12138
12139 * xdisp.c (display_line): Move the call to
12140 highlight_trailing_whitespace before the call to
12141 compute_line_metrics, since the latter needs to see the final
12142 faces of all the glyphs to compute ROW's hash value.
12143 Fixes assertion violations in row_equal_p. (Bug#10035)
12144
12145 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12146
12147 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12148 just return (bug#10044).
12149
12150 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12151
12152 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12153 with user-defined heap size. Bump the default size of the temacs
12154 heap to 27MB, to avoid memory warning when running temacs.
12155 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12156
12157 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12158 current_matrix and desired_matrix. (Bug#9990)
12159 (verify_row_hash) [XASSERTS]: New function.
12160 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12161 that the hash value of glyph rows is correct.
12162
12163 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12164
12165 * window.h (window): Remove splits slot.
12166 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12167 (Fdelete_other_windows_internal, make_parent_window)
12168 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12169 (Fset_window_configuration, save_window_save): Don't deal with
12170 split status of windows.
12171 (saved_window): Remove splits slot.
12172 (Vwindow_splits): Rewrite doc-string.
12173
12174 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12175
12176 * xfns.c (unwind_create_frame):
12177 * nsfns.m (unwind_create_frame):
12178 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12179 Vframe_list (Bug#9999).
12180
12181 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12182
12183 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12184
12185 2011-11-11 Kenichi Handa <handa@m17n.org>
12186
12187 * callproc.c (Fcall_process): Set the member dst_multibyte of
12188 process_coding.
12189
12190 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12191
12192 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12193 avoid a crash (bug#9496).
12194
12195 2011-11-09 Chong Yidong <cyd@gnu.org>
12196
12197 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12198 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12199
12200 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12201
12202 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12203
12204 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12205
12206 Avoid some portability problems by eschewing 'extern inline' functions.
12207 The trivial performance wins aren't worth the portability hassles; see
12208 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12209 et seq.
12210 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12211 (window_box_width, window_box_left, window_box_left_offset)
12212 (window_box_right, window_box_right_offset): Undo previous change,
12213 by removing the "extern"s.
12214 * intervals.c (adjust_intervals_for_insertion)
12215 (adjust_intervals_for_deletion): Undo previous change,
12216 making these static again.
12217 (offset_intervals, temp_set_point_both, temp_set_point)
12218 (copy_intervals_to_string): No longer inline.
12219 * xdisp.c (window_text_bottom_y, window_box_width)
12220 (window_box_height, window_box_left_offset)
12221 (window_box_right_offset, window_box_left, window_box_right)
12222 (window_box): No longer inline.
12223
12224 2011-11-08 Chong Yidong <cyd@gnu.org>
12225
12226 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12227 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12228 Signal an error if not a live window.
12229 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12230 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12231
12232 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12233
12234 * lisp.h (syms_of_abbrev): Remove declaration.
12235 Reported by CHENG Gao <chenggao@royau.me>.
12236
12237 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12238
12239 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12240 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12241 of temacs in GUI mode.
12242
12243 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12244
12245 * window.h: Declare delete_all_child_windows instead of
12246 delete_all_subwindows.
12247 * window.c (Fwindow_nest, Fset_window_nest)
12248 (Fset_window_new_total, Fset_window_new_normal)
12249 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12250 (delete_all_subwindows): Rename to delete_all_child_windows.
12251 (Fdelete_other_windows_internal, Fset_window_configuration):
12252 Call delete_all_child_windows instead of delete_all_subwindows.
12253 * frame.c (delete_frame): Call delete_all_child_windows instead
12254 of delete_all_subwindows.
12255
12256 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12257
12258 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12259 This is also needed for porting to any host where GC_MARK_STACK is
12260 not GC_MAKE_GCPROS_NOOPS.
12261 (which_symbols): Use it.
12262
12263 2011-11-07 Kenichi Handa <handa@m17n.org>
12264
12265 * coding.c (coding_set_destination): Check coding->src_pos only
12266 when coding->src_object is a buffer (bug#9910).
12267
12268 * process.c (send_process): Set the member src_multibyte of coding
12269 to 0 (bug#9911) when sending a unibyte text.
12270
12271 * callproc.c (Fcall_process): Set the member src_multibyte of
12272 process_coding to 0 (bug#9912).
12273
12274 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12275
12276 * xmenu.c (cleanup_widget_value_tree): New function.
12277 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12278 calling free_menubar_widget_value_tree directly (Bug#9830).
12279
12280 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12281
12282 Fix some portability problems with 'inline'.
12283 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12284 (window_box_width, window_box_left, window_box_left_offset)
12285 (window_box_right, window_box_right_offset): Declare extern.
12286 Otherwise, these inline functions do not conform to C99 and
12287 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12288 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12289 * intervals.c (adjust_intervals_for_insertion)
12290 (adjust_intervals_for_deletion): Now extern, because otherwise the
12291 extern inline functions 'offset_intervals' couldn't refer to it.
12292 (static_offset_intervals): Remove.
12293 (offset_intervals): Rewrite using the old contents of
12294 static_offset_intervals. The old version didn't conform to C99
12295 because an extern inline function contained a reference to an
12296 identifier with static linkage.
12297
12298 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12299
12300 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12301 GC.
12302
12303 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12304
12305 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12306 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12307 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12308 return Qleft_to_right.
12309
12310 2011-11-06 Chong Yidong <cyd@gnu.org>
12311
12312 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12313 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12314 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12315 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12316 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12317 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12318 (Fwindow_vscroll): Doc fix.
12319 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12320 argument, since it makes no sense to pass a live window and for
12321 consistency with window-child.
12322
12323 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12324
12325 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12326 support MSVC.
12327
12328 2011-11-05 Jason Rumney <jasonr@gnu.org>
12329
12330 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12331 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12332 fonts (Bug#6029).
12333 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12334 bitwise arithmetic preventing use of unicode-sip and non-truetype
12335 opentype fonts.
12336
12337 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12338
12339 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12340 "emacs"-only part.
12341
12342 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12343 initialization code to keep similarity to xfns.c after changes
12344 from 2011-11-05.
12345
12346 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12347
12348 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12349 (unwind_create_frame): New function (Bug#9943).
12350 (Fx_create_frame): Restructure code to be more similar to the one in
12351 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12352 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12353 Move terminal->reference_count++ just before making the frame official
12354 (Bug#9943).
12355
12356 * nsterm.m (x_free_frame_resources): New function.
12357 (x_destroy_window): Move code to x_free_frame_resources.
12358
12359 * xfns.c (unwind_create_frame): Fix comment.
12360 (Fx_create_frame, x_create_tip_frame):
12361 Move terminal->reference_count++ just before making the frame
12362 official. Move initialization of image_cache_refcount and
12363 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12364
12365 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12366
12367 Support MSVC build with newer versions of Visual Studio.
12368 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12369 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12370 nt/gmake.defs.
12371
12372 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12373 which are not supported by MSVC.
12374 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12375 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12376 bitfields.
12377 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12378 types in bitfields.
12379 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12380
12381 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12382
12383 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12384
12385 Support MSVC build with newer versions of Visual Studio.
12386 * w32.c: Don't include w32api.h for MSVC.
12387 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12388
12389 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12390 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12391 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12392 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12393 e_* cousins.
12394 (alloca) [_MSC_VER]: Define to _alloca.
12395
12396 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12397
12398 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12399
12400 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12401
12402 * xdisp.c (note_mouse_highlight): If either of
12403 previous/next-single-property-change returns nil, treat that as
12404 the beginning or the end of the buffer. (Bug#9955)
12405
12406 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12407
12408 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12409 label is not null (Bug#9951).
12410 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12411 may be NULL.
12412
12413 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12414
12415 * window.c (Fwindow_body_size): Mention in the doc string that the
12416 return value is in frame's canonical units. (Bug#9949)
12417
12418 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12419
12420 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12421
12422 * w32fns.c (unwind_create_frame): If needed, free the glyph
12423 matrices of the partially constructed frame. (Bug#9943)
12424 * xfns.c (unwind_create_frame): Likewise.
12425
12426 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12427
12428 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12429 Don't stop backward scan on the continuation glyph, even though
12430 its CHARPOS is positive.
12431 (mouse_face_from_buffer_pos, note_mouse_highlight):
12432 Rename cover_string to disp_string.
12433
12434 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12435
12436 * window.c (temp_output_buffer_show): Don't use
12437 Vtemp_buffer_show_specifiers.
12438 (Vtemp_buffer_show_specifiers): Remove unused variable.
12439
12440 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12441
12442 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12443 past the beginning of the current glyph matrix.
12444
12445 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12446
12447 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12448 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12449 HAVE_GTK3 (Bug#9869).
12450
12451 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12452 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12453
12454 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12455
12456 * xterm.c: Declare x_handle_net_wm_state to return int.
12457 (handle_one_xevent): Check if we are iconified but don't have
12458 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12459 (get_current_wm_state): Return non-zero if not hidden,
12460 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12461 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12462 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12463 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12464
12465 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12468 so that this new function doesn't get optimized away by a
12469 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12470
12471 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12472
12473 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12474
12475 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12476
12477 Fix the `xbytecode' command.
12478 * .gdbinit (xprintbytestr): New command.
12479 (xwhichsymbols): Rename from `which'; all callers changed.
12480 (xbytecode): Print the byte-code string as well.
12481
12482 2011-10-29 Kim Storm <storm@cua.dk>
12483
12484 * alloc.c (which_symbols): New function.
12485
12486 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12487
12488 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12489 line. (Bug#9903)
12490
12491 2011-10-29 Glenn Morris <rgm@gnu.org>
12492
12493 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12494 Not clear what it was for, and it causes various bugs. (Bug#9839)
12495
12496 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12497
12498 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12499 possible random value that matches one of those tested as
12500 condition to clear the mouse face.
12501
12502 2011-10-28 Chong Yidong <cyd@gnu.org>
12503
12504 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12505
12506 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12507
12508 * window.c (make_window): Initialize phys_cursor_on_p.
12509
12510 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12511
12512 * lisp.h (struct Lisp_Symbol): Update comments.
12513
12514 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12515
12516 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12517
12518 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12519
12520 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12521 <oslsachem@gmail.com> for helping to debug this.
12522
12523 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12524 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12525 (g_b_init_get_glyph_outline_w): New static variables.
12526 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12527 (GetGlyphOutlineW_Proc): New typedefs.
12528 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12529 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12530 New functions.
12531 (w32font_open_internal, compute_metrics):
12532 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12533 instead of calling the "wide" APIs directly.
12534
12535 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12536
12537 * w32.h (syms_of_w32font): Add prototype.
12538
12539 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12540
12541 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12542 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12543 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12544 (Fmove_to_window_line): Doc fix.
12545
12546 2011-10-27 Chong Yidong <cyd@gnu.org>
12547
12548 * process.c (make_process): Set gnutls_state to NULL.
12549
12550 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12551 non-NULL, regardless of GNUTLS_INITSTAGE.
12552 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12553 an error. Set process slots as soon as we allocate them.
12554
12555 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12556
12557 2011-10-27 Chong Yidong <cyd@gnu.org>
12558
12559 * gnutls.c (emacs_gnutls_deinit): New function.
12560 Deallocate credentials structures as well as calling gnutls_deinit.
12561 (Fgnutls_deinit, Fgnutls_boot): Use it.
12562
12563 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12564 (deactivate_process): Call emacs_gnutls_deinit.
12565
12566 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12567
12568 * image.c (x_create_x_image_and_pixmap):
12569 * w32.c (sys_rename, w32_delayed_load):
12570 * w32font.c (fill_in_logfont):
12571 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12572
12573 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12574
12575 * w32fns.c (w32_default_color_map): New function,
12576 extracted from Fw32_default_color_map.
12577 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12578
12579 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12580
12581 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12582
12583 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12584
12585 * keyboard.c (test_undefined): New function (bug#9751).
12586 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12587
12588 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12589
12590 * sysdep.c (init_sys_modes): Fix the check for the controlling
12591 terminal (Bug#6649).
12592
12593 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12594
12595 * dispextern.h (struct bidi_it): New member next_en_type.
12596
12597 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12598 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12599 current character, check also for next_en_type being WEAK_EN.
12600 (bidi_resolve_weak): Don't enter the expensive loop if the current
12601 position is before next_en_pos. Record the bidi type of the first
12602 non-ET, non-BN character we find, in addition to its position.
12603 (bidi_level_of_next_char): Invalidate next_en_type when
12604 next_en_pos is over-stepped.
12605
12606 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12607
12608 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12609 * editfns.c: Rewrite current-time-zone so that it invokes
12610 the equivalent of (format-time-string "%Z") to get the time zone name.
12611 This fixes a bug when the time zone name contains characters that
12612 need converting from the system time locale to Emacs internal format.
12613 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12614 that patch fixed format-time-string to do the conversion, but
12615 I forgot to fix current-time-zone.
12616 (format_time_string): New function, containing most of
12617 what Fformat_time_string used to contain.
12618 (Fformat_time_string): Rewrite in terms of format_time_string.
12619 This doesn't change this function's behavior.
12620 (current-time-zone): Rewrite to use format_time_string.
12621 This fixes the bug reported by Michael Schierl in
12622 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12623 Jason Rumney's 2007-06-07 change worked around this bug, but
12624 didn't fix it.
12625 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12626
12627 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12628
12629 * xdisp.c (start_display): If the character at POS is displayed
12630 via a display vector, reset IT->current.dpvec_index to zero.
12631 (try_window_reusing_current_matrix): If a line ends in a display
12632 vector or the next line starts in a display vector, continue
12633 redrawing the window even though the character position of
12634 start_row was reached.
12635 (Bug#9771, part 2)
12636
12637 2011-10-18 Chong Yidong <cyd@gnu.org>
12638
12639 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12640 with nobreak-char-display too.
12641
12642 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12643
12644 Fix part 3 of bug#9771.
12645 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12646 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12647 non-neutral characters if the current character is a paragraph
12648 separator (a.k.a. Newline). This avoids running the same
12649 expensive loop twice, once when we consume the preceding newline
12650 and the other time when the line actually needs to be displayed.
12651 Avoid the loop when we see neutrals on the base embedding level
12652 following a character whose directionality is the same as the
12653 paragraph's. This avoids running the expensive loop when a line
12654 ends in a long sequence of neutrals, like control characters.
12655 Add assertion against STRONG_AL type. Slightly rearrange code
12656 that determines the type of a neutral given the first non-neutral
12657 that follows it.
12658 (bidi_level_of_next_char): Set next_en_pos to zero when
12659 invalidating its info.
12660
12661 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12662
12663 * xdisp.c (push_display_prop): Determine whether to record string
12664 or buffer position by IT->string, not by IT->method. Allow
12665 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12666 (move_it_vertically_backward): Don't look for character position
12667 immediately after the newline when in a continuation line.
12668 (Bug#9771, part 1)
12669
12670 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12671
12672 * window.c (coordinates_in_window): Rewrite and delabelize
12673 vertical border check. (Bug#5357) (Bug#9618)
12674
12675 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12676
12677 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12678 errors in XSetWindowBorder (bug#9310).
12679
12680 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12681
12682 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12683 avoid crash when xmalloc overrun checking is enabled.
12684
12685 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12686
12687 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12688 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12689 cursor motion with <left> and <right> arrow keys.
12690
12691 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12692 some callers set that themselves.
12693
12694 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12695
12696 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12697 display string and the previous row comes from the same string and
12698 is empty. (Bug#9739) (Bug#9738)
12699
12700 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12701
12702 * doc.c (get_doc_string): Encode file name (bug#9735).
12703
12704 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12705
12706 * bidi.c (bidi_level_of_next_char):
12707 * xdisp.c (get_visually_first_element): Remove old incorrect
12708 comments regarding the Unicode Line Separator character.
12709
12710 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12711
12712 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12713
12714 * alloc.c (Fgc_status): Do not access beyond zombies array
12715 boundary if nzombies > MAX_ZOMBIES.
12716 * alloc.c (dump_zombies): Add missing format specifier.
12717
12718 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12719
12720 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12721 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12722
12723 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12724 Some packages use them to denote characters with modifiers.
12725
12726 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12727
12728 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12729 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12730 matching a pp-number. Rename parameter var to var1.
12731
12732 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12733
12734 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12735
12736 2011-10-08 Glenn Morris <rgm@gnu.org>
12737
12738 * callint.c (Fcall_interactively): Give a more explicit error for the
12739 'c' case with a non-character input. (Bug#8479)
12740
12741 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12742
12743 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12744 lines.
12745 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12746 lines that are hscrolled on the left.
12747
12748 * dispnew.c (buffer_posn_from_coords): Account for a possible
12749 presence of header-line. (Bug#4426)
12750
12751 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12752
12753 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12754 Don't advertise functionality which we discourage or doesn't work.
12755
12756 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12757
12758 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12759 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12760 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12761 this makes Emacs dump core during garbage collection on rare
12762 occasions. sizeof is obviously inferior to offsetof here, so
12763 stick with offsetof.
12764 (GC_POINTER_ALIGNMENT): New macro.
12765 (mark_memory): Omit 3rd (offset) arg; caller changed.
12766 Don't assume EMACS_INT alignment is the same as pointer alignment.
12767
12768 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12769
12770 * keyboard.c (read_key_sequence_remapped): New var.
12771 (read_key_sequence): Compute remapping in the right buffer.
12772 (command_loop_1): Use read_key_sequence's remapping directly.
12773
12774 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12775
12776 * dired.c (file_name_completion): Don't expand file name.
12777 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12778 before checking file name handler.
12779
12780 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12781 they've been requested explicitly (bug#9591).
12782
12783 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12784
12785 * keymap.c (Fsingle_key_description): Use make_specified_string
12786 instead of build_string to build string from push_key_description.
12787 (Bug#5193)
12788
12789 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12790
12791 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12792 This fixes a Y2038 bug on 64-bit hosts.
12793 * buffer.c (reset_buffer):
12794 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12795 (Fclear_buffer_auto_save_failure):
12796 Use 0, not -1, to represent an unset failure time, since time_t
12797 might not be signed.
12798
12799 Remove dependency on glibc malloc internals.
12800 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12801 Move back here from lisp.h, but with their new implementations.
12802 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12803 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12804 * charset.c (charset_table_init): New static var.
12805 (syms_of_charset): Use it instead of xmalloc. This removes a
12806 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12807 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12808 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12809 Move back to alloc.c.
12810 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12811 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12812
12813 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12814
12815 * nsterm.m (windowDidResize): Call x_set_window_size only when
12816 ns_in_resize is true. Otherwise set pixelwidth/height and
12817 call change_frame_size (Bug#9628).
12818
12819 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12820
12821 Port --enable-checking=all to Fedora 14 x86-64.
12822 * charset.c (syms_of_charset): Also account for glibc malloc's
12823 internal overhead when calculating the initial malloc maximum.
12824
12825 Port --enable-checking=all to Fedora 14 x86.
12826 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12827 Move to lisp.h.
12828 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12829 (overrun_check_realloc, overrun_check_free):
12830 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12831 That way, xmalloc returns a properly-aligned pointer even if
12832 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12833 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12834 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12835 into account when calculating the initial malloc maximum.
12836 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12837 Move here from alloc.c, so that charset.c can use it too.
12838 Properly align; the old code wasn't right for common 32-bit hosts
12839 when configured with --enable-checking=all.
12840 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12841 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12842
12843 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12844
12845 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12846 use EDOM.
12847
12848 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12849
12850 * xdisp.c (compute_display_string_end): If there's no display
12851 string at CHARPOS, return -1.
12852
12853 * bidi.c (bidi_fetch_char): When compute_display_string_end
12854 returns a negative value, treat the character as a normal
12855 character not covered by a display string. (Bug#9624)
12856
12857 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12858
12859 * lread.c (Fread_from_string): Fix typo in docstring.
12860
12861 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12862
12863 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12864 newline, reseat the iterator instead of bidi-iterating there one
12865 character at a time. (Bug#9610)
12866 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12867 TO_CHARPOS if the bidi iterator is at base embedding level.
12868
12869 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12870
12871 * lread.c (readevalloop): Use correct code for NBSP.
12872 (read1): Likewise. (Bug#9608)
12873
12874 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12875
12876 * dbusbind.c (Fdbus_register_signal): When service is not
12877 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12878
12879 2011-09-25 Glenn Morris <rgm@gnu.org>
12880
12881 * buffer.c (truncate-lines): Doc fix.
12882
12883 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12884
12885 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12886 (Fset_window_next_buffers): Doc fix.
12887
12888 2011-09-24 Glenn Morris <rgm@gnu.org>
12889
12890 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12891
12892 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12893
12894 Fix minor problems found by static checking.
12895 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12896 * indent.c (Fvertical_motion): Fix == vs = typo.
12897
12898 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12899
12900 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12901 Default value is now t. Doc fix.
12902
12903 * indent.c (Fvertical_motion): Compute and apply the overshoot
12904 logic when moving up, not only when moving down. Fix the
12905 confusing name and values of the it_overshoot_expected variable;
12906 logic changes accordingly. (Bug#9254) (Bug#9549)
12907
12908 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12909 CHARPOS is covered by a display string which includes newlines.
12910 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12911 is covered by a display string with embedded newlines.
12912
12913 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12914
12915 * dbusbind.c (Fdbus_register_signal): Add match rule to
12916 Vdbus_registered_objects_table. (Bug#9581)
12917 (Fdbus_register_method, Vdbus_registered_objects_table):
12918 Fix docstring.
12919
12920 2011-09-24 Jim Meyering <meyering@redhat.com>
12921
12922 do not ignore write error for any output size
12923 The previous change was incomplete.
12924 While it makes emacs --batch detect the vast majority of stdout
12925 write failures, errors were still ignored whenever the output size is
12926 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12927 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12928 && echo FAIL: ignored write error
12929 FAIL: ignored write error
12930 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12931 && echo FAIL: ignored write error
12932 FAIL: ignored write error
12933 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12934
12935 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12936
12937 * emacs.c (Fkill_emacs): In noninteractive mode exit
12938 non-successfully if a write error occurred on stdout. (Bug#9574)
12939
12940 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12941
12942 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12943 the xassert test.
12944
12945 * dispextern.h (struct it): Update the comment documenting what
12946 can it->OBJECT be.
12947
12948 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12949
12950 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12951 a display string, extend search for cursor position to end of row.
12952 (find_row_edges): If the row ends in a newline from a display
12953 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12954 Handle the case of a display string with multiple newlines.
12955 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12956 non-empty line. Fixes confusing cursor motion with arrow keys at
12957 the beginning of a line that starts with whitespace.
12958
12959 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12960
12961 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12962 (bug#9493).
12963
12964 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12965
12966 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12967 boolean (Bug#9154).
12968
12969 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12970
12971 * xdisp.c (display_line): Record maximum and minimum buffer
12972 positions even if no glyphs were produced (e.g., by a zero-width
12973 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12974 buffer positions that will be removed from the glyph row because
12975 they don't fit.
12976 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12977 column is beyond frame width: don't subtract 1 "pixel" when
12978 computing width of the stretch.
12979 (reseat_at_next_visible_line_start): Undo the change made on
12980 2011-09-17 that saved paragraph information and restored it after
12981 the call to `reseat'. (Bug#9545)
12982
12983 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12984
12985 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12986 and turn window cursor on if cleared (Bug#9415).
12987
12988 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12989
12990 * search.c (boyer_moore): Take unibyte characters from pattern
12991 literally. (Bug#9458)
12992
12993 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12994
12995 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12996
12997 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12998
12999 Fix minor problem found by static checking.
13000 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13001 initialized, to pacify gcc -Wuninitialized.
13002
13003 * fileio.c: Report proper errno when syscall falls.
13004 (Finsert_file_contents): Save and restore errno,
13005 so that report_file_error outputs the correct diagnostic.
13006 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13007
13008 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13009
13010 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13011
13012 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13013
13014 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13015 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13016
13017 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13018
13019 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13020 about the current paragraph and restore it after the call to reseat.
13021
13022 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13023 (bidi_find_paragraph_start): Search back for paragraph beginning
13024 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13025 (bidi_move_to_visually_next): Only trigger paragraph-related
13026 computations when the last character is a newline or at EOB, not
13027 just any NEUTRAL_B. (Bug#9470)
13028
13029 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13030 truncated lines if point is covered by a display string. (Bug#9524)
13031
13032 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13033
13034 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13035 (cons_to_x_long): New function.
13036 (lisp_data_to_selection_data): Use it. Correct the test for
13037 short-versus-long data; it was negated. Break out of vector
13038 loop, for efficiency, when a long datum is discovered.
13039
13040 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13041
13042 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13043
13044 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13045
13046 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13047 GCC PR/17406) by declaring this function with external scope.
13048
13049 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13050
13051 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13052 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13053
13054 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13055
13056 * editfns.c (Fformat): Correctly handle text properties on "%%".
13057
13058 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13059
13060 * xterm.c (x_draw_composite_glyph_string_foreground):
13061 * w32term.c (x_draw_composite_glyph_string_foreground):
13062 * term.c (encode_terminal_code):
13063 * composite.c (composition_update_it, get_composition_id):
13064 * xdisp.c (get_next_display_element)
13065 (fill_composite_glyph_string): Add comments about special meaning
13066 of TAB characters in a composition.
13067
13068 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13069
13070 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13071 This occurs when processing a multibyte format.
13072 Problem reported by Wolfgang Jenker.
13073
13074 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13075
13076 * xdisp.c (try_cursor_movement): Only check for exact match if
13077 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13078
13079 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13080
13081 Remove unused external symbols.
13082 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13083 * xdisp.c (calc_pixel_width_or_height): Now static.
13084 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13085 * indent.c (check_display_width):
13086 * w32term.c: Fix comment to match code.
13087 * xterm.c, xterm.h (x_catching_errors): Remove.
13088
13089 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13090
13091 * xselect.c: Use signed conversions more consistently (Bug#9498).
13092 (selection_data_to_lisp_data): Assume incoming selection data are
13093 signed integers, not unsigned. This is to be consistent with
13094 outgoing selection data, which was modified to use signed integers
13095 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13096 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13097 expects long, not unsigned long.
13098
13099 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13100
13101 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13102 computation of loop end. Reported by Johan Bockgård
13103 <bojohan@gnu.org>.
13104
13105 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13106
13107 * frame.c (Fother_visible_frames_p): Function deleted.
13108
13109 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13110
13111 * indent.c (compute_motion): Process display vector front to back
13112 rather than the other way around. (Bug#2496)
13113
13114 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13115
13116 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13117
13118 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13119
13120 * minibuf.c (Fread_from_minibuffer): Doc fix.
13121
13122 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13123
13124 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13125 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13126
13127 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13128
13129 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13130 value for non-existent files.
13131
13132 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13133
13134 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13135 set its "size" to -1. This will set the modtime_size field of
13136 the corresponding buffer to -1, which is what
13137 verify-visited-file-modtime expects for files that do not exist.
13138 (Bug#9139)
13139
13140 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13141
13142 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13143 here ...
13144 * lisp.h: ... from here. push_key_description is no longer
13145 defined in keyboard.c, so its declaration should not be in
13146 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13147 logically belongs with push_key_description.
13148
13149 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13150
13151 * buffer.h: Include <sys/types.h> instead of <time.h>.
13152 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13153 Problem reported by Herbert J. Skuhra.
13154
13155 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13156
13157 * xml.c (parse_region): Make the parsing work for
13158 non-comment-starting XML files again (bug#9144).
13159
13160 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13161
13162 * image.c (gif_load): Fix calculation of bottom and right corner.
13163 (Bug#9468)
13164
13165 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13166
13167 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13168 redisplay in small windows.
13169
13170 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13171
13172 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13173
13174 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13175
13176 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13177 Operate on live windows only.
13178
13179 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13180
13181 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13182
13183 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13184
13185 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13186 only under bidi iteration.
13187
13188 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13189
13190 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13191
13192 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13193
13194 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13195 Without this fix, the command to link temacs failed due to an
13196 undefined symbol __builtin_isnan. This is because
13197 /usr/include/iso/math_c99.h #defines isnan(x) to
13198 __builtin_isnan(x), but the bundled gcc, which identifies itself
13199 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13200 a __builtin_isnan.
13201 * floatfns.c (isnan): #undef, and then #define to a clone of
13202 what's in data.c.
13203 (Fisnan): Always define, since it's always available now.
13204 (syms_of_floatfns): Always define isnan at the Lisp level.
13205
13206 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13207
13208 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13209
13210 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13211
13212 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13213 The previous code assumed that file offsets (off_t values) fit in
13214 EMACS_INT variables, which is not true on typical 32-bit hosts.
13215 The code messed up by falsely reporting buffer overflow in cases
13216 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13217 when "big" contains more than 2**29 bytes, even though this
13218 inserts just one byte and does not overflow the buffer.
13219 (Finsert_file_contents): Store file offsets as off_t
13220 values, not as EMACS_INT values. Check for overflow when
13221 converting between EMACS_INT and off_t. When checking for
13222 buffer overflow or for overlap, take the offsets into account.
13223 Don't use EMACS_INT for small values where int suffices.
13224 When checking for overlap, fix a typo: ZV was used where
13225 ZV_BYTE was intended.
13226 (Fwrite_region): Don't assume off_t fits into 'long'.
13227 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13228
13229 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13230
13231 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13232
13233 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13234
13235 sprintf-related integer and memory overflow issues (Bug#9412).
13236
13237 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13238 (esprintf, exprintf, evxprintf): New functions.
13239 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13240 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13241 (modify_event_symbol): Do not assume that the length of
13242 name_alist_or_stem is safe to alloca and fits in int.
13243 (Fexecute_extended_command): Likewise for function name and binding.
13244 (Frecursion_depth): Wrap around reliably on integer overflow.
13245 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13246 since some callers pass EMACS_INT values.
13247 (Fsingle_key_description): Don't crash if symbol name contains more
13248 than MAX_ALLOCA bytes.
13249 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13250 (get_minibuffer): Arg is now EMACS_INT, not int.
13251 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13252 (esprintf, exprintf, evxprintf): New decls.
13253 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13254
13255 * dbusbind.c (signature_cat): New function.
13256 (xd_signature, Fdbus_register_signal):
13257 Do not overrun buffer; instead, report string overflow.
13258
13259 * dispnew.c (add_window_display_history): Don't overrun buffer.
13260 Truncate instead; this is OK since it's just a log.
13261
13262 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13263 even if the time zone offset is outlandishly large.
13264 Don't mishandle offset == INT_MIN.
13265
13266 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13267 when creating daemon; the previous buffer-overflow check was incorrect.
13268
13269 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13270 which has the guts of the old verror function.
13271
13272 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13273 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13274
13275 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13276 (font_unparse_xlfd): Don't blindly alloca long strings.
13277 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13278 fits in int, when using sprintf. Use single snprintf to count
13279 length of string rather than counting it via multiple sprintfs;
13280 that's simpler and more reliable.
13281 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13282 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13283 sprintf, in case result does not fit in int.
13284
13285 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13286 (fontset_from_font): Print it.
13287
13288 * frame.c (tty_frame_count): Now printmax_t, not int.
13289 (make_terminal_frame, set_term_frame_name): Print it.
13290 (x_report_frame_params): In X, window IDs are unsigned long,
13291 not signed long, so print them as unsigned.
13292 (validate_x_resource_name): Check for implausibly long names,
13293 and don't assume name length fits in 'int'.
13294 (x_get_resource_string): Don't blindly alloca invocation name;
13295 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13296 not fit in int.
13297
13298 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13299 (xg_check_special_colors, xg_set_geometry):
13300 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13301
13302 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13303 Use esprintf, not sprintf, in case result does not fit in int.
13304
13305 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13306 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13307 it as a large positive number.
13308 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13309 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13310
13311 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13312 in case result does not fit in int.
13313
13314 * print.c (float_to_string): Detect width overflow more reliably.
13315 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13316 buffer overrun. Don't assume list length fits in 'int'. Treat
13317 print length of 0 as 0, not as infinity; to be consistent with other
13318 uses of print length in this function. Don't overflow print length
13319 index. Don't assume hash table size fits in 'long', or that
13320 vectorlike size fits in 'unsigned long'.
13321
13322 * process.c (make_process): Use printmax_t, not int, to format
13323 process-name gensyms.
13324
13325 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13326
13327 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13328 to avoid potential buffer overrun.
13329
13330 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13331 if X resource line is longer than 512 bytes.
13332
13333 * xfns.c (x_window): Make sprintf buffer a bit bigger
13334 to avoid potential buffer overrun.
13335
13336 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13337
13338 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13339
13340 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13341
13342 Integer overflow fixes for scrolling, etc.
13343 Without these, Emacs silently mishandles large integers sometimes.
13344 For example, "C-u 4294967297 M-x recenter" was treated as if
13345 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13346
13347 * xdisp.c (try_window_id): Check Emacs fixnum range before
13348 converting to 'int'.
13349
13350 * window.c (window_scroll_line_based, Frecenter):
13351 Check that an Emacs fixnum is in range before assigning it to 'int'.
13352 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13353 values converted from Emacs fixnums.
13354 (Frecenter): Don't wrap around a line count if it is out of 'int'
13355 range; instead, treat it as an extreme value.
13356 (Fset_window_configuration, compare_window_configurations):
13357 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13358
13359 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13360 that can exceed INT_MAX. Check that EMACS_INT value is in range
13361 before assigning it to the (possibly-narrower) index.
13362 (match_limit): Don't assume that a fixnum can fit in 'int'.
13363
13364 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13365 exceed INT_MAX.
13366
13367 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13368 (Fvertical_motion): Don't wrap around LINES values that don't fit
13369 in 'int'. Instead, treat them as extreme values. This is good
13370 enough for windows, which can't have more than INT_MAX lines anyway.
13371
13372 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13373
13374 * Require libxml/parser.h to avoid compilation warning.
13375
13376 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13377
13378 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13379 since this reportedly can destroy thread storage.
13380
13381 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13382
13383 * syntax.c (find_defun_start): Update all cache variables if
13384 exiting early (Bug#9401).
13385
13386 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13387
13388 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13389
13390 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13391 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13392 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13393
13394 * term.c (tty_append_glyph): New function.
13395 (produce_stretch_glyph): Static function and its prototype deleted.
13396
13397 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13398 Add prototypes.
13399
13400 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13401
13402 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13403 when checking :margin (Bug#9390).
13404 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13405 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13406 so that the name doesn't mislead. All uses changed.
13407
13408 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13409
13410 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13411 set_tty_hooks.
13412
13413 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13414
13415 * xdisp.c (move_it_to): Don't bail out early when reaching
13416 position beyond to_charpos, if we are scanning backwards.
13417 (move_it_vertically_backward): When DY == 0, make sure we get to
13418 the first character in the line after the newline.
13419
13420 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13421
13422 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13423 (ccl_driver): Do not generate an out-of-range pointer.
13424 (Fccl_execute_on_string): Remove unnecessary check for
13425 integer overflow, noted by Stefan Monnier in
13426 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13427 Remove a FIXME that didn't need fixing.
13428 Simplify the newly-introduced buffer reallocation code.
13429
13430 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13431
13432 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13433
13434 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13435
13436 Integer and memory overflow issues (Bug#9196).
13437
13438 * doc.c (get_doc_string): Rework so that
13439 get_doc_string_buffer_size is the actual buffer size, rather than
13440 being 1 less than the actual buffer size; this makes xpalloc more
13441 convenient.
13442
13443 * image.c (x_allocate_bitmap_record, cache_image):
13444 * xselect.c (Fx_register_dnd_atom):
13445 Simplify previous changes by using xpalloc.
13446
13447 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13448 since either will do and ptrdiff_t is convenient with xpalloc.
13449
13450 * charset.c (charset_table_size)
13451 (struct charset_sort_data.priority): Now ptrdiff_t.
13452 (charset_compare): Don't overflow if priorities differ greatly.
13453 (Fsort_charsets): Don't assume list length fits in int.
13454 Check for size-calculation overflow when allocating sort data.
13455 (syms_of_charset): Allocate an initial charset table that is
13456 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13457
13458 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13459
13460 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13461 The actual value is always <= INT_MAX, and leaving it unsigned made
13462 overflow checking harder.
13463
13464 * dispextern.h (struct glyph_matrix.rows_allocated)
13465 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13466 with xpalloc. The values are still always <= INT_MAX.
13467
13468 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13469
13470 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13471 (SAFE_NALLOCA): New macro.
13472
13473 * region-cache.c (struct boundary.pos, find_cache_boundary)
13474 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13475 (set_cache_region, invalidate_region_cache)
13476 (revalidate_region_cache, know_region_cache, region_cache_forward)
13477 (region_cache_backward, pp_cache):
13478 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13479 so that ptrdiff_t * can be passed to xpalloc.
13480 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13481 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13482 (pp_cache): Don't assume cache_len fits in int.
13483 * region-cache.h: Adjust extern decls to match.
13484
13485 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13486 EMACS_INT, since either will do, for xpalloc.
13487
13488 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13489 (xnmalloc, xnrealloc, xpalloc): New functions.
13490
13491 * bidi.c (bidi_shelve_header_size): New constant.
13492 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13493 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13494
13495 * bidi.c (bidi_cache_shrink):
13496 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13497 (overlay_strings):
13498 Don't update size of array until after memory allocation succeeds,
13499 because xmalloc/xrealloc may not return.
13500 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13501 now that we have proper integer overflow checking.
13502 (record_overlay_string, overlay_strings): Catch overflows when
13503 calculating size of overlay_str_buf.
13504
13505 * callproc.c (Fcall_process): Check for size overflow when
13506 calculating size of args2.
13507 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13508 Normally we prefer signed values, but sticking with ptrdiff_t would
13509 require adding more-complicated checks.
13510
13511 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13512 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13513 Redo buffer-overflow calculations to avoid integer overflow.
13514 Add a FIXME comment where memory seems to be over-allocated.
13515
13516 * character.c (Fstring): Check for size-calculation overflow.
13517
13518 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13519 unnecessary integer overflow. Check for size overflow.
13520 (encode_coding_object): Don't update size until xmalloc succeeds.
13521
13522 * composite.c (get_composition_id): Check for overflow in glyph
13523 length calculations.
13524
13525 Integer and memory overflow fixes for display code.
13526 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13527 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13528 (scrolling_window): Check for overflow in size calculations.
13529 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13530 Don't assume glyph table len fits in int.
13531 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13532 (row_table_size): Now ptrdiff_t, not int.
13533 (scrolling_window): Avoid overflow in size calculations.
13534 Don't update size until allocation succeeds.
13535 * fns.c (concat): Check for overflow in size calculations.
13536 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13537 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13538 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13539
13540 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13541 (get_doc_string): Check for size calculation overflow.
13542 Don't update size until allocation succeeds.
13543 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13544 EMACS_INT, where ptrdiff_t will do.
13545 (Fsubstitute_command_keys): Check for string overflow.
13546
13547 * editfns.c (set_time_zone_rule): Don't assume environment length
13548 fits in int.
13549 (message_length): Now ptrdiff_t, not int.
13550 (Fmessage_box): Don't update size until allocation succeeds.
13551 Don't assume message length fits in int.
13552 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13553
13554 * emacs.c (main): Do not reallocate argv, since there is a null at
13555 the end that can be overwritten, and this way there's no need to
13556 worry about size-calculation overflow.
13557 (sort_args): Check for size-calculation overflow.
13558
13559 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13560 alloc succeeds.
13561 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13562
13563 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13564 (x_set_scroll_bar_width, x_figure_window_size):
13565 Check for integer overflow.
13566 (x_set_alpha): Do not assume XINT fits in int.
13567
13568 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13569 This is for the members text_lines, text_cols, total_lines, total_cols,
13570 where the system imposes an 'int' limit.
13571
13572 * fringe.c (Fdefine_fringe_bitmap):
13573 Don't update size until alloc works.
13574
13575 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13576 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13577
13578 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13579 Check for size-calculation overflow.
13580 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13581 do, as we prefer signed integers.
13582 (id_to_widget.max_size, id_to_widget.used)
13583 (xg_store_widget_in_map, xg_remove_widget_from_map)
13584 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13585 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13586 Use and return ptrdiff_t, not int.
13587 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13588 * gtkutil.h: Change prototypes to match the above.
13589
13590 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13591 are duplicate now that they've been promoted to lisp.h.
13592 (x_allocate_bitmap_record, x_alloc_image_color)
13593 (make_image_cache, cache_image, xpm_load):
13594 Don't update size until alloc is done.
13595 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13596 (x_detect_edges):
13597 Check for size calculation overflow.
13598 (ct_colors_allocated_max): New constant.
13599 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13600 overflow.
13601
13602 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13603 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13604 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13605 Use ptrdiff_t, not int, to count maps.
13606 (read_char_minibuf_menu_prompt): Check for overflow in size
13607 calculations. Don't update size until allocation succeeds.
13608 Redo calculations to avoid overflow.
13609 * keyboard.h: Change prototypes to match the above.
13610
13611 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13612 to count maps.
13613 (current_minor_maps): Check for size calculation overflow.
13614 * keymap.h: Change prototypes to match the above.
13615
13616 * lread.c (read1, init_obarray): Don't update size until alloc done.
13617
13618 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13619 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13620
13621 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13622 Now ptrdiff_t, not int.
13623 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13624 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13625
13626 * process.c (Fnetwork_interface_list): Check for overflow
13627 in size calculation.
13628
13629 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13630
13631 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13632 overflow. Don't bother calling xmalloc when xrealloc will do.
13633
13634 * search.c (Freplace_match): Check for size calculation overflow.
13635 (Fset_match_data): Don't assume list lengths fit in 'int'.
13636
13637 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13638 for command line length. Do not attempt to address one before the
13639 beginning of an array, as that's not portable.
13640
13641 * term.c (max_frame_lines): Remove; unused.
13642 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13643 not int.
13644 (encode_terminal_code, calculate_costs): Check for size
13645 calculation overflow.
13646 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13647 table lengths and related sizes. Don't update size until alloc
13648 done. Redo calculations to avoid overflow.
13649 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13650
13651 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13652 subtracting pointers.
13653 (gobble_line): Check for overflow more carefully. Don't update size
13654 until alloc done.
13655
13656 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13657 Don't update size until alloc done.
13658 Redo size calculations to avoid overflow.
13659 Check for size calculation overflow.
13660 (main) [DEBUG]: Fix typo in invoking tparam1.
13661
13662 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13663 Use ptrdiff_t, not int, for sizes.
13664 (store_mode_line_noprop_char): Don't update size until alloc done.
13665
13666 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13667 Use ptrdiff_t, not int, for sizes.
13668 (Finternal_make_lisp_face, cache_face):
13669 Check for size calculation overflow.
13670 (cache_face): Treat size calculation overflows as if they were
13671 memory exhaustion (the usual treatment), rather than aborting.
13672
13673 * xfns.c (x_encode_text, x_set_name_internal)
13674 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13675 sizes, since they can exceed INT_MAX in size. Check for size
13676 calculation overflow.
13677
13678 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13679 (xg_select): Check for size calculation overflow.
13680 Don't update size until alloc done.
13681
13682 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13683 as sprintf is limited to int lengths.
13684
13685 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13686 (X_LONG_MIN): New macros.
13687 Use them to make the following changes clearer.
13688 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13689 This change doesn't affect the value now, but it may help remind
13690 future maintainers not to raise the value too much later.
13691 (SELECTION_QUANTUM): Remove, replacing with ...
13692 (selection_quantum): ... new function, which avoids overflow.
13693 All uses changed.
13694 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13695 assumption that selection length fits in 'int'.
13696 (x_reply_selection_request, x_handle_selection_request)
13697 (x_get_window_property, receive_incremental_selection)
13698 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13699 (lisp_data_to_selection_data, clean_local_selection_data):
13700 Use ptrdiff_t, not int, to record length of selection.
13701 (x_reply_selection_request, x_get_window_property)
13702 (receive_incremental_selection, x_property_data_to_lisp):
13703 Redo calculations to avoid overflow.
13704 (x_reply_selection_request): When sending hint, ceiling it at
13705 X_LONG_MAX rather than relying on wraparound overflow to send
13706 something.
13707 (x_get_window_property, receive_incremental_selection)
13708 (lisp_data_to_selection_data, x_property_data_to_lisp):
13709 Check for size-calculation overflow.
13710 (x_get_window_property, receive_incremental_selection)
13711 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13712 Don't store size until memory allocation succeeds.
13713 (x_get_window_property): Plug memory leak on memory exhaustion.
13714 Don't double-block input; malloc is safe here. Don't assume 2**34
13715 - 4 fits in unsigned long. Add an xassert to check
13716 XGetWindowProperty overflow. Be more careful about overflow
13717 calculations, and distinguish size from memory overflow better.
13718 (receive_incremental_selection): When tracing, don't assume
13719 unsigned int is less than INT_MAX.
13720 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13721 harmful) conversions of unsigned short to int.
13722 (lisp_data_to_selection_data): Don't assume that integers
13723 in the range -65535 through -1 fit in an X unsigned short.
13724 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13725 result parameters unless successful. Rely on cons_to_unsigned
13726 to report problems with elements; the old code wasn't right anyway.
13727 (x_check_property_data): Check for int overflow; we cannot use
13728 a wider type due to X limits.
13729 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13730
13731 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13732
13733 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13734 (x_term_init): Check for size calculation overflow.
13735 (x_color_cells): Don't store size until memory allocation succeeds.
13736 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13737 Don't assume alloca size is less than MAX_ALLOCA.
13738 (x_term_init): Don't assume length fits in int (sprintf is limited
13739 to int size).
13740
13741 Use ptrdiff_t for composition IDs.
13742 * character.c (lisp_string_width):
13743 * composite.c (composition_table_size, n_compositions)
13744 (get_composition_id, composition_gstring_from_id):
13745 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13746 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13747 * window.c (Frecenter):
13748 Use ptrdiff_t, not int, for composition IDs.
13749 * composite.c (get_composition_id): Check for integer overflow.
13750 * composite.h: Adjust prototypes to match the above changes.
13751
13752 Use ptrdiff_t for hash table indexes.
13753 * category.c (hash_get_category_set):
13754 * ccl.c (ccl_driver):
13755 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13756 * coding.c (coding_system_charset_list, detect_coding_system):
13757 * coding.h (struct coding_system.id):
13758 * composite.c (get_composition_id, gstring_lookup_cache):
13759 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13760 * image.c (xpm_get_color_table_h):
13761 * lisp.h (hash_lookup, hash_put):
13762 * minibuf.c (Ftest_completion):
13763 Use ptrdiff_t for hash table indexes, not int (which is too
13764 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13765 32-bit --with-wide-int hosts).
13766
13767 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13768 Add a FIXME comment about memory leaks.
13769 (syms_of_charset): Don't assume xmalloc returns.
13770
13771 Don't assume that stated character widths fit in int.
13772 * character.c (Fchar_width, c_string_width, lisp_string_width):
13773 * character.h (CHAR_WIDTH):
13774 * indent.c (MULTIBYTE_BYTES_WIDTH):
13775 Use sanitize_char_width to avoid undefined and/or bad behavior
13776 with outlandish widths.
13777 * character.h (sanitize_tab_width): Rename from sanitize_width,
13778 now that we have two such functions. All uses changed.
13779 (sanitize_char_width): New inline function.
13780
13781 Don't assume that tab-width fits in int.
13782 * character.h (sanitize_width): New inline function.
13783 (SANE_TAB_WIDTH): New macro.
13784 (ASCII_CHAR_WIDTH): Use it.
13785 * indent.c (sane_tab_width): Remove. All uses replaced by
13786 SANE_TAB_WIDTH (current_buffer).
13787 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13788
13789 * fileio.c: Integer overflow issues with file modes.
13790 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13791
13792 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13793 Remove unreachable code.
13794 (read_hex, load_charset_map_from_file): Check for integer overflow.
13795
13796 * xterm.c: Don't go over XClientMessageEvent limit.
13797 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13798 (x_send_scroll_bar_event): Likewise. Check that the size does not
13799 exceed limits imposed by XClientMessageEvent, as well as the usual
13800 ptrdiff_t and size_t limits.
13801
13802 * keyboard.c: Overflow, signedness and related fixes.
13803 (make_lispy_movement): Use same integer type in forward decl
13804 that is used in the definition.
13805 (read_key_sequence, keyremap_step):
13806 Change bufsize argument back to int, undoing my 2011-03-30 change.
13807 We prefer signed types, and int is wide enough here.
13808 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13809 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13810 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13811 length, not size_t. Use ptrdiff_t for index, not int.
13812 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13813 possibility of integer overflow.
13814
13815 Overflow, signedness and related fixes for images.
13816
13817 * dispextern.h (struct it.stack[0].u.image.image_id)
13818 (struct_it.image_id, struct image.id, struct image_cache.size)
13819 (struct image_cache.used, struct image_cache.ref_count):
13820 * gtkutil.c (update_frame_tool_bar):
13821 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13822 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13823 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13824 * nsmenu.m (update_frame_tool_bar):
13825 * xdisp.c (calc_pixel_width_or_height):
13826 * xfns.c (image_cache_refcount):
13827 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13828 on typical 64-bit hosts.
13829
13830 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13831 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13832 Omit unnecessary casts to int.
13833 (parse_image_spec): Check that integers fall into 'int' range
13834 when the callers expect that.
13835 (image_ascent): Redo ascent calculation to avoid int overflow.
13836 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13837 (lookup_image): Remove unnecessary tests.
13838 (xbm_image_p): Locals are now of int, not EMACS_INT,
13839 since parse_image_check makes sure they fit into int.
13840 (png_load, gif_load, svg_load_image):
13841 Prefer int to unsigned where either will do.
13842 (tiff_handler): New function, combining the cores of the
13843 old tiff_error_handler and tiff_warning_handler.
13844 This function is rewritten to use vsnprintf and thereby avoid
13845 stack buffer overflows. It uses only the features of vsnprintf
13846 that are common to both POSIX and native Microsoft.
13847 (tiff_error_handler, tiff_warning_handler): Use it.
13848 (tiff_load, gif_load, imagemagick_load_image):
13849 Don't assume :index value fits in 'int'.
13850 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13851 (imagemagick_load_image): Check that crop parameters fit into
13852 the integer types that MagickCropImage accepts. Don't assume
13853 Vimagemagick_render_type has a nonnegative value. Don't assume
13854 size_t fits in 'long'.
13855 (gs_load): Use printmax_t to print the widest integers possible.
13856 Check for integer overflow when computing image height and width.
13857
13858 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13859
13860 * xdisp.c (redisplay_window): Don't force window start if point
13861 will be invisible in the resulting window. (Bug#9324)
13862
13863 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13864
13865 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13866 the display spec is of the form `(space ...)'.
13867 (handle_display_spec): Return the value returned by
13868 handle_single_display_spec, not just 1 or zero.
13869 (handle_single_display_spec): If the display spec is of the form
13870 `(space ...)', and specifies display in the text area, return 2
13871 rather than 1.
13872 (try_cursor_movement): Check for the need to scroll more
13873 accurately, and prefer exact match for point under bidi.
13874 Don't advance `row' beyond the last row of the window.
13875
13876 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13877 into disp_prop; all users changed.
13878
13879 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13880 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13881 for the text covered by the display property.
13882
13883 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13884
13885 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13886 Change return value to nil.
13887 (Frecord_buffer): Delete unused function.
13888
13889 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13890
13891 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13892 buffers, return left-to-right.
13893 (set_cursor_from_row): Consider candidate row a win if its glyph
13894 represents a newline and point is on that newline. Fixes cursor
13895 positioning on the newline at EOL of R2L text within L2R
13896 paragraph, and vice versa.
13897 (try_cursor_movement): Check continued rows, in addition to
13898 continuation rows. Fixes unwarranted scroll when point enters a
13899 continued line of R2L text within an L2R paragraph, or vice versa.
13900 (cursor_row_p): Consider the case of point being equal to
13901 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13902 from the end of a short line to the beginning of a continued line
13903 of R2L text within L2R paragraph.
13904 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13905 composed characters.
13906
13907 * bidi.c (bidi_check_type): Use xassert.
13908 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13909 members.
13910
13911 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13912
13913 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13914 a character.
13915
13916 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13917
13918 * nsfont.m (ns_otf_to_script): Fix typo.
13919
13920 2011-08-22 Kenichi Handa <handa@m17n.org>
13921
13922 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13923 extra slot even if the purpose is char-code-property-table.
13924
13925 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13926
13927 * xdisp.c (redisplay_window): When computing centering_position,
13928 account for the height of the header line. (Bug#8874)
13929
13930 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13931 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13932 candidate is selected by the mouse, and that candidate has a
13933 composed character under the mouse.
13934
13935 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13936 coordinates reported by pos-visible-in-window-p for a composed
13937 character in column zero.
13938
13939 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13940
13941 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13942
13943 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13944
13945 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13946 consider it a hit if to_charpos is anywhere in the range of the
13947 composed buffer positions.
13948
13949 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13950
13951 * image.c (gif_load): Don't assume that each subimage has the same
13952 dimensions as the base image. Handle disposal method that is
13953 "undefined" by the gif spec (Bug#9335).
13954
13955 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13956
13957 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13958 (Fcondition_case): Document `debug' symbol in error handler.
13959
13960 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13961
13962 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13963 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13964 from an Org mode buffer to a Speedbar frame.
13965
13966 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13967 a composition, take its buffer position from IT->cmp_it.charpos.
13968 Fixes cursor positioning at the beginning of a line that begins
13969 with a composed character.
13970
13971 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13972
13973 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13974 character bidirectional type, use STRONG_L instead. Fixes crashes
13975 in a buffer produced by `describe-categories'.
13976
13977 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13978 members before the level stack, so they would be saved and
13979 restored when copying iterator state. Fixes incorrect reordering
13980 around TABs covered by display properties.
13981
13982 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13983
13984 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13985
13986 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13987
13988 * eval.c (internal_condition_case, internal_condition_case_1)
13989 (internal_condition_case_2, internal_condition_case_n):
13990 Remove unnecessary aborts (Bug#9081).
13991
13992 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13993
13994 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13995 has no `load' handler, try opening the file locally. (Bug#9311)
13996
13997 2011-08-16 Ken Brown <kbrown@cornell.edu>
13998
13999 * gmalloc.c: Expand comment.
14000
14001 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14002
14003 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14004 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14005
14006 2011-08-16 Ken Brown <kbrown@cornell.edu>
14007
14008 Fix memory allocation problems in Cygwin build (Bug#9273).
14009
14010 * unexcw.c ( __malloc_initialized): Declare external variable.
14011 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14012
14013 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14014 New variables.
14015 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14016 dumped emacs.
14017 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14018 in the static heap.
14019 [CYGWIN] (special_realloc): New function.
14020 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14021 requests to realloc storage in the static heap.
14022
14023 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14024
14025 * bidi.c (bidi_initialize): Remove unused local.
14026
14027 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14028
14029 * bidimirror.h:
14030 * biditype.h: Remove file.
14031 * makefile.w32-in ($(BLD)/bidi.$(O)):
14032 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14033
14034 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14035
14036 * chartab.c: Improve commentary for the uniprop_table API.
14037
14038 * bidi.c (bidi_paragraph_init): Support zero value of
14039 bidi_ignore_explicit_marks_for_paragraph_level.
14040 (bidi_initialize): Use uniprop_table instead of including
14041 biditype.h and bidimirror.h.
14042
14043 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14044 coordinates of the iterator when restoring from ppos_it.
14045 (Bug#9296)
14046
14047 2011-08-14 Kenichi Handa <handa@m17n.org>
14048
14049 * process.c (create_process): Call setup_process_coding_systems
14050 after the pid of the process is set to -1 (Bug#8162).
14051
14052 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14053
14054 * xdisp.c (move_it_in_display_line_to): Don't invoke
14055 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14056 ppos_it. Fixes vertical cursor motion when line beginning is
14057 covered by an image. (Bug#9296)
14058
14059 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14060
14061 * nsterm.h (ns_run_ascript): Declare.
14062 (NSAPP_DATA2_RUNASSCRIPT): Define.
14063
14064 * nsfns.m (as_script, as_result, as_status): New static variables.
14065 (ns_run_ascript): New function.
14066 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14067 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14068 the event loop. Get status from as_status (Bug#7276).
14069
14070 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14071 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14072 the event loop (Bug#7276).
14073
14074 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14075
14076 * gnutls.c (QCgnutls_bootprop_priority)
14077 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14078 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14079 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14080 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14081 (QCgnutls_bootprop_verify_hostname_error)
14082 (QCgnutls_bootprop_callbacks_verify): Rename from
14083 Qgnutls_bootprop_..., all uses changed.
14084
14085 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14086 uses changed.
14087
14088 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14089
14090 * xfaces.c (Qframe_set_background_mode): Now static.
14091 * dispextern.h (Qframe_set_background_mode): Remove decl.
14092
14093 * process.c (Fnetwork_interface_info): Declare local only if needed.
14094
14095 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14096
14097 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14098 (Fnetwork_interface_list): Allocate in increments of bytes instead
14099 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14100 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14101 sockaddr.
14102 (struct ifflag_def): notrailers is smart on OSX.
14103 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14104 Get hardware address with getifaddrs if available.
14105
14106 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14107
14108 * xdisp.c (iterate_out_of_display_property): xassert that
14109 IT->position is set to within IT->object's boundaries. Break from
14110 the loop as soon as EOB is reached; avoids infloops in redisplay
14111 when IT->position is set up wrongly due to some bug.
14112 Set IT->current to match the bidi iterator unconditionally.
14113 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14114 entry. Force push_it to save on the stack the current
14115 buffer/string position, to be restored by pop_it. Fix flags in
14116 the iterator structure wrt the object coming from a display
14117 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14118 properties. (Bug#9284)
14119
14120 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14121
14122 * fontset.c (fontset_get_font_group): Add proper type checks.
14123 (Bug#9172)
14124
14125 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14126
14127 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14128 and LC_VERSION_MIN_MACOSX.
14129 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14130 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14131
14132 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14133
14134 * xdisp.c (forward_to_next_line_start): Allow to use the
14135 no-display-properties-and-no-overlays under bidi display.
14136 Set disp_pos in the bidi iterator to avoid searches for display
14137 properties and overlays.
14138
14139 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14140
14141 * editfns.c (Fset_time_zone_rule): Document relationship with the
14142 setenv function.
14143
14144 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14145 the font entity extracted from the cache (Bug#8109).
14146
14147 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14148
14149 * composite.c (autocmp_chars): Don't reset point. That is done by
14150 restore_point_unwind (Bug#5984).
14151
14152 2011-08-07 Juri Linkov <juri@jurta.org>
14153
14154 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14155 to show the arg `TIME' instead of `TIMEVAL'.
14156
14157 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14158
14159 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14160 display property strides EOL and includes a newline, as in
14161 longlines-mode. (Bug#9254)
14162 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14163 word-wrap under bidirectional display. (Bug#9224)
14164
14165 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14166 is non-zero, even if the data buffer is NULL. Fixes a crash in
14167 vertical-motion with longlines-mode. (Bug#9254)
14168
14169 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14170
14171 * bidi.c <bidi_cache_total_alloc>: Now static.
14172 (bidi_initialize): Initialize bidi_cache_total_alloc.
14173
14174 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14175 cache. (Bug#9221)
14176
14177 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14178 amount allocated this far in `bidi_cache_total_alloc'.
14179 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14180 non-zero, only free the data buffer without restoring the cache
14181 contents. All callers changed.
14182
14183 * dispextern.h (bidi_unshelve_cache): Update prototype.
14184
14185 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14186 (move_it_in_display_line, move_it_to)
14187 (move_it_vertically_backward, move_it_by_lines): Replace the call
14188 to xfree to an equivalent call to bidi_unshelve_cache.
14189 (move_it_in_display_line_to): Fix logic of returning
14190 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14191
14192 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14193
14194 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14195 came from a string character with a `cursor' property. (Bug#9229)
14196
14197 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14198
14199 * Makefile.in (LIB_PTHREAD): New variable.
14200 (LIBES): Add LIB_PTHREAD (Bug#9216).
14201
14202 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14203 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14204
14205 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14206
14207 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14208
14209 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14210
14211 * xterm.c (x_find_topmost_parent): New function.
14212 (x_set_frame_alpha): Find topmost parent window with
14213 x_find_topmost_parent and set the property there also (bug#9181).
14214 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14215
14216 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14217
14218 * callproc.c (Fcall_process): Avoid vfork clobbering
14219 the local vars buffer, coding_systems, current_dir.
14220
14221 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14222
14223 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14224
14225 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14226
14227 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14228 so that it is not optimized away.
14229
14230 * xdisp.c (compute_display_string_pos): Remove unused local.
14231
14232 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14233
14234 Fix slow cursor motion and scrolling in large buffers with
14235 selective display, like Org Mode buffers. (Bug#9218)
14236
14237 * dispextern.h (struct bidi_it): New member disp_prop_p.
14238
14239 * xdisp.c: Remove one-slot cache of display string positions.
14240 (compute_display_string_pos): Accept an additional argument
14241 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14242 for a display string or property. If found, set DISP_PROP_P
14243 non-zero.
14244
14245 * bidi.c (bidi_fetch_char): Accept an additional argument
14246 DISP_PROP_P, and pass it to compute_display_string_pos.
14247 Only handle text covered by a display string if DISP_PROP_P is returned
14248 non-zero. All callers of bidi_fetch_char changed.
14249
14250 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14251
14252 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14253
14254 2010-12-03 Don March <don@ohspite.net>
14255
14256 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14257 last character M-[char] is translated to ESC [char] (bug#7541).
14258
14259 2011-08-02 Kenichi Handa <handa@m17n.org>
14260
14261 * lisp.h (uniprop_table): Extern it.
14262
14263 * chartab.c (uniprop_table): Make it non-static.
14264
14265 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14266
14267 * xdisp.c (forward_to_next_line_start): Accept additional argument
14268 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14269 on the newline.
14270 (reseat_at_next_visible_line_start): Use the bidi iterator state
14271 returned by forward_to_next_line_start to restore the state of
14272 it->bidi_it after backing up to previous newline. (Bug#9212)
14273
14274 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14275
14276 * regex.c (re_comp): Protoize.
14277 (re_exec): Fix return type.
14278 (regexec): Fix type of `ret'. (Bug#9203)
14279
14280 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14281
14282 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14283 This is needed if max-image-size is a floating-point number.
14284
14285 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14286
14287 * print.c (print_object): Print empty symbol as ##.
14288
14289 * lread.c (read1): Read ## as empty symbol.
14290
14291 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14292
14293 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14294 setting frame foreground color (Bug#9175).
14295 (x_set_background_color): Likewise.
14296
14297 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14298 contents (Bug#9176).
14299 (EmacsTooltip -init): Remove bezels and add shadows to
14300 tooltip windows.
14301
14302 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14303 or scroll bar (Bug#8470).
14304
14305 * nsfont.m (nsfont_open): Remove assignment to voffset and
14306 unnecessary vars hshink, expand, hd, full_height, min_height.
14307 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14308
14309 * nsterm.h (nsfont_info): Remove voffset field.
14310
14311 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14312
14313 Implement strike-through and overline on NextStep (Bug#8863).
14314
14315 * nsfont.m (nsfont_open): Use underline position provided by font,
14316 instead of hard-coded value of 2.
14317 (nsfont_draw): Call ns_draw_text_decoration instead.
14318
14319 * nsterm.h: Add declaration for ns_draw_text_decoration.
14320
14321 * nsterm.m (ns_draw_text_decoration): New function for drawing
14322 underline, overline, and strike-through.
14323 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14324 ns_draw_text_decoration. Change treatment of cursor drawing to
14325 accommodate underlining, etc.
14326
14327 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14328
14329 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14330 default.
14331
14332 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14333
14334 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14335 Without this fix, if a signal arrives just after memory fills up,
14336 'malloc' might be invoked reentrantly.
14337
14338 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14339 In other words, assume that every image size is allowed, on non-X
14340 hosts. This assumption is probably wrong, but it lets Emacs compile.
14341
14342 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14343
14344 * regex.c (re_iswctype): Convert return values to boolean.
14345
14346 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14347
14348 * xdisp.c (compute_display_string_pos): Don't use cached display
14349 string position if the buffer had its restriction changed.
14350 (Bug#9184)
14351
14352 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14353
14354 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14355
14356 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14357
14358 Integer signedness and overflow and related fixes. (Bug#9079)
14359
14360 * bidi.c: Integer size and overflow fixes.
14361 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14362 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14363 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14364 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14365 (bidi_find_other_level_edge):
14366 Use ptrdiff_t instead of EMACS_INT where either will do.
14367 This works better on 32-bit hosts configured --with-wide-int.
14368 (bidi_cache_ensure_space): Check for size-calculation overflow.
14369 Use % rather than repeated addition, for better worst-case speed.
14370 Don't set bidi_cache_size until after xrealloc returns, because it
14371 might not return.
14372 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14373 (bidi_cache_ensure_space): Also check that the bidi cache size
14374 does not exceed that of the largest Lisp string or buffer. See Eli
14375 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14376
14377 * alloc.c (__malloc_size_t): Remove.
14378 All uses replaced by size_t. See Andreas Schwab's note
14379 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14380
14381 * image.c: Improve checking for integer overflow.
14382 (check_image_size): Assume that f is nonnull, since
14383 it is always nonnull in practice. This is one less thing to
14384 worry about when checking for integer overflow later.
14385 (x_check_image_size): New function, which checks for integer
14386 overflow issues inside X.
14387 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14388 This removes the need for a memory_full check.
14389 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14390 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14391 (xbm_read_bitmap_data): Change locals back to 'int', since
14392 their values must fit in 'int'.
14393 (xpm_load_image, png_load, tiff_load):
14394 Invoke x_create_x_image_and_pixmap earlier,
14395 to avoid much needless work if the image is too large.
14396 (tiff_load): Treat overly large images as if
14397 x_create_x_image_and_pixmap failed, not as malloc failures.
14398 (gs_load): Use x_check_image_size.
14399
14400 * gtkutil.c: Omit integer casts.
14401 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14402 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14403
14404 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14405
14406 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14407 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14408 would wrongly return t on a 64-bit host.
14409
14410 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14411 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14412 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14413 and therefore cause GCC to emit a bogus diagnostic in some cases.
14414
14415 * image.c: Integer signedness and overflow and related fixes.
14416 This is not an exhaustive set of fixes, but it's time to
14417 record what I've got.
14418 (lookup_pixel_color, check_image_size): Remove redundant decls.
14419 (check_image_size): Don't assume that arbitrary EMACS_INT values
14420 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14421 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14422 (tiff_load, imagemagick_load_image):
14423 Check for overflow in size calculations.
14424 (x_create_x_image_and_pixmap): Remove unnecessary test for
14425 xmalloc returning NULL; that can't happen.
14426 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14427 (xpm_color_bucket): Use better integer hashing function.
14428 (xpm_cache_color): Don't possibly over-allocate memory.
14429 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14430 (gif_memory_source):
14431 Use ptrdiff_t, not int or size_t, to record sizes.
14432 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14433 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14434 either works, as we prefer signed integers.
14435 (tiff_read_from_memory, tiff_write_from_memory):
14436 Return tsize_t, not size_t, since that's what the TIFF API wants.
14437 (tiff_read_from_memory): Don't fail simply because the read would
14438 go past EOF; instead, return a short read.
14439 (tiff_load): Omit no-longer-needed casts.
14440 (Fimagemagick_types): Don't assume size fits into 'int'.
14441
14442 Improve hashing quality when configured --with-wide-int.
14443 * fns.c (hash_string): New function, taken from sxhash_string.
14444 Do not discard information about ASCII character case; this
14445 discarding is no longer needed.
14446 (sxhash-string): Use it. Change sig to match it. Caller changed.
14447 * lisp.h: Declare it.
14448 * lread.c (hash_string): Remove, since we now use fns.c's version.
14449 The fns.c version returns a wider integer if --with-wide-int is
14450 specified, so this should help the quality of the hashing a bit.
14451
14452 * emacs.c: Integer overflow minor fix.
14453 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14454 Define only if GNU_LINUX.
14455 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14456
14457 * dispnew.c: Integer signedness and overflow fixes.
14458 Remove unnecessary forward decls, that were a maintenance hassle.
14459 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14460 All uses changed.
14461 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14462 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14463 (prepare_desired_row, line_draw_cost):
14464 Use int, not unsigned, where either works.
14465 (save_current_matrix, restore_current_matrix):
14466 Use ptrdiff_t, not size_t, where either works.
14467 (init_display): Check for overflow more accurately, and without
14468 relying on undefined behavior.
14469
14470 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14471 Remove, replacing with the new symbols in lisp.h. All uses changed.
14472 * fileio.c (make_temp_name):
14473 * filelock.c (lock_file_1, lock_file):
14474 * xdisp.c (message_dolog):
14475 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14476 Use pMd etc. instead.
14477 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14478 replacing the pWIDE etc. symbols removed from editfns.c.
14479
14480 * keyboard.h (num_input_events): Now uintmax_t.
14481 This is (very slightly) less likely to mess up due to wraparound.
14482 All uses changed.
14483
14484 * buffer.c: Integer signedness fixes.
14485 (alloc_buffer_text, enlarge_buffer_text):
14486 Use ptrdiff_t rather than size_t when either will do, as we prefer
14487 signed integers.
14488
14489 * alloc.c: Integer signedness and overflow fixes.
14490 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14491 (__malloc_size_t): Default to size_t, not to int.
14492 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14493 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14494 Prefer ptrdiff_t to size_t when either would do, as we prefer
14495 signed integers.
14496 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14497 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14498 Now const. Initialize with values that are in range even if char
14499 is signed.
14500 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14501 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14502 These functions do the right thing with sizes > 2**32.
14503 (check_depth): Now ptrdiff_t, not int.
14504 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14505 Adjust to new way of storing sizes. Check for size overflow bugs
14506 in rest of code.
14507 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14508 slightly wrong anyway, as it missed one instance of
14509 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14510 (refill_memory_reserve): Omit needless cast to size_t.
14511 (mark_object_loop_halt): Mark as externally visible.
14512
14513 * xselect.c: Integer signedness and overflow fixes.
14514 (Fx_register_dnd_atom, x_handle_dnd_message):
14515 Use ptrdiff_t, not size_t, since we prefer signed.
14516 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14517 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14518 x_dnd_atoms_size and x_dnd_atoms_length.
14519
14520 * doprnt.c: Prefer signed to unsigned when either works.
14521 * eval.c (verror):
14522 * doprnt.c (doprnt):
14523 * lisp.h (doprnt):
14524 * xdisp.c (vmessage):
14525 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14526 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14527 prefer signed arithmetic to avoid comparison confusion.
14528 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14529 but is a bit tricky.
14530
14531 Assume freestanding C89 headers, string.h, stdlib.h.
14532 * data.c, doprnt.c, floatfns.c, print.c:
14533 Include float.h unconditionally.
14534 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14535 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14536 * regex.c: Likewise for stddef.h, string.h.
14537 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14538 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14539 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14540 (STDC_HEADERS): Remove obsolete defines.
14541 * sysdep.c: Include limits.h unconditionally.
14542
14543 Assume support for memcmp, memcpy, memmove, memset.
14544 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14545 * regex.c (memcmp, memcpy):
14546 Remove; we assume C89 now.
14547
14548 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14549 (__malloc_safe_bcopy): Remove; no longer needed.
14550
14551 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14552 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14553 well either way, and we prefer signed to unsigned.
14554
14555 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14556
14557 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14558 closes the connection while we're reading (bug#9182).
14559
14560 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14561
14562 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14563 are specified (Bug#9168).
14564
14565 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14566
14567 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14568 Found by GCC static checking and --with-wide-int on a 32-bit host.
14569
14570 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14571
14572 * xdisp.c (compute_display_string_pos): Fix logic of caching
14573 previous display string position. Initialize cached_prev_pos to
14574 -1. Fixes slow-down at the beginning of a buffer.
14575
14576 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14577
14578 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14579 for attrs[LFACE_FONTSET_INDEX].
14580
14581 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14582
14583 * xml.c (parse_region): Remove unused local
14584 that was recently introduced.
14585
14586 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14587
14588 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14589 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14590
14591 * xdisp.c (move_it_in_display_line_to): Record the best matching
14592 position for TO_CHARPOS while scanning the line, and restore it on
14593 exit if none of the characters scanned was an exact match.
14594 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14595 when exact match is impossible due to invisible text, and the
14596 lines are truncated.
14597
14598 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14599
14600 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14601 for OSX >= 10.7.
14602
14603 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14604
14605 Fix a significant slow-down of cursor motion with C-n, C-p,
14606 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14607 auto-repeat under bidi redisplay in fontified buffers.
14608 * xdisp.c (compute_stop_pos_backwards): New function.
14609 (next_element_from_buffer): Call compute_stop_pos_backwards to
14610 find a suitable prev_stop when we find ourselves before
14611 base_level_stop.
14612 (reseat): Don't look for prev_stop, as that could mean a very long
14613 run.
14614 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14615 <cached_disp_overlay_modiff>: Cache for last found display string
14616 position.
14617 (compute_display_string_pos): Return the cached position if asked
14618 about the same buffer in the same area of character positions, and
14619 the buffer wasn't changed since the time the display string
14620 position was cached.
14621
14622 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14623
14624 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14625 is an integer, which is important for empty lines. (Bug#9149)
14626
14627 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14628
14629 * frame.c (Fmodify_frame_parameters): In tty case, update the
14630 default face if necessary (Bug#4238).
14631
14632 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14633
14634 * editfns.c (Fstring_to_char): No need to explain what a character
14635 is in the docstring (Bug#6576).
14636
14637 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14638
14639 * xml.c (parse_region): Make sure we always return a tree.
14640
14641 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14642
14643 * xml.c (parse_region): If a document contains only comments,
14644 return that, too.
14645
14646 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14647
14648 * xml.c (make_dom): Return comments, too.
14649
14650 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14651
14652 Port to OpenBSD.
14653 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14654 and the surrounding thread.
14655 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14656 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14657 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14658 timer goes off.
14659 * s/openbsd.h (BROKEN_SIGIO): Define.
14660 * unexelf.c (unexec) [__OpenBSD__]:
14661 Don't update the .mdebug section of the Alpha COFF symbol table.
14662
14663 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14664
14665 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14666 (bug#8460).
14667
14668 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14669
14670 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14671 This fixes some race conditions on the permissions of any newly
14672 created file.
14673
14674 * alloc.c (valid_pointer_p): Use pipe, not open.
14675 This fixes some permissions issues when debugging.
14676
14677 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14678 If fchown fails to set both uid and gid, try to set just gid,
14679 as that is sometimes allowed. Adjust the file's mode to eliminate
14680 setuid or setgid bits that are inappropriate if fchown fails.
14681
14682 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14683
14684 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14685 to compare Lisp_Objects.
14686 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14687 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14688 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14689
14690 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14691
14692 * lread.c (read_integer): Unread even EOF character.
14693 (read1): Likewise. Properly record start position of symbol.
14694
14695 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14696 symbol character follows.
14697
14698 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14699
14700 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14701 This works around a problem with the previous change to Fcopy_file.
14702 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14703 and without this change, GCC might complain about discarding
14704 fchown's return value.
14705
14706 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14707
14708 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14709
14710 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14711
14712 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14713
14714 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14715
14716 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14717 it's used from the C level.
14718
14719 * process.c: Use the same condition for POLL_FOR_INPUT in both
14720 keyboard.c and process.c (bug#1858).
14721
14722 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14723
14724 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14725 (Fgnutls_boot): Use it.
14726
14727 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14728
14729 * doc.c (Fsubstitute_command_keys): Revert last change.
14730
14731 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14732
14733 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14734 quotes the next character, and doesn't affect other longer
14735 sequences (bug#8935).
14736
14737 * lread.c (syms_of_lread): Clarify that is isn't only
14738 `eval-buffer' and `eval-defun' that's affected by
14739 `lexical-binding' (bug#8460).
14740
14741 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14742
14743 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14744 bidi redisplay when a line includes both an image and is truncated.
14745
14746 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14747
14748 Fix minor problems found by static checking.
14749 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14750 (elsz): Now a signed constant, not a size_t var. We prefer signed
14751 types to unsigned, to avoid integer comparison confusion. Without
14752 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14753 "cannot optimize loop, the loop counter may overflow", a symptom
14754 of the confusion.
14755 * indent.c (Fvertical_motion): Mark locals as initialized.
14756 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14757
14758 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14759
14760 * search.c (Fre_search_backward): Mention `case-fold-search' in
14761 all the re_search_* functions (bug#8138).
14762
14763 * keyboard.c (Fopen_dribble_file): Document when the file is
14764 closed (bug#8056).
14765
14766 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14767
14768 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14769 bidi_cache_idx.
14770
14771 Support bidi reordering of display and overlay strings.
14772 * xdisp.c (compute_display_string_pos)
14773 (compute_display_string_end): Accept additional argument STRING.
14774 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14775 (reseat_to_string): Initialize bidi_it->string.s and
14776 bidi_it->string.schars.
14777 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14778 NULL (avoids a crash in bidi_paragraph_init).
14779 Initialize itb.string.lstring.
14780 (init_iterator): Call bidi_init_it only of a valid
14781 buffer position was specified. Initialize paragraph_embedding to
14782 L2R.
14783 (reseat_to_string): Initialize the bidi iterator.
14784 (display_string): If we need to ignore text properties of
14785 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14786 original value of -1 will not work with bidi.)
14787 (compute_display_string_pos): First arg is now struct
14788 `text_pos *'; all callers changed. Support display properties on
14789 Lisp strings.
14790 (compute_display_string_end): Support display properties on Lisp
14791 strings.
14792 (init_iterator, reseat_1, reseat_to_string): Initialize the
14793 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14794 when iterating on a string not from display properties).
14795 (compute_display_string_pos, compute_display_string_end):
14796 Fix calculation of the object to scan. Fixes an error when using
14797 arrow keys.
14798 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14799 base_level_stop; instead, set base_level_stop to BEGV.
14800 Fixes crashes in vertical-motion.
14801 (next_element_from_buffer): Improve commentary for when
14802 the iterator is before prev_stop.
14803 (init_iterator): Initialize bidi_p from the default value of
14804 bidi-display-reordering, not from buffer-local value. Use the
14805 buffer-local value only if initializing for buffer iteration.
14806 (handle_invisible_prop): Support invisible properties on strings
14807 that are being bidi-reordered.
14808 (set_iterator_to_next): Support bidi reordering of C strings and
14809 Lisp strings.
14810 (next_element_from_string): Support bidi reordering of Lisp
14811 strings.
14812 (handle_stop_backwards): Support Lisp strings as well.
14813 (display_string): Support display of R2L glyph rows.
14814 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14815 (init_iterator): Don't initialize it->bidi_p for strings
14816 here.
14817 (reseat_to_string): Initialize it->bidi_p for strings here.
14818 (next_element_from_string, next_element_from_c_string)
14819 (next_element_from_buffer): Add xassert's for correspondence
14820 between IT's object being iterated and it->bidi_it.string
14821 structure.
14822 (face_before_or_after_it_pos): Support bidi iteration.
14823 (next_element_from_c_string): Handle the case of the first string
14824 character that is not the first one in the visual order.
14825 (get_visually_first_element): New function, refactored from common
14826 parts of next_element_from_buffer, next_element_from_string, and
14827 next_element_from_c_string.
14828 (tool_bar_lines_needed, redisplay_tool_bar)
14829 (display_menu_bar): Force left-to-right direction. Add a FIXME
14830 comment for making that be controlled by a user option.
14831 (push_it, pop_it): Save and restore the state of the
14832 bidi iterator. Save and restore the bidi_p flag.
14833 (pop_it): Iterate out of display property for string iteration as
14834 well.
14835 (iterate_out_of_display_property): Support iteration over strings.
14836 (handle_single_display_spec): Set up it->bidi_it for iteration
14837 over a display string, and call bidi_init_it.
14838 (handle_single_display_spec, next_overlay_string)
14839 (get_overlay_strings_1, push_display_prop): Set up the bidi
14840 iterator for displaying display or overlay strings.
14841 (forward_to_next_line_start): Don't use the shortcut if
14842 bidi-iterating.
14843 (back_to_previous_visible_line_start): If handle_display_prop
14844 pushed the iterator stack, restore the internal state of the bidi
14845 iterator by calling bidi_pop_it same number of times.
14846 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14847 and we are bidi-iterating, don't decrement the iterator position;
14848 instead, set the first_elt flag in the bidi iterator, to produce
14849 the same effect.
14850 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14851 (push_display_prop): xassert that we are iterating a buffer.
14852 (push_it, pop_it): Save and restore paragraph_embedding member.
14853 (handle_single_display_spec, next_overlay_string)
14854 (get_overlay_strings_1, reseat_1, reseat_to_string)
14855 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14856 correctly. Don't assume unibyte strings are not bidi-reordered.
14857 (compute_display_string_pos)
14858 (compute_display_string_end): Fix handling the case of C string.
14859 (push_it, pop_it): Save and restore from_disp_prop_p.
14860 (handle_single_display_spec, push_display_prop): Set the
14861 from_disp_prop_p flag.
14862 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14863 (pop_it): Call iterate_out_of_display_property only if we are
14864 popping after iteration over a string that came from a display
14865 property. Fix a typo in popping stretch info. Add an assertion
14866 for verifying that the iterator position is in sync with the bidi
14867 iterator.
14868 (handle_single_display_spec, get_overlay_strings_1)
14869 (push_display_prop): Fix initialization of paragraph direction for
14870 string when that of the parent object is not yet determined.
14871 (reseat_1): Call bidi_init_it to resync the bidi
14872 iterator with IT's position. (Bug#7616)
14873 (find_row_edges): If ROW->start.pos gives position
14874 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14875 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14876 Reset the from_disp_prop_p flag.
14877 (SAVE_IT, RESTORE_IT): New macros.
14878 (pos_visible_p, face_before_or_after_it_pos)
14879 (back_to_previous_visible_line_start)
14880 (move_it_in_display_line_to, move_it_in_display_line)
14881 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14882 (try_scrolling, redisplay_window, display_line): Use them when
14883 saving a temporary copy of the iterator and restoring it back.
14884 (back_to_previous_visible_line_start, reseat_1)
14885 (init_iterator): Empty the bidi cache "stack".
14886 (move_it_in_display_line_to): If iterator ended up at
14887 EOL, but we never saw any buffer positions smaller than
14888 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14889 motion in bidi-reordered lines.
14890 (move_it_in_display_line_to): Record prev_method and prev_pos
14891 immediately before the call to set_iterator_to_next. Fixes cursor
14892 motion in bidi-reordered lines with stretch glyphs and strings
14893 displayed in margins. (Bug#8133) (Bug#8867)
14894 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14895 TO_CHARPOS.
14896 (pos_visible_p): Support positions in bidi-reordered lines.
14897 Save and restore bidi cache.
14898
14899 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14900 (bidi_paragraph_info): Delete unused struct.
14901 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14902 (bidi_cache_start): New variable.
14903 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14904 to zero.
14905 (bidi_cache_fetch_state, bidi_cache_search)
14906 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14907 (bidi_cache_find, bidi_peek_at_next_level)
14908 (bidi_level_of_next_char, bidi_find_other_level_edge)
14909 (bidi_move_to_visually_next): Compare cache index with
14910 bidi_cache_start rather than with zero.
14911 (bidi_fetch_char): Accept new argument STRING; all callers
14912 changed. Support iteration over a string. Support strings with
14913 display properties. Support unibyte strings. Fix the type of
14914 `len' according to what STRING_CHAR_AND_LENGTH expects.
14915 (bidi_paragraph_init, bidi_resolve_explicit_1)
14916 (bidi_resolve_explicit, bidi_resolve_weak)
14917 (bidi_level_of_next_char, bidi_move_to_visually_next):
14918 Support iteration over a string.
14919 (bidi_set_sor_type, bidi_resolve_explicit_1)
14920 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14921 can now be zero (for strings); special values 0 and -1 were
14922 changed to -1 and -2, respectively.
14923 (bidi_char_at_pos): New function.
14924 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14925 Call it instead of FETCH_MULTIBYTE_CHAR.
14926 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14927 initialized to valid values.
14928 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14929 values.
14930 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14931 the test for valid cached positions. Fix the logic for looking up
14932 the sentinel state in the cache. GCPRO the Lisp string we are
14933 iterating.
14934 (bidi_push_it, bidi_pop_it): New functions.
14935 (bidi_initialize): Initialize the bidi cache start stack pointer.
14936 (bidi_cache_ensure_space): New function, refactored from part of
14937 bidi_cache_iterator_state. Don't assume the required size is just
14938 one BIDI_CACHE_CHUNK away.
14939 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14940 (bidi_count_bytes, bidi_char_at_pos): New functions.
14941 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14942 always valid if bidi_cache_idx is valid.
14943 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14944 is valid if it's going to be used.
14945 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14946 (bidi_cache_fetch_state, bidi_cache_search)
14947 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14948 (bidi_cache_iterator_state, bidi_cache_find)
14949 (bidi_find_other_level_edge, bidi_cache_start_stack):
14950 All variables related to cache indices are now EMACS_INT.
14951
14952 * dispextern.h (struct bidi_string_data): New structure.
14953 (struct bidi_it): New member `string'. Make flag members be 1-bit
14954 fields, and put them last in the struct.
14955 (compute_display_string_pos, compute_display_string_end):
14956 Update prototypes.
14957 (bidi_push_it, bidi_pop_it): Add prototypes.
14958 (struct iterator_stack_entry): New members bidi_p,
14959 paragraph_embedding, and from_disp_prop_p.
14960 (struct it): Member bidi_p is now a bit field 1 bit wide.
14961 (bidi_shelve_cache, bidi_unshelve_cache):
14962 Declare prototypes.
14963
14964 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14965 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14966 and vector-like objects.
14967
14968 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14969 cache around display iteration.
14970
14971 * window.c (Fwindow_end, window_scroll_pixel_based)
14972 (displayed_window_lines, Frecenter): Save and restore the bidi
14973 cache around display iteration.
14974
14975 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14976
14977 * editfns.c (Fdelete_region): Clarify the use of the named
14978 parameters (bug#6788).
14979
14980 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14981
14982 * indent.c (Fvertical_motion): Set and restore w->pointm when
14983 saving and restoring the window's buffer (Bug#9006).
14984
14985 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14986
14987 * editfns.c (Fstring_to_char): Clarify just what is returned
14988 (bug#6576). Text by Eli Zaretskii.
14989
14990 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14991
14992 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14993
14994 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14995
14996 * buffer.c (mmap_find): Fix a typo.
14997
14998 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14999
15000 Fix execution of x selection hooks.
15001 * xselect.c (Qx_lost_selection_functions)
15002 (Qx_sent_selection_functions): New vars.
15003 (syms_of_xselect): DEFSYM them.
15004 (x_handle_selection_request): Pass Qx_sent_selection_functions
15005 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15006 (x_handle_selection_clear,x_clear_frame_selections):
15007 Pass Qx_lost_selection_functions rather than
15008 Vx_lost_selection_functions to Frun_hook_with_args.
15009
15010 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15011
15012 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15013 The old code sometimes used this field without initializing it.
15014
15015 * alloc.c (gc_sweep): Don't read past end of array.
15016 In theory, the old code could also have corrupted Emacs internals,
15017 though it'd be very unlikely.
15018
15019 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15020
15021 * character.c (Fcharacterp): Don't advertise optional ignored
15022 argument. (Bug#4026)
15023
15024 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15025
15026 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15027 key" (bug#4257).
15028
15029 * window.c (Fset_window_start): Doc fix (bug#4199).
15030 (Fset_window_hscroll): Ditto.
15031
15032 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15033
15034 Fix minor new problems caught by GCC 4.6.1.
15035 * term.c (init_tty): Remove unused local.
15036 * xsettings.c (store_monospaced_changed): Define this function only
15037 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15038 not used otherwise.
15039
15040 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15041
15042 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15043
15044 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15045
15046 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15047 are the mini-buffer and the echo area (bug#3320).
15048
15049 * term.c (init_tty): Remove support for supdup, c10 and perq
15050 terminals, which are no longer supported (bug#1482).
15051
15052 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15053
15054 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15055
15056 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15057
15058 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15059 for non-popups (Bug#3642).
15060
15061 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15062
15063 * alloc.c (reset_malloc_hooks): Protoize.
15064 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15065 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15066 * cm.c (losecursor): Likewise.
15067 * data.c (fmod): Likewise.
15068 * dispnew.c (swap_glyphs_in_rows): Likewise.
15069 * emacs.c (memory_warning_signal): Likewise.
15070 * floatfns.c (float_error): Likewise.
15071 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15072 (otf_open, font_otf_capability, generate_otf_features)
15073 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15074 Likewise.
15075 * image.c (pbm_read_file): Likewise.
15076 * indent.c (string_display_width): Likewise.
15077 * intervals.c (check_for_interval, search_for_interval)
15078 (inc_interval_count, count_intervals, root_interval)
15079 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15080 * lread.c (defalias): Likewise.
15081 * ralloc.c (r_alloc_check): Likewise.
15082 * regex.c (set_image_of_range_1, set_image_of_range)
15083 (regex_grow_registers): Likewise.
15084 * sysdep.c (strerror): Likewise.
15085 * termcap.c (valid_filename_p, tprint, main): Likewise.
15086 * tparam.c (main): Likewise.
15087 * unexhp9k800.c (run_time_remap, save_data_space)
15088 (update_file_ptrs, read_header, write_header, calculate_checksum)
15089 (copy_file, copy_rest, display_header): Likewise.
15090 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15091 Likewise.
15092 * xdisp.c (check_it): Likewise.
15093 * xfaces.c (register_color, unregister_color, unregister_colors):
15094 Likewise.
15095 * xfns.c (print_fontset_result): Likewise.
15096 * xrdb.c (member, fatal, main): Likewise.
15097
15098 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15099
15100 Fix minor problems found by static checking (Bug#9031).
15101 * chartab.c (char_table_set_range, map_sub_char_table):
15102 Remove unused locals.
15103 (uniprop_table): Now static.
15104 * composite.c (_work_char): Remove unused static var.
15105
15106 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15107
15108 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15109
15110 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15111
15112 * gtkutil.c (qttip_cb): Remove code without function.
15113
15114 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15115
15116 * w32.c (pthread_sigmask): New stub.
15117
15118 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15119
15120 Use pthread_sigmask, not sigprocmask (Bug#9010).
15121 sigprocmask is portable only for single-threaded applications, and
15122 Emacs can be multi-threaded when it uses GTK.
15123 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15124 (LIBES): Use it.
15125 * callproc.c (Fcall_process):
15126 * process.c (create_process):
15127 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15128 Use pthread_sigmask, not sigprocmask.
15129
15130 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15131
15132 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15133 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15134 wrong (Bug#8591).
15135
15136 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15137
15138 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15139 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15140 (xg_hide_tooltip): Fix comment.
15141
15142 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15143 in registerServicesMenuSendTypes.
15144 (validRequestorForSendType): Don't check ns_return_types.
15145
15146 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15147 ns_return_type.
15148
15149 2011-07-08 Jason Rumney <jasonr@gnu.org>
15150
15151 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15152 SH_SHOW for hidden windows (Bug#5482).
15153
15154 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15155 frame struct members of non-existent frames (Bug#6284).
15156
15157 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15158
15159 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15160 variable firstTime not needed on OSX >= 10.6.
15161 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15162 >= 10.5. Use setKnobProportion, setDoubleValue.
15163
15164 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15165 (MAC_OS_X_VERSION_10_5): Define if not defined.
15166 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15167 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15168 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15169
15170 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15171 cString and lossyCString on OSX >= 10.4.
15172
15173 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15174 sizeToFit on OSX >= 10.2.
15175
15176 * nsimage.m (allocInitFromFile): Don't use deprecated method
15177 bestRepresentationForDevice on OSX >= 10.6.
15178
15179 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15180 to avoid warning.
15181
15182 * emacs.c: Declare unexec_init_emacs_zone.
15183
15184 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15185
15186 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15187
15188 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15189 on svcsMenu (Bug#8842).
15190
15191 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15192 ns_return_types.
15193 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15194
15195 * nsterm.m (QUTF8_STRING): Declare.
15196 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15197 (validRequestorForSendType): Return type is (id).
15198 Change indexOfObjectIdenticalTo to indexOfObject.
15199 Check if we have local selection before returning self (Bug#8842).
15200 (writeSelectionToPasteboard): Put local selection into paste board
15201 if we have a local selection (Bug#8842).
15202 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15203
15204 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15205 (ns_get_local_selection): Declare.
15206
15207 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15208
15209 * keymap.c (describe_map_tree): Don't insert a double newline at
15210 the end of the buffer (bug#1169) and return whether we inserted
15211 something.
15212
15213 * callint.c (Fcall_interactively): Change "reading args" to
15214 "providing args" to try to clarify what it does (bug#1010).
15215
15216 2011-07-07 Kenichi Handa <handa@m17n.org>
15217
15218 * composite.c (composition_compute_stop_pos): Ignore a static
15219 composition starting before CHARPOS (Bug#8915).
15220
15221 * xdisp.c (handle_composition_prop): Likewise.
15222
15223 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15224
15225 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15226 (Bug#9015)
15227
15228 2011-07-07 Kenichi Handa <handa@m17n.org>
15229
15230 * character.h (unicode_category_t): New enum type.
15231
15232 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15233 (Qchar_code_property_table): New variable.
15234 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15235 (UNIPROP_COMPRESSED_FORM_P): New macros.
15236 (char_table_ascii): Uncompress the compressed values.
15237 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15238 Uncompress the compressed values.
15239 (sub_char_table_ref_and_range): Likewise.
15240 (char_table_ref_and_range): Uncompress the compressed values.
15241 (sub_char_table_set): New arg is_uniprop. Callers changed.
15242 Uncompress the compressed values.
15243 (sub_char_table_set_range): Args changed. Callers changed.
15244 (char_table_set_range): Adjuted for the above change.
15245 (map_sub_char_table): Delete args default_val and parent. Add arg
15246 top. Give decoded values to a Lisp function.
15247 (map_char_table): Adjust for the above change. Give decoded
15248 values to a Lisp function. Gcpro more variables.
15249 (uniprop_table_uncompress)
15250 (uniprop_decode_value_run_length): New functions.
15251 (uniprop_decoder, uniprop_decoder_count): New variables.
15252 (uniprop_get_decoder, uniprop_encode_value_character)
15253 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15254 New functions.
15255 (uniprop_encoder, uniprop_encoder_count): New variables.
15256 (uniprop_get_encoder, uniprop_table)
15257 (Funicode_property_table_internal, Fget_unicode_property_internal)
15258 (Fput_unicode_property_internal): New functions.
15259 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15260 Sunicode_property_table_internal, Sget_unicode_property_internal,
15261 and Sput_unicode_property_internal. Defvar_lisp
15262 char-code-property-alist.
15263
15264 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15265 Vunicode_category_table.
15266
15267 * font.c (font_range): Adjust for the change of
15268 Vunicode_category_table.
15269
15270 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15271
15272 * m/iris4d.h: Remove file, move contents ...
15273 * s/irix6-5.h: ... here.
15274
15275 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15276
15277 Remove unportable assumption about struct layout (Bug#8884).
15278 * alloc.c (mark_buffer):
15279 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15280 (clone_per_buffer_values): Don't assume that
15281 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15282 This isn't true in general, and it's particularly not true
15283 if Emacs is configured with --with-wide-int.
15284 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15285 New macros, used in the buffer.c change.
15286
15287 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15288
15289 * xsettings.c: Use both GConf and GSettings if both are available.
15290 (store_config_changed_event): Add comment.
15291 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15292 (store_tool_bar_style_changed): New functions.
15293 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15294 (struct xsettings): Move font inside HAVE_XFT.
15295 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15296 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15297 Move inside HAVE_XFT.
15298 (something_changed_gsettingsCB): Rename from something_changedCB.
15299 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15300 also.
15301 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15302 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15303 (something_changed_gconfCB): Rename from something_changedCB.
15304 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15305 (parse_settings): Move check for font inside HAVE_XFT.
15306 (read_settings, apply_xft_settings): Add comment.
15307 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15308 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15309 call store_font_name_changed.
15310 (xft_settings_event): Add comment.
15311 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15312 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15313 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15314 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15315 (xsettings_initialize): Call init_gsettings last.
15316 (xsettings_get_system_font, xsettings_get_system_normal_font):
15317 Add comment.
15318
15319 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15320
15321 Random fixes. E.g., (random) never returned negative values.
15322 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15323 subseconds part to the entropy, as that's a bit more random.
15324 Prefer signed to unsigned, since the signedness doesn't matter and
15325 in general we prefer signed. When given a limit, use a
15326 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15327 latter isn't right if USE_2_TAGS_FOR_INTS.
15328 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15329 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15330
15331 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15332
15333 * textprop.c (text_property_stickiness):
15334 Obey Vtext_property_default_nonsticky.
15335 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15336 * w32fns.c (syms_of_w32fns):
15337 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15338
15339 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15340
15341 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15342 This is more efficient than Ffile_directory_p and avoids a minor race.
15343
15344 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15345
15346 * buffer.c (Foverlay_put): Say what the return value is
15347 (bug#7835).
15348
15349 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15350 is a directory before asking whether to use the file name
15351 (bug#7564).
15352 (barf_or_query_if_file_exists): Make the "File is a directory"
15353 error be more correct.
15354
15355 * fns.c (Frequire): Remove the mention of the .gz files, since
15356 that's installation-specific, but keep the mention of
15357 `get-load-suffixes'.
15358
15359 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15360
15361 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15362 Report string overflow if the output is too long.
15363
15364 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15365
15366 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15367 (syms_of_gnutls): Remove duplicate DEFSYM for
15368 Qgnutls_bootprop_verify_hostname_error, an error for
15369 Qgnutls_bootprop_verify_error (which is no longer used).
15370
15371 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15372 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15373 Also (re)move comments that are misplaced or no longer relevant.
15374
15375 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15376
15377 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15378
15379 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15380
15381 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15382 and background color parameters if they have been changed.
15383
15384 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15385
15386 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15387
15388 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15389
15390 * xsettings.c (SYSTEM_FONT): Define only when used.
15391 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15392
15393 * keymap.c (access_keymap_1): Now static.
15394
15395 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15396
15397 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15398 leave any prefix arg for the up event (Bug#1586).
15399
15400 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15401
15402 * lread.c (syms_of_lread): Mention single symbols defined by
15403 `defvar' or `defconst' (bug#7154).
15404
15405 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15406 (Frequire): Mention get-load-suffixes.
15407
15408 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15409
15410 * window.h (window): Remove clone_number slot.
15411 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15412 Remove.
15413 (make_parent_window, make_window, saved_window)
15414 (Fset_window_configuration, save_window_save): Don't deal with
15415 clone numbers.
15416 * buffer.c (Qclone_number): Remove declaration.
15417 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15418
15419 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15420
15421 Add multiple inheritance to keymaps.
15422 * keymap.c (Fmake_composed_keymap): New function.
15423 (Fset_keymap_parent): Simplify.
15424 (fix_submap_inheritance): Remove.
15425 (access_keymap_1): New function extracted from access_keymap to handle
15426 embedded parents and handle lists of maps.
15427 (access_keymap): Use it.
15428 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15429 (Fcopy_keymap): Handle embedded parents.
15430 (Fcommand_remapping, define_as_prefix): Simplify.
15431 (Fkey_binding): Simplify.
15432 (syms_of_keymap): Move minibuffer-local-completion-map,
15433 minibuffer-local-filename-completion-map,
15434 minibuffer-local-must-match-map, and
15435 minibuffer-local-filename-must-match-map to Elisp.
15436 (syms_of_keymap): Defsubr make-composed-keymap.
15437 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15438 (parse_menu_item): Trivial simplification.
15439
15440 2011-07-01 Glenn Morris <rgm@gnu.org>
15441
15442 * Makefile.in (SETTINGS_LIBS): Fix typo.
15443
15444 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15445
15446 * coding.c (Fencode_coding_string): Record the last coding system
15447 used, as the function doc string says (bug#8738).
15448
15449 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15450
15451 * xsettings.c (store_monospaced_changed): Take new font as arg and
15452 check for change against current_mono_font.
15453 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15454 (emacs_settings_constructor, emacs_settings_get_property)
15455 (emacs_settings_set_property, emacs_settings_class_init)
15456 (emacs_settings_init, gsettings_obj): Remove.
15457 (something_changedCB): New function for HAVE_GSETTINGS.
15458 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15459 with value as argument.
15460 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15461 g_settings_new (Bug#8967). Do not create gsettings_obj.
15462 Remove calls to g_settings_bind. Connect something_changedCB to
15463 "changed".
15464
15465 * xgselect.c: Add defined (HAVE_GSETTINGS).
15466 (xgselect_initialize): Ditto.
15467
15468 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15469 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15470 xg_select.
15471
15472 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15473
15474 * eval.c (struct backtrace): Simplify and port the data structure.
15475 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15476 signed bit field, as this assumption is not portable and it makes
15477 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15478 "char debug_on_exit : 1" as this is not portable either; instead,
15479 use the portable "unsigned int debug_on_exit : 1". Remove unused
15480 member evalargs. Remove obsolete comments about cc bombing out.
15481
15482 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15483
15484 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15485 Let HAVE_GSETTINGS override HAVE_GCONF.
15486 (store_monospaced_changed): New function.
15487 (EMACS_SETTINGS): A new type derived from GObject to handle
15488 GSettings notifications.
15489 (emacs_settings_constructor, emacs_settings_get_property)
15490 (emacs_settings_set_property, emacs_settings_class_init):
15491 New functions.
15492 (gsettings_client, gsettings_obj): New variables.
15493 (GSETTINGS_SCHEMA): New define.
15494 (something_changedCB): Call store_monospaced_changed.
15495 (init_gsettings): New function.
15496 (xsettings_initialize): Call init_gsettings.
15497 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15498 to NULL.
15499
15500 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15501 GCONF_CFLAGS/LIBS.
15502
15503 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15504
15505 * window.c (resize_root_window, grow_mini_window)
15506 (shrink_mini_window): Rename Qresize_root_window to
15507 Qwindow_resize_root_window and Qresize_root_window_vertically to
15508 Qwindow_resize_root_window_vertically.
15509
15510 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15511
15512 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15513
15514 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15515
15516 * makefile.w32-in: Redesign dependencies so they reflect more
15517 clearly which files are directly included by each source file,
15518 and not through other includes.
15519
15520 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15521
15522 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15523 (sort_overlays, overlay_strings): When an overlay's clone number
15524 matches the window's clone number process the overlay even if
15525 the overlay's window property doesn't match the current window.
15526
15527 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15528 (Fwindow_hchild): Rename to Fwindow_left_child.
15529 (Fwindow_next): Rename to Fwindow_next_sibling.
15530 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15531 (resize_window_check): Rename to window_resize_check.
15532 (resize_window_apply): Rename to window_resize_apply.
15533 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15534 (Fdelete_other_windows_internal, resize_frame_windows)
15535 (Fsplit_window_internal, Fdelete_window_internal)
15536 (grow_mini_window, shrink_mini_window)
15537 (Fresize_mini_window_internal): Fix callers accordingly.
15538
15539 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15540
15541 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15542 (emacs_fixed_set_min_size): Remove.
15543 (emacs_fixed_new): Take frame as argument.
15544
15545 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15546 (_EmacsFixedPrivate): Remove minwidth/height.
15547 Add struct frame *f.
15548 (emacs_fixed_init): Initialize priv->f.
15549 (get_parent_class, emacs_fixed_set_min_size): Remove.
15550 (emacs_fixed_new): Set priv->f to argument.
15551 (emacs_fixed_get_preferred_width)
15552 (emacs_fixed_get_preferred_height): Use min_width/height from
15553 frames size_hint to set minimum and natural (Bug#8919).
15554 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15555 and use min_width/height from frames size_hint to set
15556 min_width/height (Bug#8919).
15557
15558 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15559 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15560 Fix indentation.
15561
15562 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15563
15564 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15565 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15566 called at ZV.
15567
15568 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15569
15570 * process.c (wait_reading_process_output): Bypass select if
15571 waiting for a cell while ignoring keyboard input, and input is
15572 pending. Suggested by Jan Djärv (Bug#8869).
15573
15574 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15575
15576 Use gnulib's dup2 module instead of rolling our own.
15577 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15578
15579 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15580
15581 * dispnew.c (scrolling_window): Before scrolling, turn off a
15582 mouse-highlight in the window being scrolled.
15583
15584 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15585
15586 Move DEFSYM to lisp.h and use everywhere.
15587
15588 * character.h (DEFSYM): Move declaration...
15589 * lisp.h (DEFSYM): ...here.
15590
15591 * gnutls.c:
15592 * minibuf.c:
15593 * w32menu.c:
15594 * w32proc.c:
15595 * w32select.c: Don't include character.h.
15596
15597 * alloc.c (syms_of_alloc):
15598 * buffer.c (syms_of_buffer):
15599 * bytecode.c (syms_of_bytecode):
15600 * callint.c (syms_of_callint):
15601 * casefiddle.c (syms_of_casefiddle):
15602 * casetab.c (init_casetab_once):
15603 * category.c (init_category_once, syms_of_category):
15604 * ccl.c (syms_of_ccl):
15605 * cmds.c (syms_of_cmds):
15606 * composite.c (syms_of_composite):
15607 * dbusbind.c (syms_of_dbusbind):
15608 * dired.c (syms_of_dired):
15609 * dispnew.c (syms_of_display):
15610 * doc.c (syms_of_doc):
15611 * editfns.c (syms_of_editfns):
15612 * emacs.c (syms_of_emacs):
15613 * eval.c (syms_of_eval):
15614 * fileio.c (syms_of_fileio):
15615 * fns.c (syms_of_fns):
15616 * frame.c (syms_of_frame):
15617 * fringe.c (syms_of_fringe):
15618 * insdel.c (syms_of_insdel):
15619 * keymap.c (syms_of_keymap):
15620 * lread.c (init_obarray, syms_of_lread):
15621 * macros.c (syms_of_macros):
15622 * msdos.c (syms_of_msdos):
15623 * print.c (syms_of_print):
15624 * process.c (syms_of_process):
15625 * search.c (syms_of_search):
15626 * sound.c (syms_of_sound):
15627 * syntax.c (init_syntax_once, syms_of_syntax):
15628 * terminal.c (syms_of_terminal):
15629 * textprop.c (syms_of_textprop):
15630 * undo.c (syms_of_undo):
15631 * w32.c (globals_of_w32):
15632 * window.c (syms_of_window):
15633 * xdisp.c (syms_of_xdisp):
15634 * xfaces.c (syms_of_xfaces):
15635 * xfns.c (syms_of_xfns):
15636 * xmenu.c (syms_of_xmenu):
15637 * xsettings.c (syms_of_xsettings):
15638 * xterm.c (syms_of_xterm): Use DEFSYM.
15639
15640 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15641
15642 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15643
15644 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15645
15646 Integer and buffer overflow fixes (Bug#8873).
15647
15648 * print.c (printchar, strout): Check for string overflow.
15649 (PRINTPREPARE, printchar, strout):
15650 Don't set size unless allocation succeeds.
15651
15652 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15653 for sizes. Check for string overflow more accurately.
15654 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15655
15656 * macros.c: Integer and buffer overflow fixes.
15657 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15658 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15659 Use ptrdiff_t, not int, for sizes.
15660 Don't increment bufsize until after realloc succeeds.
15661 Check for size-calculation overflow.
15662 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15663
15664 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15665
15666 * lread.c: Integer overflow fixes.
15667 (read_integer): Radix is now EMACS_INT, not int,
15668 to improve quality of diagnostics for out-of-range radices.
15669 Calculate buffer size correctly for out-of-range radices.
15670 (read1): Check for integer overflow in radices, and in
15671 read-circle numbers.
15672 (read_escape): Avoid int overflow.
15673 (Fload, openp, read_buffer_size, read1)
15674 (substitute_object_recurse, read_vector, read_list, map_obarray):
15675 Use ptrdiff_t, not int, for sizes.
15676 (read1): Use EMACS_INT, not int, for sizes.
15677 Check for size overflow.
15678
15679 * image.c (cache_image): Check for size arithmetic overflow.
15680
15681 * lread.c: Integer overflow issues.
15682 (saved_doc_string_size, saved_doc_string_length)
15683 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15684 Now ptrdiff_t, not int.
15685 (read1): Don't assume doc string length fits in int. Check for
15686 out-of-range doc string lengths.
15687 (read_list): Don't assume file position fits in int.
15688 (read_escape): Check for hex character overflow.
15689
15690 2011-06-22 Leo Liu <sdl.web@gmail.com>
15691
15692 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15693 Move to minibuffer.el.
15694
15695 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15696
15697 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15698 The following patches are for when GLYPH_DEBUG && !XASSERT.
15699 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15700 * dispnew.c (flush_stdout):
15701 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15702 Mark as externally visible.
15703 * dispnew.c (check_window_matrix_pointers): Now static.
15704 * dispnew.c (window_to_frame_vpos):
15705 * xfns.c (unwind_create_frame):
15706 * xterm.c (x_check_font): Remove unused local.
15707 * scroll.c (CHECK_BOUNDS):
15708 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15709 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15710 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15711 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15712 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15713 Now static.
15714 (debug_method_add): Use va_list and vsprintf rather than relying
15715 on undefined behavior with wrong number of arguments.
15716 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15717 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15718 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15719 since we're not interested in debugging glyphs with old libraries.
15720 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15721 GCC 4.6.0's static checking.
15722
15723 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15724
15725 Integer overflow and signedness fixes (Bug#8873).
15726 A few related buffer overrun fixes, too.
15727
15728 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15729
15730 * dispextern.h (struct face.stipple):
15731 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15732 (x_bitmap_mask, x_allocate_bitmap_record)
15733 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15734 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15735 (x_create_bitmap_from_xpm_data):
15736 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15737 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15738 (.bitmaps_last):
15739 * xfaces.c (load_pixmap):
15740 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15741 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15742 (.bitmaps_last, struct x_output.icon_bitmap):
15743 Use ptrdiff_t, not int, for bitmap indexes.
15744 (x_allocate_bitmap_record): Check for size overflow.
15745 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15746
15747 Use ptrdiff_t, not int, for overlay counts.
15748 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15749 * editfns.c (overlays_around, get_pos_property):
15750 * textprop.c (get_char_property_and_overlay):
15751 * xdisp.c (next_overlay_change, note_mouse_highlight):
15752 * xfaces.c (face_at_buffer_position):
15753 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15754 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15755 (Fnext_overlay_change, Fprevious_overlay_change)
15756 (mouse_face_overlay_overlaps, Foverlays_in):
15757 Use ptrdiff_t, not int, for sizes.
15758 (overlays_at, overlays_in): Check for size-calculation overflow.
15759
15760 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15761
15762 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15763 (x_session_initialize): Do not assume string length fits in int.
15764
15765 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15766 This is unlikely, but can occur if DPI is outlandish.
15767
15768 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15769 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15770
15771 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15772 * xrdb.c (magic_file_p, search_magic_path):
15773 Omit last arg SUFFIX; it was always 0. All callers changed.
15774 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15775
15776 * xfont.c (xfont_match): Avoid need for strlen.
15777
15778 * xfns.c: Don't assume strlen fits in int.
15779 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15780
15781 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15782 not unsigned long, as we prefer signed integers. All callers changed.
15783 Detect integer overflow in repeat count.
15784 (message_dolog): Don't assume print length fits in 39 bytes.
15785 (display_mode_element): Don't assume strlen fits in int.
15786
15787 * termcap.c: Don't assume sizes fit in int and never overflow.
15788 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15789 (gobble_line): Check for size-calculation overflow.
15790
15791 * minibuf.c (Fread_buffer):
15792 * lread.c (intern, intern_c_string):
15793 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15794 Don't assume string length fits in int.
15795
15796 * keyboard.c (parse_tool_bar_item):
15797 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15798
15799 * font.c: Don't assume string length fits in int.
15800 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15801 Use ptrdiff_t, not int.
15802 (font_intern_prop): Don't assume string length fits in int.
15803 Don't assume integer property fits in fixnum.
15804 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15805
15806 * filelock.c: Fix some buffer overrun and integer overflow issues.
15807 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15808 Reformulate so as not to need the command string.
15809 Invoke gzip -cd rather than gunzip, as it's more portable.
15810 (lock_info_type, lock_file_1, lock_file):
15811 Don't assume pid_t and time_t fit in unsigned long.
15812 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15813 (current_lock_owner): Prefer signed type for sizes.
15814 Use memcpy, not strncpy, where memcpy is what is really wanted.
15815 Don't assume (via atoi) that time_t and pid_t fit in int.
15816 Check for time_t and/or pid_t out of range, e.g., via a network share.
15817 Don't alloca where an auto var works fine.
15818
15819 * fileio.c: Fix some integer overflow issues.
15820 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15821 Don't assume string length fits in int.
15822 (directory_file_name): Don't assume string length fits in long.
15823 (make_temp_name): Don't assume pid fits in int, or that its print
15824 length is less than 20.
15825
15826 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15827
15828 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15829
15830 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15831
15832 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15833 We prefer signed integers, even for size calculations.
15834
15835 * emacs.c: Don't assume string length fits in 'int'.
15836 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15837 (main): Don't invoke strlen when not needed.
15838
15839 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15840 (XD_DEBUG_MESSAGE): Don't waste a byte.
15841
15842 * callproc.c (getenv_internal_1, getenv_internal)
15843 (Fgetenv_internal):
15844 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15845
15846 * lread.c (invalid_syntax): Omit length argument.
15847 All uses changed. This doesn't fix a bug, but it simplifies the
15848 code away from its former Hollerith-constant appearance, and it's
15849 one less 'int' to worry about when looking at integer-overflow issues.
15850 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15851
15852 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15853 This didn't break anything, but it didn't help either.
15854 It's confusing to put a bogus integer in a place where the actual
15855 value does not matter.
15856 (LIST_END_P): Remove unused macro and its bogus comment.
15857 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15858
15859 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15860 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15861 implementation.
15862 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15863 We prefer signed types, and the value cannot exceed the EMACS_INT
15864 range anyway (because otherwise the length would not be representable).
15865 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15866 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15867 This avoids a GCC warning when WIDE_EMACS_INT.
15868
15869 * indent.c (sane_tab_width): New function.
15870 (current_column, scan_for_column, Findent_to, position_indentation)
15871 (compute_motion): Use it. This is just for clarity.
15872 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15873
15874 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15875
15876 * lisp.h (lint_assume): New macro.
15877 * composite.c (composition_gstring_put_cache):
15878 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15879
15880 * editfns.c, insdel.c:
15881 Omit unnecessary forward decls, to simplify future changes.
15882
15883 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15884
15885 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15886
15887 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15888 Use much-faster test for byte-length change.
15889 Don't assume string byte-length fits in 'int'.
15890 Check that character arg fits in 'int'.
15891 (mapcar1): Declare byte as byte, for clarity.
15892
15893 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15894
15895 * fns.c (concat): Catch string overflow earlier.
15896 Do not rely on integer wraparound.
15897
15898 * dispextern.h (struct it.overlay_strings_charpos)
15899 (struct it.selective): Now EMACS_INT, not int.
15900 * xdisp.c (forward_to_next_line_start)
15901 (back_to_previous_visible_line_start)
15902 (reseat_at_next_visible_line_start, next_element_from_buffer):
15903 Don't arbitrarily truncate the value of 'selective' to int.
15904
15905 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15906
15907 * composite.c: Don't truncate sizes to 'int'.
15908 (composition_gstring_p, composition_reseat_it)
15909 (composition_adjust_point): Use EMACS_INT, not int.
15910 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15911 not EMACS_UINT, for indexes.
15912
15913 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15914
15915 * buffer.c: Include <verify.h>.
15916 (struct sortvec.priority, struct sortstr.priority):
15917 Now EMACS_INT, not int.
15918 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15919 (struct sortstr.size, record_overlay_string)
15920 (struct sortstrlist.size, struct sortlist.used):
15921 Don't truncate size to int.
15922 (record_overlay_string): Check for size-calculation overflow.
15923 (init_buffer_once): Check at compile-time, not run-time.
15924
15925 2011-06-22 Jim Meyering <meyering@redhat.com>
15926
15927 Don't leak an XBM-image-sized buffer
15928 * image.c (xbm_load): Free the image buffer after using it.
15929
15930 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15931
15932 Port to Sun C.
15933 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15934 that Sun C diagnosed.
15935 * fns.c (secure_hash): Fix pointer signedness issue.
15936 * intervals.c (static_offset_intervals): New function.
15937 (offset_intervals): Use it.
15938
15939 2011-06-21 Leo Liu <sdl.web@gmail.com>
15940
15941 * deps.mk (fns.o):
15942 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15943 sha512.h.
15944
15945 * fns.c (secure_hash): Rename from crypto_hash_function and change
15946 the first arg to accept symbols.
15947 (Fsecure_hash): New primitive.
15948 (syms_of_fns): New symbols.
15949
15950 2011-06-20 Deniz Dogan <deniz@dogan.se>
15951
15952 * process.c (Fset_process_buffer): Clarify return value in
15953 docstring.
15954
15955 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15956
15957 * dispnew.c (add_window_display_history): Use BVAR.
15958
15959 * xdisp.c (debug_method_add): Use BVAR.
15960 (check_window_end, dump_glyph_matrix, dump_glyph)
15961 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15962
15963 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15964 Likewise.
15965
15966 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15967 check till after the cache is created in init_frame_faces.
15968
15969 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15970
15971 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15972
15973 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15974
15975 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15976 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15977 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15978
15979 Improve buffer-overflow checking (Bug#8873).
15980 * fileio.c (Finsert_file_contents):
15981 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15982 Remove the old (too-loose) buffer overflow checks.
15983 They weren't needed, since make_gap checks for buffer overflow.
15984 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15985 The old code merely checked for Emacs fixnum overflow, and relied
15986 on undefined (wraparound) behavior. The new code avoids undefined
15987 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15988
15989 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15990 Tune. Don't use wider integers than needed. Don't use alloca.
15991 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15992
15993 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15994
15995 * insdel.c, lisp.h (buffer_overflow): New function.
15996 (insert_from_buffer_1, replace_range, replace_range_2):
15997 * insdel.c (make_gap_larger):
15998 * editfns.c (Finsert_char):
15999 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16000
16001 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16002
16003 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16004
16005 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16006
16007 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16008 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16009
16010 * fileio.c: Don't assume EMACS_INT fits in off_t.
16011 (emacs_lseek): New static function.
16012 (Finsert_file_contents, Fwrite_region): Use it.
16013 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16014
16015 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16016
16017 * fns.c: Don't overflow int when computing a list length.
16018 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16019 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16020 truncation on 64-bit hosts. Check for QUIT every
16021 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16022 faster and is responsive enough.
16023 (Flength): Report an error instead of overflowing an integer.
16024 (Fsafe_length): Return a float if the value is not representable
16025 as a fixnum. This shouldn't happen except in contrived situations.
16026 (Fnthcdr, Fsort): Don't assume list length fits in int.
16027 (Fcopy_sequence): Don't assume vector length fits in int.
16028
16029 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16030 (header_size, word_size): New constants.
16031 (allocate_vectorlike): Don't check size overflow here.
16032 (allocate_vector): Check it here instead, since this is the only
16033 caller of allocate_vectorlike that could cause overflow.
16034 Check that the new vector's length is representable as a fixnum.
16035
16036 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16037 The previous code was bogus. For example, next_almost_prime (32)
16038 returned 39, which is undesirable as it is a multiple of 3; and
16039 next_almost_prime (24) returned 25, which is a multiple of 5 so
16040 why was the code bothering to check for multiples of 7?
16041
16042 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16043
16044 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16045
16046 Variadic C functions now count arguments with ptrdiff_t.
16047 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16048 Back then I didn't know that the Emacs coding style prefers signed int.
16049 Also, in the meantime I found a few more instances where arguments
16050 were being counted with int, which may truncate counts on 64-bit
16051 machines, or EMACS_INT, which may be unnecessarily wide.
16052 * lisp.h (struct Lisp_Subr.function.aMANY)
16053 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16054 Arg counts are now ptrdiff_t, not size_t.
16055 All variadic functions and their callers changed accordingly.
16056 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16057 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16058 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16059 * callint.c (Fcall_interactively): Check arg count for overflow,
16060 to avoid potential buffer overrun. Use signed char, not 'int',
16061 for 'varies' array, so that we needn't bother to check its size
16062 calculation for overflow.
16063 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16064 * eval.c (apply_lambda):
16065 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16066 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16067 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16068
16069 * callint.c (Fcall_interactively): Don't use index var as event count.
16070
16071 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16072 * mem-limits.h (SIZE): Remove; no longer used.
16073
16074 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16075
16076 Remove unnecessary casts.
16077 * xterm.c (x_term_init):
16078 * xfns.c (x_set_border_pixel):
16079 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16080 These aren't needed now that we assume ANSI C.
16081
16082 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16083 It's more likely to cause problems (due to unsigned overflow)
16084 than to cure them.
16085
16086 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16087
16088 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16089
16090 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16091
16092 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16093
16094 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16095
16096 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16097
16098 GLYPH_CODE_FACE returns EMACS_INT, not int.
16099 * dispextern.h (merge_faces):
16100 * xfaces.c (merge_faces):
16101 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16102 Don't assume EMACS_INT fits in int.
16103
16104 * character.h (CHAR_VALID_P): Remove unused parameter.
16105 * fontset.c, lisp.h, xdisp.c: All uses changed.
16106
16107 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16108
16109 * fns.c (concat): Minor tuning based on overflow analysis.
16110 This doesn't fix any bugs. Use int to hold character, instead
16111 of constantly refetching from Emacs object. Use XFASTINT, not
16112 XINT, for value known to be a character. Don't bother comparing
16113 a single byte to 0400, as it's always less.
16114
16115 * floatfns.c (Fexpt):
16116 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16117
16118 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16119 for characters.
16120
16121 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16122
16123 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16124 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16125 incorrectly succeed when S was a string, because 4294967386 was
16126 truncated before it was used.
16127
16128 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16129 Otherwise, an out-of-range integer could cause undefined behavior
16130 on a 64-bit host.
16131
16132 * composite.c: Use int, not EMACS_INT, for characters.
16133 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16134 EMACS_INT, for values that are known to be in character range.
16135 This doesn't fix any bugs but is the usual style inside Emacs and
16136 may generate better code on 32-bit machines.
16137
16138 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16139 This is for reasons similar to the recent CHAR_STRING fix.
16140 * charset.c (Fencode_char): Check that character arg is actually
16141 a character. Pass an int to ENCODE_CHAR.
16142 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16143 wider than 'int', as a compile-time check to prevent future regressions
16144 in this area.
16145
16146 * character.c (char_string): Remove unnecessary casts.
16147
16148 Make sure a 64-bit char is never passed to CHAR_STRING.
16149 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16150 by silently ignoring the top 32 bits, allowing some values
16151 that were far too large to be valid characters.
16152 * character.h: Include <verify.h>.
16153 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16154 arguments are no wider than unsigned, as a compile-time check
16155 to prevent future regressions in this area.
16156 * data.c (Faset):
16157 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16158 (Fsubst_char_in_region):
16159 * fns.c (concat):
16160 * xdisp.c (decode_mode_spec_coding):
16161 Adjust to CHAR_STRING's new requirement.
16162 * editfns.c (Finsert_char, Fsubst_char_in_region):
16163 * fns.c (concat): Check that character args are actually
16164 characters. Without this test, these functions did the wrong
16165 thing with wildly out-of-range values on 64-bit hosts.
16166
16167 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16168 These casts should not be needed on 32-bit hosts, either.
16169 * keyboard.c (read_char):
16170 * lread.c (Fload): Remove casts to unsigned.
16171
16172 * lisp.h (UNSIGNED_CMP): New macro.
16173 This fixes comparison bugs on 64-bit hosts.
16174 (ASCII_CHAR_P): Use it.
16175 * casefiddle.c (casify_object):
16176 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16177 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16178 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16179 * dispextern.h (FACE_FROM_ID):
16180 * keyboard.c (read_char): Use UNSIGNED_CMP.
16181
16182 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16183 not to EMACS_INT, to avoid GCC warning.
16184
16185 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16186
16187 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16188 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16189 isn't needed on 32-bit machines.
16190
16191 * buffer.c (Fgenerate_new_buffer_name):
16192 Use EMACS_INT for count, not int.
16193 (advance_to_char_boundary): Return EMACS_INT, not int.
16194
16195 * data.c (Qcompiled_function): Now static.
16196
16197 * window.c (window_body_lines): Now static.
16198
16199 * image.c (gif_load): Rename local to avoid shadowing.
16200
16201 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16202 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16203 * alloc.c (make_save_value): Integer argument is now of type
16204 ptrdiff_t, not int.
16205 (mark_object): Use ptrdiff_t, not int.
16206 * lisp.h (pD): New macro.
16207 * print.c (print_object): Use it.
16208
16209 * alloc.c: Use EMACS_INT, not int, to count objects.
16210 (total_conses, total_markers, total_symbols, total_vector_size)
16211 (total_free_conses, total_free_markers, total_free_symbols)
16212 (total_free_floats, total_floats, total_free_intervals)
16213 (total_intervals, total_strings, total_free_strings):
16214 Now EMACS_INT, not int. All uses changed.
16215 (Fgarbage_collect): Compute overall total using a double, so that
16216 integer overflow is less likely to be a problem. Check for overflow
16217 when converting back to an integer.
16218 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16219 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16220 These were 'int' variables that could overflow on 64-bit hosts;
16221 they were never used, so remove them instead of repairing them.
16222 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16223 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16224 Previously, this ceilinged at INT_MAX, but that doesn't work on
16225 64-bit machines.
16226 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16227
16228 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16229 (allocate_vectorlike): Check for ptrdiff_t overflow.
16230 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16231 when a (possibly-narrower) signed value would do just as well.
16232 We prefer using signed arithmetic, to avoid comparison confusion.
16233
16234 * alloc.c: Catch some string size overflows that we were missing.
16235 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16236 for convenience in STRING_BYTES_MAX.
16237 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16238 The definition here is exact; the one in lisp.h was approximate.
16239 (allocate_string_data): Check for string overflow. This catches
16240 some instances we weren't catching before. Also, it catches
16241 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16242 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16243 and ptrdiff_t and EMACS_INT are both 64 bits.
16244
16245 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16246 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16247 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16248
16249 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16250
16251 * alloc.c (Fmake_string): Check for out-of-range init.
16252
16253 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16254
16255 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16256
16257 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16258
16259 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16260 xg_get_default_scrollbar_width.
16261
16262 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16263 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16264 (style_changed_cb): Call update_theme_scrollbar_width and call
16265 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16266 all frames (Bug#8505).
16267 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16268 Call gtk_window_set_resizable if HAVE_GTK3.
16269 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16270 and height if HAVE_GTK3 (Bug#8505).
16271 (scroll_bar_width_for_theme): New variable.
16272 (update_theme_scrollbar_width): New function.
16273 (xg_get_default_scrollbar_width): Move code to
16274 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16275 (xg_initialize): Call update_theme_scrollbar_width.
16276
16277 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16278
16279 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16280
16281 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16282
16283 * frame.c (make_frame): Call other_buffer_safely instead of
16284 other_buffer.
16285
16286 * window.c (temp_output_buffer_show): Call display_buffer with
16287 second argument Vtemp_buffer_show_specifiers and reset latter
16288 immediately after the call.
16289 (Vtemp_buffer_show_specifiers): New variable.
16290 (auto_window_vscroll_p, next_screen_context_lines)
16291 (Vscroll_preserve_screen_position): Remove leading asterisks from
16292 doc-strings.
16293
16294 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16295
16296 Fix minor problems found by GCC 4.6.0 static checking.
16297 * buffer.c (Qclone_number): Remove for now, as it's unused.
16298 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16299 (record_buffer): Remove unused local.
16300 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16301 (set_frame_buffer_list): Remove; unused.
16302 * frame.h (other_visible_frames): Remove decl.
16303 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16304 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16305 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16306 if HAVE_GPM.
16307 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16308 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16309 Define only if HAVE_GPM.
16310 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16311 (update_hints_inhibit): Remove; never set. All uses removed.
16312 * widgetprv.h (emacsFrameClassRec): Remove decl.
16313 * window.c (delete_deletable_window): Now returns void, since it
16314 wasn't returning anything.
16315 (compare_window_configurations): Remove unused locals.
16316 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16317 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16318 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16319 the same widths as pointers. This follows up on the 2011-05-06 patch.
16320 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16321 * xterm.h: Likewise.
16322 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16323
16324 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16325
16326 * makefile.w32-in: Update dependencies.
16327 (LISP_H): Add lib/intprops.h.
16328
16329 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16330
16331 * image.c (gif_load): Add animation frame delay to the metadata.
16332 (syms_of_image): Use DEFSYM. New symbol `delay'.
16333
16334 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16335
16336 * window.c (delete_deletable_window): Re-add.
16337 (Fset_window_configuration): Rewrite to handle dead buffers and
16338 consequently deletable windows.
16339 (window_tree, Fwindow_tree): Remove. Supply functionality in
16340 window.el.
16341 (compare_window_configurations): Simplify code.
16342
16343 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16344
16345 * image.c (imagemagick_load_image): Fix type mismatch.
16346 (Fimagemagick_types): Likewise.
16347
16348 * window.h (replace_buffer_in_windows): Declare.
16349
16350 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16351
16352 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16353 Qclone_number. Remove external declaration of Qdelete_window.
16354 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16355 code.
16356 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16357 Run Qbuffer_list_update_hook if allowed.
16358 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16359 buffer list implementation.
16360 (other_buffer_safely): New function.
16361 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16362 calls to replace_buffer_in_windows and
16363 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16364 if allowed.
16365 (record_buffer): Inhibit quitting and rewrite using quittable
16366 functions. Run Qbuffer_list_update_hook if allowed.
16367 (Frecord_buffer, Funrecord_buffer): New functions.
16368 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16369 Move switch-to-buffer to window.el.
16370 (bury-buffer): Move to window.el.
16371 (Vbuffer_list_update_hook): New variable.
16372
16373 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16374 section.
16375
16376 * window.h (resize_frame_windows): Move up in code.
16377 (Fwindow_frame): Remove EXFUN.
16378 (replace_buffer_in_all_windows): Remove prototype.
16379 (replace_buffer_in_windows_safely): Add prototype.
16380
16381 * window.c: Declare Qdelete_window static again. Move down
16382 declaration of select_count.
16383 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16384 (Fother_window): Move to window.el.
16385 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16386 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16387 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16388 window.el.
16389 (replace_buffer_in_windows): Implement by calling
16390 Qreplace_buffer_in_windows.
16391 (replace_buffer_in_all_windows): Remove with some functionality
16392 moved into replace_buffer_in_windows_safely.
16393 (replace_buffer_in_windows_safely): New function.
16394 (select_window_norecord, select_frame_norecord): Move in front
16395 of run_window_configuration_change_hook. Remove now obsolete
16396 declarations.
16397 (Fset_window_buffer): Rewrite doc-string.
16398 Call Qrecord_window_buffer.
16399 (keys_of_window): Move binding for other-window to window.el.
16400
16401 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16402
16403 * dispextern.h (struct image): Replace data member, whose int_val
16404 and ptr_val fields were not used by anything, with a single
16405 lisp_val object.
16406
16407 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16408 (gif_clear_image, gif_load, imagemagick_load_image)
16409 (gs_clear_image, gs_load): Callers changed.
16410
16411 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16412
16413 * buffer.h: Include <time.h>, for time_t.
16414 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16415
16416 Fix minor problems found by static checking.
16417
16418 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16419
16420 Make identifiers static if they are not used in other modules.
16421 * data.c (Qcompiled_function, Qframe, Qvector):
16422 * image.c (QimageMagick, Qsvg):
16423 * minibuf.c (Qmetadata):
16424 * window.c (resize_window_check, resize_root_window): Now static.
16425 * window.h (resize_window_check, resize_root_window): Remove decls.
16426
16427 * window.c (window_deletion_count, delete_deletable_window):
16428 Remove; unused.
16429 (window_body_lines): Now static.
16430 (Fdelete_other_windows_internal): Mark vars as initialized.
16431 Make sure 'resize_failed' is initialized.
16432 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16433 (resize_window_apply): Remove unused local.
16434 * window.h (delete_deletable_window): Remove decl.
16435
16436 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16437 (imagemagick_load_image): Fix pointer signedness problem by changing
16438 last arg from unsigned char * to char *. All uses changed.
16439 Also, fix a local for similar reasons.
16440 Remove unused locals. Remove locals to avoid shadowing.
16441 (fn_rsvg_handle_free): Remove; unused.
16442 (svg_load, svg_load_image): Fix pointer signedness problem.
16443 (imagemagick_load_image): Don't use garbage pointer image_wand.
16444
16445 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16446
16447 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16448
16449 * image.c (gif_load): Fix omitted cast error introduced by
16450 2011-06-06 change.
16451
16452 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16453
16454 * window.h (resize_proportionally, orig_total_lines)
16455 (orig_top_line): Remove from window structure.
16456 (set_window_height, set_window_width, change_window_heights)
16457 (Fdelete_window): Remove prototypes.
16458 (resize_frame_windows): Remove duplicate declaration.
16459
16460 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16461
16462 * window.h (resize_frame_windows, resize_window_check)
16463 (delete_deletable_window, resize_root_window)
16464 (resize_frame_windows): Declare prototypes.
16465
16466 * window.c (resize_window_apply): Make definition be "static" to
16467 match the prototype.
16468
16469 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16470
16471 * window.c: Remove declarations of Qwindow_size_fixed,
16472 window_min_size_1, window_min_size_2, window_min_size,
16473 size_window, window_fixed_size_p, enlarge_window, delete_window.
16474 Remove static from declaration of Qdelete_window, it's
16475 temporarily needed by Fbury_buffer.
16476 (replace_window): Don't assign orig_top_line and
16477 orig_total_lines.
16478 (Fdelete_window, delete_window): Remove. Window deletion is
16479 handled by window.el.
16480 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16481 Replace Fdelete_window calls with calls to Qdelete_window.
16482 (Fdelete_other_windows): Remove. Deleting other windows is
16483 handled by window.el.
16484 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16485 handled in window.el.
16486 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16487 Window minimum sizes are handled in window.el.
16488 (shrink_windows, size_window, set_window_height)
16489 (set_window_width, change_window_heights, window_height)
16490 (window_width, CURBEG, CURSIZE, enlarge_window)
16491 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16492 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16493 handled in window.el.
16494 (make_dummy_parent): Rename to make_parent_window and give it a
16495 second argument horflag.
16496 (make_window): Don't set resize_proportionally any more.
16497 (Fsplit_window): Remove. Windows are split in window.el.
16498 (save_restore_action, save_restore_orig_size)
16499 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16500 Resize mini windows in window.el.
16501 (grow_mini_window, shrink_mini_window): Implement by calling
16502 Qresize_root_window_vertically, resize_window_check and
16503 resize_window_apply.
16504 (saved_window, Fset_window_configuration, save_window_save):
16505 Do not handle orig_top_line, orig_total_lines, and
16506 resize_proportionally.
16507 (window_min_height, window_min_width): Move to window.el.
16508 (keys_of_window): Move bindings for delete-other-windows,
16509 split-window, delete-window and enlarge-window to window.el.
16510
16511 * buffer.c: Temporarily extern Qdelete_window.
16512 (Fbury_buffer): Temporarily call Qdelete_window instead of
16513 Fdelete_window (Fbury_buffer will move to window.el soon).
16514
16515 * frame.c (set_menu_bar_lines_1): Remove code handling
16516 orig_top_line and orig_total_lines.
16517
16518 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16519 set_window_height but set heights directly.
16520 (change_frame_size_1): Use resize_frame_windows.
16521
16522 * xdisp.c (init_xdisp): Don't use set_window_height but set
16523 heights directly.
16524
16525 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16526 Use resize_frame_windows instead of change_window_heights and run
16527 run_window_configuration_change_hook.
16528
16529 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16530 instead of change_window_heights and run
16531 run_window_configuration_change_hook.
16532
16533 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16534
16535 * window.c (replace_window): Rename second argument REPLACEMENT to
16536 NEW. New third argument SETFLAG. Rewrite.
16537 (delete_window, make_dummy_parent): Call replace_window with
16538 third argument 1.
16539 (window_list_1): Move down in code.
16540 (run_window_configuration_change_hook): Move set_buffer part
16541 before select_frame_norecord part in order to unwind correctly.
16542 Rename count1 to count.
16543 (recombine_windows, delete_deletable_window, resize_root_window)
16544 (Fdelete_other_windows_internal)
16545 (Frun_window_configuration_change_hook, make_parent_window)
16546 (resize_window_check, resize_window_apply, Fresize_window_apply)
16547 (resize_frame_windows, Fsplit_window_internal)
16548 (Fdelete_window_internal, Fresize_mini_window_internal):
16549 New functions.
16550 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16551
16552 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16553
16554 * window.h (window): Add some new members to window structure -
16555 normal_lines, normal_cols, new_total, new_normal, clone_number,
16556 splits, nest, prev_buffers, next_buffers.
16557 (WINDOW_TOTAL_SIZE): Move here from window.c.
16558 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16559
16560 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16561 Remove.
16562 (make_dummy_parent): Set new members of windows structure.
16563 (make_window): Move down in code. Handle new members of window
16564 structure.
16565 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16566 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16567 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16568 (Fset_window_prev_buffers, Fwindow_next_buffers)
16569 (Fset_window_next_buffers, Fset_window_clone_number):
16570 New functions.
16571 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16572 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16573 Doc-string fixes.
16574 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16575 Argument WINDOW can be now internal window too.
16576 (Fwindow_use_time): Move up in code.
16577 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16578 Rewrite doc-string.
16579 (Fset_window_configuration, saved_window)
16580 (Fcurrent_window_configuration, save_window_save): Handle new
16581 members of window structure.
16582 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16583 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16584 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16585 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16586 Qget_mru_window, Qresize_root_window,
16587 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16588 Qauto_buffer_name; staticpro them.
16589
16590 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16591
16592 * window.c (Fwindow_total_size, Fwindow_left_column)
16593 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16594 (Fwindow_list_1): New functions.
16595 (window_box_text_cols): Replace with window_body_cols.
16596 (Fwindow_width, Fscroll_left, Fscroll_right):
16597 Use window_body_cols instead of window_box_text_cols.
16598 (delete_window, Fset_window_configuration):
16599 Call delete_all_subwindows with window as argument.
16600 (delete_all_subwindows): Take a window as argument and not a
16601 structure. Rewrite.
16602 (window_loop): Remove handling of GET_LRU_WINDOW and
16603 GET_LARGEST_WINDOW.
16604 (Fget_lru_window, Fget_largest_window): Move to window.el.
16605
16606 * window.h: Extern window_body_cols instead of
16607 window_box_text_cols. delete_all_subwindows now takes a
16608 Lisp_Object as argument.
16609
16610 * indent.c (compute_motion, Fcompute_motion):
16611 Use window_body_cols instead of window_box_text_cols.
16612
16613 * frame.c (delete_frame): Call delete_all_subwindows with root
16614 window as argument.
16615
16616 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16617
16618 * fns.c (Fputhash): Document return value.
16619
16620 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16621
16622 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16623
16624 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16625
16626 Cons<->int and similar integer overflow fixes (Bug#8794).
16627
16628 Check for overflow when converting integer to cons and back.
16629 * charset.c (Fdefine_charset_internal, Fdecode_char):
16630 Use cons_to_unsigned to catch overflow.
16631 (Fencode_char): Use INTEGER_TO_CONS.
16632 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16633 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16634 * data.c (long_to_cons, cons_to_long): Remove.
16635 (cons_to_unsigned, cons_to_signed): New functions.
16636 These signal an error for invalid or out-of-range values.
16637 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16638 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16639 * font.c (Ffont_variation_glyphs):
16640 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16641 * lisp.h: Include <intprops.h>.
16642 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16643 (cons_to_signed, cons_to_unsigned): New decls.
16644 (long_to_cons, cons_to_long): Remove decls.
16645 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16646 (Fprimitive_undo): Use CONS_TO_INTEGER.
16647 * xfns.c (Fx_window_property): Likewise.
16648 * xselect.c: Include <limits.h>.
16649 (x_own_selection, selection_data_to_lisp_data):
16650 Use INTEGER_TO_CONS.
16651 (x_handle_selection_request, x_handle_selection_clear)
16652 (x_get_foreign_selection, Fx_disown_selection_internal)
16653 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16654 (lisp_data_to_selection_data): Use cons_to_unsigned.
16655 (x_fill_property_data): Use cons_to_signed.
16656 Report values out of range.
16657
16658 Check for buffer and string overflow more precisely.
16659 * buffer.h (BUF_BYTES_MAX): New macro.
16660 * lisp.h (STRING_BYTES_MAX): New macro.
16661 * alloc.c (Fmake_string):
16662 * character.c (string_escape_byte8):
16663 * coding.c (coding_alloc_by_realloc):
16664 * doprnt.c (doprnt):
16665 * editfns.c (Fformat):
16666 * eval.c (verror):
16667 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16668 since they may not be the same number.
16669 * editfns.c (Finsert_char):
16670 * fileio.c (Finsert_file_contents):
16671 Likewise for BUF_BYTES_MAX.
16672
16673 * image.c: Use ptrdiff_t, not int, for sizes.
16674 (slurp_file): Switch from int to ptrdiff_t.
16675 All uses changed.
16676 (slurp_file): Check that file size fits in both size_t (for
16677 malloc) and ptrdiff_t (for sanity and safety).
16678
16679 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16680 if b->modtime has its maximal value.
16681
16682 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16683
16684 Don't assume time_t can fit into int.
16685 * buffer.h (struct buffer.modtime): Now time_t, not int.
16686 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16687 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16688
16689 Minor fixes for signed vs unsigned integers.
16690 * character.h (MAYBE_UNIFY_CHAR):
16691 * charset.c (maybe_unify_char):
16692 * keyboard.c (read_char, reorder_modifiers):
16693 XINT -> XFASTINT, since the integer must be nonnegative.
16694 * ftfont.c (ftfont_spec_pattern):
16695 * keymap.c (access_keymap, silly_event_symbol_error):
16696 XUINT -> XFASTINT, since the integer must be nonnegative.
16697 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16698 since it makes no difference and we prefer signed.
16699 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16700 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16701 nonnegative.
16702
16703 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16704
16705 * window.h (Fwindow_frame): Declare.
16706
16707 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16708
16709 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16710 (SPARE_MEMORY): Always define.
16711 (LARGE_REQUEST): Remove.
16712 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16713
16714 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16715
16716 * lisp.h: Move EXFUNS for Fframe_root_window,
16717 Fframe_first_window and Fset_frame_selected_window to window.h.
16718
16719 * window.h: Move EXFUNS for Fframe_root_window,
16720 Fframe_first_window and Fset_frame_selected_window here from
16721 lisp.h.
16722
16723 * frame.c (Fwindow_frame, Fframe_first_window)
16724 (Fframe_root_window, Fframe_selected_window)
16725 (Fset_frame_selected_window): Move to window.c.
16726 (Factive_minibuffer_window): Move to minibuf.c.
16727 (Fother_visible_frames_p): New function.
16728
16729 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16730
16731 * window.c (decode_window, decode_any_window): Move up in code.
16732 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16733 (inhibit_frame_unsplittable): Remove unused variable.
16734 (Fwindow_buffer): Move up and rewrite doc-string.
16735 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16736 (Fwindow_prev): New functions.
16737 (Fwindow_frame): Move here from frame.c. Accept any window as
16738 argument.
16739 (Fframe_root_window, Fframe_first_window)
16740 (Fframe_selected_window): Move here from frame.c. Accept frame
16741 or arbitrary window as argument. Update doc-strings.
16742 (Fminibuffer_window): Move up in code.
16743 (Fwindow_minibuffer_p): Move up in code and simplify.
16744 (Fset_frame_selected_window): Move here from frame.c.
16745 Marginal rewrite.
16746 (Fselected_window, select_window, Fselect_window): Move up in
16747 code. Minor doc-string fixes.
16748
16749 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16750
16751 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16752 Do not assume that spare memory exists; that assumption is valid
16753 only if SYSTEM_MALLOC.
16754 (LARGE_REQUEST): New macro, so that the issue of large requests
16755 is separated from the issue of spare memory.
16756
16757 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16758
16759 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16760 format. (Bug#8806)
16761
16762 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16763
16764 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16765 before statements.
16766
16767 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16768
16769 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16770
16771 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16772
16773 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16774 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16775
16776 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16777
16778 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16779
16780 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16781
16782 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16783 (x_clipboard_manager_save): Add return value.
16784 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16785 New error handlers.
16786 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16787 Obey Vx_select_enable_clipboard_manager. Catch errors in
16788 x_clipboard_manager_save (Bug#8779).
16789 (Vx_select_enable_clipboard_manager): New variable.
16790 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16791
16792 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16793
16794 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16795
16796 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16797
16798 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16799 in the current matrix if keep_current_p is non-zero.
16800
16801 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16802
16803 * bidi.c (bidi_level_of_next_char): Fix last change.
16804
16805 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16806
16807 Support bidi reordering of text covered by display properties.
16808
16809 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16810 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16811 (bidi_cache_search, bidi_cache_iterator_state)
16812 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16813 (bidi_level_of_next_char, bidi_move_to_visually_next):
16814 Support character positions inside a run of characters covered by a
16815 display string.
16816 (bidi_paragraph_init, bidi_resolve_explicit_1)
16817 (bidi_level_of_next_char): Call bidi_fetch_char and
16818 bidi_fetch_char_advance instead of FETCH_CHAR and
16819 FETCH_CHAR_ADVANCE.
16820 (bidi_init_it): Initialize new members.
16821 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16822 definitions.
16823 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16824 instead of using explicit *_CHAR codes.
16825 (bidi_resolve_explicit, bidi_resolve_weak):
16826 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16827 bidirectional text is supported only in multibyte buffers.
16828 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16829 it to initialize the frame_window_p member of struct bidi_it.
16830 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16831 (bidi_resolve_explicit, bidi_resolve_weak)
16832 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16833 bidi_it->nchars is non-positive.
16834 (bidi_level_of_next_char): Don't try to lookup the cache for the
16835 next/previous character if nothing is cached there yet, or if we
16836 were just reseat()'ed to a new position.
16837
16838 * xdisp.c (set_cursor_from_row): Set start and stop points
16839 according to the row's direction when priming the loop that looks
16840 for the glyph on which to display cursor.
16841 (single_display_spec_intangible_p): Function deleted.
16842 (display_prop_intangible_p): Reimplement to call
16843 handle_display_spec instead of single_display_spec_intangible_p.
16844 Accept 3 additional arguments needed by handle_display_spec.
16845 This fixes incorrect cursor motion across display property with complex
16846 values: lists, `(when COND...)' forms, etc.
16847 (single_display_spec_string_p): Support property values that are
16848 lists with the argument STRING its top-level element.
16849 (display_prop_string_p): Fix the condition for processing a
16850 property that is a list to be consistent with handle_display_spec.
16851 (handle_display_spec): New function, refactored from the
16852 last portion of handle_display_prop.
16853 (compute_display_string_pos): Accept additional argument
16854 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16855 value of a `display' property is a "replacing spec".
16856 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16857 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16858 the display property, but just return a value indicating whether
16859 the display property will replace the characters it covers.
16860 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16861 frame_window_p members of struct bidi_it.
16862 (compute_display_string_pos, compute_display_string_end):
16863 New functions.
16864 (push_it): Accept second argument POSITION, where pop_it should
16865 jump to continue iteration.
16866 (reseat_1): Initialize bidi_it.disp_pos.
16867
16868 * keyboard.c (adjust_point_for_property): Adjust the call to
16869 display_prop_intangible_p to its new signature.
16870
16871 * dispextern.h (struct bidi_it): New member frame_window_p.
16872 (bidi_init_it): Update prototypes.
16873 (display_prop_intangible_p): Update prototype.
16874 (compute_display_string_pos, compute_display_string_end):
16875 Declare prototypes.
16876 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16877 EMACS_INT.
16878
16879 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16880
16881 Malloc failure behavior now depends on size of allocation.
16882 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16883 * lisp.h: Change signatures accordingly.
16884 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16885 All callers changed. (Bug#8762)
16886
16887 * gnutls.c: Use Emacs's memory allocators.
16888 Without this change, the gnutls library would invoke malloc etc.
16889 directly, which causes problems on non-SYNC_INPUT hosts, and which
16890 runs afoul of improving memory_full behavior. (Bug#8761)
16891 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16892 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16893 xfree instead of the default malloc, realloc, free.
16894 (Fgnutls_boot): No need to check for memory allocation failure,
16895 since xmalloc does that for us.
16896
16897 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16898 * category.c (hash_get_category_set):
16899 * ccl.c (ccl_driver):
16900 * charset.c (Fdefine_charset_internal):
16901 * charset.h (struct charset.hash_index):
16902 * composite.c (get_composition_id, gstring_lookup_cache)
16903 (composition_gstring_put_cache):
16904 * composite.h (struct composition.hash_index):
16905 * dispextern.h (struct image.hash):
16906 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16907 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16908 (hashfn_equal, hashfn_user_defined, make_hash_table)
16909 (maybe_resize_hash_table, hash_lookup, hash_put)
16910 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16911 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16912 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16913 * image.c (make_image, search_image_cache, lookup_image)
16914 (xpm_put_color_table_h):
16915 * lisp.h (struct Lisp_Hash_Table):
16916 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16917 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16918 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16919 * alloc.c (allocate_vectorlike):
16920 Check for overflow in vector size calculations.
16921 * ccl.c (ccl_driver):
16922 Check for overflow when converting EMACS_INT to int.
16923 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16924 need to be updated by these changes.
16925 * fns.c (make_hash_table, maybe_resize_hash_table):
16926 Check for integer overflow with large hash tables.
16927 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16928 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16929 (SXHASH_REDUCE): New macro.
16930 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16931 Use it instead of discarding useful hash info with large hash values.
16932 (sxhash_float): New function.
16933 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16934 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16935 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16936 Rewrite to use FIXNUM_BITS, as this simplifies things.
16937 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16938 Adjust signatures to match updated version of code.
16939 (consing_since_gc): Now EMACS_INT, since a single hash table can
16940 use more than INT_MAX bytes.
16941
16942 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16943
16944 Make it possible to build with GCC-4.6+ -O2 -flto.
16945
16946 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16947
16948 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16949
16950 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16951 Call minibuffer-inactive-mode.
16952
16953 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16954
16955 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16956 Update dependencies.
16957
16958 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16959
16960 * data.c (init_data): Remove code for UTS, this system is not
16961 supported anymore.
16962
16963 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16964
16965 Don't force ./temacs to start in terminal mode.
16966
16967 * frame.c (make_initial_frame): Initialize faces in all cases, not
16968 only when CANNOT_DUMP is defined.
16969 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16970
16971 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16972
16973 * dispnew.c (add_window_display_history): Use const for the string
16974 pointer. Remove declaration, not needed.
16975
16976 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16977
16978 Use 'inline', not 'INLINE'.
16979 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16980 * alloc.c, fontset.c (INLINE): Remove.
16981 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16982 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16983 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16984 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16985 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16986
16987 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16988
16989 Make it possible to run ./temacs.
16990
16991 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16992 syms_of_callproc does the same thing. Remove test for
16993 "initialized", do it in the caller.
16994 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16995
16996 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16997
16998 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16999 (read_minibuf): Use get_minibuffer.
17000 (syms_of_minibuf): Use DEFSYM.
17001 (Qmetadata): New var.
17002 * data.c (Qbuffer): Don't make it static.
17003 (syms_of_data): Use DEFSYM.
17004
17005 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17006
17007 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17008 (CCL_CODE_MIN): New macro.
17009
17010 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17011
17012 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17013
17014 * eval.c (Qdebug): Now static.
17015 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17016 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17017 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17018
17019 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17020
17021 * image.c: Various fixes to ImageMagick code comments.
17022 (Fimagemagick_types): Doc fix.
17023
17024 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17025
17026 Minor fixes prompted by GCC 4.6.0 warnings.
17027
17028 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17029
17030 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17031 (x_clipboard_manager_save_all): Move extern decl to ...
17032 * xterm.h: ... here, so that it can be checked for consistency.
17033
17034 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17035
17036 * xselect.c (x_clipboard_manager_save_frame)
17037 (x_clipboard_manager_save_all): New functions.
17038 (Fx_clipboard_manager_save): Lisp function deleted.
17039
17040 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17041 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17042
17043 * xterm.h: Update prototype.
17044
17045 2011-05-28 William Xu <william.xwl@gmail.com>
17046
17047 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17048 exiting (Bug#8239).
17049
17050 2011-05-28 Jim Meyering <meyering@redhat.com>
17051
17052 Avoid a sign-extension bug in crypto_hash_function.
17053 * fns.c (to_uchar): Define.
17054 (crypto_hash_function): Use it to convert some newly-signed
17055 variables to unsigned, to avoid sign-extension bugs. For example,
17056 without this change, (md5 "truc") would evaluate to
17057 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17058 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17059 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17060
17061 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17062
17063 Integer overflow fixes.
17064
17065 * dbusbind.c: Serial number integer overflow fixes.
17066 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17067 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17068 to hold a serial number that is too large for a fixnum.
17069 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17070 Check for serial numbers out of range. Decode any serial number
17071 that was so large that it became a float. (Bug#8722)
17072
17073 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17074 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17075 Use XFASTINT rather than XUINT when numbers are nonnegative.
17076 (xd_append_arg, Fdbus_method_return_internal):
17077 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17078 arguments, check that Lisp number is nonnegative, rather than
17079 silently wrapping negative numbers around. (Bug#8722)
17080 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17081 (Bug#8722)
17082
17083 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17084
17085 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17086
17087 ccl: Add integer overflow checks.
17088 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17089 (IN_INT_RANGE): New macros.
17090 (ccl_driver): Use them to check for integer overflow when
17091 decoding a CCL program. Many of the new checks are whether XINT (x)
17092 fits in int; it doesn't always, on 64-bit hosts. The new version
17093 doesn't catch all possible integer overflows, but it's an
17094 improvement. (Bug#8719)
17095
17096 * alloc.c (make_event_array): Use XINT, not XUINT.
17097 There's no need for unsigned here.
17098
17099 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17100 This follows up to the 2011-05-06 change that substituted uintptr_t
17101 for EMACS_INT. This case wasn't caught back then.
17102
17103 Rework Fformat to avoid integer overflow issues.
17104 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17105 now (part of C89). Include <verify.h>.
17106 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17107 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17108 (Fformat): Avoid the prepass trying to compute sizes; it was only
17109 approximate and thus did not catch overflow reliably. Instead, walk
17110 through the format just once, formatting and computing sizes as we go,
17111 checking for integer overflow at every step, and allocating a larger
17112 buffer as needed. Keep track separately whether the format is
17113 multibyte. Keep only the most-recently calculated precision, rather
17114 than them all. Record whether each argument has been converted to
17115 string. Use EMACS_INT, not int, for byte and char and arg counts.
17116 Support field widths and precisions larger than INT_MAX. Avoid
17117 sprintf's undefined behavior with conversion specifications such as %#d
17118 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17119 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17120 formatting out-of-range floating point numbers with int
17121 formats. (Bug#8668)
17122
17123 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17124
17125 * data.c: Avoid integer truncation in expressions involving floats.
17126 * data.c: Include <intprops.h>.
17127 (arith_driver): When there's an integer overflow in an expression
17128 involving floating point, convert the integers to floating point
17129 so that the resulting value does not suffer from catastrophic
17130 integer truncation. For example, on a 64-bit host (* 4
17131 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17132 Do not rely on undefined behavior after integer overflow.
17133
17134 merge count_size_as_multibyte, parse_str_to_multibyte
17135 * character.c, character.h (count_size_as_multibyte):
17136 Rename from parse_str_to_multibyte; all uses changed.
17137 Check for integer overflow.
17138 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17139 since it's now a duplicate of the other. This is more of
17140 a character than a buffer op, so better that it's in character.c.
17141 * fns.c, print.c: Adjust to above changes.
17142
17143 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17144
17145 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17146
17147 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17148
17149 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17150 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17151 (x_clipboard_manager_save): Now static.
17152 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17153
17154 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17155 (crypto_hash_function): Now static.
17156 Fix pointer signedness problems. Avoid unnecessary initializations.
17157
17158 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17159
17160 * termhooks.h (Vselection_alist): Make it terminal-local.
17161
17162 * terminal.c (create_terminal): Initialize it.
17163
17164 * xselect.c: Support for clipboard managers.
17165 (Vselection_alist): Move to termhooks.h as terminal-local var.
17166 (LOCAL_SELECTION): New macro.
17167 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17168 (symbol_to_x_atom): Remove gratuitous arg.
17169 (x_handle_selection_request, lisp_data_to_selection_data)
17170 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17171 (x_own_selection, x_get_local_selection, x_convert_selection):
17172 New arg, specifying work frame. Use terminal-local Vselection_alist.
17173 (some_frame_on_display): Delete unused function.
17174 (Fx_own_selection_internal, Fx_get_selection_internal)
17175 (Fx_disown_selection_internal, Fx_selection_owner_p)
17176 (Fx_selection_exists_p): New optional frame arg.
17177 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17178 (x_handle_selection_clear): Don't treat other terminals with the
17179 same keyboard specially. Use the terminal-local Vselection_alist.
17180 (x_clear_frame_selections): Use Frun_hook_with_args.
17181
17182 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17183
17184 * xterm.h: Add support for those atoms.
17185
17186 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17187
17188 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17189 (converted_selections, conversion_fail_tag): New global variables.
17190 (x_selection_request_lisp_error): Free the above.
17191 (x_get_local_selection): Remove unnecessary code.
17192 (x_reply_selection_request): Args changed; handle arbitrary array
17193 of converted selections stored in converted_selections.
17194 Separate the XChangeProperty and SelectionNotify steps.
17195 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17196 (x_convert_selection): New function.
17197 (x_handle_selection_event): Simplify.
17198 (x_get_foreign_selection): Don't ignore incoming requests while
17199 waiting for an answer; this will fail when we implement
17200 SAVE_TARGETS, and seems unnecessary anyway.
17201 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17202 (Vx_sent_selection_functions): Doc fix.
17203
17204 2011-05-26 Leo Liu <sdl.web@gmail.com>
17205
17206 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17207
17208 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17209
17210 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17211
17212 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17213 for fringe update if it has periodic bitmap.
17214 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17215 and fringe_bitmap_periodic_p.
17216
17217 * fringe.c (get_fringe_bitmap_data): New function.
17218 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17219 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17220 row. Mark glyph row for fringe update if periodicity changed.
17221
17222 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17223 for fringe update unless it has periodic bitmap.
17224
17225 2011-05-25 Kenichi Handa <handa@m17n.org>
17226
17227 * xdisp.c (get_next_display_element): Set correct it->face_id for
17228 a static composition.
17229
17230 2011-05-24 Leo Liu <sdl.web@gmail.com>
17231
17232 * deps.mk (fns.o):
17233 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17234
17235 * fns.c (crypto_hash_function, Fsha1): New function.
17236 (Fmd5): Use crypto_hash_function.
17237 (syms_of_fns): Add Ssha1.
17238
17239 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17240
17241 * gnutls.c: Remove unused macros.
17242 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17243 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17244 Remove macros that are defined and never used.
17245 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17246
17247 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17248
17249 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17250 (Fx_get_selection_internal): Minor cleanup.
17251 (Fx_own_selection_internal): Rename arguments for consistency with
17252 select.el.
17253
17254 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17255
17256 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17257
17258 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17259
17260 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17261
17262 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17263
17264 * dispnew.c (scrolling_window): Don't exclude the case that the
17265 last enabled row in the desired matrix touches the bottom boundary.
17266
17267 2011-05-21 Glenn Morris <rgm@gnu.org>
17268
17269 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17270 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17271 and add some more files.
17272
17273 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17274
17275 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17276 report_file_error introduced by the change from 2011-05-07.
17277
17278 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17279
17280 * systime.h (Time): Define only if emacs is defined.
17281 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17282 where the include path doesn't have X11/X.h by default. See
17283 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17284
17285 2011-05-20 Kenichi Handa <handa@m17n.org>
17286
17287 * composite.c (find_automatic_composition): Fix previous change.
17288
17289 2011-05-20 Glenn Morris <rgm@gnu.org>
17290
17291 * lisp.mk: New file, split from Makefile.in.
17292 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17293 (shortlisp): Remove.
17294 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17295
17296 2011-05-19 Glenn Morris <rgm@gnu.org>
17297
17298 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17299 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17300 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17301 (lisp): Set the order to that of loadup.el.
17302 (shortlisp): Make it a copy of $lisp.
17303 (SOME_MACHINE_LISP): Remove.
17304 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17305 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17306
17307 2011-05-18 Kenichi Handa <handa@m17n.org>
17308
17309 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17310 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17311 (find_automatic_composition): Mostly rewrite for efficiency.
17312
17313 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17314
17315 * makefile.w32-in: Update dependencies.
17316
17317 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17318
17319 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17320 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17321
17322 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17323
17324 Fix some integer overflow issues, such as string length overflow.
17325
17326 * insdel.c (count_size_as_multibyte): Check for string overflow.
17327
17328 * character.c (lisp_string_width): Check for string overflow.
17329 Use EMACS_INT, not int, for string indexes and lengths; in
17330 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17331 the resulting string length overflows an EMACS_INT; instead,
17332 report a string overflow if no precision given. When checking for
17333 precision exhaustion, use a check that cannot possibly have
17334 integer overflow. (Bug#8675)
17335 * character.h (lisp_string_width): Adjust to new signature.
17336
17337 * alloc.c (string_overflow): New function.
17338 (Fmake_string): Use it. This doesn't change behavior, but saves
17339 a few bytes and will simplify future changes.
17340 * character.c (string_escape_byte8): Likewise.
17341 * lisp.h (string_overflow): New decl.
17342
17343 Fixups, following up to the user-interface timestamp change.
17344 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17345 for UI timestamps, instead of unsigned long.
17346 * msdos.c (mouse_get_pos): Likewise.
17347 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17348 * w32gui.h (Time): Define by including "systime.h" rather than by
17349 declaring it ourselves. (Bug#8664)
17350
17351 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17352 * image.c (clear_image_cache): Likewise.
17353
17354 * term.c (term_mouse_position): Don't assume time_t wraparound.
17355
17356 Be more systematic about user-interface timestamps.
17357 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17358 and sometimes 'EMACS_UINT', to represent these timestamps.
17359 This change causes it to use 'Time' uniformly, as that's what X uses.
17360 This makes the code easier to follow, and makes it easier to catch
17361 integer overflow bugs such as Bug#8664.
17362 * frame.c (Fmouse_position, Fmouse_pixel_position):
17363 Use Time, not unsigned long, for user-interface timestamps.
17364 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17365 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17366 * keyboard.h (last_event_timestamp): Likewise.
17367 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17368 * menu.h (xmenu_show): Likewise.
17369 * term.c (term_mouse_position): Likewise.
17370 * termhooks.h (struct input_event.timestamp): Likewise.
17371 (struct terminal.mouse_position_hook): Likewise.
17372 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17373 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17374 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17375 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17376 what it was before.
17377 * menu.h, termhooks.h: Include "systime.h", for Time.
17378
17379 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17380 Don't assume that the difference between two unsigned long values
17381 can fit into an integer. At this point, we know button_down_time
17382 <= event->timestamp, so the difference must be nonnegative, so
17383 there's no need to cast the result if double-click-time is
17384 nonnegative, as it should be; check that it's nonnegative, just in
17385 case. This bug is triggered when events are more than 2**31 ms
17386 apart (about 25 days). (Bug#8664)
17387
17388 * xselect.c (last_event_timestamp): Remove duplicate decl.
17389 (x_own_selection): Remove needless cast to unsigned long.
17390
17391 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17392 that always fit in int. Use a sentinel instead of a counter, to
17393 avoid a temp and to allay GCC's concerns about possible int overflow.
17394 * frame.h (struct frame): Use int for menu_bar_items_used
17395 instead of EMACS_INT, since it always fits in int.
17396
17397 * menu.c (grow_menu_items): Check for int overflow.
17398
17399 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17400
17401 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17402 Before, the code was not consistent. These values cannot exceed
17403 2**31 - 1 so there's no need to make them unsigned.
17404 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17405 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17406 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17407 as modifiers.
17408 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17409
17410 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17411 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17412 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17413 presumably because the widths might not match.
17414
17415 * window.c (size_window): Avoid needless test at loop start.
17416
17417 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17418
17419 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17420
17421 2011-05-12 Drew Adams <drew.adams@oracle.com>
17422
17423 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17424
17425 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17426
17427 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17428 `width' to `bar_area_x' and `bar_area_width', respectively.
17429 (x_scroll_run): Take account of fringe background extension.
17430
17431 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17432 Rename local vars `left' and `width' to `bar_area_x' and
17433 `bar_area_width', respectively.
17434 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17435 background extension.
17436
17437 2011-05-10 Jim Meyering <meyering@redhat.com>
17438
17439 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17440
17441 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17442
17443 * image.c (Finit_image_library): Return t for built-in image types,
17444 like pbm and xbm. (Bug#8640)
17445
17446 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17447
17448 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17449
17450 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17451
17452 * w32console.c (Fset_screen_color): Doc fix.
17453 (Fget_screen_color): New function.
17454 (syms_of_ntterm): Defsubr it.
17455
17456 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17457 unlink the temporary file if Fcall_process didn't create it in the
17458 first place.
17459 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17460 child process will be redirected to a file specified with `:file'.
17461 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17462 cue to call_process_cleanup not to close that handle.
17463
17464 2011-05-07 Ben Key <bkey76@gmail.com>
17465
17466 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17467 one of two shell specific rules, either bootstrap-temacs-CMD or
17468 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17469 to the previous implementation of the bootstrap-temacs rule.
17470 The bootstrap-temacs-CMD rule is similar to the previous
17471 implementation of the bootstrap-temacs rule except that it
17472 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17473 variable.
17474
17475 These changes, along with some changes to nt/configure.bat,
17476 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17477 earlier fix to add support for --cflags and --ldflags options
17478 that include quotes so that it works whether make uses cmd or
17479 sh as the shell.
17480
17481 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17482
17483 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17484 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17485 is a constant.
17486 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17487 a string. Handle both cases.
17488 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17489 (Fdbus_register_method): Use Qinvalid_function.
17490
17491 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17492
17493 * makefile.w32-in: Update dependencies.
17494 (LISP_H): Add inttypes.h and stdin.h.
17495 (PROCESS_H): Add unistd.h.
17496
17497 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17498
17499 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17500 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17501
17502 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17503
17504 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17505
17506 * term.c (vfatal): Remove stray call to va_end.
17507 It's not needed and the C Standard doesn't allow it here anyway.
17508
17509 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17510 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17511
17512 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17513 bytes.
17514
17515 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17516
17517 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17518
17519 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17520
17521 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17522
17523 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17524
17525 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17526 * charset.c (Fdefine_charset_internal): Don't initialize
17527 charset.code_space[15]. The value was garbage, on hosts with
17528 32-bit int (Bug#8600).
17529
17530 * lread.c (read_integer): Be more consistent with string-to-number.
17531 Use string_to_number to do the actual conversion; this avoids
17532 rounding errors and fixes some other screwups. Without this fix,
17533 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17534 (digit_to_number): Move earlier, for benefit of read_integer.
17535 Return -1 if the digit is out of range for the base, -2 if it is
17536 not a digit in any supported base. (Bug#8602)
17537
17538 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17539
17540 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17541 to match comment at start of function. This also removes a
17542 GCC warning about overflow in a 32+64-bit port.
17543
17544 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17545
17546 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17547 Reported by Stefan Monnier in
17548 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17549 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17550 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17551
17552 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17553 (EMACS_UINTPTR): Likewise, with uintptr_t.
17554
17555 * lisp.h: Prefer 64-bit EMACS_INT if available.
17556 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17557 on 32-bit hosts that have 64-bit int, so that they can access
17558 large files.
17559 However, temporarily disable this change unless the temporary
17560 symbol WIDE_EMACS_INT is defined.
17561
17562 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17563
17564 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17565 This removes an assumption that EMACS_INT and long are the same
17566 width as pointers. The assumption is true for Emacs porting targets
17567 now, but we want to make other targets possible.
17568 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17569 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17570 In the rest of the code, change types of integers that hold casted
17571 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17572 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17573 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17574 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17575 No need to cast type when ORing.
17576 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17577 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17578 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17579 assume EMACS_INT is the same width as char *.
17580 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17581 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17582 Remove no-longer-needed casts.
17583 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17584 (xg_tool_bar_help_callback, xg_make_tool_item):
17585 Use EMACS_INTPTR to hold an integer
17586 that will be cast to void *; this can avoid a GCC warning
17587 if EMACS_INT is not the same width as void *.
17588 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17589 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17590 (current_message_1, set_message_1):
17591 Use a local to convert to proper width without a cast.
17592 * xmenu.c (dialog_selection_callback): Likewise.
17593
17594 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17595 Also, don't assume VALBITS / RAND_BITS is less than 5,
17596 and don't rely on undefined behavior when shifting a 1 left into
17597 the sign bit.
17598 * lisp.h (get_random): Change signature to match.
17599
17600 * lread.c (hash_string): Use size_t, not int, for hash computation.
17601 Normally we prefer signed values; but hashing is special, because
17602 it's better to use unsigned division on hash table sizes so that
17603 the remainder is nonnegative. Also, size_t is the natural width
17604 for hashing into memory. The previous code used 'int', which doesn't
17605 retain enough info to hash well into very large tables.
17606 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17607
17608 * dbusbind.c: Don't possibly lose pointer info when converting.
17609 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17610 Use XPNTR rather than XHASH, so that the high-order bits of
17611 the pointer aren't lost when converting through void *.
17612
17613 * eval.c (Fautoload): Don't double-shift a pointer.
17614
17615 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17616
17617 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17618
17619 * gnutls.c (DEF_GNUTLS_FN):
17620 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17621
17622 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17623
17624 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17625 marker. (Bug#8610)
17626
17627 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17628
17629 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17630 New version that can reserve upto 2GB of heap space.
17631
17632 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17633
17634 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17635
17636 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17637
17638 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17639 `gnutls_certificate_set_x509_key_file'.
17640
17641 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17642
17643 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17644 Update dependencies.
17645
17646 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17647
17648 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17649 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17650 Remove unused parameter `fildes'.
17651 * process.c (read_process_output, send_process): Don't pass it.
17652
17653 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17654
17655 Fix previous change: the library cache is defined in w32.c.
17656 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17657 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17658
17659 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17660
17661 Implement dynamic loading of GnuTLS on Windows.
17662
17663 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17664 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17665 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17666 Declare.
17667
17668 * gnutls.c (Qgnutls_dll): Define.
17669 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17670 (gnutls_*): Declare function pointers.
17671 (init_gnutls_functions): New function to initialize function pointers.
17672 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17673 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17674 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17675 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17676 (emacs_gnutls_write, emacs_gnutls_read)
17677 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17678 (Fgnutls_available_p): New function.
17679 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17680 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17681 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17682
17683 * image.c: Include w32.h.
17684 (Vimage_type_cache): Delete.
17685 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17686 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17687 (w32_delayed_load): Move to w32.c.
17688
17689 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17690
17691 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17692 (w32_delayed_load): Move from image.c. When loading a library, record
17693 its filename in the :loaded-from property of the library id.
17694 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17695 Initialize and staticpro them.
17696 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17697
17698 * process.c: Include lisp.h before w32.h, not after.
17699 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17700 instead of gnutls_record_check_pending.
17701
17702 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17703
17704 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17705
17706 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17707 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17708 as passed in.
17709
17710 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17711
17712 * xterm.c (x_set_frame_alpha): Do not set property on anything
17713 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17714
17715 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17716
17717 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17718
17719 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17720
17721 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17722 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17723 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17724 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17725 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17726 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17727 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17728 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17729 (Qgnutls_bootprop_callbacks_verify): Make static.
17730
17731 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17732
17733 * callproc.c: Indentation fixup.
17734
17735 * sysdep.c (wait_for_termination_1): Make static.
17736 (wait_for_termination, interruptible_wait_for_termination):
17737 Move after wait_for_termination_1.
17738
17739 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17740
17741 * sysdep.c (interruptible_wait_for_termination): New function
17742 which is like wait_for_termination, but allows keyboard
17743 interruptions.
17744
17745 * callproc.c (Fcall_process): Add (:file "file") as an option for
17746 the STDOUT buffer.
17747 (Fcall_process_region): Ditto.
17748
17749 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17750
17751 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17752 rather than `XVECTOR (FOO)->size'.
17753
17754 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17755 inttypes.h, as a gnulib replacement is used if it not available in
17756 system headers.
17757
17758 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17759
17760 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17761 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17762 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17763
17764 * coding.c (coding_alloc_by_realloc): Error out if destination
17765 will grow beyond MOST_POSITIVE_FIXNUM.
17766 (decode_coding_emacs_mule): Abort if there isn't enough place in
17767 charbuf for the composition carryover bytes. Reserve an extra
17768 space for up to 2 characters produced in a loop.
17769 (decode_coding_iso_2022): Abort if there isn't enough place in
17770 charbuf for the composition carryover bytes.
17771
17772 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17773
17774 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17775 aborting when %lld or %lll format is passed.
17776 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17777 %llo or %llx format is passed. (Bug#8545)
17778
17779 * window.c (window_scroll_line_based): Use a marker instead of
17780 simple variables to record original value of point. (Bug#7952)
17781
17782 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17783 produced by %s or %c overflows available buffer space. (Bug#8545)
17784
17785 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17786
17787 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17788 (SIZE_MAX): Move defn after all includes, as they might #define it.
17789
17790 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17791
17792 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17793
17794 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17795
17796 * keyboard.c (Qdelayed_warnings_hook): Define.
17797 (command_loop_1): Run `delayed-warnings-hook'
17798 if Vdelayed_warnings_list is non-nil.
17799 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17800 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17801
17802 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17803
17804 * doprnt.c (doprnt): Don't return value smaller than the buffer
17805 size if the message was truncated. (Bug#8545).
17806
17807 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17808
17809 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17810 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17811
17812 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17813
17814 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17815
17816 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17817
17818 * makefile.w32-in: Update dependencies.
17819
17820 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17821
17822 Improve `doprnt' and its usage. (Bug#8545)
17823 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17824 `format_end'. Remove support for %l as a conversion specifier.
17825 Don't use xrealloc. Improve diagnostics when the %l size modifier
17826 is used. Update the commentary.
17827
17828 * eval.c (verror): Simplify calculation of size_t.
17829
17830 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17831 messages.
17832
17833 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17834
17835 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17836 change.
17837
17838 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17839
17840 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17841 This makes this file independent of the recent pseudovector change.
17842
17843 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17844
17845 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17846
17847 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17848 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17849 Remove unused local.
17850 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17851
17852 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17853 GCC 4.6.0 optimizes based on type-based alias analysis.
17854 For example, if b is of type struct buffer * and v of type struct
17855 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17856 != &v->size, and therefore "v->size = 1; b->size = 2; return
17857 v->size;" must therefore return 1. This assumption is incorrect
17858 for Emacs, since it type-puns struct Lisp_Vector * with many other
17859 types. To fix this problem, this patch adds a new type struct
17860 vectorlike_header that documents the constraints on layout of vectors
17861 and pseudovectors, and helps optimizing compilers not get fooled
17862 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17863 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17864 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17865 the size member.
17866 (XSETPVECTYPE): Rewrite in terms of new macro.
17867 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17868 This is a bit clearer, and further avoids the possibility of
17869 undesirable aliasing.
17870 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17871 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17872 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17873 since Lisp_Subr is a special case (no "next" field).
17874 (ASIZE): Now uses header.size rather than size.
17875 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17876 to avoid the hassle of writing XVECTOR (foo)->header.size.
17877 (struct vectorlike_header): New type.
17878 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17879 object, to help avoid aliasing.
17880 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17881 (SUBRP): Likewise, since Lisp_Subr is a special case.
17882 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17883 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17884 (struct Lisp_Hash_Table): Combine first two members into a single
17885 struct vectorlike_header member. All uses of "size" and "next" members
17886 changed to be "header.size" and "header.next".
17887 * buffer.h (struct buffer): Likewise.
17888 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17889 * frame.h (struct frame): Likewise.
17890 * process.h (struct Lisp_Process): Likewise.
17891 * termhooks.h (struct terminal): Likewise.
17892 * window.c (struct save_window_data, struct saved_window): Likewise.
17893 * window.h (struct window): Likewise.
17894 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17895 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17896 * buffer.c (init_buffer_once): Likewise.
17897 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17898 special case.
17899 * process.c (Fformat_network_address): Use local var for size,
17900 for brevity.
17901
17902 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17903
17904 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17905 * data.c (atof): Remove decl; no longer used or needed.
17906 (digit_to_number): Move to lread.c.
17907 (Fstring_to_number): Use new string_to_number function, to be
17908 consistent with how the Lisp reader treats infinities and NaNs.
17909 Do not assume that floating-point numbers represent EMACS_INT
17910 without losing information; this is not true on most 64-bit hosts.
17911 Avoid double-rounding errors, by insisting on integers when
17912 parsing non-base-10 numbers, as the documentation specifies.
17913 * lisp.h (string_to_number): New decl, replacing ...
17914 (isfloat_string): Remove.
17915 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17916 (read1): Do not accept +. and -. as integers; this
17917 appears to have been a coding error. Similarly, do not accept
17918 strings like +-1e0 as floating point numbers. Do not report
17919 overflow for integer overflows unless the base is not 10 which
17920 means we have no simple and reliable way to continue.
17921 Break out the floating-point parsing into a new
17922 function string_to_number, so that Fstring_to_number parses
17923 floating point numbers consistently with the Lisp reader.
17924 (digit_to_number): Move here from data.c. Make it static inline.
17925 (E_CHAR, EXP_INT): Remove, replacing with ...
17926 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17927 (string_to_number): New function, replacing isfloat_string.
17928 This function checks for valid syntax and produces the resulting
17929 Lisp float number too. Rework it so that string-to-number
17930 no longer mishandles examples like "1.0e+". Use strtoumax,
17931 so that overflow for non-base-10 numbers is reported only when
17932 there's no portable and simple way to convert to floating point.
17933
17934 * textprop.c (set_text_properties_1): Rewrite for clarity,
17935 and to avoid GCC warning about integer overflow.
17936
17937 * intervals.h (struct interval): Use EMACS_INT for members
17938 where EMACS_UINT might cause problems. See
17939 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17940 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17941 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17942 All uses changed.
17943 (offset_intervals): Tell GCC not to worry about length overflow
17944 when negating a negative length.
17945
17946 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17947 (overrun_check_free): Likewise.
17948
17949 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17950 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17951 word size.
17952
17953 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17954 (gnutls_make_error): Rename local to avoid shadowing.
17955 (gnutls_emacs_global_deinit): ifdef out; not used.
17956 (Fgnutls_boot): Use const for pointer to readonly storage.
17957 Comment out unused local. Fix pointer signedness problems.
17958
17959 * lread.c (openp): Don't stuff size_t into an 'int'.
17960 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17961 about possible signed overflow.
17962
17963 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17964 (GDK_KEY_g): Don't define if already defined.
17965 (xg_prepare_tooltip): Avoid pointer signedness problem.
17966 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17967
17968 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17969 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17970
17971 * xfns.c (Fx_window_property): Simplify a bit,
17972 to make a bit faster and to avoid GCC 4.6.0 warning.
17973 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17974
17975 * fns.c (internal_equal): Don't assume size_t fits in int.
17976
17977 * alloc.c (compact_small_strings): Tighten assertion a little.
17978
17979 Replace pEd with more-general pI, and fix some printf arg casts.
17980 * lisp.h (pI): New macro, generalizing old pEd macro to other
17981 conversion specifiers. For example, use "...%"pI"d..." rather
17982 than "...%"pEd"...".
17983 (pEd): Remove. All uses replaced with similar uses of pI.
17984 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17985 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17986 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17987 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17988 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17989 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17990 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17991 64-bit hosts.
17992 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17993 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17994 * print.c (safe_debug_print, print_object): Likewise.
17995 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17996 to int.
17997 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17998 avoiding the 0 flag, which is not portable.
17999 * process.c (Fmake_network_process): Use pI to avoid cast.
18000 * region-cache.c (pp_cache): Likewise.
18001 * xdisp.c (decode_mode_spec): Likewise.
18002 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18003 behavior on 64-bit hosts with printf arg.
18004 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18005 (x_stop_queuing_selection_requests): Likewise.
18006 (x_get_window_property): Don't truncate byte count to an 'int'
18007 when tracing.
18008
18009 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18010 here, since it parses constructs like leading '-' and spaces,
18011 which are not wanted; and it overflows with large numbers.
18012 Instead, simply match F[0-9]+, which is what is wanted anyway.
18013
18014 * alloc.c: Remove unportable assumptions about struct layout.
18015 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18016 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18017 (allocate_vectorlike, make_pure_vector): Use the new macros,
18018 plus offsetof, to remove unportable assumptions about struct layout.
18019 These assumptions hold on all porting targets that I know of, but
18020 they are not guaranteed, they're easy to remove, and removing them
18021 makes further changes easier.
18022
18023 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18024 This doesn't fix a bug but makes the code clearer.
18025 (string_overrun_cookie): Now const. Use initializers that
18026 don't formally overflow signed char, to avoid warnings.
18027 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18028 can cause Emacs to crash when string overrun checking is enabled.
18029 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18030 multiple of sizeof (EMACS_INT); it need not be, if
18031 alignof(EMACS_INT) < sizeof (EMACS_INT).
18032 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18033
18034 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18035
18036 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18037
18038 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18039
18040 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18041 supposed to be handshaking. (Bug#8556)
18042 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18043
18044 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18045
18046 * lisp.h (Qdebug): List symbol.
18047 * eval.c (Qdebug): Restore global linkage.
18048 * keyboard.c (debug-on-event): New variable.
18049 (handle_user_signal): Break into debugger when debug-on-event
18050 matches the current signal symbol.
18051
18052 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18053
18054 * alloc.c (check_sblock, check_string_bytes)
18055 (check_string_free_list): Convert to standard C.
18056
18057 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18058
18059 * w32.c (emacs_gnutls_push): Fix typo.
18060
18061 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18062
18063 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18064 "cast to pointer from integer of different size".
18065
18066 Improve doprnt and its use in verror. (Bug#8545)
18067 * doprnt.c (doprnt): Document the set of format control sequences
18068 supported by the function. Use SAFE_ALLOCA instead of always
18069 using `alloca'.
18070
18071 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18072 is one byte too soon. Don't use xrealloc; instead xfree and
18073 xmalloc anew.
18074
18075 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18076
18077 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18078 callbacks stage.
18079
18080 * gnutls.c: Renamed global_initialized to
18081 gnutls_global_initialized. Added internals for the
18082 :verify-hostname-error, :verify-error, and :verify-flags
18083 parameters of `gnutls-boot' and documented those parameters in the
18084 docstring. Start callback support.
18085 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18086 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18087 on error. Return error code.
18088 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18089 (emacs_gnutls_read): Likewise.
18090 (Fgnutls_boot): Return handshake error code.
18091 (emacs_gnutls_handle_error): New function.
18092 (wsaerror_to_errno): Likewise.
18093
18094 * w32.h (emacs_gnutls_pull): Add prototype.
18095 (emacs_gnutls_push): Likewise.
18096
18097 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18098 (emacs_gnutls_push): Likewise.
18099
18100 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18101
18102 * process.c (wait_reading_process_output): Check if GnuTLS
18103 buffered some data internally if no FDs are set for TLS
18104 connections.
18105
18106 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18107 (LIBS): Link to USER_LIBS.
18108 ($(BLD)/gnutls.$(0)): New target.
18109
18110 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18111
18112 * xdisp.c (handle_single_display_spec): Rename the
18113 display_replaced_before_p argument into display_replaced_p, to
18114 make it consistent with the commentary. Fix typos in the
18115 commentary.
18116
18117 * textprop.c (syms_of_textprop): Remove dead code.
18118 (copy_text_properties): Delete obsolete commentary about an
18119 interface that was deleted long ago. Fix typos in the description
18120 of arguments.
18121
18122 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18123 to changes in oldXMenu/XMenu.h from 2011-04-16.
18124 <menu_help_message, prev_menu_help_message>: Constify.
18125 (IT_menu_make_room): menu->help_text is now `const char **';
18126 adjust.
18127
18128 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18129 to changes in oldXMenu/XMenu.h from 2011-04-16.
18130 (struct XMenu): Declare `help_text' `const char **'.
18131
18132 * xfaces.c <Qunspecified>: Make extern again.
18133
18134 * syntax.c: Include sys/types.h before including regex.h, as
18135 required by POSIX.
18136
18137 * doc.c (get_doc_string): Improve the format passed to `error'.
18138
18139 * doprnt.c (doprnt): Improve commentary.
18140
18141 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18142
18143 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18144 them with etags.
18145
18146 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18147 changes in globals.h immediately force recompilation.
18148 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18149 $(CURDIR)/s/ms-w32.h.
18150 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18151
18152 * character.c (Fchar_direction): Function deleted.
18153 (syms_of_character): Don't defsubr it.
18154 <char-direction-table>: Deleted.
18155
18156 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18157
18158 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18159 * doprnt.c: Include limits.h.
18160 (SIZE_MAX): New macro.
18161 (doprnt): Return a size_t value. 2nd arg is now size_t.
18162 Many local variables are now size_t instead of int or unsigned.
18163 Improve overflow protection. Support `l' modifier for integer
18164 conversions. Support %l conversion. Don't assume an EMACS_INT
18165 argument for integer conversions and for %c.
18166
18167 * lisp.h (doprnt): Restore prototype.
18168
18169 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18170 $(SRC)/character.h.
18171
18172 * Makefile.in (base_obj): Add back doprnt.o.
18173
18174 * deps.mk (doprnt.o): Add back prerequisites.
18175 (callint.o): Depend on character.h.
18176
18177 * eval.c (internal_lisp_condition_case): Include the handler
18178 representation in the error message.
18179 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18180 when breaking from the loop.
18181
18182 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18183
18184 * callint.c (Fcall_interactively): When displaying error message
18185 about invalid control letter, pass the character's codepoint, not
18186 a pointer to its multibyte form. Improve display of the character
18187 in octal and display also its hex code.
18188
18189 * character.c (char_string): Use %x to display the (unsigned)
18190 codepoint of an invalid character, to avoid displaying a bogus
18191 negative value.
18192
18193 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18194 `error', not SYMBOL_NAME itself.
18195
18196 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18197 character arguments to `error'.
18198
18199 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18200 to `error' in error message about FINAL_CHAR argument. Make sure
18201 FINAL_CHAR is a character, and use %c when it is passed as
18202 argument to `error'.
18203
18204 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18205
18206 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18207
18208 * w32.c: Include <time.h>.
18209 (sys_localtime): New function.
18210
18211 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18212
18213 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18214
18215 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18216
18217 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18218
18219 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18220 zombies (Bug#8467).
18221
18222 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18223
18224 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18225 gl_state.e_property when gl_state.object is Qt.
18226
18227 * insdel.c (make_gap_larger): Remove limitation of buffer size
18228 to <= INT_MAX.
18229
18230 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18231
18232 * xdisp.c (lookup_glyphless_char_display)
18233 (produce_glyphless_glyph): Handle cons cell entry in
18234 glyphless-char-display.
18235 (Vglyphless_char_display): Document it.
18236
18237 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18238 glyphless-char-display.
18239
18240 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18241
18242 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18243
18244 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18245
18246 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18247 definition for no-X builds.
18248
18249 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18250
18251 Static checks with GCC 4.6.0 and non-default toolkits.
18252
18253 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18254
18255 * process.c (keyboard_bit_set): Define only if SIGIO.
18256 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18257 (send_process): Repair possible setjmp clobbering.
18258
18259 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18260
18261 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18262
18263 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18264
18265 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18266 Define only if needed.
18267
18268 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18269 by pacifying GCC about it. Maybe it's time to retire it?
18270 * xfaces.c (USG, __TIMEVAL__): Likewise.
18271
18272 * dispextern.h (struct redisplay_interface): Rename param
18273 to avoid shadowing.
18274 * termhooks.h (struct terminal): Likewise.
18275 * xterm.c (xembed_send_message): Likewise.
18276
18277 * insdel.c (make_gap_smaller): Define only if
18278 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18279
18280 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18281 it.
18282
18283 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18284 so that we aren't warned about unused symbols.
18285
18286 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18287
18288 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18289
18290 * xfns.c (x_real_positions): Mark locals as initialized.
18291
18292 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18293
18294 * xterm.c: Fix problems found by static analysis with other toolkits.
18295 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18296 (x_dispatch_event): Declare static if USE_GTK, and
18297 define if USE_GTK || USE_X_TOOLKIT.
18298 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18299 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18300 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18301 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18302
18303 * xmenu.c (menu_help_callback): Pointer type fixes.
18304 Use const pointers when pointing at readonly data. Avoid pointer
18305 signedness clashes.
18306 (FALSE): Remove unused macro.
18307 (update_frame_menubar): Remove unused decl.
18308
18309 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18310
18311 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18312 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18313 (single_menu_item): Rename local to avoid shadowing.
18314
18315 * keyboard.c (make_lispy_event): Remove unused local var.
18316
18317 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18318 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18319
18320 * bitmaps: Change bitmaps from unsigned char back to the X11
18321 compatible char. Avoid the old compiler warnings about
18322 out-of-range initializers by using, for example, '\xab' rather
18323 than 0xab.
18324
18325 * xgselect.c (xgselect_initialize): Check vs interface
18326 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18327
18328 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18329
18330 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18331 to read-only memory.
18332
18333 * fns.c (vector): Remove; this old hack is no longer needed.
18334
18335 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18336 Remove unused var.
18337 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18338
18339 * xrdb.c (x_load_resources): Omit unused local.
18340
18341 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18342 (x_window): Rename locals to avoid shadowing.
18343 (USG): Use the kludged USG macro, to pacify gcc.
18344
18345 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18346 (x_term_init): Remove local to avoid shadowing.
18347
18348 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18349
18350 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18351 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18352
18353 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18354
18355 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18356
18357 Fix regex.c, syntax.c and friends for buffers > 2GB.
18358 * syntax.h (struct gl_state_s): Declare character position members
18359 EMACS_INT.
18360
18361 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18362
18363 * textprop.c (verify_interval_modification, interval_of):
18364 Declare arguments EMACS_INT.
18365
18366 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18367 EMACS_INT.
18368
18369 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18370
18371 * indent.c (Fvertical_motion): Local variable it_start is now
18372 EMACS_INT.
18373
18374 * regex.c (re_match, re_match_2, re_match_2_internal)
18375 (bcmp_translate, regcomp, regexec, print_double_string)
18376 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18377 (re_compile_pattern, re_exec): Declare arguments and local
18378 variables `size_t' and `ssize_t' and return values `regoff_t', as
18379 appropriate.
18380 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18381 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18382 <compile_stack_type>: `size' and `avail' are now `size_t'.
18383
18384 * regex.h <regoff_t>: Use ssize_t, not int.
18385 (re_search, re_search_2, re_match, re_match_2): Arguments that
18386 specify buffer/string position and length are now ssize_t and
18387 size_t. Return type is regoff_t.
18388
18389 2011-04-16 Ben Key <bkey76@gmail.com>
18390
18391 * nsfont.m: Fixed bugs in ns_get_family and
18392 ns_descriptor_to_entity that were caused by using free to
18393 deallocate memory blocks that were allocated by xmalloc (via
18394 xstrdup). This caused Emacs to crash when compiled with
18395 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18396 --enable-checking=xmallocoverrun). xfree is now used to
18397 deallocate these memory blocks.
18398
18399 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18400
18401 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18402
18403 emacs_write: Accept and return EMACS_INT for sizes.
18404 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18405 et seq.
18406 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18407 Accept and return EMACS_INT.
18408 (emacs_gnutls_write): Return the number of bytes written on
18409 partial writes.
18410 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18411 (emacs_read, emacs_write): Remove check for negative size, as the
18412 Emacs source code has been audited now.
18413 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18414 (emacs_read, emacs_write): Use it.
18415 * process.c (send_process): Adjust to the new signatures of
18416 emacs_write and emacs_gnutls_write. Do not attempt to store
18417 a byte offset into an 'int'; it might overflow.
18418 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18419
18420 * sound.c: Don't assume sizes fit in 'int'.
18421 (struct sound_device.period_size, alsa_period_size):
18422 Return EMACS_INT, not int.
18423 (struct sound_device.write, vox_write, alsa_write):
18424 Accept EMACS_INT, not int.
18425 (wav_play, au_play): Use EMACS_INT to store sizes and to
18426 record read return values.
18427
18428 2011-04-15 Ben Key <bkey76@gmail.com>
18429
18430 * keyboard.c (Qundefined): Don't declare static since it is used
18431 in nsfns.m.
18432 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18433 static since they are used in nsfont.m.
18434
18435 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18436
18437 * process.c (Qprocessp): Don't declare static.
18438 * lisp.h (Qprocessp): Declare again.
18439
18440 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18441
18442 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18443
18444 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18445
18446 Improve C-level modularity by making more things 'static'.
18447
18448 Don't publish debugger-only interfaces to other modules.
18449 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18450 (verify_bytepos, count_markers): Move decls to the only modules
18451 that need them.
18452 * region-cache.h (pp_cache): Likewise.
18453 * window.h (check_all_windows): Likewise.
18454 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18455
18456 * sysdep.c (croak): Now static, if
18457 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18458 * syssignal.h (croak): Declare only if not static.
18459
18460 * alloc.c (refill_memory_reserve): Now static if
18461 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18462 * lisp.h (refill_memory_reserve): Declare only if not static.
18463
18464 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18465 Define only if USE_LUCID.
18466
18467 * xrdb.c (x_customization_string, x_rm_string): Now static.
18468
18469 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18470 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18471
18472 * xdisp.c (draw_row_with_mouse_face): Now static.
18473 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18474
18475 * window.h (check_all_windows): Mark externally visible.
18476
18477 * window.c (window_deletion_count): Now static.
18478
18479 * undo.c: Make symbols static if they're not exported.
18480 (last_undo_buffer, last_boundary_position, pending_boundary):
18481 Now static.
18482
18483 * textprop.c (interval_insert_behind_hooks): Now static.
18484 (interval_insert_in_front_hooks): Likewise.
18485
18486 * term.c: Make symbols static if they're not exported.
18487 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18488 (max_frame_lines, tty_set_terminal_modes):
18489 (tty_reset_terminal_modes, tty_turn_off_highlight):
18490 (get_tty_terminal): Now static.
18491 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18492 * termhooks.h (term_mouse_moveto): Do not declare if
18493 HAVE_WINDOW_SYSTEM.
18494 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18495 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18496
18497 * sysdep.c: Make symbols static if they're not exported.
18498 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18499 Now static.
18500 (sigprocmask_set, full_mask): Remove; unused.
18501 (wait_debugging): Mark as visible.
18502 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18503 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18504
18505 * syntax.c (syntax_temp): Define only if !__GNUC__.
18506
18507 * sound.c (current_sound_device, current_sound): Now static.
18508
18509 * search.c (searchbufs, searchbuf_head): Now static.
18510
18511 * scroll.c (scroll_cost): Remove; unused.
18512 * dispextern.h (scroll_cost): Remove decl.
18513
18514 * region-cache.h (pp_cache): Mark as externally visible.
18515
18516 * process.c: Make symbols static if they're not exported.
18517 (process_tick, update_tick, create_process, chan_process):
18518 (Vprocess_alist, proc_buffered_char, datagram_access):
18519 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18520 (deactivate_process): Mark defn as static, as well as decl.
18521 * lisp.h (create_process): Remove decl.
18522 * process.h (chan_process, Vprocess_alist): Remove decls.
18523
18524 * print.c: Make symbols static if they're not exported.
18525 (print_depth, new_backquote_output, being_printed, print_buffer):
18526 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18527 (print_interval, print_number_index, initial_stderr_stream):
18528 Now static.
18529 * lisp.h (Fprinc): Remove decl.
18530 (debug_output_compilation_hack): Mark as externally visible.
18531
18532 * sysdep.c (croak): Move decl from here to syssignal.h.
18533 * syssignal.h (croak): Put it here, so the API can be checked when
18534 'croak' is called from dissociate_if_controlling_tty.
18535
18536 * minibuf.c: Make symbols static if they're not exported.
18537 (minibuf_save_list, choose_minibuf_frame): Now static.
18538 * lisp.h (choose_minibuf_frame): Remove decl.
18539
18540 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18541
18542 * lread.c: Make symbols static if they're not exported.
18543 (read_objects, initial_obarray, oblookup_last_bucket_number):
18544 Now static.
18545 (make_symbol): Remove; unused.
18546 * lisp.h (initial_obarray, make_symbol): Remove decls.
18547
18548 * keyboard.c: Make symbols static if they're not exported.
18549 (single_kboard, recent_keys_index, total_keys, recent_keys):
18550 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18551 (this_single_command_key_start, echoing, last_auto_save):
18552 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18553 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18554 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18555 (Vlispy_mouse_stem, double_click_count):
18556 Now static.
18557 (force_auto_save_soon): Define only if SIGDANGER.
18558 (ignore_mouse_drag_p): Now static if
18559 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18560 (print_help): Remove; unused.
18561 (stop_character, last_timer_event): Mark as externally visible.
18562 * keyboard.h (ignore_mouse_drag_p): Declare only if
18563 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18564 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18565 * lisp.h (echoing): Remove decl.
18566 (force_auto_save_soon): Declare only if SIGDANGER.
18567 * xdisp.c (redisplay_window): Simplify code, to make it more
18568 obvious that ignore_mouse_drag_p is not accessed if !defined
18569 USE_GTK && !defined HAVE_NS.
18570
18571 * intervals.c: Make symbols static if they're not exported.
18572 (merge_properties_sticky, merge_interval_right, delete_interval):
18573 Now static.
18574 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18575
18576 * insdel.c: Make symbols static if they're not exported.
18577 However, leave prepare_to_modify_buffer alone. It's never
18578 called from outside this function, but that appears to be a bug.
18579 (combine_after_change_list, combine_after_change_buffer):
18580 (adjust_after_replace, signal_before_change): Now static.
18581 (adjust_after_replace_noundo): Remove; unused.
18582 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18583 (signal_before_change): Remove decls.
18584
18585 * indent.c (val_compute_motion, val_vmotion): Now static.
18586
18587 * image.c: Make symbols static if they're not exported.
18588 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18589 if USE_GTK.
18590 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18591 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18592
18593 * fringe.c (standard_bitmaps): Now static.
18594 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18595
18596 * frame.c: Make symbols static if they're not exported.
18597 (x_report_frame_params, make_terminal_frame): Now static.
18598 (get_frame_param): Now static, unless HAVE_NS.
18599 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18600 (x_get_resource_string): Remove; not used.
18601 * frame.h (make_terminal_frame, x_report_frame_params):
18602 (x_get_resource_string); Remove decls.
18603 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18604 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18605
18606 * font.c, fontset.c: Make symbols static if they're not exported.
18607 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18608 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18609 * font.c (font_close_object): Now static.
18610 * font.h (font_close_object): Remove.
18611 * fontset.c (FONTSET_OBJLIST): Remove.
18612 (free_realized_fontset) #if-0 the body, which does nothing.
18613 (face_suitable_for_char_p): #if-0, as it's never called.
18614 * fontset.h (face_suitable_for_char_p): Remove decl.
18615 * xfaces.c (face_at_string_position):
18616 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18617 since 0 is always ASCII.
18618
18619 * fns.c (weak_hash_tables): Now static.
18620
18621 * fileio.c: Make symbols static if they're not exported.
18622 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18623 (Vwrite_region_annotation_buffers): Now static.
18624
18625 * eval.c: Make symbols static if they're not exported.
18626 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18627 * lisp.h (backtrace_list): Remove decl.
18628
18629 * emacs.c: Make symbols static if they're not exported.
18630 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18631 (fatal_error_code, fatal_error_signal_hook, standard_args):
18632 Now static.
18633 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18634 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18635 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18636 * lisp.h (fatal_error_signal_hook): Remove decl.
18637 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18638
18639 * editfns.c: Move a (normally-unused) function to its only use.
18640 * editfns.c, lisp.h (get_operating_system_release): Remove.
18641 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18642 worth the hassle of breaking this out.
18643
18644 * xterm.c: Make symbols static if they're not exported.
18645 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18646 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18647 (x_destroy_window, x_delete_display):
18648 Now static.
18649 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18650 (x_mouse_leave): Remove; unused.
18651 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18652 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18653 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18654 Remove decls.
18655 (x_mouse_leave): Declare only if WINDOWSNT.
18656 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18657 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18658 USE_X_TOOLKIT.
18659
18660 * ftxfont.c: Make symbols static if they're not exported.
18661 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18662 HAVE_FREETYPE.
18663 * font.h (ftxfont_driver): Likewise.
18664
18665 * xfns.c: Make symbols static if they're not exported.
18666 (x_last_font_name, x_display_info_for_name):
18667 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18668 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18669 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18670 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18671 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18672 (last_show_tip_args): Now static.
18673 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18674 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18675 (x_screen_planes): Remove; unused.
18676 * dispextern.h (x_screen_planes): Remove decl.
18677
18678 * dispnew.c: Make symbols static if they're not exported.
18679 * dispextern.h (redraw_garbaged_frames, scrolling):
18680 (increment_row_positions): Remove.
18681 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18682 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18683 Now static.
18684 (redraw_garbaged_frames): Remove; unused.
18685
18686 * xfaces.c: Make symbols static if they're not exported.
18687 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18688 Remove decls.
18689 * xterm.h (defined_color): Remove decls.
18690 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18691 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18692 (menu_face_changed_default, defined_color, free_realized_face):
18693 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18694 (ascii_face_of_lisp_face): Remove; unused.
18695
18696 * xdisp.c: Make symbols static if they're not exported.
18697 * dispextern.h (scratch_glyph_row, window_box_edges):
18698 (glyph_to_pixel_coords, set_cursor_from_row):
18699 (get_next_display_element, set_iterator_to_next):
18700 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18701 (show_mouse_face): Remove decls
18702 * frame.h (message_buf_print): Likewise.
18703 * lisp.h (pop_message, set_message, check_point_in_composition):
18704 Likewise.
18705 * xterm.h (set_vertical_scroll_bar): Likewise.
18706 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18707 (message_buf_print, scratch_glyph_row, displayed_buffer):
18708 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18709 (get_next_display_element, show_mouse_face, window_box_edges):
18710 (frame_to_window_pixel_xy, check_point_in_composition):
18711 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18712 (glyph_to_pixel_coords): Remove; unused.
18713
18714 * dired.c (file_name_completion): Now static.
18715
18716 * dbusbind.c (xd_in_read_queued_messages): Now static.
18717
18718 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18719 * data.c (circular_list_error): Remove.
18720
18721 * commands.h (last_point_position, last_point_position_buffer):
18722 (last_point_position_window): Remove decls.
18723 * keyboard.c: Make these variables static.
18724
18725 * coding.h (coding, code_convert_region, encode_coding_gap):
18726 Remove decls.
18727 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18728 (iso_code_class, detect_coding, code_convert_region): Now static.
18729 (encode_coding_gap): Remove; unused.
18730
18731 * chartab.c (chartab_chars, chartab_bits): Now static.
18732
18733 * charset.h (charset_iso_8859_1): Remove decl.
18734 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18735 Now static.
18736
18737 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18738 * ccl.c (Vccl_program_table): Now static.
18739 (check_ccl_update): Remove; unused.
18740
18741 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18742 * category.h: ... from here.
18743 * category.c (check_category_table, set_category_set): Now static.
18744
18745 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18746 * lisp.h: Remove these decls.
18747
18748 * buffer.c (buffer_count): Remove unused var.
18749
18750 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18751 so that it's not optimized away.
18752 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18753 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18754 exported only to the debugger.
18755
18756 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18757 * atimer.h (run_all_atimers): Remove; not exported.
18758
18759 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18760 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18761 was inaccessible from Lisp.
18762 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18763 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18764
18765 alloc.c: Import and export fewer symbols, and remove unused items.
18766 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18767 is defined.
18768 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18769 it's not optimized away by whole-program optimization.
18770 (message_enable_multibyte, free_misc): Remove.
18771 (catchlist, handlerlist, mark_backtrace):
18772 Declare only if BYTE_MARK_STACK.
18773 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18774 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18775 (message_enable_multibyte): Remove decl.
18776 (free_misc, interval_free_list, float_block, float_block_index):
18777 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18778 (cons_free_list, last_marked_index):
18779 Now static.
18780 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18781 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18782 (mark_backtrace): Define only if BYTE_MARK_STACK.
18783 * xdisp.c (message_enable_multibyte): Now static.
18784
18785 Declare Lisp_Object Q* variables to be 'static' if not exported.
18786 This makes it easier for human readers (and static analyzers)
18787 to see whether these variables are used from other modules.
18788 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18789 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18790 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18791 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18792 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18793 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18794 * xmenu.c, xselect.c:
18795 Declare Q* vars static if they are not used in other modules.
18796 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18797 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18798 Remove decls of unexported vars.
18799 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18800
18801 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18802
18803 Make Emacs functions such as Fatom 'static' by default.
18804 This makes it easier for human readers (and static analyzers)
18805 to see whether these functions can be called from other modules.
18806 DEFUN now defines a static function. To make the function external
18807 so that it can be used in other C modules, use the new macro DEFUE.
18808 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18809 (Finit_image_library):
18810 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18811 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18812 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18813 Remove decls, since these functions are now static.
18814 (Funintern, Fget_internal_run_time): New decls, since these functions
18815 were already external.
18816
18817 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18818 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18819 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18820 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18821 * keyboard.c, keymap.c, lread.c:
18822 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18823 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18824 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18825 Mark functions with DEFUE instead of DEFUN,
18826 if they are used in other modules.
18827 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18828 decls for now-static functions.
18829 * buffer.h (Fdelete_overlay): Remove decl.
18830 * callproc.c (Fgetenv_internal): Mark as internal.
18831 * composite.c (Fremove_list_of_text_properties): Remove decl.
18832 (Fcomposition_get_gstring): New forward static decl.
18833 * composite.h (Fcomposite_get_gstring): Remove decl.
18834 * dired.c (Ffile_attributes): New forward static decl.
18835 * doc.c (Fdocumntation_property): New forward static decl.
18836 * eval.c (Ffetch_bytecode): New forward static decl.
18837 (Funintern): Remove extern decl; now in .h file where it belongs.
18838 * fileio.c (Fmake_symbolic_link): New forward static decl.
18839 * image.c (Finit_image_library): New forward static decl.
18840 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18841 * intervals.h (Fprevious_property_change):
18842 (Fremove_list_of_text_properties): Remove decls.
18843 * keyboard.c (Fthis_command_keys): Remove decl.
18844 (Fcommand_execute): New forward static decl.
18845 * keymap.c (Flookup_key): New forward static decl.
18846 (Fcopy_keymap): Now static.
18847 * keymap.h (Flookup_key): Remove decl.
18848 * process.c (Fget_process): New forward static decl.
18849 (Fprocess_datagram_address): Mark as internal.
18850 * syntax.c (Fsyntax_table_p): New forward static decl.
18851 (skip_chars): Remove duplicate decl.
18852 * textprop.c (Fprevious_property_change): New forward static decl.
18853 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18854 Now internal.
18855 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18856 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18857
18858 * editfns.c (Fformat): Remove unreachable code.
18859
18860 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18861
18862 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18863 change. (Bug#8496)
18864
18865 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18866
18867 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18868 when at ZV. (Bug#8487)
18869
18870 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18871
18872 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18873 (Bug#8437)
18874 * keyboard.c (parse_tool_bar_item): Likewise.
18875 * sound.c (sound_cleanup, alsa_close): Likewise.
18876 * termcap.c (tgetent): Likewise.
18877 * xfns.c (x_default_font_parameter): Likewise.
18878 * xsettings.c (read_and_apply_settings): Likewise.
18879
18880 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18881 (overrun_check_free): Protoize.
18882
18883 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18884
18885 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18886 since callers should never pass a negative size.
18887 Change the signature to match that of plain 'read' and 'write'; see
18888 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18889 * lisp.h: Update prototypes of emacs_write and emacs_read.
18890
18891 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18892
18893 * xdisp.c (redisplay_window): Don't try to determine the character
18894 position of the scroll margin if the window start point w->startp
18895 is outside the buffer's accessible region. (Bug#8468)
18896
18897 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18898
18899 Fix write-region and its subroutines for buffers > 2GB.
18900 * fileio.c (a_write, e_write): Modify declaration of arguments and
18901 local variables to support buffers larger than 2GB.
18902 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18903
18904 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18905 argument, local variables, and return value.
18906
18907 * lisp.h: Update prototypes of emacs_write and emacs_read.
18908
18909 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18910
18911 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18912
18913 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18914
18915 Fix more problems found by GCC 4.6.0's static checks.
18916
18917 * xdisp.c (vmessage): Use a better test for character truncation.
18918
18919 * charset.c (load_charset_map): <, not <=, for optimization,
18920 and to avoid potential problems with integer overflow.
18921 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18922 * casetab.c (set_identity, shuffle): Likewise.
18923 * editfns.c (Fformat): Likewise.
18924 * syntax.c (skip_chars): Likewise.
18925
18926 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18927 This also lets GCC 4.6.0 generate slightly better loop code.
18928
18929 * callint.c (Fcall_interactively): <, not <=, for optimization.
18930 (Fcall_interactively): Count the number of arguments produced,
18931 not the number of arguments given. This is simpler and lets GCC
18932 4.6.0 generate slightly better code.
18933
18934 * ftfont.c: Distingish more carefully between FcChar8 and char.
18935 The previous code passed unsigned char * to a functions like
18936 strlen and xstrcasecmp that expect char *, which does not
18937 conform to the C standard.
18938 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18939 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18940 char * when the C standard requires it.
18941
18942 * keyboard.c (read_char): Remove unused var.
18943
18944 * eval.c: Port to Windows vsnprintf (Bug#8435).
18945 Include <limits.h>.
18946 (SIZE_MAX): Define if the headers do not.
18947 (verror): Do not give up if vsnprintf returns a negative count.
18948 Instead, grow the buffer. This ports to Windows vsnprintf, which
18949 does not conform to C99. Problem reported by Eli Zaretskii.
18950 Also, simplify the allocation scheme, by avoiding the need for
18951 calling realloc, and removing the ALLOCATED variable.
18952
18953 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18954
18955 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18956 But keep the doprint source code for now, as we might revamp it
18957 and use it again (Bug#8435).
18958 * lisp.h (doprnt): Remove.
18959 * Makefile.in (base_obj): Remove doprnt.o.
18960 * deps.mk (doprnt.o): Remove.
18961
18962 error: Print 32- and 64-bit integers portably (Bug#8435).
18963 Without this change, on typical 64-bit hosts error ("...%d...", N)
18964 was used to print both 32- and 64-bit integers N, which relied on
18965 undefined behavior.
18966 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18967 * lisp.h (error, verror): Mark as printf-like functions.
18968 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18969 Report overflow in size calculations when allocating printf buffer.
18970 Do not truncate output string at its first null byte.
18971 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18972 Truncate the output at a character boundary, since vsnprintf does not
18973 do that.
18974 * charset.c (check_iso_charset_parameter): Convert internal
18975 character to string before calling 'error', since %c now has the
18976 printf meaning.
18977 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18978 overflow when computing char to be passed to 'error'. Do not
18979 pass Lisp_Object to 'error'; pass the integer instead.
18980 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18981 formatted with plain %d.
18982
18983 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18984
18985 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18986
18987 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18988
18989 * xterm.c (x_catch_errors): Remove duplicate declaration.
18990
18991 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18992
18993 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18994
18995 2011-04-10 Jim Meyering <meyering@redhat.com>
18996
18997 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18998 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18999 return ssize_t not "int", and use size_t as the buffer length.
19000 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19001 * gnutls.h: Update declarations.
19002 * process.c (read_process_output): Use ssize_t, to match.
19003 (send_process): Likewise.
19004
19005 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19006
19007 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19008
19009 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19010
19011 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19012 Use unsigned char, to match FcChar8 type definition.
19013
19014 * xterm.c (handle_one_xevent):
19015 * xmenu.c (create_and_show_popup_menu):
19016 * xselect.c (x_decline_selection_request)
19017 (x_reply_selection_request): Avoid type-punned deref of X events.
19018
19019 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19020
19021 Fix some uses of `int' instead of EMACS_INT.
19022 * search.c (string_match_1, fast_string_match)
19023 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19024 (scan_buffer, find_next_newline_no_quit)
19025 (find_before_next_newline, search_command, Freplace_match)
19026 (Fmatch_data): Make some `int' variables be EMACS_INT.
19027
19028 * xdisp.c (display_count_lines): 3rd argument and return value now
19029 EMACS_INT. All callers changed.
19030 (pint2hrstr): Last argument is now EMACS_INT.
19031
19032 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19033 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19034 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19035 (decode_coding_utf_16, decode_coding_emacs_mule)
19036 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19037 (decode_coding_ccl, decode_coding_charset)
19038 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19039 (decode_coding_iso_2022, decode_coding_emacs_mule)
19040 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19041 <char_offset, last_offset>: Declare EMACS_INT.
19042 (encode_coding_utf_8, encode_coding_utf_16)
19043 (encode_coding_emacs_mule, encode_invocation_designation)
19044 (encode_designation_at_bol, encode_coding_iso_2022)
19045 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19046 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19047 Declare EMACS_INT.
19048 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19049 (encode_invocation_designation): Last argument P_NCHARS is now
19050 EMACS_INT.
19051 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19052 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19053
19054 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19055 All users changed.
19056
19057 * ccl.c (Fccl_execute_on_string): Declare some variables
19058 EMACS_INT.
19059
19060 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19061
19062 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19063
19064 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19065
19066 * process.c (Fformat_network_address): Doc fix.
19067
19068 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19069
19070 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19071
19072 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19073
19074 * keyboard.c (read_char): Call Lisp function help-form-show,
19075 instead of using internal_with_output_to_temp_buffer.
19076 (Qhelp_form_show): New var.
19077 (syms_of_keyboard): Use DEFSYM macro.
19078
19079 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19080
19081 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19082
19083 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19084
19085 * process.c (Flist_processes): Remove to Lisp.
19086 (list_processes_1): Delete.
19087
19088 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19089
19090 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19091
19092 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19093
19094 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19095
19096 Fix more problems found by GCC 4.6.0's static checks.
19097
19098 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19099
19100 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19101
19102 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19103
19104 * xdisp.c (vmessage): Mark as a printf-like function.
19105
19106 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19107
19108 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19109
19110 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19111 printf-like functions.
19112 (tiff_load): Add casts to remove these marks before passing them
19113 to system-supplied API.
19114
19115 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19116
19117 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19118 This avoids several warnings with gcc -Wstrict-overflow.
19119 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19120 directly, rather than having caller test rule sign. This avoids
19121 some unnecessary tests.
19122 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19123 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19124 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19125
19126 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19127 (xfont_open): Avoid unnecessary tests.
19128
19129 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19130
19131 * composite.h, composite.c (composition_gstring_put_cache):
19132 Use EMACS_INT, not int, for length.
19133
19134 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19135 breaking out part of COMPOSITION_DECODE_RULE.
19136 (COMPOSITION_DECODE_RULE): Use it.
19137 * composite.c (get_composition_id): Remove unused local vars,
19138 by using the new macro.
19139
19140 * textprop.c (set_text_properties_1): Change while to do-while,
19141 since the condition is always true at first.
19142
19143 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19144 (interval_deletion_adjustment): Return unsigned value.
19145 All uses changed.
19146
19147 * process.c (list_processes_1, create_pty, read_process_output):
19148 (exec_sentinel): Remove vars that were set but not used.
19149 (create_pty): Remove unnecessary "volatile"s.
19150 (Fnetwork_interface_info): Avoid possibility of int overflow.
19151 (read_process_output): Do adaptive read buffering even if carryover.
19152 (read_process_output): Simplify nbytes computation if buffered.
19153
19154 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19155
19156 * syntax.c (scan_words): Remove var that was set but not used.
19157 (update_syntax_table): Use unsigned instead of int.
19158
19159 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19160 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19161 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19162
19163 * print.c (print_error_message): Avoid int overflow.
19164
19165 * font.c (font_list_entities): Redo for clarity,
19166 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19167
19168 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19169 (font_score): Avoid potential overflow in diff calculation.
19170
19171 * fns.c (substring_both): Remove var that is set but not used.
19172 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19173
19174 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19175
19176 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19177 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19178 can always succeed if overflow has undefined behavior.
19179
19180 * search.c (boyer_moore, wordify): Remove vars set but not used.
19181 (wordify): Omit three unnecessary tests.
19182
19183 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19184 All callers changed. This avoids the need for an unused var.
19185
19186 * casefiddle.c (casify_region): Remove var that is set but not used.
19187
19188 * dired.c (file_name_completion): Remove var that is set but not used.
19189
19190 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19191
19192 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19193 (Finsert_file_contents): Remove unnecessary code checking fd.
19194
19195 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19196 Check for integer overflow on size calculations.
19197
19198 * buffer.c (Fprevious_overlay_change): Remove var that is set
19199 but not used.
19200
19201 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19202 Remove vars that are set but not used.
19203 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19204 (timer_check_2): Mark vars as initialized.
19205
19206 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19207
19208 * image.c (lookup_image): Remove var that is set but not used.
19209 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19210
19211 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19212 that are set but not used.
19213
19214 * xfns.c (make_invisible_cursor): Don't return garbage
19215 if XCreateBitmapFromData fails (Bug#8410).
19216
19217 * xselect.c (x_get_local_selection, x_handle_property_notify):
19218 Remove vars that are set but not used.
19219
19220 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19221 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19222
19223 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19224 Remove var that is set but not used.
19225 (scroll_bar_windows_size): Now size_t, not int.
19226 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19227 Check for overflow.
19228
19229 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19230 (map_tty_color) [!defined MSDOS]: Likewise.
19231
19232 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19233
19234 * coding.c: Remove vars that are set but not used.
19235 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19236 All callers changed.
19237 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19238 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19239 (decode_coding_charset): Remove vars that are set but not used.
19240
19241 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19242 that is set but not used.
19243
19244 * print.c (print_object): Remove var that is set but not used.
19245
19246 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19247 The gnulib version avoids calling malloc in the usual case,
19248 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19249 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19250 * filelock.c (current_lock_owner): Likewise.
19251 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19252 * sysdep.c: Include allocator.h, careadlinkat.h.
19253 (emacs_no_realloc_allocator): New static constant.
19254 (emacs_readlink): New function.
19255 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19256 ../lib/careadlinkat.h.
19257
19258 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19259
19260 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19261 first non-nil return value).
19262
19263 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19264
19265 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19266 if not defined (Bug#8403).
19267
19268 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19269
19270 * xdisp.c (display_count_lines): Remove parameter `start',
19271 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19272 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19273 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19274 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19275 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19276 and thereabouts. All callers changed.
19277 (get_per_char_metric): Remove parameter `f', unused since
19278 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19279
19280 2011-04-02 Jim Meyering <meyering@redhat.com>
19281
19282 do not dereference NULL upon failed strdup
19283 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19284 (ns_get_family): Likewise.
19285
19286 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19287
19288 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19289
19290 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19291
19292 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19293 later (Bug#8403).
19294
19295 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19296
19297 Add lexical binding.
19298
19299 * window.c (Ftemp_output_buffer_show): New fun.
19300 (Fsave_window_excursion):
19301 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19302
19303 * lread.c (lisp_file_lexically_bound_p): New function.
19304 (Fload): Bind Qlexical_binding.
19305 (readevalloop): Remove `evalfun' arg.
19306 Bind Qinternal_interpreter_environment.
19307 (Feval_buffer): Bind Qlexical_binding.
19308 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19309 Mark as dynamic.
19310 (syms_of_lread): Declare `lexical-binding'.
19311
19312 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19313
19314 * keyboard.c (eval_dyn): New fun.
19315 (menu_item_eval_property): Use it.
19316
19317 * image.c (parse_image_spec): Use Ffunctionp.
19318
19319 * fns.c (concat, mapcar1): Accept byte-code-functions.
19320
19321 * eval.c (Fsetq): Handle lexical vars.
19322 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19323 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19324 (FletX, Flet): Obey lexical binding.
19325 (Fcommandp): Handle closures.
19326 (Feval): New `lexical' arg.
19327 (eval_sub): New function extracted from Feval. Use it almost
19328 everywhere where Feval was used. Look up vars in lexical env.
19329 Handle closures.
19330 (Ffunctionp): Move from subr.el.
19331 (Ffuncall): Handle closures.
19332 (apply_lambda): Remove `eval_flags'.
19333 (funcall_lambda): Handle closures and new byte-code-functions.
19334 (Fspecial_variable_p): New function.
19335 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19336 but without exporting it to Lisp.
19337
19338 * doc.c (Fdocumentation, store_function_docstring):
19339 * data.c (Finteractive_form): Handle closures.
19340
19341 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19342 interactive spec.
19343
19344 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19345 New byte-codes.
19346 (exec_byte_code): New function extracted from Fbyte_code to handle new
19347 calling convention for byte-code-functions. Add new byte-codes.
19348
19349 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19350
19351 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19352
19353 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19354
19355 * xdisp.c (redisplay_internal): Fix prototype.
19356
19357 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19358
19359 * xdisp.c (SCROLL_LIMIT): New macro.
19360 (try_scrolling): Use it when setting scroll_limit.
19361 Limit scrolling to 100 screen lines.
19362 (redisplay_window): Even when falling back on "recentering",
19363 position point in the window according to scroll-conservatively,
19364 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19365
19366 (try_scrolling): When point is above the window, allow searching
19367 as far as scroll_max, or one screenful, to compute vertical
19368 distance from PT to the scroll margin position. This prevents
19369 try_scrolling from unnecessarily failing when
19370 scroll-conservatively is set to a value slightly larger than the
19371 window height. Clean up the case of PT below the margin at bottom
19372 of window: scroll_max can no longer be INT_MAX. When aggressive
19373 scrolling is in use, don't let point enter the opposite scroll
19374 margin as result of the scroll.
19375 (syms_of_xdisp) <scroll-conservatively>: Document the
19376 threshold of 100 lines for never-recentering scrolling.
19377
19378 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19379
19380 * dispextern.h (move_it_by_lines):
19381 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19382 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19383 (message_log_check_duplicate): Remove parameters `prev_bol' and
19384 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19385 (redisplay_internal): Remove parameter `preserve_echo_area',
19386 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19387
19388 * indent.c (Fvertical_motion):
19389 * window.c (window_scroll_pixel_based, Frecenter):
19390 Don't pass `need_y_p' to `move_it_by_lines'.
19391
19392 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19393
19394 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19395 steal a few bits to be more compact.
19396 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19397 Remove unneeded casts.
19398
19399 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19400
19401 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19402
19403 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19404 binding" message (bug#7967).
19405
19406 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19407
19408 Fix more problems found by GCC 4.6.0's static checks.
19409
19410 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19411 Remove unused local var.
19412
19413 * editfns.c (Fmessage_box): Remove unused local var.
19414
19415 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19416 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19417 Omit unused local vars.
19418 * window.c (shrink_windows): Omit unused local var.
19419 * menu.c (digest_single_submenu): Omit unused local var.
19420 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19421 Omit unused local var.
19422
19423 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19424 Don't assume string length fits in int.
19425 (keyremap_step, read_key_sequence): Use size_t for sizes.
19426 (read_key_sequence): Don't check last_real_key_start redundantly.
19427
19428 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19429 instead of alloca (Bug#8344).
19430
19431 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19432 (Fbacktrace_frame): Don't assume nframes fits in int.
19433
19434 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19435
19436 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19437 concerns.
19438
19439 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19440
19441 * cm.c (calccost): Turn while-do into do-while, for clarity.
19442
19443 * keyboard.c (syms_of_keyboard): Use the same style as later
19444 in this function when indexing through an array. This also
19445 works around GCC bug 48267.
19446
19447 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19448
19449 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19450
19451 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19452 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19453
19454 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19455 This avoids undefined behavior on integer overflow, and is a bit
19456 more convenient anyway since it is compared to a size_t variable.
19457
19458 Variadic C functions now count arguments with size_t, not int.
19459 This avoids an unnecessary limitation on 64-bit machines, which
19460 caused (substring ...) to crash on large vectors (Bug#8344).
19461 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19462 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19463 All variadic functions and their callers changed accordingly.
19464 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19465 * data.c (arith_driver, float_arith_driver): Likewise.
19466 * editfns.c (general_insert_function): Likewise.
19467 * eval.c (struct backtrace.nargs, interactive_p)
19468 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19469 (funcall_lambda, mark_backtrace): Likewise.
19470 * fns.c (concat): Likewise.
19471 * frame.c (x_set_frame_parameters): Likewise.
19472 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19473 0 if not found, not -1. All callers changed.
19474
19475 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19476 (stack_copy_size): Now size_t, not int.
19477 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19478
19479 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19480
19481 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19482 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19483 All callers changed.
19484
19485 * lisp.h (multibyte_char_to_unibyte):
19486 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19487 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19488 * character.h (CHAR_TO_BYTE8):
19489 * cmds.c (internal_self_insert):
19490 * editfns.c (general_insert_function):
19491 * keymap.c (push_key_description):
19492 * search.c (Freplace_match):
19493 * xdisp.c (message_dolog, set_message_1): All callers changed.
19494
19495 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19496
19497 * keyboard.c (safe_run_hook_funcall): New function.
19498 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19499 don't set the hook to nil, but remove the offending function instead.
19500 (Qcommand_hook_internal): Remove, unused.
19501 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19502 Vcommand_hook_internal.
19503
19504 * eval.c (enum run_hooks_condition): Remove.
19505 (funcall_nil, funcall_not): New functions.
19506 (run_hook_with_args): Call each function through a `funcall' argument.
19507 Remove `cond' argument, now redundant.
19508 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19509 (Frun_hook_with_args_until_failure): Adjust accordingly.
19510 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19511
19512 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19513
19514 * dispextern.h (string_buffer_position): Remove declaration.
19515
19516 * print.c (strout): Remove parameter `multibyte', unused since
19517 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19518
19519 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19520 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19521 All callers changed.
19522
19523 * w32.c (_wsa_errlist): Use braces for struct initializers.
19524
19525 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19526 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19527 All callers changed.
19528 (string_buffer_position): Likewise. Also, make static (it's never
19529 used outside xdisp.c).
19530 (cursor_row_p): Remove parameter `w', unused since
19531 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19532 (decode_mode_spec): Remove parameter `precision', introduced during
19533 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19534 All callers changed.
19535
19536 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19537
19538 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19539
19540 2011-03-27 Anders Lindgren <andlind@gmail.com>
19541
19542 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19543 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19544 (ns_update_auto_hide_menu_bar): New functions.
19545 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19546 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19547 ns_constrain_all_frames.
19548 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19549 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19550
19551 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19552
19553 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19554
19555 2011-03-27 Glenn Morris <rgm@gnu.org>
19556
19557 * syssignal.h: Replace RETSIGTYPE with void.
19558 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19559 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19560 Replace SIGTYPE with void everywhere.
19561 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19562 * s/template.h (SIGTYPE): Remove commented out definition.
19563
19564 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19565
19566 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19567 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19568
19569 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19570
19571 * w32.c (read_unc_volume): Use parameter `henum', instead of
19572 global variable `wget_enum_handle'.
19573
19574 * keymap.c (describe_vector): Remove parameters `indices' and
19575 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19576 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19577
19578 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19579
19580 * keyboard.c (timer_check): Remove parameter `do_it_now',
19581 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19582 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19583 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19584
19585 * keyboard.c (read_char):
19586 * w32menu.c (w32_menu_display_help):
19587 * xmenu.c (show_help_event, menu_help_callback):
19588 Adjust calls to `show_help_echo'.
19589
19590 * gtkutil.c (xg_maybe_add_timer):
19591 * keyboard.c (readable_events):
19592 * process.c (wait_reading_process_output):
19593 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19594
19595 * insdel.c (adjust_markers_gap_motion):
19596 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19597 (gap_left, gap_right): Don't call it.
19598
19599 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19600
19601 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19602 incurred during fontification.
19603
19604 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19605
19606 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19607 (DEFVAR_PER_BUFFER): Don't pass it.
19608
19609 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19610 (scrolling_window): Don't pass it.
19611
19612 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19613
19614 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19615
19616 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19617 and `suffix'.
19618 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19619 of variables specific to SELinux and computation of `encoded_absname'.
19620
19621 * image.c (XPutPixel): Remove unused variable `height'.
19622
19623 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19624
19625 * unexw32.c (get_section_info): Remove unused variable `section'.
19626
19627 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19628 (system_process_attributes): Remove unused variable `sess'.
19629 (sys_read): Remove unused variable `err'.
19630
19631 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19632 (w32_wnd_proc): Remove unused variable `isdead'.
19633 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19634 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19635 (x_create_tip_frame): Remove unused variable `tem'.
19636
19637 * w32inevt.c (w32_console_read_socket):
19638 Remove unused variable `no_events'.
19639
19640 * w32term.c (x_draw_composite_glyph_string_foreground):
19641 Remove unused variable `width'.
19642
19643 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19644
19645 * w32term.c (x_set_glyph_string_clipping):
19646 Don't pass uninitialized region to CombineRgn.
19647
19648 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19649
19650 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19651 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19652 (Fx_close_connection): Remove unused variable `i'.
19653
19654 * w32font.c (w32font_draw): Return number of glyphs.
19655 (w32font_open_internal): Remove unused variable `i'.
19656 (w32font_driver): Add missing initializer.
19657
19658 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19659 (fill_in_menu): Remove unused variable `items_added'.
19660
19661 * w32term.c (last_mouse_press_frame): Remove static global variable.
19662 (w32_clip_to_row): Remove unused variable `f'.
19663 (x_delete_terminal): Remove unused variable `i'.
19664
19665 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19666 (NOTHING): Remove unused static global variable.
19667 (uniscribe_check_otf): Remove unused variable `table'.
19668 (uniscribe_font_driver): Add missing initializers.
19669
19670 2011-03-23 Julien Danjou <julien@danjou.info>
19671
19672 * term.c (Fsuspend_tty, Fresume_tty):
19673 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19674 * window.c (temp_output_buffer_show):
19675 * insdel.c (signal_before_change):
19676 * frame.c (Fhandle_switch_frame):
19677 * fileio.c (Fdo_auto_save):
19678 * emacs.c (Fkill_emacs):
19679 * editfns.c (save_excursion_restore):
19680 * cmds.c (internal_self_insert):
19681 * callint.c (Fcall_interactively):
19682 * buffer.c (Fkill_all_local_variables):
19683 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19684 Use Frun_hooks.
19685 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19686 unconditionally since it does the check itself.
19687
19688 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19689
19690 Fix more problems found by GCC 4.5.2's static checks.
19691
19692 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19693 the first time through the loop, since we know p0 < p1 then.
19694 This also avoids a gcc -Wstrict-overflow warning.
19695
19696 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19697 leading to a memory leak, possible in functions like
19698 load_charset_map_from_file that can allocate an unbounded number
19699 of objects (Bug#8318).
19700
19701 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19702 that could (at least in theory) be that large.
19703
19704 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19705 This is less likely to overflow, and avoids undefined behavior if
19706 overflow does occur. All callers changed. Use strtoul to scan
19707 for the unsigned long integer.
19708 (pint2hrstr): Simplify and tune code slightly.
19709 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19710
19711 * scroll.c (do_scrolling): Work around GCC bug 48228.
19712 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19713
19714 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19715 This also avoids a warning with gcc -Wstrict-overflow.
19716 (validate_x_resource_name): Simplify count usage.
19717 This also avoids a warning with gcc -Wstrict-overflow.
19718
19719 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19720 fail (Bug#8306).
19721
19722 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19723
19724 * process.c (Fmake_network_process): Use socklen_t, not int,
19725 where POSIX says socklen_t is required in portable programs.
19726 This fixes a porting bug on hosts like 64-bit HP-UX, where
19727 socklen_t is wider than int (Bug#8277).
19728 (Fmake_network_process, server_accept_connection):
19729 (wait_reading_process_output, read_process_output):
19730 Likewise.
19731
19732 * process.c: Rename or move locals to avoid shadowing.
19733 (list_processes_1, Fmake_network_process):
19734 (read_process_output_error_handler, exec_sentinel_error_handler):
19735 Rename or move locals.
19736 (Fmake_network_process): Define label "retry_connect" only if needed.
19737 (Fnetwork_interface_info): Fix pointer signedness.
19738 (process_send_signal): Add cast to avoid pointer signedness problem.
19739 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19740 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19741
19742 Make tparam.h and terminfo.c consistent.
19743 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19744 Include tparam.h instead, since it declares them.
19745 * cm.h (PC): Remove extern decl; tparam.h now does this.
19746 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19747 * terminfo.c: Include tparam.h, to check interfaces.
19748 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19749 (tparam): Adjust signature to match interface in tparam.h;
19750 this removes some undefined behavior. Check that outstring and len
19751 are zero, which they always are with Emacs.
19752 * tparam.h (PC, BC, UP): New extern decls.
19753
19754 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19755 (xftfont_open): Rename locals to avoid shadowing.
19756
19757 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19758 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19759 (OTF_TAG_SYM): Omit macro if not needed.
19760 (ftfont_list): Remove unused local.
19761 (get_adstyle_property, ftfont_pattern_entity):
19762 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19763 Rename locals to avoid shadowing.
19764
19765 * xfont.c (xfont_list_family): Mark var as initialized.
19766
19767 * xml.c (make_dom): Now static.
19768
19769 * composite.c (composition_compute_stop_pos): Rename local to
19770 avoid shadowing.
19771 (composition_reseat_it): Remove unused locals.
19772 (find_automatic_composition, composition_adjust_point): Likewise.
19773 (composition_update_it): Mark var as initialized.
19774 (find_automatic_composition): Mark vars as initialized,
19775 with a FIXME (Bug#8290).
19776
19777 character.h: Rename locals to avoid shadowing.
19778 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19779 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19780 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19781 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19782 to avoid shadowing.
19783
19784 * textprop.c (property_change_between_p): Remove; unused.
19785
19786 * intervals.c (interval_start_pos): Now static.
19787
19788 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19789
19790 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19791 Rename locals to avoid shadowing.
19792
19793 * sound.c (wav_play, au_play, Fplay_sound_internal):
19794 Fix pointer signedness.
19795 (alsa_choose_format): Remove unused local var.
19796 (wav_play): Initialize a variable to 0, to prevent undefined
19797 behavior (Bug#8278).
19798
19799 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19800
19801 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19802
19803 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19804 clobbering (Bug#8298).
19805 * sysdep.c (sys_subshell): Likewise.
19806 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19807
19808 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19809 This should get cleaned up, so that child_setup has the
19810 same signature on all platforms.
19811
19812 * callproc.c (call_process_cleanup): Now static.
19813 (relocate_fd): Rename locals to avoid shadowing.
19814
19815 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19816
19817 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19818 not to be necessary, and produces flickering.
19819
19820 2011-03-20 Glenn Morris <rgm@gnu.org>
19821
19822 * config.in: Remove file.
19823
19824 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19825
19826 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19827 are now in src/globals.h.
19828 (syms_of_minibuf): Remove spurious & from previous change.
19829
19830 2011-03-20 Leo Liu <sdl.web@gmail.com>
19831
19832 * minibuf.c (completing-read-function): New variable.
19833 (completing-read-default): Rename from completing-read.
19834 (completing-read): Call completing-read-function.
19835
19836 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19837
19838 * xfaces.c (Fx_load_color_file):
19839 Read color file from absolute filename (bug#8250).
19840
19841 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19842
19843 * makefile.w32-in: Update dependencies.
19844
19845 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19846
19847 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19848
19849 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19850
19851 Fix more problems found by GCC 4.5.2's static checks.
19852
19853 * process.c (make_serial_process_unwind, send_process_trap):
19854 (sigchld_handler): Now static.
19855
19856 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19857 That way, the code declares only the vars that it needs.
19858 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19859 * s/cygwin.h (PTY_ITERATION): Likewise.
19860 * s/darwin.h (PTY_ITERATION): Likewise.
19861 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19862
19863 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19864 * process.c (allocate_pty): Don't declare stb unless it's needed.
19865
19866 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19867 (CONSTANTLIM): Remove; unused.
19868 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19869 Define only if needed.
19870
19871 * unexelf.c (unexec): Name an expression,
19872 to avoid gcc -Wbad-function-cast warning.
19873 Use a different way to cause a compilation error if anyone uses
19874 n rather than nn, a way that does not involve shadowing.
19875 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19876
19877 * deps.mk (unexalpha.o): Remove; unused.
19878
19879 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19880 * unexec.h: New file.
19881 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19882 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19883 Depend on unexec.h.
19884 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19885 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19886 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19887 Change as necessary to match prototype in unexec.h.
19888
19889 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19890 shadowing.
19891 (back_comment, skip_chars): Mark vars as initialized.
19892
19893 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19894 Rename locals to avoid shadowing.
19895
19896 * lread.c (read1): Rewrite so as not to use empty "else".
19897 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19898
19899 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19900
19901 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19902 warning when compiling print.c.
19903
19904 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19905 instead of using an uninitialized var.
19906 (font_sort_entities): Mark var as initialized.
19907
19908 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19909
19910 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19911 pointers to constants.
19912 (font_parse_fcname): Remove unused vars.
19913 (font_delete_unmatched): Now static.
19914 (font_get_spec): Remove; unused.
19915 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19916 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19917 Rename or move locals to avoid shadowing.
19918
19919 * fns.c (require_nesting_list, require_unwind): Now static.
19920 (Ffillarray): Rename locals to avoid shadowing.
19921
19922 * floatfns.c (domain_error2): Define only if needed.
19923 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19924
19925 * alloc.c (mark_backtrace): Move decl from here ...
19926 * lisp.h: ... to here, so that it can be checked.
19927
19928 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19929 (Fdefvar): Rewrite so as not to use empty "else".
19930 (lisp_indirect_variable): Name an expression,
19931 to avoid gcc -Wbad-function-cast warning.
19932 (Fdefvar): Rename locals to avoid shadowing.
19933
19934 * callint.c (quotify_arg, quotify_args): Now static.
19935 (Fcall_interactively): Rename locals to avoid shadowing.
19936 Use const pointer when appropriate.
19937
19938 * lisp.h (get_system_name, get_operating_system_release):
19939 Move decls here, to check interfaces.
19940 * process.c (get_operating_system_release): Move decl to lisp.h.
19941 * xrdb.c (get_system_name): Likewise.
19942 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19943 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19944 some of which prompt warnings from gcc -Wbad-function-cast.
19945 (Fformat_time_string, Fencode_time, Finsert_char):
19946 (Ftranslate_region_internal, Fformat):
19947 Rename or remove local vars to avoid shadowing.
19948 (Ftranslate_region_internal): Mark var as initialized.
19949
19950 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19951 avoid shadowing.
19952
19953 * lisp.h (eassert): Check that the argument compiles, even if
19954 ENABLE_CHECKING is not defined.
19955
19956 * data.c (Findirect_variable): Name an expression, to avoid
19957 gcc -Wbad-function-cast warning.
19958 (default_value, arithcompare, arith_driver, arith_error): Now static.
19959 (store_symval_forwarding): Rename local to avoid shadowing.
19960 (Fmake_variable_buffer_local, Fmake_local_variable):
19961 Mark variables as initialized.
19962 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19963
19964 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19965 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19966 Rename locals to avoid shadowing.
19967 (mark_stack): Move local variables into the #ifdef region where
19968 they're used.
19969 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19970 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19971 needed otherwise.
19972 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19973 (GC_STRING_CHARS): Remove; not used.
19974 (Fmemory_limit): Cast sbrk's returned value to char *.
19975
19976 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19977 avoids undefined behavior in theory.
19978
19979 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19980
19981 Use functions, not macros, for up- and down-casing (Bug#8254).
19982 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19983 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19984 to use the following functions instead of these macros.
19985 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19986 EMACS_INT, since callers assume the returned value fits in int.
19987 (upcase1): Likewise, for UPCASE_TABLE.
19988 (uppercasep, lowercasep, upcase): New static inline functions.
19989 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19990 the race-condition problem in the old DOWNCASE.
19991
19992 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19993 Rename locals to avoid shadowing.
19994 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19995 (regex_compile, re_search_2, re_match_2_internal):
19996 Remove unused local vars.
19997 (FREE_VAR): Rewrite so as not to use empty "else",
19998 which gcc can warn about.
19999 (regex_compile, re_match_2_internal): Mark locals as initialized.
20000 (RETALLOC_IF): Define only if needed.
20001 (WORDCHAR_P): Likewise. This one is never needed, but is used
20002 only in a comment talking about a compiler bug, so put inside
20003 the #if 0 of that comment.
20004 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20005 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20006 Remove; unused.
20007
20008 * search.c (boyer_moore): Rename locals to avoid shadowing.
20009 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20010 (PREV_CHAR_BOUNDARY): Likewise.
20011
20012 * search.c (simple_search): Remove unused var.
20013
20014 * dired.c (compile_pattern): Move decl from here ...
20015 * lisp.h: ... to here, so that it can be checked.
20016 (struct re_registers): New forward decl.
20017
20018 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20019
20020 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20021 All uses changed.
20022 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20023 Rename locals to avoid shadowing.
20024 (Fvertical_motion): Mark locals as initialized.
20025
20026 * casefiddle.c (casify_object, casify_region): Now static.
20027 (casify_region): Mark local as initialized.
20028
20029 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20030
20031 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20032 New macros, so that the caller can use some names other than
20033 gcpro1, gcpro2, etc.
20034 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20035 of the new macros.
20036 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20037 argument, for consistency with GCPRO2_VAR, etc: it is now the
20038 prefix of the variable, not the variable itself. All uses
20039 changed.
20040 * dired.c (directory_files_internal, file_name_completion):
20041 Rename locals to avoid shadowing.
20042
20043 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20044 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20045 dired.c's scmp function, had undefined behavior.
20046 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20047 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20048 * buffer.h: ... to here, because these macros use current_buffer,
20049 and the new implementation with inline functions needs to have
20050 current_buffer in scope now, rather than later when the macros
20051 are used.
20052 (downcase, upcase1): New static inline functions.
20053 (DOWNCASE, UPCASE1): Reimplement using these functions.
20054 This avoids undefined behavior in expressions like
20055 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20056 from race conditions in accessing the global variables
20057 case_temp1 and case_temp2.
20058 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20059 * lisp.h (case_temp1, case_temp2): Remove their decls.
20060 * character.h (ASCII_CHAR_P): Move from here ...
20061 * lisp.h: ... to here, so that the inline functions mentioned
20062 above can use them.
20063
20064 * dired.c (directory_files_internal_unwind): Now static.
20065
20066 * fileio.c (file_name_as_directory, directory_file_name):
20067 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20068 Now static.
20069 (file_name_as_directory): Use const pointers when appropriate.
20070 (Fexpand_file_name): Likewise. In particular, newdir might
20071 point at constant storage, so make it a const pointer.
20072 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20073 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20074 signedness issues.
20075 (Fset_file_times, Finsert_file_contents, auto_save_error):
20076 Rename locals to avoid shadowing.
20077
20078 * minibuf.c (choose_minibuf_frame_1): Now static.
20079 (Ftry_completion, Fall_completions): Rename or remove locals
20080 to avoid shadowing.
20081
20082 * marker.c (bytepos_to_charpos): Remove; unused.
20083
20084 * lisp.h (verify_bytepos, count_markers): New decls,
20085 so that gcc does not warn that these functions aren't declared.
20086
20087 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20088 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20089 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20090 (copy_text): Remove unused local var.
20091
20092 * filelock.c (within_one_second): Now static.
20093 (lock_file_1): Rename local to avoid shadowing.
20094
20095 * buffer.c (fix_overlays_before): Mark locals as initialized.
20096 (fix_start_end_in_overlays): Likewise. This function should be
20097 simplified by using pointers-to-pointers, but that's a different
20098 matter.
20099 (switch_to_buffer_1): Now static.
20100 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20101 (report_overlay_modification): Rename locals to avoid shadowing.
20102
20103 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20104 Fix pointer signedness issue.
20105 (sys_subshell): Mark local as volatile if checking for lint,
20106 to suppress a gcc -Wclobbered warning that does not seem to be right.
20107 (MAXPATHLEN): Define only if needed.
20108
20109 * process.c (serial_open, serial_configure): Move decls from here ...
20110 * systty.h: ... to here, so that they can be checked.
20111
20112 * fns.c (get_random, seed_random): Move extern decls from here ...
20113 * lisp.h: ... to here, so that they can be checked.
20114
20115 * sysdep.c (reset_io): Now static.
20116 (wait_for_termination_signal): Remove; unused.
20117
20118 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20119 (copy_keymap_item, append_key, push_text_char_description):
20120 Now static.
20121 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20122 (DENSE_TABLE_SIZE): Remove; unused.
20123 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20124 (describe_map_tree):
20125 Rename locals to avoid shadowing.
20126
20127 * keyboard.c: Declare functions static if they are not used elsewhere.
20128 (echo_char, echo_dash, cmd_error, top_level_2):
20129 (poll_for_input, handle_async_input): Now static.
20130 (read_char, kbd_buffer_get_event, make_lispy_position):
20131 (make_lispy_event, make_lispy_movement, apply_modifiers):
20132 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20133 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20134 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20135 (read_key_sequence, read_char): Mark locals as initialized.
20136 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20137
20138 * keyboard.h (make_ctrl_char): New decl.
20139 (mark_kboards): Move decl here ...
20140 * alloc.c (mark_kboards): ... from here.
20141
20142 * lisp.h (force_auto_save_soon): New decl.
20143
20144 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20145 (DEFINE_DUMMY_FUNCTION): New macro.
20146 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20147 Use it.
20148 (main): Add casts to avoid warnings
20149 if GCC considers string literals to be constants.
20150
20151 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20152
20153 * dbusbind.c: Pointer signedness fixes.
20154 (xd_signature, xd_append_arg, xd_initialize):
20155 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20156 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20157 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20158 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20159
20160 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20161 if GCC considers string literals to be constants.
20162 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20163
20164 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20165
20166 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20167 (print_preprocess, print_object): New macro to fix last change.
20168
20169 * print.c (print_preprocess): Don't forget font objects.
20170
20171 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20172
20173 * emacs.c (USAGE3): Doc fixes.
20174
20175 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20176
20177 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20178 structure.
20179
20180 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20181
20182 * lisp.h (VWindow_system, Qfile_name_history):
20183 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20184 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20185 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20186
20187 * w32select.c: Don't #include "keyboard.h".
20188 (run_protected): Add extern declaration for waiting_for_input.
20189
20190 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20191 * w32console.c (detect_input_pending, read_input_pending)
20192 (encode_terminal_code):
20193 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20194 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20195 (w32_system_caret_y, Qfile_name_history):
20196 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20197 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20198 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20199 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20200 * w32proc.c (Qlocal, report_file_error):
20201 * w32term.c (Vwindow_system, updating_frame):
20202 * w32uniscribe.c (initialized, uniscribe_font_driver):
20203 Remove unneeded extern declarations.
20204
20205 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20206
20207 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20208
20209 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20210
20211 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20212 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20213 These macros can no longer be used for assignment.
20214
20215 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20216 Assign struct members directly, instead of using BUF_BEGV etc.
20217 (record_buffer_markers, fetch_buffer_markers): New functions for
20218 recording and fetching special buffer markers.
20219 (set_buffer_internal_1, set_buffer_temp): Use them.
20220
20221 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20222
20223 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20224
20225 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20226 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20227
20228 * xdisp.c (hscroll_window_tree):
20229 (reconsider_clip_changes): Use PT instead of BUF_PT.
20230
20231 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20232
20233 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20234 $(EMACS_ROOT)/lib/intprops.h.
20235
20236 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20237
20238 Fix more problems found by GCC 4.5.2's static checks.
20239
20240 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20241 to unsigned char * to avoid compiler diagnostic.
20242 (xg_free_frame_widgets): Make it clear that a local variable is
20243 needed only if USE_GTK_TOOLTIP.
20244 (gdk_window_get_screen): Make it clear that this macro is needed
20245 only if USE_GTK_TOOLTIP.
20246 (int_gtk_range_get_value): New function, which avoids a diagnostic
20247 from gcc -Wbad-function-cast.
20248 (xg_set_toolkit_scroll_bar_thumb): Use it.
20249 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20250 diagnostic from gcc -Wbad-function-cast.
20251 (get_utf8_string, xg_get_file_with_chooser):
20252 Rename locals to avoid shadowing.
20253 (create_dialog): Move locals to avoid shadowing.
20254
20255 * xgselect.c (xg_select): Remove unused var.
20256
20257 * image.c (four_corners_best): Mark locals as initialized.
20258 (gif_load): Initialize transparent_p to zero (Bug#8238).
20259 Mark another local as initialized.
20260 (my_png_error, my_error_exit): Mark with NO_RETURN.
20261
20262 * image.c (clear_image_cache): Now static.
20263 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20264 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20265 (x_edge_detection): Remove unnecessary cast that
20266 gcc -Wbad-function-cast diagnoses.
20267 (gif_load): Fix pointer signedness.
20268 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20269 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20270
20271 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20272
20273 Improve quality of tests for time stamp overflow.
20274 For example, without this patch (encode-time 0 0 0 1 1
20275 1152921504606846976) returns the obviously-bogus value (-948597
20276 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20277 reports time overflow. See
20278 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20279 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20280 * editfns.c: Include limits.h and intprops.h.
20281 (TIME_T_MIN, TIME_T_MAX): New macros.
20282 (time_overflow): Move earlier, to before first use.
20283 (hi_time, lo_time): New functions, for an accurate test for
20284 out-of-range times.
20285 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20286 (Fget_internal_run_time): Don't assume time_t fits in int.
20287 (make_time): Use list2 instead of Fcons twice.
20288 (Fdecode_time): More accurate test for out-of-range times.
20289 (check_tm_member): New function.
20290 (Fencode_time): Use it, to test for out-of-range times.
20291 (lisp_time_argument): Don't rely on undefined left-shift and
20292 right-shift behavior when checking for time stamp overflow.
20293
20294 * editfns.c (time_overflow): New function, refactoring common code.
20295 (Fformat_time_string, Fdecode_time, Fencode_time):
20296 (Fcurrent_time_string): Use it.
20297
20298 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20299 * dired.c (make_time): Move to ...
20300 * editfns.c (make_time): ... here.
20301 * systime.h: Note the move.
20302
20303 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20304
20305 * fringe.c (update_window_fringes): Remove unused variables.
20306
20307 * unexmacosx.c (copy_data_segment): Also copy __got section.
20308 (Bug#8223)
20309
20310 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20311
20312 * termcap.c [MSDOS]: Include "msdos.h".
20313 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20314 Constify `char *' arguments and their references according to
20315 prototypes in tparam.h.
20316
20317 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20318
20319 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20320 Adapt all references accordingly.
20321
20322 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20323
20324 2011-03-11 Tom Tromey <tromey@redhat.com>
20325
20326 * buffer.c (syms_of_buffer): Remove obsolete comment.
20327
20328 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20329
20330 * termhooks.h (encode_terminal_code): Declare prototype.
20331
20332 * msdos.c (encode_terminal_code): Don't declare prototype.
20333
20334 * term.c (encode_terminal_code): Now external again, used by
20335 w32console.c and msdos.c.
20336
20337 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20338 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20339
20340 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20341
20342 Fix some minor problems found by GCC 4.5.2's static checks.
20343
20344 * fringe.c (update_window_fringes): Mark locals as initialized
20345 (Bug#8227).
20346 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20347
20348 * alloc.c (mark_fringe_data): Move decl from here ...
20349 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20350 to check its interface.
20351 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20352
20353 * fontset.c (free_realized_fontset): Now static.
20354 (Fset_fontset_font): Rename local to avoid shadowing.
20355 (fontset_font): Mark local as initialized.
20356 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20357
20358 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20359
20360 * xselect.c (x_disown_buffer_selections): Remove; not used.
20361 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20362 (x_own_selection, Fx_disown_selection_internal): Rename locals
20363 to avoid shadowing.
20364 (x_handle_dnd_message): Remove local to avoid shadowing.
20365
20366 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20367 so that the caller can use some name other than gcpro1.
20368 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20369 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20370 (Fx_backspace_delete_keys_p):
20371 Use them to avoid shadowing, and rename vars to avoid shadowing.
20372 (x_decode_color, x_set_name, x_window): Now static.
20373 (Fx_create_frame): Add braces to silence GCC warning.
20374 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20375 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20376 Remove unused locals.
20377 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20378 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20379 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20380 macros.
20381
20382 * xterm.h (x_mouse_leave): New decl.
20383
20384 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20385 Remove unused functions.
20386 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20387 (x_calc_absolute_position): Now static.
20388 (XTread_socket): Don't define label "out" unless it's used.
20389 Don't declare local "event" unless it's used.
20390 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20391 unless they are used.
20392 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20393 (x_fatal_error_signal): Remove; not used.
20394 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20395 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20396 (x_error_catcher, x_connection_closed, x_error_handler):
20397 (x_error_quitter, xembed_send_message, x_iconify_frame):
20398 (my_log_handler): Rename locals to avoid shadowing.
20399 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20400 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20401
20402 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20403 Rename or move locals to avoid shadowing.
20404 (tty_defined_color, merge_face_heights): Now static.
20405 (free_realized_faces_for_fontset): Remove; not used.
20406 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20407 does not deduce is never used uninitialized.
20408 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20409 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20410
20411 * terminal.c (store_terminal_param): Now static.
20412
20413 * xmenu.c (menu_highlight_callback): Now static.
20414 (set_frame_menubar): Remove unused local.
20415 (xmenu_show): Rename parameter to avoid shadowing.
20416 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20417 since they might point to immutable storage.
20418 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20419 since it's unused otherwise.
20420
20421 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20422 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20423 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20424 avoids a gcc -Wuninitialized diagnostic.
20425 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20426 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20427 does not deduce are never used uninitialized.
20428
20429 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20430
20431 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20432 * window.c (window_loop, size_window):
20433 (run_window_configuration_change_hook, enlarge_window): Likewise.
20434
20435 * window.c (display_buffer): Now static.
20436 (size_window): Mark variables that gcc -Wuninitialized
20437 does not deduce are never used uninitialized.
20438 * window.h (check_all_windows): New decl, to forestall
20439 gcc -Wmissing-prototypes diagnostic.
20440 * dispextern.h (bidi_dump_cached_states): Likewise.
20441
20442 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20443 shadowing.
20444 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20445 Include <limits.h>.
20446 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20447 and to avoid gcc -Wuninitialized warning.
20448 (load_charset_map): Mark variables that gcc -Wuninitialized
20449 does not deduce are never used uninitialized.
20450 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20451
20452 * coding.c (coding_set_source, coding_set_destination):
20453 Use "else { /* comment */ }" rather than "else /* comment */;"
20454 for clarity, and to avoid gcc -Wempty-body warning.
20455 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20456 a block, when the outer 'i' will do.
20457 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20458 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20459 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20460 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20461 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20462 Rename locals to avoid shadowing.
20463 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20464 * coding.c (emacs_mule_char, encode_invocation_designation):
20465 Now static, since they're not used elsewhere.
20466 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20467 (decode_coding_object, encode_coding_object, detect_coding_system):
20468 (decode_coding_emacs_mule): Mark variables that gcc
20469 -Wuninitialized does not deduce are never used uninitialized.
20470 (detect_coding_iso_2022): Initialize a local variable that might
20471 be used uninitialized. Leave a FIXME because it's not clear that
20472 this initialization is needed. (Bug#8211)
20473 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20474 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20475 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20476 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20477 Remove unused macros.
20478
20479 * category.c (hash_get_category_set): Remove unused local var.
20480 (copy_category_table): Now static, since it's not used elsewhere.
20481 * character.c (string_count_byte8): Likewise.
20482
20483 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20484 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20485
20486 * chartab.c (copy_sub_char_table): Now static, since it's not used
20487 elsewhere.
20488 (sub_char_table_ref_and_range, char_table_ref_and_range):
20489 Rename locals to avoid shadowing.
20490 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20491
20492 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20493 (BIDI_BOB): Remove unused macro.
20494
20495 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20496 deduce are never used uninitialized.
20497 * term.c (encode_terminal_code): Likewise.
20498
20499 * term.c (encode_terminal_code): Now static. Remove unused local.
20500
20501 * tparam.h: New file.
20502 * term.c, tparam.h: Include it.
20503 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20504 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20505 Move these decls to tparam.h, and make them agree with what
20506 is actually in tparam.c. The previous trick of using incompatible
20507 decls in different modules does not conform to the C standard.
20508 All callers of tparam changed to use tparam's actual API.
20509 * tparam.c (tparam1, tparam, tgoto):
20510 Use const pointers where appropriate.
20511
20512 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20513 * cm.h (struct cm): Likewise.
20514 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20515 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20516 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20517 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20518 (turn_on_face, init_tty): Likewise.
20519 * termchar.h (struct tty_display_info): Likewise.
20520
20521 * term.c (term_mouse_position): Rename local to avoid shadowing.
20522
20523 * alloc.c (mark_ttys): Move decl from here ...
20524 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20525
20526 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20527
20528 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20529
20530 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20531
20532 * search.c (compile_pattern_1): Remove argument regp, unused since
20533 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20534 (compile_pattern): Don't pass it.
20535
20536 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20537
20538 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20539 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20540 for ! HAVE_GTK3.
20541 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20542
20543 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20544
20545 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20546 gdk_window_get_screen, gdk_window_get_geometry,
20547 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20548 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20549 (xg_get_pixbuf_from_pixmap): New function.
20550 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20551 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20552 Call xg_get_pixbuf_from_pixmap instead of
20553 gdk_pixbuf_get_from_drawable.
20554 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20555 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20556 (xg_check_special_colors): Use GtkStyleContext and its functions
20557 for HAVE_GTK3.
20558 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20559 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20560 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20561 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20562 Call gtk_widget_get_preferred_size.
20563 (xg_frame_resized): gdk_window_get_geometry only takes 5
20564 parameters.
20565 (xg_win_to_widget, xg_event_is_for_menubar):
20566 Call gdk_x11_window_lookup_for_display.
20567 (xg_set_widget_bg): New function.
20568 (delete_cb): New function.
20569 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20570 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20571 (xg_set_background_color): Call xg_set_widget_bg.
20572 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20573 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20574 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20575 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20576 if ! HAVE_GTK3.
20577 (update_frame_tool_bar): Call gtk_widget_hide.
20578 (xg_initialize): Use GDK_KEY_g.
20579
20580 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20581 if ! HAVE_GTK3
20582 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20583
20584 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20585 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20586 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20587
20588 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20589
20590 * w32xfns.c (select_palette): Check success of RealizePalette against
20591 GDI_ERROR, not zero.
20592
20593 See ChangeLog.11 for earlier changes.
20594
20595 ;; Local Variables:
20596 ;; coding: utf-8
20597 ;; End:
20598
20599 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20600
20601 This file is part of GNU Emacs.
20602
20603 GNU Emacs is free software: you can redistribute it and/or modify
20604 it under the terms of the GNU General Public License as published by
20605 the Free Software Foundation, either version 3 of the License, or
20606 (at your option) any later version.
20607
20608 GNU Emacs is distributed in the hope that it will be useful,
20609 but WITHOUT ANY WARRANTY; without even the implied warranty of
20610 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20611 GNU General Public License for more details.
20612
20613 You should have received a copy of the GNU General Public License
20614 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.