Convenient macro to check whether the buffer is hidden.
[bpt/emacs.git] / src / ChangeLog
1 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Convenient macro to check whether the buffer is hidden.
4 * buffer.h (BUFFER_HIDDEN_P): New macro.
5 * frame.c (make_frame): Use it. Adjust comment.
6 * buffer.c (candidate_buffer): New function.
7 (Fother_buffer, other_buffer_safely): Use it.
8
9 2012-12-06 Eli Zaretskii <eliz@gnu.org>
10
11 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
12 if the child process is still running. Instead, exit the wait
13 loop and return zero. (Bug#13086)
14
15 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
16
17 * frame.h (x_char_width, x_char_height): Remove prototypes.
18 * w32term.h (x_char_width, x_char_height): Likewise.
19 * xfns.c (x_char_width, x_char_height): Remove.
20 * w32fns.c (x_char_width, x_char_height): Likewise.
21 * nsfns.c (x_char_width, x_char_height): Likewise.
22 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
23 all window frames.
24 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
25 * keyboard.c (command_loop_1): Remove prototype.
26 (command_loop_2, top_level_1): Add static to match prototype.
27
28 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
29
30 Fix a recently-introduced delete-process race condition.
31 * callproc.c, process.h (record_kill_process):
32 New function, containing part of the old call_process_kill.
33 (call_process_kill): Use it.
34 This does not change call_process_kill's behavior.
35 * process.c (Fdelete_process): Use record_kill_process to fix a
36 race condition that could cause Emacs to lose track of a child.
37
38 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
39
40 Avoid code duplication between prev_frame and next_frame.
41 * frame.c (candidate_frame): New function. Add comment.
42 (prev_frame, next_frame): Use it. Adjust comment.
43
44 2012-12-06 Eli Zaretskii <eliz@gnu.org>
45
46 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
47 fails, signal an error instead of continuing with an empty
48 string. (Bug#13079)
49 Encode expanded temp file pattern before passing it to mkstemp or
50 mktemp.
51
52 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
53 Encode the file name before passing it to dostounix_filename, in
54 case it will downcase it (under w32-downcase-file-names).
55 (Bug#12933)
56
57 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
58
59 Minor call-process cleanups.
60 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
61 at the same time as other platforms, to simplify analysis.
62 No need for fd0_volatile since we have synch_process_fd.
63 Avoid needless emacs_close; arg is always negative.
64
65 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
66
67 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
68 processes.
69
70 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
71
72 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
73 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
74 and mouse_face_hidden members to a bitfields.
75 * frame.h (struct frame): Remove set-but-not-used space_width member.
76 (FRAME_SPACE_WIDTH): Remove.
77 * nsterm.m, w32term.c, xterm.c: Adjust users.
78 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
79 member. Adjust users. Convert term_initted, delete_in_insert_mode,
80 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
81 members to a bitfields.
82
83 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
84
85 Don't let call-process be a zombie factory (Bug#12980).
86 Fixing this bug required some cleanup of the signal-handling code.
87 As a side effect, this change also fixes a longstanding rare race
88 condition whereby Emacs could mistakenly kill unrelated processes,
89 and it fixes a bug where a second C-g does not kill a recalcitrant
90 synchronous process in GNU/Linux and similar platforms.
91 The patch should also fix the last vestiges of Bug#9488,
92 a bug which has mostly been fixed on the trunk by other changes.
93 * callproc.c, process.h (synch_process_alive, synch_process_death)
94 (synch_process_termsig, sync_process_retcode):
95 Remove. All uses removed, to simplify analysis and so that
96 less consing is done inside critical sections.
97 * callproc.c (call_process_exited): Remove. All uses replaced
98 with !synch_process_pid.
99 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
100 These take the role of what used to be in unwind-protect arg.
101 All uses changed.
102 (block_child_signal, unblock_child_signal):
103 New functions, to avoid races that could kill innocent-victim processes.
104 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
105 (call_process_kill): Record killed processes as deleted, so that
106 zombies do not clutter up the system. Do this inside a critical
107 section, to avoid a race that would allow the clutter.
108 (call_process_cleanup): Fix code so that the second C-g works again
109 on common platforms such as GNU/Linux.
110 (Fcall_process): Create the child process in a critical section,
111 to fix a race condition. If creating an asynchronous process,
112 record it as deleted so that zombies do not clutter up the system.
113 Do unwind-protect for WINDOWSNT too, as that's simpler in the
114 light of these changes. Omit unnecessary call to emacs_close
115 before failure, as the unwind-protect code does that.
116 * callproc.c (call_process_cleanup):
117 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
118 * process.c (record_deleted_pid): New function, containing
119 code refactored out of Fdelete_process.
120 (Fdelete_process): Use it.
121 (process_status_retrieved): Remove. All callers changed to use
122 child_status_change.
123 (record_child_status_change): Remove, folding its contents into ...
124 (handle_child_signal): ... this signal handler. Now, this
125 function is purely a handler for SIGCHLD, and is not called after
126 a synchronous waitpid returns; the synchronous code is moved to
127 wait_for_termination. There is no need to worry about reaping
128 more than one child now.
129 * sysdep.c (get_child_status, child_status_changed): New functions.
130 (wait_for_termination): Now takes int * status and bool
131 interruptible arguments, too. Do not record child status change;
132 that's now the caller's responsibility. All callers changed.
133 Reimplement in terms of get_child_status.
134 (wait_for_termination_1, interruptible_wait_for_termination):
135 Remove. All callers changed to use wait_for_termination.
136 * syswait.h: Include <stdbool.h>, for bool.
137 (record_child_status_change, interruptible_wait_for_termination):
138 Remove decls.
139 (record_deleted_pid, child_status_changed): New decls.
140 (wait_for_termination): Adjust to API changes noted above.
141
142 * bytecode.c, lisp.h (Qbytecode): Remove.
143 No longer needed after 2012-11-20 interactive-p changes.
144
145 2012-12-03 Eli Zaretskii <eliz@gnu.org>
146
147 * xdisp.c (redisplay_window): If the cursor is visible, but inside
148 the scroll margin, move point outside the margin. (Bug#13055)
149
150 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
151
152 * gtkutil.c (my_log_handler): New function.
153 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
154
155 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
156
157 * lisp.h (modify_region): Rename to...
158 (modify_region_1): ...new prototype.
159 * textprop.c (modify_region): Now static. Adjust users.
160 * insdel.c (modify_region): Rename to...
161 (modify_region_1): ...new function to work with current buffer.
162 Adjust comment and users. Use true and false for booleans.
163
164 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
165
166 * alloc.c (free_save_value): New function.
167 (safe_alloca_unwind): Use it.
168 * lisp.h (free_save_value): New prototype.
169 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
170 Add comment.
171 (save_excursion_restore): Adjust to match saved data structure.
172 Use free_save_value to offload some work from GC. Drop obsolete
173 #if 0 code.
174
175 2012-12-03 Chong Yidong <cyd@gnu.org>
176
177 * fileio.c (Vauto_save_list_file_name): Doc fix.
178
179 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
180
181 * w32fns.c: Remove prototype of atof.
182 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
183 builds.
184 (file_dialog_callback): Declared UINT_PTR.
185
186 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
187 with 64-bit builds.
188
189 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
190 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
191 defined.
192
193 2012-12-03 Glenn Morris <rgm@gnu.org>
194
195 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
196
197 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
198
199 Fix xpalloc confusion after memory is exhausted.
200 * alloc.c (xpalloc): Comment fix.
201 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
202 and signals an error, do not clear charset_table_size, as
203 charset_table is still valid.
204 * doprnt.c (evxprintf): Clear *BUF after freeing it.
205
206 Use execve to avoid need to munge environ (Bug#13054).
207 * callproc.c (Fcall_process):
208 * process.c (create_process):
209 Don't save and restore environ; no longer needed.
210 * callproc.c (child_setup):
211 Use execve, not execvp, to preserve environ.
212
213 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
214
215 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
216
217 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
218
219 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
220 display for sliced images (Bug#10500).
221
222 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
223
224 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
225
226 * doc.c (Fdocumentation): Re-add handling of function-documentation,
227 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
228
229 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
230
231 * xdisp.c (window_outdated): Remove eassert since it hits
232 some suspicious corner cases (see Bug#13007 and Bug#13012).
233 (mode_line_update_needed): New function.
234 (redisplay_internal, redisplay_window): Use it.
235 (ensure_selected_frame): New function.
236 (redisplay_internal, unwind_redisplay): Use it.
237 (redisplay_internal): Move comment about buffer_shared...
238 (buffer_shared_and_changed): ...near to its real use.
239
240 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
241
242 * callproc.c (Fcall_process): Don't misreport vfork failure.
243
244 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
245
246 * callproc.c (Fcall_process): Fix vfork portability problems.
247 Do not assume that fd[0], count, filefd, and save_environ survive
248 vfork. Fix bug whereby wrong errno value could be reported for
249 pipe failure. Some minor cleanups, too, as follows. Move buf and
250 bufsize to the context where they're needed. Change new_argv to
251 be of type char **, as this is more convenient and avoids casts.
252 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
253 Now local constants, not macros.
254
255 2012-11-18 Kenichi Handa <handa@gnu.org>
256
257 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
258 for the variable "f".
259
260 2012-11-13 Kenichi Handa <handa@gnu.org>
261
262 * font.c (font_unparse_xlfd): Exclude special characters from the
263 generating XLFD name.
264
265 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
266
267 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
268 * dired.c (stat_uname, stat_gname):
269 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
270
271 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
272 * dired.c (directory_files_internal, file_name_completion):
273 Assume EAGAIN and EINTR are defined.
274
275 * fileio.c (Fcopy_file): Assume EISDIR is defined.
276 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
277 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
278 * lread.c (readbyte_from_file): Assume EINTR is defined.
279 * process.c (wait_reading_process_output, send_process) [subprocesses]:
280 Assume EIO and EAGAIN are defined.
281 * unexcoff.c (write_segment): Assume EFAULT is defined.
282
283 2012-11-27 Eli Zaretskii <eliz@gnu.org>
284
285 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
286 (Bug#11964)
287
288 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
289 highlighting on the frame was cleared. Prevents assertion
290 violations when repeatedly clicking on the "Top" link of the
291 "bread-crumbs" in Info buffers.
292
293 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
294
295 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
296
297 2012-11-24 Ken Brown <kbrown@cornell.edu>
298
299 * keyboard.c (HAVE_MOUSE):
300 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
301 were always defined.
302
303 2012-11-24 Eli Zaretskii <eliz@gnu.org>
304
305 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
306 between bpos_covered and bpos_max. This fixes cursor display when
307 several display strings follow each other.
308
309 * .gdbinit (pgx): If the glyph's object is a string, display the
310 pointer to string data, rather than the value of the string object
311 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
312
313 * indent.c (Fvertical_motion): If the starting position is covered
314 by a display string, return to one position before that, to avoid
315 overshooting it inside move_it_to. (Bug#12930)
316
317 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
318
319 * frame.h (struct frame): Remove display_preempted member
320 since all users are dead long ago.
321 * nsterm.h (struct x_output): Use the only dummy member.
322 * w32menu.c (pending_menu_activation): Remove since not
323 really used.
324 (set_frame_menubar): Adjust user.
325 * w32term.h (struct x_output): Drop outdated #if 0 code.
326 (struct w32_output): Use bitfields for explicit_parent,
327 asked_for_visible and menubar_active members. Drop
328 unused pending_menu_activation member.
329 * xterm.h (struct x_output): Drop outdated #if 0 code.
330 Use bitfields for explicit_parent, asked_for_visible,
331 has_been_visible and net_wm_state_hidden_seen members.
332
333 2012-11-23 Eli Zaretskii <eliz@gnu.org>
334
335 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
336 of a literal "/". (Bug#12955)
337 (gl-stamp): Invoke fc.exe directly, not through cmd.
338
339 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
340
341 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
342 * dired.c: Assume HAVE_DIRENT_H.
343 (NAMLEN): Remove, replacing with ...
344 (dirent_namelen): New function. All uses changed. Use the GNU macro
345 _D_EXACT_NAMELEN if available, as it's faster than strlen.
346 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
347 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
348 * makefile.w32-in (DIR_H): Remove. All uses replaced with
349 $(NT_INC)/dirent.h.
350 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
351 * ndir.h: Rename to ../nt/inc/dirent.h.
352 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
353 Do not include <dirent.h>; no longer needed.
354 * w32.c: Include <dirent.h> rather than "ndir.h".
355
356 2012-11-23 Chong Yidong <cyd@gnu.org>
357
358 * xftfont.c (xftfont_open): Remove duplicate assignment.
359
360 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
361
362 * alloc.c (Fgarbage_collect): Unblock input after clearing
363 gc_in_progress to avoid note_mouse_highlight glitch with GC.
364 * frame.h (FRAME_MOUSE_UPDATE): New macro.
365 * msdos.c (IT_frame_up_to_date): Use it here...
366 * w32term.c (w32_frame_up_to_date): ...here...
367 * xterm.c (XTframe_up_to_date): ...and here...
368 * nsterm.m (ns_frame_up_to_date): ...but not here.
369 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
370 Adjust users.
371 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
372 Do not check whether GC is in progress.
373
374 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
375
376 * xdisp.c (window_buffer_changed): New function.
377 (update_menu_bar, update_tool_bar): Use it to
378 simplify large 'if' statements.
379 (redisplay_internal): Generalize commonly used
380 'tail' and 'frame' local variables.
381
382 2012-11-22 Eli Zaretskii <eliz@gnu.org>
383
384 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
385 with Windows system header.
386
387 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
388
389 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
390 * alloc.c: Assume unistd.h exists.
391 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
392 * sysdep.c (get_current_dir_name): Assume getcwd exists.
393 (getwd) [USG]: Remove; no longer needed.
394 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
395 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
396 * w32.h (getcwd): Remove decl.
397
398 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
399
400 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
401 Make it set selected_window as well.
402 (update_tool_bar): Use it.
403
404 2012-11-21 Ken Brown <kbrown@cornell.edu>
405
406 * emacs.c (main): Set the G_SLICE environment variable for all
407 Cygwin builds, not just GTK builds. See
408 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
409
410 2012-11-21 Eli Zaretskii <eliz@gnu.org>
411
412 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
413 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
414 Define for the MSVC compiler.
415
416 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
417
418 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
419 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
420 dostounix_filename. Prevents crashes down the road, because
421 dostounix_filename assumes it gets a unibyte string. Reported by
422 Michel de Ruiter <michel@sentient.nl>, see
423 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
424
425 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
426
427 Conflate Qnil and Qunbound for `symbol-function'.
428 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
429 * lread.c (init_obarray): Set `function' fields to Qnil.
430 * eval.c (Fcommandp): Ignore Qunbound.
431 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
432 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
433 Test NILP rather than Qunbound.
434 (Ffmakunbound): Set to Qnil.
435 (Fsymbol_function): Never signal an error.
436 (Finteractive_form): Ignore Qunbound.
437
438 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
439
440 * eval.c (interactive_p): Remove no-longer-used decl.
441
442 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
443
444 * xdisp.c (buffer_shared): Adjust comment.
445 (buffer_shared_and_changed): New function.
446 (prepare_menu_bars, redisplay_internal): Use it to
447 decide whether all windows or frames should be updated.
448 (window_outdated): New function.
449 (text_outside_line_unchanged_p, redisplay_window): Use it.
450 (redisplay_internal): Likewise. Fix indentation.
451
452 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
453
454 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
455 (syms_of_eval): Remove corresponding defsubr.
456 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
457
458 2012-11-19 Daniel Colascione <dancol@dancol.org>
459
460 * w32fns.c (Fx_file_dialog):
461 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
462 cygwin_convert_file_name*.
463
464 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
465 Rename cygwin_convert_path* to cygwin_convert_file_name*.
466
467 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
468
469 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
470
471 2012-11-18 Eli Zaretskii <eliz@gnu.org>
472
473 * w32select.c: Include w32common.h before w32term.h, so that
474 windows.h gets included before w32term.h uses some of its
475 features, see below.
476
477 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
478 New typedefs.
479 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
480 New prototypes.
481 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
482
483 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
484
485 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
486 (ns_select): Return at once if events are held (Bug#12834).
487
488 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
489
490 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
491 Needed following 2012-10-20 change. (Bug#12902)
492
493 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
494
495 * w32proc.c (waitpid): Remove unused label get_result.
496
497 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
498
499 * makefile.w32-in (SYSWAIT_H): New macro.
500 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
501 ($(BLD)/sysdep.$(O)): Update dependencies.
502
503 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
504
505 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
506 * callproc.c (relocate_fd): Assume F_DUPFD.
507 * emacs.c, term.c (O_RDWR): Remove.
508 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
509 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
510 * nsterm.m: Assume <fcntl.h> exists.
511 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
512 (create_pty, Fmake_network_process, server_accept_connection)
513 (wait_reading_process_output, init_process_emacs):
514 Assume O_NONBLOCK.
515 (wait_reading_process_output): Put in a special case for WINDOWSNT
516 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
517 It's not clear this is needed, but it's a more-conservative change.
518 (create_process): Assume FD_CLOEXEC.
519 (create_process, create_pty): Assume O_NOCTTY.
520 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
521 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
522 Omit if not DOS_NT, since F_GETFL is not defined there.
523 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
524 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
525 (O_NOCTTY): Remove.
526 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
527 lack it, since gnulib guarantees this.
528 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
529
530 2012-11-17 Eli Zaretskii <eliz@gnu.org>
531
532 * w32.c (faccessat): Pretend that directories have the execute bit
533 set. Emacs expects that, e.g., in files.el:cd-absolute.
534
535 * w32proc.c (create_child): Don't clip the PID of the child
536 process to fit into an Emacs integer, as this is no longer a
537 restriction.
538 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
539 reaping only the process specified by PID argument, if that is
540 positive. Use PID instead of dead_child to know which process to
541 reap. Wait for the child to die only if WNOHANG is not in
542 OPTIONS.
543 (sys_select): Don't set dead_child.
544
545 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
546 as it is no longer needed.
547
548 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
549 no longer needed.
550 (record_child_status_change): Remove the setting of
551 record_at_most_one_child for the !WNOHANG case.
552
553 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
554
555 Fix problems in ns port found by static checking.
556 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
557 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
558 not to process group.
559 (ns_select): Use emacs_write, not write, as that's more robust
560 in the presence of signals.
561 (fd_handler:): Check for read errors.
562
563 2012-11-16 Glenn Morris <rgm@gnu.org>
564
565 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
566
567 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
568
569 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
570
571 2012-11-16 Eli Zaretskii <eliz@gnu.org>
572
573 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
574 use the same value of thread handle.
575 (start_timer_thread): If the timer thread exited (due to error),
576 clean up by closing the two handles it used. Duplicate the caller
577 thread's handle here, so it gets duplicated only once, when
578 launching the timer thread. Set priority of the timer thread, not
579 the caller thread.
580 (getitimer): Don't duplicate the caller thread's handle here.
581 (Bug#12832)
582
583 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
584
585 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
586 called (Bug#12834).
587
588 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
589
590 Remove no-longer-used pty_max_bytes variable.
591 * process.c (pty_max_bytes): Remove; unused.
592 (send_process): Do not set it.
593
594 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
595
596 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
597 Update dependencies.
598
599 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
600
601 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
602 This follows up on the 2012-09-29 patch that removed indirection
603 for the 'function' field. Reported by Sergey Vinokurov in
604 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
605
606 2012-11-14 Eli Zaretskii <eliz@gnu.org>
607
608 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
609 different name, as the MS runtime does not have such a function,
610 and probably never will.) All callers changed. Ignore DIRFD
611 value if PATH is an absolute file name, to match Posix spec
612 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
613 symlinks.
614
615 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
616
617 * xdisp.c (echo_area_display, redisplay_internal):
618 Omit redundant check whether frame_garbaged is set.
619
620 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
621
622 Use faccessat, not access, when checking file permissions (Bug#12632).
623 This fixes a bug that has been present in Emacs since its creation.
624 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
625 which must set some sort of record. (Torek's bug report was against
626 a predecessor of GNU Emacs, but GNU Emacs happened to have the
627 same common flaw.) See Torek's Usenet posting
628 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
629 Posted: Fri Apr 8 14:18:56 1983.
630 * Makefile.in (LIB_EACCESS): New macro.
631 (LIBES): Use it.
632 * callproc.c (init_callproc):
633 * charset.c (init_charset):
634 * fileio.c (check_existing, check_executable, check_writable)
635 (Ffile_readable_p):
636 * lread.c (openp, load_path_check):
637 * process.c (allocate_pty):
638 * xrdb.c (file_p):
639 Use effective UID when checking permissions, not real UID.
640 * callproc.c (init_callproc):
641 * charset.c (init_charset):
642 * lread.c (load_path_check, init_lread):
643 Test whether directories are accessible, not merely whether they exist.
644 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
645 * fileio.c (check_existing, check_executable, check_writable)
646 (Ffile_readable_p):
647 Use symbolic names instead of integers for the flags, as they're
648 portable now.
649 (check_writable): New arg AMODE. All uses changed.
650 Set errno on failure.
651 (Ffile_readable_p): Use faccessat, not stat + open + close.
652 (Ffile_writable_p): No need to call check_existing + check_writable.
653 Just call check_writable and then look at errno. This saves a syscall.
654 dir should never be nil; replace an unnecessary runtime check
655 with an eassert. When checking the parent directory of a nonexistent
656 file, check that the directory is searchable as well as writable, as
657 we can't create files in unsearchable directories.
658 (file_directory_p): New function, which uses 'stat' on most platforms
659 but faccessat with D_OK (for efficiency) if WINDOWSNT.
660 (Ffile_directory_p, Fset_file_times): Use it.
661 (file_accessible_directory_p): New function, which uses a single
662 syscall for efficiency.
663 (Ffile_accessible_directory_p): Use it.
664 * xrdb.c (file_p): Use file_directory_p.
665 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
666 * lread.c (openp): When opening a file, use fstat rather than
667 stat, as that avoids a permissions race. When not opening a file,
668 use file_directory_p rather than stat.
669 (dir_warning): First arg is now a usage string, not a format.
670 Use errno. All uses changed.
671 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
672 that merely introduced a race.
673 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
674 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
675 and similarly for the other O_* flags.
676 * w32.c (sys_faccessat): Rename from sys_access and switch to
677 faccessat's API. All uses changed.
678 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
679 (magic_db): Rename from magic_file_p.
680 (magic_db, search_magic_path): Return an XrmDatabase rather than a
681 char *, so that we don't have to test for file existence
682 separately from opening the file for reading. This removes a race
683 fixes a permission-checking problem, and simplifies the code.
684 All uses changed.
685 (file_p): Remove; no longer needed.
686
687 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
688
689 Omit glyphs initialization at startup.
690 * dispnew.c (glyphs_initialized_initially_p): Remove.
691 (adjust_frame_glyphs_initially): Likewise. Adjust users.
692 (Fredraw_frame): Move actual code from here...
693 (redraw_frame): ...to here. Add eassert. Adjust comment.
694 (Fredraw_display): Use redraw_frame.
695 * xdisp.c (clear_garbaged_frames): Likewise.
696
697 2012-11-13 Eli Zaretskii <eliz@gnu.org>
698
699 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
700 passed to pint2str and pint2hrstr to be at most the size of the
701 frame's decode_mode_spec_buffer. This avoids crashes with very
702 large values of FIELD_WIDTH argument to decode_mode_spec.
703 (Bug#12867)
704
705 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
706
707 Fix a race with verify-visited-file-modtime (Bug#12863).
708 Since at least 1991 Emacs has ignored an mtime difference of no
709 more than one second, but my guess is that this was to work around
710 file system bugs that were fixed long ago. Since the race is
711 causing problems now, let's remove that code.
712 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
713 whose time stamp is off by no more than a second. Insist that the
714 file time stamps match exactly.
715
716 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
717
718 * frame.h (struct frame): Convert external_tool_bar member to
719 1-bit unsigned bitfield.
720 * termhooks.h (struct terminal): Remove mouse_moved member since
721 all users are long dead. Adjust comment on mouse_position_hook.
722
723 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
724
725 Simplify by using FOR_EACH_FRAME here and there.
726 * frame.c (next_frame, prev_frame, other_visible_frames)
727 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
728 * w32term.c (x_window_to_scroll_bar): Likewise.
729 * window.c (window_list): Likewise.
730 * xdisp.c (x_consider_frame_title): Likewise.
731 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
732 * xfns.c (x_window_to_frame, x_any_window_to_frame)
733 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
734 * xmenu.c (menubar_id_to_frame): Likewise.
735 * xselect.c (frame_for_x_selection): Likewise.
736 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
737 (x_window_to_menu_bar): Likewise.
738 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
739
740 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
741
742 * data.c (Qdefalias_fset_function): Now static.
743
744 Another tweak to vectorlike_header change.
745 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
746 Remove, and replace all uses with ...
747 (next_in_free_list, set_next_in_free_list):
748 New functions, which respect C's aliasing rules better.
749
750 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
751
752 * window.c (list4i): Rename from 'quad'. All uses changed.
753 Needed because <sys/types.h> defines 'quad' on Solaris 10.
754
755 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
756
757 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
758 warning about mixing declarations and code in ISO C90.
759
760 2012-11-10 Martin Rudalics <rudalics@gmx.at>
761
762 * window.c (Fsplit_window_internal): Set combination limit of
763 new parent window to t iff Vwindow_combination_limit is t;
764 fixing a regression introduced with the change from 2012-09-22.
765 (Fset_window_combination_limit): Fix doc-string.
766
767 2012-11-10 Eli Zaretskii <eliz@gnu.org>
768
769 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
770 amount when the scroll margins are too large. When scrolling
771 backwards in the buffer, give up if cannot reach point or the
772 scroll margin within a reasonable number of screen lines.
773 Fixes point position in window under scroll-up/down-aggressively when
774 point is positioned many lines beyond the window top/bottom.
775 (Bug#12811)
776
777 * ralloc.c (relinquish): If real_morecore fails to return memory
778 to the system, don't crash; instead, leave the last heap
779 unchanged and return. (Bug#12774)
780
781 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
782
783 * lisp.h (AUTOLOADP): New macro.
784 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
785 * data.c (Ffset): Remove special ad-advice-info handling.
786 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
787 (Fsubr_arity): CSE.
788 (Finteractive_form): Simplify.
789 (Fquo): Don't insist on having at least 2 arguments.
790 (Qdefalias_fset_function): New var.
791
792 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
793
794 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
795
796 * nsfont.m (Qcondensed, Qexpanded): New variables.
797 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
798 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
799
800 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
801
802 Fix recently introduced crash on MS-Windows (Bug#12839).
803 * w32term.h (struct scroll_bar): Use convenient header.
804 (SCROLL_BAR_VEC_SIZE): Remove.
805 * w32term.c (x_scroll_bar_create): Use VECSIZE.
806
807 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
808
809 Tweak last vectorlike_header change.
810 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
811 vectorlike object on the free list. This is introduced to avoid
812 some (but not all) pointer casting and aliasing problems, see
813 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
814 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
815 objects.
816 (xvectype, xvecsize): Use them to examine Lisp_Object values.
817
818 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
819
820 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
821 been removed, so remove them here also.
822
823 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
824
825 * doc.c (Fdocumentation): Handle new property
826 dynamic-docstring-function to replace the old ad-advice-info.
827
828 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
829
830 * fns.c (Qeql, hashtest_eq): Now static.
831
832 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
833
834 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
835 * fns.c (hashfn_eq, hashfn_eql, sxhash):
836 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
837 * buffer.c (compare_overlays): Use XLI rather than XHASH.
838
839 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
840
841 Use same hash function for hashfn_profiler as for hash_string etc.
842 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
843 * lisp.h (sxhash_combine): New inline function, with the contents
844 of the old SXHASH_COMBINE.
845 * profiler.c (hashfn_profiler): Use it, instead of having a
846 special hash function containing a comparison that always yields 1.
847
848 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
849
850 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
851 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
852 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
853 Remove unused vars.
854
855 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
856
857 * image.c (xpm_make_color_table_h): Fix compiler error because
858 make_hash_table changed.
859
860 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
861
862 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
863
864 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
865
866 Use ad-hoc comparison function for the profiler's hash-tables.
867 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
868 (make_log): Use them.
869 (handle_profiler_signal): Don't inhibit quit any longer since we don't
870 call Fequal any more.
871 (Ffunction_equal): New function.
872 (cmpfn_profiler, hashfn_profiler): New functions.
873 (syms_of_profiler): Initialize them.
874 * lisp.h (struct hash_table_test): New struct.
875 (struct Lisp_Hash_Table): Use it.
876 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
877 * fns.c (make_hash_table): Take a struct to describe the test.
878 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
879 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
880 (hash_lookup, hash_remove_from_table): Move assertion checking of
881 hashfn result here. Check hash-equality before calling cmpfn.
882 (Fmake_hash_table): Adjust call to make_hash_table.
883 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
884 (syms_of_fns): Initialize them.
885 * emacs.c (main): Move syms_of_fns earlier.
886 * xterm.c (syms_of_xterm):
887 * category.c (hash_get_category_set): Adjust call to make_hash_table.
888 * print.c (print_object): Adjust to new hash-table struct.
889 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
890
891 2012-11-08 Eli Zaretskii <eliz@gnu.org>
892
893 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
894 value of w32-scroll-lock-modifier is neither nil nor one of the
895 known key modifiers. (Bug#12806)
896
897 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
898
899 Shrink struct vectorlike_header to the only size field.
900 * lisp.h (enum pvec_type): Avoid explicit enum member values.
901 Adjust comment.
902 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
903 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
904 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
905 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
906 information from the vector header. Adjust comment.
907 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
908 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
909 layout.
910 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
911 (struct vectorlike_header): Remove next member. Adjust comment.
912 (struct Lisp_Subr): Add convenient header. Adjust comment.
913 (allocate_pseudovector): Adjust prototype.
914 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
915 (sweep_string, lisp_malloc): Remove useless prototypes.
916 (enum mem_type): Adjust comment.
917 (NEXT_IN_FREE_LIST): New macro.
918 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
919 (Fmake_bool_vector): Likewise.
920 (struct large_vector): New type to represent allocation unit for
921 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
922 (large_vectors): Change type to struct large_vector.
923 (allocate_vector_from_block): Simplify.
924 (PSEUDOVECTOR_NBYTES): Replace with...
925 (vector_nbytes): ...new function. Adjust users.
926 (sweep_vectors): Adjust processing of large vectors.
927 (allocate_vectorlike): Likewise.
928 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
929 Add easserts. Adjust XSETPVECTYPESIZE usage.
930 (allocate_buffer): Use BUFFER_PVEC_INIT.
931 (live_vector_p): Adjust to match large vector.
932 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
933 * buffer.h (struct buffer): Add next member.
934 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
935 New macros.
936 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
937 * fns.c (internal_equal): Adjust to match enum pvec_type change.
938 (copy_hash_table): Adjust to match vector header change.
939 * lread.c (defsubr): Use XSETPVECTYPE.
940 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
941 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
942 (xvecsize): New command.
943
944 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
945
946 * keyboard.c (event_to_kboard): Do not dereference
947 frame_or_window field of SELECTION_REQUEST_EVENT
948 and SELECTION_CLEAR_EVENT events (Bug#12814).
949 * xterm.h (struct selection_input_event): Adjust comment.
950
951 2012-11-07 Eli Zaretskii <eliz@gnu.org>
952
953 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
954 such as Scroll Lock, if the respective keys are treated as
955 function keys, not as modifiers. This avoids destroying non-ASCII
956 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
957
958 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
959
960 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
961
962 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
963
964 Restore some duplicate definitions (Bug#12814).
965 This undoes part of the 2012-11-03 changes. Some people build
966 with plain -g rather than with -g3, and they need the duplicate
967 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
968 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
969 Define as macros, as well as as enums or as constants.
970
971 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
972
973 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
974 to keypad keys (Bug#12816).
975
976 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
977
978 Minor adjustments of recently-changed frame functions.
979 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
980 known to be a frame (we're in the FRAMEP branch).
981 * lisp.h (Qframep): Remove decl. frame.h declares this.
982 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
983 since they're meant for Lisp fixnum values.
984
985 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
986
987 * window.c (Fwindow_combination_limit): Revert to the only
988 required argument and adjust docstring as suggested in
989 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
990 by Martin Rudalics <rudalics@gmx.at>.
991
992 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
993
994 Widely used frame validity and checking functions.
995 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
996 * frame.c (decode_live_frame, decode_any_frame): New functions.
997 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
998 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
999 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1000 (Fframe_pointer_visible_p): Use decode_any_frame.
1001 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1002 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1003 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1004 (Fframe_focus): Likewise. Allow zero number of arguments.
1005 Adjust docstring.
1006 (frame_buffer_list, frame_buffer_predicate): Remove.
1007 * lisp.h (frame_buffer_predicate): Remove prototype.
1008 * buffer.c (Fother_buffer): Use decode_any_frame.
1009 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1010 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1011 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1012 (Fclose_font, Ffont_info): Use decode_live_frame.
1013 * fontset.c (check_fontset_name): Likewise.
1014 * terminal.c (Fframe_terminal): Likewise.
1015 * w32fns.c (check_x_frame): Likewise.
1016 * window.c (Fminibuffer_window, Fwindow_at)
1017 (Fcurrent_window_configuration): Likewise.
1018 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1019 Likewise. Allow zero number of arguments. Adjust docstring.
1020 * dispnew.c (Fredraw_frame): Likewise.
1021 * xfaces.c (frame_or_selected_frame): Remove.
1022 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1023 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1024 (Fframe_face_alist): Use decode_live_frame.
1025 * xfns.c (check_x_frame): Likewise.
1026
1027 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1028
1029 * window.c (quad): New function.
1030 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1031 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1032 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1033 (Fwindow_line_height): Use it.
1034 (Fwindow_fringes): Use list3.
1035 (Fwindow_scroll_bars): Use list4.
1036 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1037 (Fwindow_combination_limit): Allow zero number of arguments.
1038
1039 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1040
1041 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1042
1043 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1044 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1045 file descriptor 2 for standard error. (Bug#12805)
1046
1047 2012-11-05 Chong Yidong <cyd@gnu.org>
1048
1049 * process.c (wait_reading_process_output): Revert previous change.
1050
1051 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1052
1053 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1054 This removes code that has been obsolete since around 1990.
1055 * callproc.c (Fcall_process):
1056 * emacs.c (main):
1057 * process.c (create_process):
1058 * term.c (dissociate_if_controlling_tty):
1059 Assume setsid exists.
1060 * callproc.c (child_setup): Assume setpgid exists and behaves as
1061 per POSIX.1-1988 or later.
1062 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1063 * emacs.c (shut_down_emacs):
1064 * sysdep.c (sys_suspend, init_foreground_group):
1065 Assume getpgrp behaves as per POSIX.1-1998 or later.
1066 * msdos.c (setpgrp): Remove.
1067 (tcgetpgrp, setpgid, setsid): New functions.
1068 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1069 * term.c (no_controlling_tty): Remove; unused.
1070 * w32proc.c (setpgrp): Remove.
1071 (setsid, tcgetpgrp): New functions.
1072
1073 Simplify by assuming __fpending.
1074 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1075 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1076 Do not assume that __fpending's result fits in int.
1077
1078 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1079
1080 Remove EMACS_OUTQSIZE+sleep hack.
1081 * dispnew.c (update_frame_1): Remove hack for terminals slower
1082 than 2400 bps, which throttled Emacs by having it sleep.
1083 This code hasn't worked since at least 2007, when the multi-tty stuff
1084 was added, and anyway those old terminals are long dead.
1085 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1086 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1087
1088 Fix data-loss with --version (Bug#9574).
1089 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1090 as we can't assume that emacs_strerror is initialized, and strerror
1091 is good enough here.
1092 (main): Invoke atexit earlier, to catch earlier instances of
1093 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1094
1095 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1096
1097 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1098 (keyDown): Remap keypad keys to X11 virtual key codes.
1099
1100 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1101
1102 Fix data-loss with --batch (Bug#9574).
1103 * emacs.c: Include <close-stream.h>.
1104 (close_output_streams): New function.
1105 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1106 and handles errors appropriately.
1107 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1108 does that now.
1109
1110 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1111 The symptom is a diagnostic "GLib-WARNING **: In call to
1112 g_spawn_sync(), exit status of a child process was requested but
1113 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1114 waitpid(), so exit status can't be returned." The diagnostic
1115 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1116 The real bug is a race condition between Emacs and glib: Emacs
1117 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1118 so that glib can't find it. Work around the bug by invoking
1119 waitpid only on subprocesses that Emacs itself creates.
1120 * process.c (create_process, record_child_status_change):
1121 Don't use special value -1 in pid field, as the caller now must
1122 know the pid rather than having the callee infer it.
1123 The inference was sometimes incorrect anyway, due to another race.
1124 (create_process): Set new 'alive' member if child is created.
1125 (process_status_retrieved): New function.
1126 (record_child_status_change): Use it.
1127 Accept negative 1st argument, which means to wait for the
1128 processes that Emacs already knows about. Move special-case code
1129 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1130 processes that have already been waited for, by testing and
1131 clearing new 'alive' member.
1132 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1133 now does this internally.
1134 (handle_child_signal): Let record_child_status_change do all
1135 the work, since we do not want to reap all exited child processes,
1136 only the child processes that Emacs itself created.
1137 * process.h (Lisp_Process): New boolean member 'alive'.
1138
1139 Omit duplicate definitions no longer needed with gcc -g3.
1140 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1141 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1142 Define only as macros. There's no longer any need to also define
1143 these symbols as enums or as constants, since we now assume
1144 gcc -g3 when debugging.
1145
1146 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1147
1148 * lisp.mk: Adjust comments to the fact that term/internal is now
1149 loaded from loadup.el.
1150
1151 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1152 (msdos_fatal_signal): New function.
1153 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1154 its argument list.
1155
1156 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1157 for GCC versions before 4.
1158 (emacs_raise): Define to call msdos_fatal_signal.
1159
1160 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1161 iterator when starting in the middle of a display or overlay
1162 string. (Bug#12745)
1163
1164 2012-11-03 Chong Yidong <cyd@gnu.org>
1165
1166 * process.c (wait_reading_process_output): Clean up the last
1167 change.
1168
1169 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1170
1171 * process.c (wait_reading_process_output): Avoid a race condition
1172 with SIGIO delivery (Bug#11536).
1173
1174 2012-11-03 Chong Yidong <cyd@gnu.org>
1175
1176 * buffer.c (cursor_type): Untabify docstring.
1177
1178 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1179
1180 * frame.h (struct frame): Drop can_have_scroll_bars member
1181 which is meaningless for a long time. Adjust comments.
1182 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1183 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1184
1185 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1186
1187 * window.c (decode_next_window_args): Update window arg after
1188 calling decode_live_window and so fix crash reported at
1189 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1190 by Juanma Barranquero <lekktu@gmail.com>.
1191 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1192 * font.c (Ffont_at): Likewise.
1193
1194 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1195
1196 * widget.c (resize_cb): New function.
1197 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1198 (EmacsFrameResize): Check if all is up to date before changing frame
1199 size.
1200
1201 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1202
1203 Implement backtrace output for fatal errors on MS-Windows.
1204 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1205 (BACKTRACE_LIMIT_MAX): New macro.
1206 (w32_backtrace): New function.
1207 (emacs_abort): Use w32_backtrace when the user chooses not to
1208 attach a debugger. Update the text of the abort dialog.
1209
1210 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1211
1212 Window-related stuff cleanup here and there.
1213 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1214 Use decode_any_window.
1215 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1216 * xdisp.c (Fformat_mode_line): Likewise.
1217 * font.c (Ffont_at): Use decode_live_window.
1218 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1219 * window.c (decode_next_window_args): Likewise.
1220 (decode_any_window): Remove static.
1221 * window.h (decode_any_window): Add prototype.
1222 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1223 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1224 respectively.
1225
1226 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 Remove pad from struct input_event.
1229 * termhooks.h (struct input_event): Remove padding field.
1230 Adjust comment.
1231 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1232 member is never cons for a long time. Adjust comment.
1233 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1234 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1235 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1236 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1237
1238 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1239
1240 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1241
1242 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1243
1244 Fix crash when using Emacs as commit editor for git (Bug#12697).
1245 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1246 and it is configured in conf_post.h.
1247 (Fcall_process): Don't invoke both setsid and setpgid; the former
1248 is enough, if it exists.
1249 * callproc.c (Fcall_process, child_setup):
1250 * process.c (create_process): Use setpgid.
1251 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1252 for the real thing.
1253 * dispnew.c (init_display): Initialize the foreground group
1254 if we are running a tty display.
1255 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1256 * lisp.h (init_foreground_group): New decl.
1257 * sysdep.c (inherited_pgroup): New static var.
1258 (init_foreground_group, tcsetpgrp_without_stopping)
1259 (narrow_foreground_group, widen_foreground_group): New functions.
1260 (init_sys_modes): Narrow foreground group.
1261 (reset_sys_modes): Widen foreground group.
1262
1263 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1264
1265 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1266
1267 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1268
1269 * minibuf.c (read_minibuf): Restore current buffer since
1270 choose_minibuf_frame calling Fset_frame_selected_window may
1271 change it (Bug#12766).
1272
1273 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1274
1275 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1276
1277 2012-10-30 Kenichi Handa <handa@gnu.org>
1278
1279 * font.c (Ffont_at): If WINDOW is specified and it is not
1280 displaying the current buffer, signal an error.
1281
1282 2012-10-29 Daniel Colascione <dancol@dancol.org>
1283
1284 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1285 In preparation for fixing bug#12739, move these functions from
1286 here...
1287
1288 * coding.h, coding.c: ... to here, and compile them only when
1289 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1290 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1291
1292 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1293
1294 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1295 (timer_loop, getitimer, setitimer): Use it instead of
1296 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1297 'clock'.
1298 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1299 literal 10000.
1300
1301 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1302
1303 * nsterm.m (NO_APPDEFINED_DATA): New define.
1304 (last_appdefined_event_data): New variable
1305 (last_appdefined_event): Remove.
1306 (ns_select): Initialize t from last_appdefined_event_data instead
1307 of [last_appdefined_event data1].
1308 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1309 remove last_appdefined_event (Bug#12698).
1310
1311 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1312
1313 * frame.c (x_set_font): Catch internal error.
1314
1315 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1316
1317 Avoid overflow in w32 implementation of interval timers.
1318 When possible, for ITIMER_PROF count only times the main thread
1319 actually executes.
1320 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1321 'volatile ULONGLONG' types. All the other data which was
1322 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1323 (GetThreadTimes_Proc): New typedef.
1324 (w32_get_timer_time): New function, returns a suitable time value
1325 for the timer.
1326 (timer_loop): Enter critical section when accessing ULONGLONG
1327 values of the itimer_data struct, as these accesses are no longer
1328 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1329 Remove unused variable.
1330 (init_timers): Initialize s_pfn_Get_Thread_Times.
1331 (start_timer_thread): Don't assign itimer->caller_thread here.
1332 (getitimer): Assign itimer->caller_thread here.
1333 (setitimer): Always call getitimer to get the value of ticks_now.
1334 (sys_spawnve): Avoid compiler warning about format mismatch.
1335
1336 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1337
1338 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1339 mouse movement events if the menu bar is active. This avoids
1340 producing a busy "hour-glass" cursor by Windows if the mouse
1341 pointer is positioned over a tooltip shown for some menu item.
1342
1343 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1344
1345 Don't assume process IDs fit in int.
1346 * emacs.c (shut_down_emacs) [!DOS_NT]:
1347 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1348 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1349 Use pid_t, not int, to store process IDs, as 'int'
1350 is not wide enough on a few platforms (e.g., AIX and IRIX).
1351
1352 2012-10-23 Kenichi Handa <handa@gnu.org>
1353
1354 The following change is to make face-font-rescale-alist work
1355 correctly for non-ASCII fonts.
1356
1357 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1358 (font_open_for_lface): Handle Vface_font_rescale_alist.
1359
1360 2012-10-23 Chong Yidong <cyd@gnu.org>
1361
1362 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1363
1364 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1365
1366 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1367 for screen font.
1368 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1369
1370 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1371 event (Bug#12681).
1372
1373 2012-10-21 Glenn Morris <rgm@gnu.org>
1374
1375 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1376
1377 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 Port to OpenBSD 5.1.
1380 * frame.c (Fmouse_position, Fmouse_pixel_position):
1381 * xdisp.c (produce_stretch_glyph):
1382 Declare local vars only when they're needed.
1383 This is clearer and avoids a warning on OpenBSD about unused vars.
1384 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1385 This is safer, and avoids OpenBSD warnings about unused vars.
1386 * keyboard.c (record_menu_key): Remove unnecessary decl.
1387 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1388 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1389 as our definition clashes with OpenBSD's.
1390 * xfaces.c (load_face_colors, check_lface_attrs)
1391 (get_lface_attributes_no_remap, get_lface_attributes)
1392 (lface_fully_specified_p, x_supports_face_attributes_p)
1393 (tty_supports_face_attributes_p, face_fontset, realize_face)
1394 (realize_x_face, realize_tty_face):
1395 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1396 merely Lisp_Object *. This is more informative and avoids
1397 a warning on OpenBSD about accessing beyond an object's size.
1398
1399 2012-10-20 Chong Yidong <cyd@gnu.org>
1400
1401 * lread.c (Fload): Doc fix (Bug#12592).
1402
1403 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1404
1405 * font.c (Ffont_at): Fix previous change.
1406
1407 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1408
1409 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1410 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1411 for the reasons.
1412
1413 * alloc.c (NSTATICS): Decrease to 0x800.
1414
1415 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1416
1417 * fns.c (Fnreverse): Include the problem element when signalling an
1418 error (bug#12677).
1419
1420 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1421
1422 * nsterm.m (ns_select): Check writefds before call to
1423 FD_ISSET (Bug#12668).
1424
1425 2012-10-18 Daniel Colascione <dancol@dancol.org>
1426
1427 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1428 (staticpro): If we run out of staticpro slots, die with an
1429 informative error instead of just calling emacs_abort.
1430
1431 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1432
1433 Fix two flaws reported by Dmitry Antipov.
1434 * window.c (Ftemp_output_buffer_show): Remove.
1435 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1436 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1437
1438 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1439
1440 * makefile.w32-in ($(BLD)/w32.$(O)):
1441 ($(BLD)/vm-limit.$(O)):
1442 ($(BLD)/term.$(O)):
1443 ($(BLD)/unexw32.$(O)):
1444 ($(BLD)/fileio.$(O)):
1445 ($(BLD)/dispnew.$(O)): Update dependencies.
1446
1447 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1448 Add prototypes.
1449
1450 * w32proc.c: Include ctype.h.
1451
1452 * w32.h (init_environment, check_windows_init_file)
1453 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1454 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1455 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1456 (sys_link): Add prototypes.
1457
1458 * w32.c: Include w32select.h.
1459 (sys_access, e_malloc, sys_select): Add prototypes.
1460 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1461
1462 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1463
1464 * unexw32.c: Include lisp.h and w32.h.
1465
1466 * term.c [WINDOWSNT]: Include w32term.h.
1467
1468 * process.c [WINDOWSNT]: Add prototype of sys_select.
1469
1470 * fileio.c [WINDOWSNT]: Include w32.h.
1471
1472 * dispnew.c [WINDOWSNT]: Include w32.h.
1473
1474 * cygw32.c (Fcygwin_convert_path_to_windows)
1475 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1476 Lisp_Object values. (Bug#12661)
1477
1478 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1479 to Lisp_Object. (Bug#12661)
1480
1481 2012-10-17 Kenichi Handa <handa@gnu.org>
1482
1483 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1484 invalidate.
1485
1486 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1487
1488 * buffer.c (Fkill_buffer): When unchaining the marker,
1489 reset its buffer pointer to NULL (Bug#12652).
1490
1491 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Do not verify indirection counters of killed buffers (Bug#12579).
1494 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1495 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1496
1497 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1498
1499 * alloc.c (Fmake_byte_code): Fix typo in comment.
1500 * print.c (print_interval): Define as static to match prototype.
1501 * indent.c (disptab_matches_widthtab, recompute_width_table):
1502 Convert to eassert.
1503
1504 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1505
1506 * editfns.c (get_system_name): Remove.
1507 * lisp.h (get_system_name): Remove prototype.
1508 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1509 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1510
1511 2012-10-15 Daniel Colascione <dancol@dancol.org>
1512
1513 * dbusbind.c: Add comment explaining reason for previous change.
1514
1515 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1516
1517 * window.c (Fwindow_end): Rewrite check whether cached position
1518 can be used (Bug#12600).
1519 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1520 Set windows_or_buffers_changed.
1521
1522 2012-10-15 Daniel Colascione <dancol@dancol.org>
1523
1524 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1525 enabled by undefining the symbol "interface", which the platform
1526 headers define to something incompatible.
1527
1528 2012-10-14 Daniel Colascione <dancol@dancol.org>
1529
1530 * image.c (init_tiff_functions, init_imagemagick_functions)
1531 (init_svg_functions): Fix cygw32 build break by using these
1532 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1533
1534 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1535
1536 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1537
1538 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1539
1540 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1541
1542 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1543
1544 * coding.c (detect_coding): Set coding->id before calling
1545 this->detector.
1546
1547 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1548
1549 * fileio.c: Formatting fixes.
1550
1551 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Fix some stat-related races.
1554 * fileio.c (Fwrite_region): Avoid race condition if a file is
1555 removed or renamed by some other process immediately after Emacs
1556 writes it but before Emacs stats it. Do not assume that stat (or
1557 fstat) succeeds.
1558 * image.c (slurp_file): Resolve the file name with fopen + fstat
1559 rather than stat + fopen.
1560 (pbm_read_file) [0]: Remove unused code with stat race.
1561 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1562 Remove ineffective code with stat race.
1563
1564 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1565
1566 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1567
1568 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1569
1570 * nsterm.m (hold_event_q): New static variable.
1571 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1572 ! q_event_ptr.
1573 (hold_event): New function.
1574 (ns_read_socket): If hold_event_q have events, store them and
1575 return (Bug#12384).
1576 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1577 is zero (Bug#12384).
1578
1579 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1580
1581 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1582
1583 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1584
1585 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1586
1587 * fileio.c (check_existing): New function.
1588 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1589 instead of calling 'stat', when what's needed is to check whether
1590 a file exists. This avoids expensive system calls on MS-Windows.
1591 (Bug#12587)
1592
1593 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1594
1595 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1596 determine whether a file exists and is not a directory.
1597
1598 * lisp.h (check_existing): Add prototype.
1599
1600 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1601
1602 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1603
1604 2012-10-12 Glenn Morris <rgm@gnu.org>
1605
1606 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1607
1608 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1609
1610 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1611
1612 * eval.c (Fautoload): Remember previous autoload status in load-history.
1613
1614 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1617 * lread.c (load_each_byte, new_backquote_flag, readchar)
1618 (read_filtered_event, lisp_file_lexically_bound_p)
1619 (safe_to_load_version, Fload, complete_filename_p, openp)
1620 (build_load_history, readevalloop, read_escape, read1)
1621 (string_to_number, read_vector, read_list):
1622 * macros.c (Fstart_kbd_macro):
1623 * marker.c (CONSIDER):
1624 * menu.c (parse_single_submenu, digest_single_submenu)
1625 (find_and_return_menu_selection, Fx_popup_menu):
1626 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1627 (Ftry_completion):
1628 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1629 (ns_menu_show):
1630 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1631 (xmenu_show, xdialog_show):
1632 Use bool for booleans.
1633 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1634 as it's not a predicate. All uses changed. Omit unnecessary
1635 buffer termination.
1636
1637 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1640 (save_excursion_restore): Do not restore mark if it was not saved.
1641
1642 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 * marker.c (cached_modiff): EMACS_INT, not int.
1645
1646 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1647 instead of having a wrong decl.
1648 * nsmenu.m (waiting_for_input): Remove wrong decl.
1649
1650 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 keyboard.c, keymap.c: Use bool for booleans.
1653 * dispnew.c (sit_for): Distinguish between 3-way display_option
1654 and boolean do_display.
1655 * keyboard.c (single_kboard, this_command_key_count_reset)
1656 (waiting_for_input, echoing, immediate_quit, input_pending)
1657 (interrupt_input, interrupts_deferred, pop_kboard)
1658 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1659 (command_loop_1, adjust_point_for_property)
1660 (safe_run_hooks_error, input_polling_used, read_char):
1661 (help_char_p, readable_events, kbd_buffer_events_waiting)
1662 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1663 (lucid_event_type_list_p, get_input_pending):
1664 (gobble_input, menu_separator_name_p, menu_bar_item)
1665 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1666 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1667 (keyremap_step, test_undefined, read_key_sequence)
1668 (detect_input_pending, detect_input_pending_ignore_squeezables)
1669 (detect_input_pending_run_timers, requeued_events_pending_p)
1670 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1671 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1672 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1673 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1674 (accessible_keymaps_1, Fkey_description, push_key_description):
1675 (shadow_lookup, struct where_is_internal_data)
1676 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1677 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1678 (describe_map, describe_vector):
1679 * menu.c (single_menu_item):
1680 * nsmenu.m (ns_update_menubar):
1681 * process.c (wait_reading_process_output):
1682 * search.c (scan_buffer, scan_newline):
1683 Use bool for boolean.
1684 * keyboard.c (timers_run, swallow_events)
1685 (detect_input_pending_run_timers):
1686 * process.c (wait_reading_process_output):
1687 Use unsigned for counter where wraparound-on-overflow is desired,
1688 since unsigned is guaranteed to have that behavior and signed is not.
1689 (read_char): Use ptrdiff_t for string length.
1690 (get_input_pending): Remove first argument, since it was always
1691 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1692 and behave as if it had that value. Return new value of
1693 input_pending. All callers changed.
1694 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1695 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1696 a string length.
1697 * keymap.c (push_key_description): Omit last arg, which was always 1.
1698 All callers changed.
1699
1700 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1701
1702 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1703
1704 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1705 ($(BLD)/term.$(O)): Update dependencies.
1706
1707 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1710 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1711 initializer for PVEC_NORMAL_VECTOR.
1712
1713 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1714
1715 Clean out old termopts cruft.
1716 * termopts.h (flow_control, meta_key): Remove unused decls.
1717 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1718 Don't include termopts.h.
1719
1720 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1721
1722 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1723
1724 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1725
1726 * commands.h (immediate_quit): Remove duplicate decl.
1727
1728 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1729
1730 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1731 caching.
1732 (nsfont_open): Remove setting of Vfonts_in_cache.
1733 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1734
1735 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1736
1737 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1738 match what GetLastError returns. Explain why the function is
1739 needed.
1740
1741 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1742 'is_tooltip_frame', to avoid confusion with its global namesake.
1743
1744 2012-10-08 Daniel Colascione <dancol@dancol.org>
1745
1746 * xdisp.c (start_hourglass): Call w32_note_current_window when
1747 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1748 build that caused Emacs to display the hourglass cursor forever.
1749
1750 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1751 which is broken under remote desktop, calculate the number of
1752 colors available for a display based on the display's number of
1753 planes and number of bits per pixel per plane. (bug#10397).
1754
1755 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1756
1757 * nsfont.m (Vfonts_in_cache): New variable.
1758 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1759 are used. Add cached fonts to Vfonts_in_cache.
1760 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1761
1762 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1763
1764 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1765 in nt/config.nt.
1766 (FONT_H): Define after FRAME_H.
1767 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1768 Update dependencies.
1769
1770 * w32term.c: Remove leftover declaration of keyboard_codepage.
1771
1772 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1773
1774 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1775 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1776 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1777 (GLOBAL_SOURCES): Add cygw32.c.
1778 ($(BLD)/unexw32.$(O)):
1779 ($(BLD)/w32.$(O)):
1780 ($(BLD)/w32console.$(O)):
1781 ($(BLD)/w32fns.$(O)):
1782 ($(BLD)/w32heap.$(O)):
1783 ($(BLD)/w32menu.$(O)):
1784 ($(BLD)/w32proc.$(O)): Add w32common.h.
1785
1786 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1787 'const char *'.
1788 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1789
1790 2012-10-08 Daniel Colascione <dancol@dancol.org>
1791
1792 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1793 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1794 accidental message numbering hole. Change other messages to
1795 match.
1796
1797 * w32select.h (HAVE_W32SELECT): Remove.
1798
1799 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1800 w32common.h instead of w32heap.h.
1801
1802 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1803 (get_allocation_unit, get_processor_type, get_w32_major_version)
1804 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1805 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1806 (OS_NT, os_subtype, cache_system_info): Move declarations to
1807 w32common.
1808
1809 * w32heap.c: Include w32common.h.
1810 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1811 (w32_minor_version, w32_build_number, w32_subtype):
1812 Remove duplicate definitions.
1813
1814 * w32fns.c: Include w32common.h; include w32heap.h only in
1815 WINDOWSNT.
1816
1817 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1818 Use `report_file_error' instead of `error' in order to better
1819 inform users of what went wrong. Increase NTGUI_UNICODE file
1820 dialog box file name length to 32k, the maximum allowed by the NT
1821 kernel.
1822
1823 * w32common.h: New file.
1824 (ROUND_UP, ROUND_DOWN, get_page_size)
1825 (get_allocation_unit, get_processor_type, get_w32_major_version)
1826 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1827 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1828 (OS_NT, os_subtype, cache_system_info): Move here.
1829
1830 * unexw32.c, unexcw.c: Include w32common.h.
1831
1832 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1833 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1834 to call syms_of_w32select.
1835
1836 * cygw32.h: Remove obsolete EXFUN declarations.
1837
1838 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1839
1840 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1841 of w32inevt.o from SOME_MACHINE_OBJECTS.
1842
1843 2012-10-08 Daniel Colascione <dancol@dancol.org>
1844
1845 * image.c: Permanent fix for JPEG compilation issue --- limit
1846 jpeglib `boolean' redefinition to Cygwin builds.
1847
1848 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1849
1850 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1851
1852 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1853 Cygwin.
1854
1855 2012-10-08 Daniel Colascione <dancol@dancol.org>
1856
1857 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1858 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1859 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1860 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1861 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1862 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1863 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1864 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1865 now a supported configuration.
1866
1867 * Makefile.in: consolidate image variables into LIBIMAGE; add
1868 W32_OBJ and W32_LIBS. Compile new files.
1869
1870 * conf_post.h:
1871 (_DebPrint) declare tracing facility for W32 debugging. We need
1872 to unify tracing later.
1873
1874 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1875 unconditional use of W32 Unicode functions. Cygwin runs only on
1876 100% Unicode operating systems.
1877
1878 * cygw32.c: New file. Define Cygwin-specific facilities.
1879 (Fcygwin_convert_path_to_windows)
1880 (Fcygwin_convert_path_from_windows): New user functions for
1881 accessing Cygwin path-munging routines.
1882
1883 * cygw32.h: New file.
1884 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1885 UTF-16LE strings temporarily inside non-Lisp-visible string
1886 objects.
1887
1888 (w32_strerror): Just what it says on the tin.
1889
1890 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1891 also run for Cygwin; both systems have the same problem with using
1892 GUI facilities in a forked child. Also call syms_of_cygw32,
1893 syms_of_w32select in correct places.
1894
1895 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1896 needs fork-then-exec for daemon launching.
1897
1898 * font.h: Include frame.h.
1899
1900 * image.c: Use the image library cache machinery only when we're
1901 compiling for native WINDOWSNT; Cygwin can use shared libraries
1902 like any other Unixlike system.
1903
1904 * keyboard.c: Clarify a comment regarding the input loop.
1905
1906 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1907 functions directly instead of trying to detect at runtime that our
1908 host operating system supports them. We make this change for two
1909 reasons: Cygwin lacks support for the multibyte character
1910 conversion functions used by the legacy menu code, and Cygwin
1911 never needs to rely on non-Unicode APIs.
1912
1913 * unexw32.c (hinst): Declare extern.
1914
1915 * w32.c: Change header order;
1916 (w32_strerror): Move to w32fns.c because we need it for
1917 non-WINDOWSNT builds.
1918
1919 * w32.h: Add #error macro to make sure we don't include w32.h for
1920 Cygwin builds. Remove w32select declarations.
1921
1922 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1923 w32fns.c. w32console.c is WINDOWSNT-only.
1924
1925 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1926 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1927 POSIXy alternative.
1928 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1929 (w32_major_version, w32_minor_version, w32_build_number)
1930 (os_subtype, sound_type): Define here
1931 (w32_defined_color): Make color parameter const for consistency
1932 with other _defined_color functions.
1933 (w32_createwindow): Unconditionally call w32_init_class instead of
1934 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1935 through the code is complex and unnecessary because class
1936 registration is practically free.
1937 (w32_name_of_message): New EMACSDEBUG-only function.
1938 (Fset_message_beep): Move here
1939 (Fx_open_connection): Require that the display name for Windows be
1940 "w32" for consistency, emacsclient disambiguation, and maybe, one
1941 day, multi-window-system support.
1942 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1943 Cygwin files for W32 GUI facilities, since these clearly don't
1944 expect Cygwin names.
1945 (_DebPrint): Define.
1946 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1947 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1948 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1949 (w32_last_error): Remove.
1950
1951 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1952
1953 * w32heap.c (syspage_mask): Declare here.
1954 (cache_system_info): Remove.
1955
1956 * w32inevt.c (faked_key): Define globally, not statically.
1957 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1958 (w32_console_toggle_lock_key): Move to w32fns.c.
1959
1960 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1961
1962 * w32proc.c (_DebPrint): Move to w32fns.c.
1963 * w32select.c: Include string.h, stdio.h for Cygwin.
1964 * w32select.h: New File.
1965
1966 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1967 get_osfhandle.
1968 (w32_message_fd): New variable. Under Cygwin, holds the file
1969 descriptor the system used to tell us about pending thread
1970 messages.
1971
1972 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1973 that prevented compilation under non-WINDOWSNT systems.
1974
1975 (w32_initialize): Open /dev/windows and assign it to
1976 w32_message_fd. Provide w32 feature.
1977
1978 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1979 (WM_EMACS_INPUT_READY): add.
1980 (prepend_msg, w32_message_fd): Declare globally.
1981
1982 * w32xfns.c:
1983 (keyboard_handle): Use only when WINDOWSNT.
1984 (notify_msg_ready): New function. Posts a message to the main
1985 thread's message queue under CYGWIN, which wakes up the main
1986 thread from select(2) by making the /dev/windows file descriptor
1987 ready. Under WINDOWSNT, it sets an event the same way the old
1988 code did.
1989
1990 (post, prepend_msg): Actually call notify_msg_ready instead of
1991 setting the input event directly.
1992
1993 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1994
1995 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1996 but it still has blocs in it, don't return it to the system,
1997 instead of aborting. (Bug#12402)
1998
1999 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2000
2001 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2002
2003 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2004 MAC_OS_X_VERSION_10_6.
2005 (syms_of_nsterm): Remove comment about Panther and above for
2006 ns-antialias-text.
2007 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2008 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2009 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2010
2011 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2012 MAC_OS_X_VERSION_10_4.
2013
2014 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2015 MAC_OS_X_VERSION_10_2.
2016
2017 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2018
2019 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2020 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2021
2022 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2023 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2024 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2025 Remove ns_in_resize check.
2026 (ns_clear_frame_area): Remove resize handle code.
2027
2028 * nsfns.m (ns_in_resize): Remove.
2029 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2030 Remove ns_in_resize check.
2031
2032 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 Improve sys_siglist detection.
2035 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2036 defined as a macro, as is done in Solaris.
2037 (sys_siglist_entries): New macro.
2038 (save_strsignal): Use it.
2039 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2040 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2041
2042 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2043
2044 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2045 fullscreen/Fullscreen.
2046
2047 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2048 tobar_height is new.
2049
2050 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2051 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2052 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2053 (windowDidResize:): Check for correct window if old style fullscreen.
2054 Capitalize word in comment. Remove incorrect comment.
2055 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2056 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2057 error in drawing background.
2058 (toggleFullScreen:): Remove comment. Rearrange calls.
2059 Set toolbar values to zero, save old height in tobar_height.
2060 Restore tool bar height when leaving fullscreen.
2061 (canBecomeMainWindow): New function.
2062
2063 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2064
2065 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2066
2067 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2068
2069 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2070
2071 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2072 that time stamps of directories could also be changed.
2073 Don't request the too broad GENERIC_WRITE, only the more restrictive
2074 FILE_WRITE_ATTRIBUTES access rights.
2075
2076 * fileio.c (Fset_file_times): Special-case ignoring errors for
2077 directories only on MSDOS, not on MS-Windows.
2078
2079 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2080
2081 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2082
2083 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2084
2085 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2086 see whether CreateFile failed.
2087
2088 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2089
2090 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2091 to avoid similar races.
2092 * keyboard.c (pending_signals): Now bool, not int.
2093
2094 Port timers to OpenBSD, plus check for timer failures.
2095 OpenBSD problem reported by Han Boetes.
2096 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2097 and/or setitimer.
2098 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2099 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2100 like OpenBSD, which has timer_settime but does not declare it.
2101 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2102 whether to use itimerspec-related primitives. All uses of
2103 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2104
2105 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2106
2107 * profiler.c (handle_profiler_signal): Fix a malloc race
2108 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2109
2110 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2111
2112 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2113
2114 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2115
2116 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2117 consistent with the change in return value of 'safe_strsignal'.
2118
2119 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 Prefer plain 'static' to 'static inline' (Bug#12541).
2122 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2123 (bidi_set_sor_type, bidi_push_embedding_level)
2124 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2125 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2126 (bidi_cache_search, bidi_cache_ensure_space)
2127 (bidi_cache_iterator_state, bidi_cache_find)
2128 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2129 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2130 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2131 Now 'static', not 'static inline'.
2132
2133 Count overruns when profiling; change units to ns.
2134 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2135 Give extra weight to samples after overruns, to attempt to count
2136 the time more accurately.
2137 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2138 the underlying primitives nominally do ns.
2139 (Fprofiler_cpu_start): Document the change. Mention that
2140 the sampling intervals are only approximate.
2141
2142 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2143
2144 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2145
2146 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2147 case for the special 0 coding-system.
2148
2149 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2150 (Fmake_overlay): Remove redundant tests.
2151 (fix_start_end_in_overlays): Remove redundant recentering.
2152
2153 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2154
2155 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2156 Update dependencies.
2157
2158 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2159
2160 Fix a malloc race condition involving strsignal.
2161 A signal can arrive in the middle of a malloc, and Emacs's signal
2162 handler can invoke strsignal, which can invoke malloc, which is
2163 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2164 Fix it by altering the signal handler so that it does not invoke
2165 strsignal.
2166 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2167 * process.c (status_message): Use const pointer, in case strsignal
2168 is #defined to safe_strsignal.
2169 * sysdep.c (sys_siglist, init_signals): Always define and
2170 initialize a substitute sys_siglist if the system does not define
2171 one, even if HAVE_STRSIGNAL.
2172 (safe_strsignal): Rename from strsignal. Always define,
2173 using sys_siglist. Return a const pointer.
2174 * syssignal.h (safe_strsignal): New decl.
2175 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2176
2177 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2178
2179 * w32proc.c (timer_loop): Fix code that waits for timer
2180 expiration, to avoid high CPU usage.
2181
2182 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2183
2184 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2185 (sweep_weak_table): Remove redundant prototypes.
2186
2187 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2188
2189 * emacs.c: Move the inclusion of TERM_HEADER after including
2190 windows.h on WINDOWSNT. This avoids compilation problems with
2191 MSVC.
2192
2193 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2194
2195 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2196 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2197 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2198 as the previous version used 'void *'.
2199
2200 * ralloc.c (ROUNDUP): Fix last change.
2201 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2202 'size_t'.
2203
2204 * w32proc.c <disable_itimers>: New static flag.
2205 (init_timers): Initialize it to zero, after creating the critical
2206 sections used by the timer threads.
2207 (term_timers): Set to 1 before deleting the critical sections.
2208 (getitimer, setitimer): If disable_itimers is non-zero, return an
2209 error indication without doing anything. Reported by Fabrice
2210 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2211 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2212 return results.
2213 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2214 support timers.
2215
2216 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2217 term_ntproc after all the other bookkeeping, to get timers working
2218 as long as possible.
2219
2220 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2221
2222 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2223 Suggested by Juri Linkov in
2224 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2225
2226 Prefer plain 'static' to 'static inline' (Bug#12541).
2227 With static functions, modern compilers inline pretty well by
2228 themselves; advice from programmers often hurts as much as it helps.
2229 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2230 this change shrinks the text size of the Emacs executable by 1.1%
2231 without affecting CPU significantly in my benchmark.
2232 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2233 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2234 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2235 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2236 (bset_auto_fill_function, bset_auto_save_file_format)
2237 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2238 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2239 (bset_cache_long_line_scans, bset_case_fold_search)
2240 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2241 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2242 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2243 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2244 (bset_header_line_format, bset_indicate_buffer_boundaries)
2245 (bset_indicate_empty_lines, bset_invisibility_spec)
2246 (bset_left_fringe_width, bset_major_mode, bset_mark)
2247 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2248 (bset_name, bset_overwrite_mode, bset_pt_marker)
2249 (bset_right_fringe_width, bset_save_length)
2250 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2251 (bset_scroll_up_aggressively, bset_selective_display)
2252 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2253 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2254 (set_buffer_overlays_after):
2255 * category.c (bset_category_table):
2256 * charset.c (read_hex):
2257 * coding.c (produce_composition, produce_charset)
2258 (handle_composition_annotation, handle_charset_annotation)
2259 (char_encodable_p):
2260 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2261 (assign_row, set_frame_matrix_frame, make_current)
2262 (add_row_entry):
2263 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2264 * fns.c (maybe_resize_hash_table):
2265 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2266 * gmalloc.c (register_heapinfo):
2267 * image.c (lookup_image_type):
2268 * intervals.c (set_interval_object, set_interval_left)
2269 (set_interval_right, copy_interval_parent, rotate_right)
2270 (rotate_left, balance_possible_root_interval):
2271 * keyboard.c (kset_echo_string, kset_kbd_queue)
2272 (kset_keyboard_translate_table, kset_last_prefix_arg)
2273 (kset_last_repeatable_command, kset_local_function_key_map)
2274 (kset_overriding_terminal_local_map, kset_real_last_command)
2275 (kset_system_key_syms, clear_event, set_prop):
2276 * lread.c (digit_to_number):
2277 * marker.c (attach_marker, live_buffer, set_marker_internal):
2278 * nsterm.m (ns_compute_glyph_string_overhangs):
2279 * process.c (pset_buffer, pset_command)
2280 (pset_decode_coding_system, pset_decoding_buf)
2281 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2282 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2283 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2284 * syntax.c (bset_syntax_table, dec_bytepos):
2285 * terminal.c (tset_param_alist):
2286 * textprop.c (interval_has_some_properties)
2287 (interval_has_some_properties_list):
2288 * window.c (wset_combination_limit, wset_dedicated)
2289 (wset_display_table, wset_hchild, wset_left_fringe_width)
2290 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2291 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2292 (wset_right_fringe_width, wset_right_margin_cols)
2293 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2294 (wset_vertical_scroll_bar_type, wset_window_parameters):
2295 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2296 (wset_column_number_displayed, wset_region_showing)
2297 (window_box_edges, run_window_scroll_functions)
2298 (append_glyph_string_lists, prepend_glyph_string_lists)
2299 (append_glyph_string, set_glyph_string_background_width)
2300 (append_glyph, append_composite_glyph)
2301 (take_vertical_position_into_account):
2302 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2303 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2304 (lface_hash, lface_same_font_attributes_p, lookup_face):
2305 * xml.c (libxml2_loaded_p):
2306 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2307 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2308 Now 'static', not 'static inline'.
2309
2310 * bidi.c: Tune.
2311 (bidi_copy_it): Do the whole copy with a single memcpy.
2312 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2313
2314 Revert the FOLLOW-SYMLINKS change for file-attributes.
2315 Doing it right would require several changes to Tramp, and there's
2316 not enough time to get that tested before the freeze today.
2317 * dired.c (directory_files_internal, Ffile_attributes):
2318 Undo last change.
2319
2320 * frame.c (x_report_frame_params): Port better to wider ints.
2321 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2322 or that pointers can be printed in 15 decimal digits.
2323 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2324
2325 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2326
2327 Support x64 build on MS-Windows.
2328 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2329 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2330 compatibility with x64.
2331 (x_get_focus_frame): Add prototype.
2332
2333 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2334 defining an XRectangle structure.
2335
2336 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2337 arithmetics for compatibility with x64.
2338
2339 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2340 compatibility with x64.
2341
2342 * w32heap.h: Adjust prototypes and declarations.
2343
2344 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2345 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2346 DWORD, long, and unsigned long, for compatibility with x64.
2347 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2348 (sbrk): Argument is now of type ptrdiff_t.
2349
2350 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2351 less than 0x0500.
2352 (w32_msg_pump): Use WPARAM type for 'result'.
2353
2354 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2355 architecture.
2356 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2357 compatibility with x64.
2358
2359 * vm-limit.c (lim_data): Now size_t.
2360 (check_memory_limits): Adjust prototypes of real_morecore and
2361 __morecore to receive argument of type ptrdiff_t. Use size_t for
2362 five_percent and data_size.
2363
2364 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2365 variables, for compatibility with x64.
2366 (rva_to_section, offset_to_section, relocate_offset)
2367 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2368 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2369 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2370 for compatibility with x64.
2371
2372 * sysdep.c (STDERR_FILENO): Define if not already defined.
2373
2374 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2375 (__morecore): Argument type is now ptrdiff_t.
2376 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2377 (relinquish): Use ptrdiff_t type for 'excess'.
2378 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2379
2380 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2381 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2382 instead of a literal number.
2383
2384 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2385 (min): Define only if not already defined.
2386
2387 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2388 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2389 hosts.
2390
2391 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2392 'bitmaps' is a pointer.
2393
2394 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2395
2396 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2397
2398 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2399
2400 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2401 * dired.c (directory_files_internal, Ffile_attributes):
2402 New arg follow_symlinks. All uses changed.
2403
2404 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2405
2406 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2407
2408 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2409
2410 Support atimers and CPU profiler via profile.c on MS-Windows.
2411 * w32proc.c (sig_mask, crit_sig): New static variables.
2412 (sys_signal): Support SIGALRM and SIGPROF.
2413 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2414 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2415 sigfillset, and sigprocmask are no longer no-ops.
2416 (sigismember): New function.
2417 (struct itimer_data): New definition.
2418 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2419 (crit_prof): New static variables.
2420 (MAX_SINGLE_SLEEP): New definition.
2421 (timer_loop, stop_timer_thread, term_timers, init_timers)
2422 (start_timer_thread, getitimer, setitimer): New functions.
2423 (alarm): No longer a no-op, calls setitimer.
2424
2425 * w32.c (term_ntproc): Call term_timers.
2426 (init_ntproc): Make sure all signals are unblocked at startup, to
2427 erase any traces of dumping. Call init_timers.
2428
2429 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2430 Windows-specific code to display the hourglass mouse pointer is no
2431 longer used.
2432 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2433 to hourglass timer expiration.
2434 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2435 Remove, no longer used.
2436 (w32_note_current_window, show_hourglass, hide_hourglass):
2437 New functions, in support of hourglass cursor display similar to other
2438 window systems.
2439 (syms_of_w32fns): Don't initialize hourglass_timer.
2440
2441 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2442 WINDOWSNT as well.
2443 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2444
2445 * w32.h (init_timers, term_timers): Add prototypes.
2446
2447 2012-09-30 Kenichi Handa <handa@gnu.org>
2448
2449 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2450 to the buffer relocation which may be caused by ccl_driver.
2451
2452 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2453
2454 * xfns.c (Fx_file_dialog): Update comment.
2455
2456 * w32fns.c (Fx_file_dialog): Update comment.
2457
2458 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2459 Initialize panel name field if OSX >= 10.6.
2460
2461 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2462
2463 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2464
2465 * nsterm.m (NEW_STYLE_FS): New define.
2466 (ns_fullscreen_hook, windowWillEnterFullScreen)
2467 (windowDidEnterFullScreen, windowWillExitFullScreen)
2468 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2469 (setFSValue): New functions.
2470 (EmacsFSWindow): New implementation.
2471 (canBecomeKeyWindow): New function for EmacsFSWindow.
2472 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2473 (dealloc): Release nonfs_window if in fullscreen.
2474 (updateFrameSize:): Call windowDidMove to update top/left.
2475 (windowWillResize:toSize:): Check if frame is still maximized.
2476 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2477 next_maximized, maximized_width, maximized_height and nonfs_window.
2478 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2479 tbar_height.
2480 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2481 fullscreen. Set maximized_width/height. Act on next_maximized.
2482
2483 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2484 (EmacsView): Add variables for fullscreen.
2485 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2486 (EmacsFSWindow): New interface for fullscreen.
2487
2488 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2489
2490 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2491
2492 2012-09-30 Chong Yidong <cyd@gnu.org>
2493
2494 * fns.c (Frandom): Doc fix.
2495
2496 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2497
2498 * window.c (Vwindow_combination_limit): New default value.
2499 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2500
2501 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2502
2503 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2504 Suggested by Eli Zaretskii in
2505 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2506
2507 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2508
2509 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2510 HAVE_TIMER_SETTIME is defined.
2511
2512 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2513
2514 Profiler improvements: more-accurate timers, overflow checks.
2515 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2516 signal.h, setjmp.h. Include systime.h instead.
2517 (saturated_add): New function.
2518 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2519 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2520 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2521 New static vars.
2522 (enum profiler_cpu_running): New enum.
2523 (profiler_cpu_running): Now of that enum type, not bool.
2524 All uses changed to store the new value.
2525 (handle_profiler_signal): Rename from sigprof_handler_1,
2526 for consistency with other handlers. Do not check whether
2527 cpu_log is a hash-table if garbage collecting, since it
2528 doesn't matter in that case.
2529 (deliver_profiler_signal): Rename from sigprof_handler,
2530 for consistency with other handlers.
2531 (setup_cpu_timer): New function, with much of what used to be in
2532 Fprofiler_cpu_start. Check for out-of-range argument.
2533 Prefer timer_settime if available, and prefer
2534 thread cputime clocks, then process cputime clocks, then
2535 monotonic clocks, to the old realtime clock. Use make_timeval
2536 to round more-correctly when falling back to setitimer.
2537 (Fprofiler_cpu_start): Use it.
2538 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2539 Don't assume that passing NULL as the 2nd argument of setitimer
2540 is the same as passing a pointer to all-zero storage.
2541 Ignore SIGPROF afterwards.
2542 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2543 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2544 non-fatal signal handlers. Ignore SIGPROF on startup.
2545 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2546 in profiler.c, since sysdep.c now uses it.
2547
2548 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2549 Suggested by Eli Zaretskii in
2550 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2551
2552 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2553
2554 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2555
2556 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2557
2558 * lisp.h (struct backtrace): Remove indirection for `function' field.
2559 * xdisp.c (redisplay_internal):
2560 * profiler.c (record_backtrace, sigprof_handler_1):
2561 * alloc.c (Fgarbage_collect):
2562 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2563 (Fbacktrace_frame): Adjust accordingly.
2564
2565 2012-09-28 Glenn Morris <rgm@gnu.org>
2566
2567 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2568 (Frun_hook_with_args_until_failure): Doc fixes.
2569
2570 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2571
2572 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2573 Qautomatic_redisplay and change the symbol name. All users changed.
2574
2575 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2576
2577 * profiler.c (sigprof_handler): Fix race condition.
2578
2579 2012-09-28 Glenn Morris <rgm@gnu.org>
2580
2581 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2582
2583 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2584
2585 Check more robustly for timer_settime.
2586 * Makefile.in (LIB_TIMER_TIME): New macro.
2587 (LIBES): Add it.
2588 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2589 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2590 call timer_settime.
2591
2592 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2593
2594 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2595
2596 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2597
2598 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2599
2600 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2601
2602 * character.h (MAYBE_UNIFY_CHAR): Remove.
2603 * charset.c, charset.h (maybe_unify_char): Now static.
2604 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2605 Since this stuff is now private to charset.c, there's no need for
2606 a public macro and no need to inline by hand.
2607
2608 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2609 Stefan Monnier <monnier@iro.umontreal.ca>
2610 Juanma Barranquero <lekktu@gmail.com>
2611
2612 * profiler.c: New file.
2613 * Makefile.in (base_obj): Add profiler.o.
2614 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2615 ($(BLD)/profiler.$(O)): New target.
2616 * emacs.c (main): Call syms_of_profiler.
2617 * alloc.c (Qautomatic_gc): New constant.
2618 (MALLOC_PROBE): New macro.
2619 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2620 (total_bytes_of_live_objects): New function.
2621 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2622 Call malloc_probe for the memory profiler.
2623 (syms_of_alloc): Define Qautomatic_gc.
2624 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2625 race condition.
2626 (struct backtrace): Move definition...
2627 * lisp.h (struct backtrace): ..here.
2628 (Qautomatic_gc, profiler_memory_running): Declare vars.
2629 (malloc_probe, syms_of_profiler): Declare functions.
2630 * xdisp.c (Qautomatic_redisplay): New constant.
2631 (redisplay_internal): Record itself in backtrace_list.
2632 (syms_of_xdisp): Define Qautomatic_redisplay.
2633
2634 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2635 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2636
2637 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2638
2639 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2640
2641 Prefer POSIX timers if available.
2642 They avoid a race if the timer is too close to the current time.
2643 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2644 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2645 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2646
2647 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2648
2649 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2650 CHAR_STRING_ADVANCE.
2651 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2652 STRING_CHAR_ADVANCE.
2653
2654 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2655
2656 Move Vlibrary_cache to emacs.c and reset before dumping.
2657
2658 * lisp.h (reset_image_types): Declare.
2659 [WINDOWSNT] (Vlibrary_cache): Declare.
2660
2661 * image.c (reset_image_types): New function.
2662
2663 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2664 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2665 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2666
2667 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2668 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2669
2670 * w32.h (Vlibrary_cache): Do not declare.
2671
2672 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2673
2674 * w32proc.c (sys_signal): Handle all signals defined by the
2675 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2676 handlers for signals supported by Windows. Don't override
2677 term_ntproc as the handler for SIGABRT.
2678 (sigaction): Rewrite to call sys_signal instead of duplicating its
2679 code.
2680 (sys_kill): Improve commentary.
2681
2682 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2683 consistency with a signature of a signal handler. All callers
2684 changed.
2685 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2686 install term_ntproc as a signal handler for SIGABRT, as that
2687 should be done by the dumped Emacs.
2688
2689 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2690
2691 * w32select.c (term_w32select): Protect against repeated
2692 invocation by setting clipboard_owner to NULL after calling
2693 DestroyWindow.
2694
2695 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2696 and term_ntproc to their modified signatures.
2697
2698 * character.c (char_string, string_char): Remove calls to
2699 MAYBE_UNIFY_CHAR. See the discussion starting at
2700 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2701 for the details.
2702
2703 2012-09-25 Chong Yidong <cyd@gnu.org>
2704
2705 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2706
2707 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2708
2709 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2710 when encountering an unknown bytecode.
2711
2712 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2713
2714 image.c, indent.c: Use bool for booleans.
2715 * dispextern.h (struct image_type): Members valid_p, load, init
2716 now return bool, not int. All uses changed.
2717 * image.c: Omit unnecessary static decls.
2718 (x_create_bitmap_mask, x_build_heuristic_mask):
2719 Return void, not int, since callers don't care about the return value.
2720 (x_create_bitmap_mask, define_image_type, valid_image_p)
2721 (struct image_keyword, parse_image_spec, image_spec_value)
2722 (check_image_size, image_background)
2723 (image_background_transparent, x_clear_image_1)
2724 (postprocess_image, lookup_image, x_check_image_size)
2725 (x_create_x_image_and_pixmap, xbm_image_p)
2726 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2727 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2728 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2729 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2730 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2731 (png_image_p, init_png_functions, png_load_body, png_load)
2732 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2733 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2734 (init_gif_functions, gif_load, imagemagick_image_p)
2735 (imagemagick_load_image, imagemagick_load, svg_image_p)
2736 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2737 (gs_load):
2738 * nsimage.m (ns_load_image):
2739 * nsterm.m (ns_defined_color):
2740 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2741 * xfns.c (x_defined_color):
2742 * xterm.c (x_alloc_lighter_color_for_widget)
2743 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2744 (x_alloc_lighter_color):
2745 * indent.c (disptab_matches_widthtab, current_column)
2746 (scan_for_column, string_display_width, indented_beyond_p)
2747 (compute_motion, vmotion, Fvertical_motion):
2748 Use bool for booleans.
2749
2750 2012-09-24 Chong Yidong <cyd@gnu.org>
2751
2752 * chartab.c (Fset_char_table_default): Obsolete function removed.
2753
2754 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2755
2756 Move pid_t related decls out of lisp.h.
2757 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2758 (interruptible_wait_for_termination):
2759 Move these decls from lisp.h to syswait.h, since they use pid_t.
2760 Needed on FreeBSD; see Herbert J. Skuhra in
2761 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2762 * callproc.c: Include syswait.h.
2763
2764 gnutls.c, gtkutil.c: Use bool for boolean.
2765 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2766 (emacs_gnutls_handle_error):
2767 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2768 (xg_hide_tooltip, xg_create_frame_widgets)
2769 (create_dialog, xg_uses_old_file_dialog)
2770 (xg_get_file_with_chooser, xg_get_file_with_selection)
2771 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2772 (xg_item_label_same_p, xg_update_menubar)
2773 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2774 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2775 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2776 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2777 (update_frame_tool_bar, free_frame_tool_bar):
2778 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2779 * nsmenu.m (ns_update_menubar):
2780 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2781 * xfns.c (Fx_show_tip) [USE_GTK]:
2782 Use bool for boolean.
2783 * gtkutil.c (xg_update_frame_menubar):
2784 * xmenu.c (update_frame_menubar):
2785 Return void, not int, since caller ignores return value.
2786 * gtkutil.c (xg_change_toolbar_position):
2787 Return void, not 1.
2788
2789 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2790
2791 * makefile.w32-in (BLOCKINPUT_H): Remove.
2792 (SYSSIGNAL_H): New macro.
2793 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2794 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2795 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2796 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2797 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2798 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2799 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2800 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2801 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2802 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2803 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2804 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2805 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2806 ($(BLD)/w32xfns.$(O)): Update dependencies.
2807
2808 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2809
2810 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2811 fatal_error_backtrace.
2812
2813 * w32proc.c (sys_kill): Undo last change: don't do anything when
2814 invoked to deliver SIGABRT to our own process. This is now
2815 handled by emacs_raise.
2816
2817 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2818
2819 * w32term.c (w32_read_socket): Remove leftover reference to
2820 interrupt_input_pending.
2821
2822 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2823
2824 Do not use SA_NODEFER.
2825 Problem reported by Dani Moncayo in
2826 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2827 * alloc.c (die):
2828 * sysdep.c (emacs_abort): Do not reset signal handler.
2829 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2830 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2831 wanted even on POSIXish hosts, and it doesn't work on Windows.
2832
2833 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2834
2835 * xterm.c (x_term_init): Call fixup_locale before and after calling
2836 gtk_init (Bug#12392).
2837
2838 2012-09-23 Chong Yidong <cyd@gnu.org>
2839
2840 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2841 Vdynamic_library_alist.
2842
2843 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2844 (Fgnutls_available_p): Caller changed.
2845
2846 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2847 (Flibxml_parse_xml_region): Likewise.
2848
2849 * dispextern.h (struct image_type): Remove arg from init function.
2850
2851 * image.c (Finit_image_library, lookup_image_type)
2852 (define_image_type): Remove now-unneeded second arg.
2853 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2854 (init_tiff_functions, init_gif_functions, init_svg_functions):
2855 Arglist and w32_delayed_load calling convention changed.
2856 (gs_type): Remove init_gs_functions; there is no such function.
2857 (valid_image_p, make_image): Fix caller to lookup_image_type.
2858
2859 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 Simplify and avoid signal-handling races (Bug#12471).
2862 * alloc.c (die):
2863 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2864 Avoid recursive loop if there's a fatal error in the function itself.
2865 * atimer.c (pending_atimers):
2866 * blockinput.h: Don't include "atimer.h"; no longer needed.
2867 (interrupt_input_pending): Remove. All uses removed.
2868 pending_signals now counts both atimers and ordinary interrupts.
2869 This is less racy than having three separate pending-signal flags.
2870 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2871 (input_blocked_p):
2872 Rename from their upper-case counterparts BLOCK_INPUT,
2873 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2874 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2875 This makes it easier to access volatile variables more accurately.
2876 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2877 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2878 that's more reliable if the code is buggy and sets
2879 interrupt_input_blocked to a negative value. All uses changed.
2880 * atimer.c (deliver_alarm_signal):
2881 Remove. No need to deliver this to the parent; any thread can
2882 handle this signal now. All uses replaced by underlying handler.
2883 * atimer.c (turn_on_atimers):
2884 * dispnew.c (handle_window_change_signal):
2885 * emacs.c (handle_danger_signal):
2886 * keyboard.c (kbd_buffer_get_event):
2887 Don't reestablish signal handler; not needed with sigaction.
2888 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2889 (UNBLOCK_INPUT_TO):
2890 Rework to avoid unnecessary accesses to volatile variables.
2891 (UNBLOCK_INPUT_TO): Now a function.
2892 (totally_unblock_input, unblock_input): New decls.
2893 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2894 (init_data): Remove. Necessary stuff now done in init_signal.
2895 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2896 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2897 (fatal_error_code): Remove; no longer needed.
2898 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2899 it doesn't always backtrace. All uses changed. No need to reset
2900 signal to default, since sigaction and/or die does that for us now.
2901 Use emacs_raise (FOO), not kill (getpid (), FOO).
2902 (main): Check more-accurately whether we're dumping.
2903 Move fatal-error setup to sysdep.c
2904 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2905 * gtkutil.c (xg_get_file_name, xg_get_font):
2906 Remove no-longer-needed signal-mask manipulation.
2907 * keyboard.c, process.c (POLL_FOR_INPUT):
2908 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2909 * keyboard.c (read_avail_input): Remove.
2910 All uses replaced by gobble_input.
2911 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2912 (kbd_buffer_store_event_hold, gobble_input):
2913 (record_asynch_buffer_change) [USABLE_SIGIO]:
2914 (store_user_signal_events):
2915 No need to mess with signal mask.
2916 (gobble_input): If blocking input and there are terminals, simply
2917 set pending_signals to 1 and return. All hooks changed to not
2918 worry about whether input is blocked.
2919 (process_pending_signals): Clear pending_signals before processing
2920 them, in case a signal comes in while we're processing.
2921 By convention callers now test pending_signals before calling us.
2922 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2923 New functions, to support changes to blockinput.h.
2924 (handle_input_available_signal): Now extern.
2925 (reinvoke_input_signal): Remove. All uses replaced by
2926 handle_async_input.
2927 (quit_count): Now volatile, since a signal handler uses it.
2928 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2929 All callers changed. Block SIGINT only if not already blocked.
2930 Clear sigmask reliably, even if Fsignal returns, which it can.
2931 Omit unnecessary accesses to volatile var.
2932 (quit_throw_to_read_char): No need to restore sigmask.
2933 * keyboard.c (gobble_input, handle_user_signal):
2934 * process.c (wait_reading_process_output):
2935 Call signal-handling code rather than killing ourselves.
2936 * lisp.h: Include <float.h>, for...
2937 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2938 (pending_signals): Now volatile.
2939 (syms_of_data): Now const if IEEE floating point.
2940 (handle_input_available_signal) [USABLE_SIGIO]:
2941 (terminate_due_to_signal, record_child_status_change): New decls.
2942 * process.c (create_process): Avoid disaster if memory is exhausted
2943 while we're processing a vfork, by tightening the critical section
2944 around the vfork.
2945 (send_process_frame, process_sent_to, handle_pipe_signal)
2946 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2947 ignores SIGPIPE.
2948 (send_process): No need for setjmp/longjmp any more, since the
2949 SIGPIPE stuff is now gone. Instead, report an error if errno
2950 is EPIPE.
2951 (record_child_status_change): Now extern. PID and W are now args.
2952 Return void, not bool. All callers changed.
2953 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2954 Remove. All uses removed. This bug should be fixed now in a
2955 different way.
2956 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2957 and record the child status change directly. This avoids the
2958 need to futz with the signal mask.
2959 (process_fatal_action): Move here from emacs.c.
2960 (emacs_sigaction_flags): New function, containing
2961 much of what used to be in emacs_sigaction_init.
2962 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2963 caught by emacs, to make races less likely.
2964 (deliver_process_signal): Rename from handle_on_main_thread.
2965 All uses changed.
2966 (BACKTRACE_LIMIT_MAX): Now at top level.
2967 (thread_backtrace_buffer, threadback_backtrace_pointers):
2968 New static vars.
2969 (deliver_thread_signal, deliver_fatal_thread_signal):
2970 New functions, for more-accurate delivery of thread-specific signals.
2971 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2972 (deliver_arith_signal): Handle in this thread, not
2973 in the main thread, since it's triggered by this thread.
2974 (maybe_fatal_sig): New function.
2975 (init_signals): New arg DUMPING so that we can be more accurate
2976 about whether we're dumping. Caller changed.
2977 Treat thread-specific signals differently from process-general signals.
2978 Block all signals while handling fatal error; that's safer.
2979 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2980 on IEEE hosts.
2981 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2982 Ignore SIGPIPE unless batch.
2983 (emacs_backtrace): Output backtrace for the appropriate thread,
2984 which is not necessarily the main thread.
2985 * syssignal.h: Include <stdbool.h>.
2986 (emacs_raise): New macro.
2987 * xterm.c (x_connection_signal): Remove; no longer needed
2988 now that we use sigaction.
2989 (x_connection_closed): No need to mess with sigmask now.
2990 (x_initialize): No need to reset SIGPIPE handler here, since
2991 init_signals does this for us now.
2992
2993 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2994
2995 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2996 background rect may be larger (Bug#12245).
2997
2998 2012-09-23 Chong Yidong <cyd@gnu.org>
2999
3000 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3001
3002 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3003
3004 * .gdbinit: Just stop at fatal_error_backtrace.
3005 See Stefan Monnier's request in
3006 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3007 Remove no-longer-used query of system type.
3008
3009 2012-09-22 Chong Yidong <cyd@gnu.org>
3010
3011 * search.c (Freplace_match): Doc fix (Bug#12325).
3012
3013 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3014
3015 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3016 (Fline_end_position): Doc fix.
3017
3018 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3019
3020 2012-09-22 Chong Yidong <cyd@gnu.org>
3021
3022 * dispextern.h (struct image_type): Add new slot, storing a type
3023 initialization function.
3024
3025 * image.c (define_image_type): Call the image initializer function
3026 if it is defined. Arguments and return value changed.
3027 (valid_image_p, make_image): Callers changed.
3028 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3029 (gif_type, imagemagick_type, svg_type, gs_type):
3030 Add initialization functions.
3031 (Finit_image_library): Call lookup_image_type.
3032 (CHECK_LIB_AVAILABLE): Macro deleted.
3033 (lookup_image_type): Call define_image_type here, rather than via
3034 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3035 (syms_of_image): Move define_image_type calls for xbm_type and
3036 pbm_type to lookup_image_type.
3037
3038 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3039
3040 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3041 'idle_timers' from here ...
3042 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3043 lists, to avoid infloops when the timer does something stupid,
3044 like reinvoke itself with the same or smaller time-out.
3045 (Bug#12447)
3046
3047 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3048
3049 * window.c (Fsplit_window_internal): Handle only Qt value of
3050 Vwindow_combination_limit separately.
3051 (Qtemp_buffer_resize): New symbol.
3052 (Vwindow_combination_limit): New default value.
3053 Rewrite doc-string.
3054
3055 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3056
3057 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3058 the new overlay string. (Bug#10159)
3059
3060 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3063 or that fprintf is async-signal-safe. POSIX doesn't require
3064 either assumption.
3065
3066 2012-09-22 Chong Yidong <cyd@gnu.org>
3067
3068 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3069 (Bug#8207).
3070
3071 2012-09-22 Kenichi Handa <handa@gnu.org>
3072
3073 * composite.c (composition_reseat_it): Handle the case that a
3074 grapheme cluster is not covered by a single font (Bug#12352).
3075
3076 2012-09-21 Chong Yidong <cyd@gnu.org>
3077
3078 * image.c (define_image_type): Avoid adding duplicate types to
3079 image_types (Bug#12463). Suggested by Jörg Walter.
3080
3081 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3082
3083 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3084 (print_load_command_name): Add case LC_DATA_IN_CODE.
3085 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3086
3087 2012-09-21 Glenn Morris <rgm@gnu.org>
3088
3089 * eval.c (Frun_hook_with_args_until_success)
3090 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3091
3092 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3093
3094 * fileio.c (Ffile_selinux_context): Only call freecon when
3095 lgetfilecon succeeded.
3096 (Fset_file_selinux_context): Likewise. (Bug#12444)
3097
3098 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3099
3100 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3101 reordering, locate the cursor by calling set_cursor_from_row; if
3102 that fails, clear the desired glyph matrix before returning a
3103 failure indication to the caller. Fixes leaving garbled display
3104 when fast scrolling with a down-key. (Bug#12403)
3105 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3106 scrolling through multibyte text.
3107
3108 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3109
3110 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3111 calling mark_vectorlike since that's the one that marks the window.
3112 (mark_discard_killed_buffers): Mark the final cdr.
3113 * window.h (struct window): Move prev/next_buffers to the
3114 non-standard fields.
3115 * window.c (make_window): Initialize prev/next_buffers manually.
3116
3117 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3118
3119 Omit unused arg EXPECTED from socket hooks.
3120 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3121 * nsterm.m (ns_term_init):
3122 * termhooks.h (struct terminal.read_socket_hook):
3123 * w32inevt.c (w32_console_read_socket):
3124 * w32term.c (w32_read_socket):
3125 * xterm.c (XTread_socket):
3126 Omit unused arg EXPECTED. All callers changed.
3127 (store_user_signal_events): Return void, not int, since callers no
3128 longer care about the return value. All uses changed.
3129
3130 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3131
3132 * w32gui.h (XParseGeometry): Do not declare.
3133
3134 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3135
3136 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3137 Ignore 'expected'. See Eli Zaretskii in
3138 <http://bugs.gnu.org/12471#8> (last line).
3139
3140 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3141 (XParseGeometry): Now static. Substitute extremal values for
3142 values that are out of range.
3143
3144 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3145
3146 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3147
3148 * nsfns.m (XParseGeometry): Remove.
3149 (Fx_create_frame): Call x_set_offset to correctly interpret
3150 top_pos in geometry.
3151
3152 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3153 (Fx_parse_geometry): If there is a space in string, call
3154 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3155
3156 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3157
3158 * search.c (scan_buffer): Use character positions in calls to
3159 region_cache_forward and region_cache_backward, not byte
3160 positions. (Bug#12196)
3161
3162 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3163 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3164
3165 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3166 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3167 emacs_blocked_malloc, now deleted.
3168
3169 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3170
3171 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3172 The workaround was for improving performance on Solaris 2.4, but
3173 is getting in the way now. Emacs will still work if someone is
3174 still running Solaris 2.4 in a museum somewhere; Sun dropped
3175 support for Solaris 2.4 in 2003.
3176 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3177 * process.c (create_process) [HAVE_WORKING_VFORK]:
3178 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3179 since Emacs no longer uses vfork on that platform.
3180
3181 2012-09-17 Glenn Morris <rgm@gnu.org>
3182
3183 * emacs.c: Use COPYRIGHT.
3184
3185 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3186
3187 Remove configure's --without-sync-input option (Bug#12450).
3188 When auditing signal-handling in preparation for cleaning it up,
3189 I found that SYNC_INPUT has race conditions and would be a real
3190 pain to fix. Since it's an undocumented and deprecated
3191 configure-time option, now seems like a good time to remove it.
3192 Also see <http://bugs.gnu.org/11080#16>.
3193 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3194 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3195 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3196 (malloc_hysteresis):
3197 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3198 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3199 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3200 (dont_register_blocks, bytes_used_when_reconsidered)
3201 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3202 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3203 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3204 Remove. All uses removed.
3205 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3206 implementation, one that depends on whether the new macro
3207 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3208 is defined.
3209 * atimer.c (run_timers, handle_alarm_signal):
3210 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3211 (handle_async_input, process_pending_signals)
3212 (handle_input_available_signal, init_keyboard):
3213 * nsterm.m (ns_read_socket):
3214 * process.c (wait_reading_process_output):
3215 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3216 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3217 (emacs_write):
3218 * xterm.c (XTread_socket):
3219 Assume SYNC_INPUT.
3220 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3221 * eval.c (handling_signal): Remove. All uses removed.
3222 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3223 All uses replaced with the SYNC_INPUT version.
3224 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3225 Remove decls.
3226 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3227 Now static.
3228
3229 * font.c (Ffont_shape_gstring): Remove unused local.
3230
3231 2012-09-16 Glenn Morris <rgm@gnu.org>
3232
3233 * Makefile.in (clean): No longer run nextstep's clean.
3234
3235 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3236 (ns_frag): Remove.
3237 (ns-app): Move here from ns.mk, and simplify.
3238 (clean): Simplify nextstep entry.
3239 * ns.mk: Remove file.
3240
3241 2012-09-17 Kenichi Handa <handa@gnu.org>
3242
3243 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3244 not covert the last few charactes.
3245
3246 2012-09-16 Kenichi Handa <handa@gnu.org>
3247
3248 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3249 here, but just check the validity of glyphs in the glyph-string.
3250
3251 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3252
3253 * window.c (Fwindow_parameter, Fset_window_parameter):
3254 Accept any window as argument (Bug#12452).
3255
3256 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3257
3258 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3259 to ns_term_init to avoid memory leak.
3260
3261 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3262 explicit retain/release.
3263 (ns_term_init): Only allow one display. Initialize outerpool and
3264 ns_*_types.
3265
3266 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3269 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3270 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3271 the Microsoft problem in a different way, by altering ../nt/config.nt.
3272
3273 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3274
3275 * w32xfns.c:
3276 * w32uniscribe.c:
3277 * w32term.c:
3278 * w32select.c:
3279 * w32reg.c:
3280 * w32proc.c:
3281 * w32menu.c:
3282 * w32inevt.c:
3283 * w32heap.c:
3284 * w32font.c:
3285 * w32fns.c:
3286 * w32console.c:
3287 * w32.c:
3288 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3289 by lisp.h. This completes removal of setjmp.h inclusion
3290 erroneously announced in the previous commit. (Bug#12446)
3291
3292 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3293 more accurate.
3294
3295 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3296 not defined as a macro. The latter happens on MS-Windows.
3297 (Bug#12446)
3298
3299 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3300
3301 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3302 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3303 Some instances of '#include <setjmp.h>' removed, if the
3304 only reason for the instance was because "lisp.h" was included.
3305 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3306 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3307 and _longjmp with the new symbols. Emacs already uses _setjmp if
3308 available, so this change affects only POSIXish hosts that have
3309 sigsetjmp but not _setjmp, such as some versions of Solaris and
3310 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3311 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3312 (png_load_body) [HAVE_PNG]:
3313 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3314 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3315 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3316 since PNG requires jmp_buf. This is the only exception to the
3317 general rule that we now use sys_setjmp and sys_longjmp.
3318 This exception is OK since this code does not change the signal
3319 mask or longjmp out of a signal handler.
3320
3321 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3322
3323 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3324 Include "syssignal.h", for 'main_thread'.
3325
3326 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3327
3328 Avoid out-of-range marker position (Bug#12426).
3329 * insdel.c (replace_range, replace_range_2):
3330 Adjust markers before overlays, as suggested by comments.
3331 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3332 Remove redundant check before calling offset_intervals.
3333
3334 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3335
3336 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3337 current buffer (Bug#12387).
3338
3339 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3340
3341 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3342
3343 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3344
3345 Use a more backwards-compatible timer format (Bug#12430).
3346 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3347 vector element, not from the 4th, since PSECS is now at the end.
3348 (Fcurrent_idle_time): Doc fix.
3349
3350 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3351
3352 Function to mark objects and remove killed buffers at once.
3353 * alloc.c (discard_killed_buffers): Rename to ...
3354 (mark_discard_killed buffers) ... new name. Add marking
3355 of remaining objects. Fix comment. Adjust users.
3356 (mark_object): Do not touch frame buffer lists here.
3357 * frame.c (delete_frame): Reset frame buffer lists here.
3358
3359 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 Better workaround for GNOME bug when --enable-gcc-warnings.
3362 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3363 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3364 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3365
3366 Simplify SIGIO usage (Bug#12408).
3367 The code that dealt with SIGIO was crufty and confusing, e.g., it
3368 played tricks like "#undef SIGIO" but these tricks were not used
3369 consistently. Simplify mostly by not #undeffing standard symbols,
3370 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3371 or not as we please) rather than "defined SIGIO" (standard symbol
3372 that we probably shouldn't #undef).
3373 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3374 Modules that need it can include it.
3375 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3376 * dispextern.h (ignore_sigio): New decl.
3377 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3378 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3379 * emacs.c (shut_down_emacs):
3380 * keyboard.c (kbd_buffer_store_event_hold):
3381 Use ignore_sigio rather than invoking 'signal' directly.
3382 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3383 for FIONREAD.
3384 (FIONREAD, SIGIO): Do not #undef.
3385 (tty_read_avail_input): Use #error rather than a syntax error.
3386 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3387 for I_PIPE, used by SETUP_SLAVE_PTY.
3388 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3389 * sysdep.c (croak): Remove; no longer needed. This bit of
3390 temporary code, with Fred N. Fish's comment that it's temporary,
3391 has been in Emacs since at least 1992!
3392 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3393 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3394 * syssignal.h (croak): Remove decl.
3395 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3396 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3397 now that we're termios-only.
3398 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3399 * term.c (dissociate_if_controlling_tty): Use #error rather than
3400 a run-time error.
3401
3402 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3403 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3404 to work around GNOME bug 683906.
3405 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3406 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3407 This works around GCC bug 54561.
3408
3409 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 More fixes for 'volatile' and setjmp/longjmp.
3412 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3413 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3414 (png_load_body) [HAVE_PNG]:
3415 (jpeg_load_body) [HAVE_JPEG]:
3416 New function, with most of the old parent function's body.
3417 (png_load) [HAVE_PNG]:
3418 (jpeg_load) [HAVE_JPEG]:
3419 Invoke the new function, to avoid longjmp munging our locals.
3420 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3421 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3422 longjmp is passed 2, as the C standard doesn't guarantee this.
3423 Instead, store the failure code into mgr->failure_code.
3424
3425 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3426
3427 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3428 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3429 (syms_of_keyboard): Remove support for unread-command-char.
3430
3431 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3432
3433 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3434 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3435 violation. (Bug#12426)
3436
3437 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3438
3439 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3440
3441 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3442
3443 * eval.c: Add `inhibit-debugger'.
3444 (Qinhibit_debugger): New symbol.
3445 (call_debugger): Bind it instead of Qdebug_on_error.
3446 (maybe_call_debugger): Test Vinhibit_debugger.
3447 (syms_of_eval): Define inhibit-debugger.
3448 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3449 (syms_of_xdisp): Remove inhibit-debug-on-message.
3450
3451 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3452
3453 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3454 If a nonvolatile local variable is written before a _longjmp to
3455 the frame containing the variable, and is read after the _longjmp,
3456 the value read is indeterminate. Some local variables of type
3457 'struct handler' and 'struct catchtag' are used in this way, so
3458 mark each of their slots as volatile if the slot can be set before
3459 _longjmp and read afterwards.
3460 * lisp.h (struct handler): var and chosen_clause are now volatile.
3461 (struct catchtag): val, next, and pdlcount are now volatile.
3462
3463 * bidi.c (bidi_push_it, bidi_pop_it):
3464 * fns.c (copy_hash_table):
3465 * image.c (define_image_type):
3466 * keyboard.c (kbd_buffer_store_event_hold):
3467 * process.c (Fprocess_send_eof):
3468 * xfaces.c (x_create_gc) [HAVE_NS]:
3469 * xgselect.c (xg_select):
3470 Prefer assignment to memcpy when either will do.
3471
3472 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3473 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3474 time an item is removed. No need to mark this function 'inline';
3475 the compiler knows better than we do.
3476
3477 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3478
3479 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3480 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3481 to change_frame_size (Bug#12388).
3482 (windowDidResize:): Pass YES to updateFrameSize.
3483
3484 * nsterm.h: Add delay parameter to updateFrameSize.
3485
3486 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3487
3488 Discard killed buffers from deleted window and frame objects.
3489 This reduces an amount of references to killed buffers and
3490 helps GC to reclaim them faster.
3491 * alloc.c (discard_killed_buffers): New function.
3492 (mark_object): Use it for deleted windows and frames.
3493 (mark_object): If symbol's value is set up for a killed buffer
3494 or deleted frame, restore its global binding.
3495 * data.c (swap_in_global_binding): Add GC notice.
3496 (swap_in_symval_forwarding): Use convenient set_blv_where.
3497 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3498 * window.h: ... to here.
3499
3500 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3501
3502 Convenient macro to check whether the buffer is live.
3503 * buffer.h (BUFFER_LIVE_P): New macro.
3504 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3505 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3506
3507 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3508
3509 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3510 composition cases (Bug#12364).
3511
3512 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3513 overhang of succeeding glyphs overlapping box cursor.
3514
3515 * w32term.c (x_draw_glyph_string): Likewise.
3516
3517 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 Simplify, document, and port floating-point (Bug#12381).
3520 The porting part of this patch fixes bugs on non-IEEE platforms
3521 with frexp, ldexp, logb.
3522 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3523 Now static.
3524 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3525 support, by removing commented-out code and briefly listing the
3526 C89 functions excluded. The commented-out stuff was confusing
3527 maintenance, e.g., we thought we needed cbrt but it was commented out.
3528 (logb): Remove decl; no longer needed.
3529 (isfinite): New macro, if not already supplied.
3530 (isnan): Don't replace any existing macro.
3531 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3532 are present on all C89 platforms.
3533 (Ffrexp): Do not special-case zero, as frexp does the right thing
3534 for that case.
3535 (Flogb): Do not use logb, as it doesn't have the desired meaning
3536 on hosts that use non-base-2 floating point. Instead, stick with
3537 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3538 frexp, to avoid getting an unspecified result.
3539
3540 * xdisp.c (Qinhibit_debug_on_message): Now static.
3541
3542 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3543
3544 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3545 NSBezierPath (Bug#12131).
3546
3547 2012-09-10 Chong Yidong <cyd@gnu.org>
3548
3549 * fns.c (Fdelq, Fdelete): Doc fix.
3550
3551 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3552
3553 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3554 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3555
3556 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3557
3558 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3559 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3560 Use it.
3561
3562 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3563
3564 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3565 left fringe if the window has a left margin. This avoids leaving
3566 traces of the cursor because its leftmost pixel is not drawn over.
3567
3568 * dispnew.c (update_window_line): When the left margin area of a
3569 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3570 that screen line. (Bug#12277)
3571
3572 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 Assume C89 or later for math functions (Bug#12381).
3575 This simplifies the code, and makes it a bit smaller and faster,
3576 and (most important) makes it easier to clean up signal handling
3577 since we can stop worring about floating-point exceptions in
3578 library code. That was a problem before C89, but the problem
3579 went away many years ago on all practical Emacs targets.
3580 * data.c, image.c, lread.c, print.c:
3581 Don't include <math.h>; no longer needed.
3582 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3583 might be autoconfigured, as that never happens.
3584 * data.c (fmod):
3585 * doprnt.c (DBL_MAX_10_EXP):
3586 * print.c (DBL_DIG):
3587 Remove. C89 or later always defines these.
3588 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3589 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3590 (arith_error, domain_error, domain_error2):
3591 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3592 no longer needed -- we simply return what C returns. All uses removed.
3593 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3594 the wrapped code.
3595 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3596 Remove. All uses expanded, as these macros are no longer used
3597 more than once and are now more trouble than they're worth.
3598 (Ftan): Use tan, not sin / cos.
3599 (Flogb): Assume C89 frexp.
3600 (fmod_float): Assume C89 fmod.
3601 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3602 (init_floatfns): Remove. All uses removed.
3603
3604 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3605
3606 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3607 compositeToPoint for OSX < 10.6 (Bug#12390).
3608
3609 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3612 This produces more-accurate results.
3613
3614 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3615
3616 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3617 changes (Bug#12088).
3618
3619 2012-09-08 Chong Yidong <cyd@gnu.org>
3620
3621 * syntax.c (Fstring_to_syntax): Doc fix.
3622
3623 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3624
3625 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3626 in the internal border.
3627 (x_set_window_size): Remove static variables and their usage.
3628 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3629 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3630 Remove fringe/internal border adjustment (Bug#11052).
3631 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3632 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3633 (ns_fix_rect_ibw): Remove.
3634 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3635 (ns_dumpglyphs_box_or_relief): Ditto.
3636 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3637 adjustment.
3638 (ns_dumpglyphs_image): Ditto.
3639 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3640 border adjustment.
3641 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3642 their usage. Add fringe_extended_p and its use as in other terms.
3643 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3644 scroll bar was removed.
3645 (updateFrameSize): New function.
3646 (windowDidResize): Move code to updateFrameSize and call it.
3647
3648 * nsterm.h (EmacsView): Add updateFrameSize.
3649
3650 2012-09-07 Chong Yidong <cyd@gnu.org>
3651
3652 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3653
3654 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3655
3656 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3657
3658 More signal-handler cleanup (Bug#12327).
3659 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3660 Problem introduced when merging patches. Noted by Eli Zaretskii in
3661 <http://bugs.gnu.org/12327#67>.
3662 * floatfns.c: Comment fix.
3663 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3664 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3665 and anyway the declaration is harmless even if SIGDANGER is not defined.
3666 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3667 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3668 source files not surprisingly expected syssignal.h to define, or
3669 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3670 Include <sys/ioctl.h>, for FIONREAD.
3671 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3672 This eliminates a problem whereby other files mysteriously had
3673 to include "syssignal.h" before including "systty.h" if they
3674 wanted to use "#ifdef SIGIO".
3675
3676 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3677
3678 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3679
3680 * w32.c (sigemptyset): Empty the set.
3681 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3682
3683 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3684
3685 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3686
3687 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3688 (mark_object): Likewise for frame objects.
3689
3690 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 * syssignal.h (handle_on_main_thread): Always declare,
3693 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3694 This ports to platforms without HAVE_PTHREAD.
3695
3696 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 Signal-handler cleanup (Bug#12327).
3699 Emacs's signal handlers were written in the old 4.2BSD style with
3700 sigblock and sigmask and so forth, and this led to some
3701 inefficiencies and confusion. Rewrite these to use
3702 pthread_sigmask etc. without copying signal sets around. Also,
3703 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3704 'signal', and instead use functions that do not attempt to take
3705 over the system name space. This patch causes Emacs's text
3706 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3707 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3708 Do not include <signal.h> or "syssignal.h", as these
3709 modules do not use signals.
3710 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3711 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3712 Do not include <signal.h>, as "syssignal.h" does that for us now.
3713 * atimer.c (sigmask_atimers): New function.
3714 (block_atimers, unblock_atimers): New functions,
3715 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3716 All uses replaced.
3717 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3718 no longer needed here.
3719 * emacs.c (main): Inspect existing signal handler with sigaction,
3720 so that there's no need to block and unblock SIGHUP.
3721 * sysdep.c (struct save_signal): New member 'action', replacing
3722 old member 'handler'.
3723 (save_signal_handlers, restore_signal_handlers):
3724 Use sigaction instead of 'signal' to save and restore.
3725 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3726 New function. All users of 'signal' modified to use set_sighandler
3727 if they're writeonly, and to use sys_signal if they're read+write.
3728 (emacs_sigaction_init, forwarded_signal): New functions.
3729 (sys_signal): Remove. All uses replaced by calls to sigaction
3730 and emacs_sigaction_init, or by direct calls to 'signal'.
3731 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3732 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3733 all uses replaced by pthread_sigmask etc. calls.
3734 * syssignal.h: Include <signal.h>.
3735 (emacs_sigaction_init, forwarded_signal): New decls.
3736 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3737 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3738 (sigmask, sys_sigmask): Remove; no longer needed.
3739 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3740 (sigblock, sigunblock, sigfree):
3741 (sigsetmask) [!defined sigsetmask]:
3742 Remove. All uses replaced by pthread_sigmask.
3743 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3744 no longer need to be replaced, and its typical old uses
3745 are now done via emacs_sigaction_init and sigaction.
3746 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3747 (sys_sigdel): Remove; unused.
3748 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3749
3750 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3751
3752 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3753 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3754
3755 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3756
3757 Explicitly mark buffer_defaults and buffer_local_symbols.
3758 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3759 mark_local_symbols here.
3760 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3761 since special buffers aren't marked here any more.
3762 (allocate_buffer): Chain new buffer with all_buffers here...
3763 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3764 not here.
3765 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3766 (syms_of_buffer): Remove staticpro of the above.
3767 (init_buffer_once): Set names for buffer_defaults and
3768 buffer_local_symbols.
3769
3770 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3771
3772 Use bool for booleans in font-related modules.
3773 * font.c (font_intern_prop, font_style_to_value)
3774 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3775 (generate_otf_features, font_check_otf_features, font_check_otf)
3776 (font_match_p, font_list_entities, font_at):
3777 * fontset.c (fontset_id_valid_p, reorder_font_vector
3778 (fontset_find_font, Fset_fontset_font)
3779 (face_suitable_for_char_p) [0]:
3780 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3781 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3782 (m17n_flt_initialized, ftfont_shape_by_flt):
3783 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3784 * nsfont.m (nsfont_draw):
3785 * w32font.c (w32font_draw):
3786 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3787 Use bool for booleans.
3788 * font.h: Adjust to above API changes.
3789 (struct font, struct font_driver, struct font_driver_list):
3790 Use bool for booleans.
3791 (struct font): Remove useless member encoding_type.
3792 All users removed.
3793 * fontset.c, xftfont.c: Omit unnecessary static decls.
3794
3795 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3796
3797 * alloc.c (mark_object): Revert window marking code
3798 since it's unsafe for the Fset_window_configuration.
3799
3800 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3801
3802 Fix race conditions with signal handlers and errno (Bug#12327).
3803 Be more systematic about preserving errno whenever a signal
3804 handler returns, even if it's not in the main thread. Do this by
3805 renaming signal handlers to distinguish between signal delivery
3806 and signal handling. All uses changed.
3807 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3808 * data.c (deliver_arith_signal): Rename from arith_error.
3809 * dispnew.c (deliver_window_change_signal): Rename from
3810 window_change_signal.
3811 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3812 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3813 * keyboard.c (deliver_input_available_signal): Rename from
3814 input_available_signal.
3815 (deliver_user_signal): Rename from handle_user_signal.
3816 (deliver_interrupt_signal): Rename from interrupt_signal.
3817 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3818 (deliver_child_signal): Rename from sigchld_handler.
3819 * atimer.c (handle_alarm_signal):
3820 * data.c (handle_arith_signal):
3821 * dispnew.c (handle_window_change_signal):
3822 * emacs.c (handle_fatal_signal, handle_danger_signal):
3823 * keyboard.c (handle_input_available_signal):
3824 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3825 * process.c (handle_pipe_signal, handle_child_signal):
3826 New functions, with the actual signal-handling code taken from the
3827 original respective signal handlers, sans the sporadic attempts to
3828 preserve errno, since that's now done by handle_on_main_thread.
3829 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3830 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3831 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3832 Move to sysdep.c.
3833 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3834 Move initialization of main_thread to sysdep.c's init_signals.
3835 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3836 our usage, and simplifies the mainline code.
3837 (record_child_status_change): New static function, as a helper
3838 for handle_child_signal, and with most of the old child handler's
3839 contents.
3840 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3841 (handle_child_signal): Use the above.
3842 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3843 Moved here from emacs.c.
3844 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3845 code moved here from emacs.c's main function.
3846 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3847 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3848 This lets callers save and restore errno properly.
3849
3850 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3851
3852 Remove redundant or unused things here and there.
3853 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3854 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3855 * editfns.c (Fcompare_buffer_substrings): Likewise.
3856 * frame.h (struct terminal, struct font_driver_list):
3857 Remove redundant declarations.
3858 * window.h (Qleft, Qright): Likewise.
3859
3860 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3861
3862 Do not mark objects from deleted buffers, windows and frames.
3863 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3864 (mark_object): Likewise for windows and frames.
3865
3866 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3867
3868 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3869 buffer_defaults and buffer_local_symbols as valid objects.
3870 Return special value to denote them.
3871
3872 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3873
3874 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3875 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3876 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3877 (file_name_absolute_p, Fsubstitute_in_file_name):
3878 (check_executable, check_writable, Ffile_accessible_directory_p)
3879 (Fset_file_selinux_context, Fdefault_file_modes)
3880 (Finsert_file_contents, choose_write_coding_system)
3881 (Fwrite_region, build_annotations, a_write, e_write)
3882 (Fdo_auto_save):
3883 * filelock.c (boot_time_initialized, get_boot_time)
3884 (get_boot_time_1, lock_file_1, within_one_second):
3885 * floatfns.c (in_float):
3886 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3887 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3888 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3889 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3890 * window.c (compare_window_configurations):
3891 Use bool for booleans.
3892 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3893 (Fdefault_file_modes): Now mode_t, not int, for modes.
3894 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3895 (internal_delete_file): Now returns void, not a (boolean) int,
3896 since nobody was looking at the return value.
3897 * lisp.h, window.h: Adjust to above API changes.
3898
3899 * xdisp.c (set_message): Simplify and reindent last change.
3900
3901 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3902
3903 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3904
3905 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3906
3907 * eval.c (call_debugger): Make the function non-static so that we
3908 can call it from set_message.
3909
3910 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3911 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3912
3913 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3914
3915 Give more-useful info on a fatal error (Bug#12328).
3916 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3917 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3918 of doing the work ourselves.
3919 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3920 do most of the work.
3921 (fatal_error_backtrace): New function, taken from the guts
3922 of the old fatal_error_signal, but with a new option to output
3923 a backtrace.
3924 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3925 info about the signal than just its number.
3926 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3927 * sysdep.c: Include <execinfo.h>
3928 (emacs_backtrace): New function, taken partly from the previous
3929 code of the 'die' function.
3930 (emacs_abort): Call fatal_error_backtrace rather than abort.
3931
3932 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3933
3934 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3935 eager (load-time) macro-expansion.
3936 * lisp.mk (lisp): Add macroexp.
3937
3938 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3939
3940 Simplify redefinition of 'abort' (Bug#12316).
3941 Do not try to redefine the 'abort' function. Instead, redo
3942 the code so that it calls 'emacs_abort' rather than 'abort'.
3943 This removes the need for the NO_ABORT configure-time macro
3944 and makes it easier to change the abort code to do a backtrace.
3945 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3946 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3947 Remove; sysdep.c's emacs_abort now takes its place.
3948 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3949 'abort' changed to use 'emacs_abort'.
3950 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3951 (abort) [!defined abort]: Rename to ...
3952 (emacs_abort): ... new name.
3953 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3954 the place of the old 'abort' in emacs.c.
3955 * w32.c, w32fns.c (abort): Do not #undef.
3956 * w32.c (emacs_abort): Rename from w32_abort.
3957
3958 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3959
3960 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3961 offsets[j].dv, since the y axis of the screen coordinates points
3962 down, while the y axis of the font definition coordinates points
3963 up. This fixes display of Arabic diacritics such as KASRA and
3964 KASRATAN. (Bug#11860)
3965
3966 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3967
3968 Be more systematic about _setjmp vs setjmp.
3969 * alloc.c (test_setjmp, mark_stack):
3970 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3971 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3972 (png_load, my_error_exit, jpeg_load):
3973 * process.c (send_process_trap, send_process):
3974 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3975 The underscored versions are up to 30x faster on some hosts.
3976 Formerly, the code used setjmp+longjmp sometimes and
3977 _setjmp+_longjmp at other times, with no particular reason to
3978 prefer setjmp+longjmp.
3979
3980 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3981
3982 Fix minor problem found by static checking.
3983 * buffer.c (Fdelete_all_overlays): Return nil.
3984
3985 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3986
3987 * buffer.c (Fdelete_all_overlays): New function.
3988
3989 2012-09-03 Chong Yidong <cyd@gnu.org>
3990
3991 * gtkutil.c: Add extern decl for Qxft.
3992
3993 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3994
3995 * emacs.c, eval.c: Use bool for boolean.
3996 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3997 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3998 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3999 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4000 (main, decode_env_path, Fdaemon_initialized):
4001 * eval.c (call_debugger, Finteractive_p, interactive_p):
4002 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4003 (maybe_call_debugger, Fbacktrace):
4004 * process.c (read_process_output, exec_sentinel):
4005 Use bool for booleans.
4006 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4007 All callers changed.
4008 * eval.c (interactive_p): Omit always-true boolean argument
4009 EXCLUDE_SUBRS_P. All callers changed.
4010 * dispextern.h, lisp.h: Reflect above API changes.
4011 * firstfile.c (dummy): Use the address of 'main', whose signature
4012 won't change, instead of the address of 'initialize', whose
4013 signature just changed from int to bool.
4014 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4015 * msdos.c (fatal_error_in_progress): ... from here.
4016 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4017 of incrementing it.
4018 (redisplay_internal, unwind_redisplay): Simply clear
4019 REDISPLAYING_P when unwinding, instead of saving its previous,
4020 always-false value and then restoring it.
4021
4022 Clean up some extern decls.
4023 Mostly, this hoists extern decls out of .c files and into .h files.
4024 That way, we're more likely to catch errors if the interfaces change.
4025 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4026 declare xg_mark_data.
4027 * dispextern.h (x_frame_parm_handlers):
4028 * font.h (Qxft):
4029 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4030 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4031 (Qultra_bold, Qoblique, Qitalic):
4032 Move extern decl here from .c file.
4033 * alloc.c (xg_mark_data) [USE_GTK]:
4034 * doc.c (Qclosure):
4035 * eval.c (Qlexical_binding):
4036 * fns.c (time) [!HAVE_UNISTD_H]:
4037 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4038 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4039 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4040 * lread.c (Qinternal_interpreter_environment):
4041 * minibuf.c (Qbuffer):
4042 * process.c (QCfamily, QCfilter):
4043 * widget.c (free_frame_faces):
4044 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4045 * xfont.c (x_clear_errors):
4046 * xterm.c (x_frame_parm_handlers):
4047 Remove now-redundant extern decls.
4048 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4049 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4050 Now static.
4051 * xfaces.c: Remove unnecessary static decls.
4052 * xterm.c (updating_frame): Remove decl of nonexistent object.
4053
4054 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4055 when building globals.h, as the objects that are not built on
4056 this host are not needed to compile C files on this host.
4057
4058 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4059
4060 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4061
4062 * frame.h: Add missing prototype for x_wm_set_size_hint.
4063
4064 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4067 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4068 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4069 (Fsubstitute_command_keys):
4070 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4071 (save_excursion_save, save_excursion_restore)
4072 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4073 (format_time_string, general_insert_function)
4074 (make_buffer_string, make_buffer_string_both)
4075 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4076 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4077 (copy_text, insert_1, insert_1_both, insert_from_string)
4078 (insert_from_string_before_markers, insert_from_string_1)
4079 (insert_from_buffer, insert_from_buffer_1, replace_range)
4080 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4081 (del_range_2, modify_region):
4082 * intervals.c (intervals_equal, balance_possible_root_interval)
4083 (adjust_intervals_for_insertion, merge_properties_sticky)
4084 (graft_intervals_into_buffer, lookup_char_property)
4085 (adjust_for_invis_intang, set_point_both)
4086 (get_property_and_range, compare_string_intervals)
4087 (set_intervals_multibyte_1, set_intervals_multibyte):
4088 * keyboard.c (decode_timer):
4089 Use bool for boolean.
4090 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4091 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4092
4093 2012-09-02 Chong Yidong <cyd@gnu.org>
4094
4095 * keymap.c (push_key_description): Print M-TAB as C-M-i
4096 (Bug#11758).
4097
4098 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4099
4100 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4101 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4102 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4103 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4104 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4105 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4106 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4107
4108 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4109
4110 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4111 more than one grapheme cluster passed to the shaper: compute the
4112 offset adjustment values separately for each cluster. (Bug#11860)
4113
4114 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4115 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4116 about implicit conversions from integer to pointer.
4117
4118 2012-09-01 Daniel Colascione <dancol@dancol.org>
4119
4120 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4121 system used too early.
4122
4123 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4124
4125 Better seed support for (random).
4126 * emacs.c (main): Call init_random.
4127 * fns.c (Frandom): Set the seed from a string argument, if given.
4128 Remove long-obsolete Gentzel cruft.
4129 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4130 (init_random): New function.
4131
4132 2012-09-01 Daniel Colascione <dancol@dancol.org>
4133
4134 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4135 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4136 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4137 x_wm_set_size_hint, x_query_colors, x_real_positions,
4138 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4139 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4140 all of which have been moved to common code.
4141
4142 * xfaces.c: Include TERM_HEADER instead of listing all possible
4143 window-system headers.
4144
4145 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4146 to match header.
4147
4148 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4149 directly accessing frame internals.
4150
4151 * w32font.h: Include font.h. Define syms_of_w32font and
4152 globals_of_w32font.
4153
4154 * process.c: Include TERM_HEADER instead of listing all possible
4155 window-system headers.
4156
4157 * nsterm.h: Remove declarations now in frame.h.
4158 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4159
4160 * menu.c: Include TERM_HEADER instead of listing all possible
4161 window-system headers.
4162
4163 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4164 window system.
4165
4166 * keyboard.c: Include TERM_HEADER instead of listing all possible
4167 window-system headers.
4168
4169 * image.c: Include TERM_HEADER instead of listing all possible
4170 window-system headers. Declare Vlibrary_cache when compiling for
4171 Windows.
4172
4173 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4174 window system declarations.
4175
4176 * frame.h: Move common functions here: set_frame_menubar,
4177 x_set_window_size, x_sync, x_get_focus_frame,
4178 x_set_mouse_position, x_set_mouse_pixel_position,
4179 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4180 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4181 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4182 x_activate_menubar, x_real_positions, x_bitmap_icon,
4183 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4184 and x_query_colors.
4185
4186 * frame.c: Include TERM_HEADER instead of listing all possible
4187 window-system headers.
4188
4189 * font.c: Include TERM_HEADER instead of listing all possible
4190 window-system headers.
4191
4192 * emacs.c: Include TERM_HEADER.
4193
4194 * dispnew.c: Include TERM_HEADER instead of listing all possible
4195 window-system headers.
4196
4197 * ccl.h: Include character.h.
4198
4199 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4200 the current window system; include in list of objects to link into
4201 Emacs.
4202
4203 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Remove mark_ttys function and fix tty_display_info initialization.
4206 * lisp.h (mark_ttys): Remove prototype.
4207 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4208 to mark_ttys because all possible values of 'top_frame' slot are
4209 the frames which are reachable from Vframe_list.
4210 * term.c (mark_ttys): Remove.
4211 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4212
4213 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4214
4215 Change struct frame bitfields from unsigned char to unsigned.
4216 * frame.h (struct frame): Change type of 'display_preempted',
4217 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4218 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4219 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4220 bitfields from unsigned char to unsigned.
4221
4222 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4223
4224 Remove unused member of struct x_output and struct w32_output.
4225 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4226 * w32term.h (struct w32_output): Likewise.
4227
4228 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4229
4230 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4231 does not become zero (Bug#12234).
4232
4233 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4234
4235 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4236 for GCC 4.7.1 x86-64.
4237
4238 2012-08-30 Glenn Morris <rgm@gnu.org>
4239
4240 * lread.c (init_lread): For out-of-tree builds, only add the
4241 source directory's site-lisp dir to the load-path if it exists,
4242 consistent with in-tree builds. (Bug#12302)
4243
4244 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4245
4246 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4247 button_values to NULL. Call setStykeMask so dialogs get a close button.
4248 (windowShouldClose:): Set window_closed.
4249 (dealloc): New member, free button_values.
4250 (process_dialog:): Make member function. Remove window argument,
4251 replace window with self. Count buttons and allocate and store values
4252 in button_values.
4253 (addButton:value:row:): value is int with the name tag. Call setTag
4254 with tag. Remove return self, declare return value as void.
4255 (addString:row:): Remove return self, declare return value as void.
4256 (addSplit): Remove return self, declare return value as void.
4257 (clicked:): Remove return self, declare return value as void.
4258 Set dialog_return to button_values[seltag]. Code formatting change.
4259 (initFromContents:isQuestion:): Adjust call to process_dialog.
4260 Code formatting change.
4261 (timeout_handler:): Set timer_fired to YES.
4262 (runDialogAt:): Set timer_fired to NO.
4263 Handle click on close button as quit.
4264
4265 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4266 Add window_closed and button_values. Add void as return value for
4267 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4268 Add process_dialog as new member.
4269
4270 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4271
4272 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4273 is not one of the heaps we manage. (Bug#12242)
4274
4275 2012-08-28 Glenn Morris <rgm@gnu.org>
4276
4277 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4278
4279 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4280
4281 * window.c (Fset_window_configuration): Remove handling of
4282 auto-buffer-name window parameter. Install revision of reverted
4283 fix.
4284
4285 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Do not allow to set major mode for a dead buffer.
4288 * buffer.c (Fset_buffer_major_mode): Signal an error
4289 if the buffer is dead.
4290 (Fother_buffer, other_buffer_safely): Remove redundant
4291 nested declaration.
4292
4293 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Always use set_buffer_if_live to restore original buffer at unwind.
4296 * buffer.h (record_unwind_current_buffer): New function.
4297 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4298 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4299 * undo.c, window.c: Adjust users.
4300 * buffer.c (set_buffer_if_live): Fix comment.
4301
4302 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4303
4304 Fix usage of set_buffer_internal.
4305 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4306 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4307 * coding.c (decode_coding): Omit redundant test.
4308 * fileio.c (decide_coding_unwind): Likewise.
4309 * fns.c (secure_hash): Likewise.
4310 * insdel.c (modify_region): Likewise.
4311 * keyboard.c (command_loop_1): Likewise.
4312 * print.c (PRINTFINISH): Likewise.
4313 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4314
4315 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4316
4317 * dispnew.c: Use bool for boolean.
4318 (frame_garbaged, display_completed, delayed_size_change)
4319 (fonts_changed_p, add_window_display_history)
4320 (add_frame_display_history, verify_row_hash)
4321 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4322 (row_equal_p, realloc_glyph_pool)
4323 (allocate_matrices_for_frame_redisplay)
4324 (showing_window_margins_p)
4325 (adjust_frame_glyphs_for_frame_redisplay)
4326 (build_frame_matrix_from_leaf_window, make_current)
4327 (mirrored_line_dance, mirror_line_dance, update_frame)
4328 (update_window_tree, update_single_window)
4329 (check_current_matrix_flags, update_window, update_text_area)
4330 (update_window_line, set_window_update_flags, scrolling_window)
4331 (update_frame_1, scrolling, buffer_posn_from_coords)
4332 (do_pending_window_change, change_frame_size)
4333 (change_frame_size_1, sit_for):
4334 Use bool for boolean.
4335 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4336 and remove last int (actually boolean) argument, which was always 0.
4337 All callers changed.
4338 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4339 * dispextern.h (struct composition_it): Use bool for boolean.
4340 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4341 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4342 * dired.c (file_name_completion):
4343 Use bool for boolean. (This was missed in an earlier change.)
4344
4345 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4346
4347 * window.c (Fset_window_configuration): Revert first part of
4348 last change.
4349
4350 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4351
4352 * nsterm.h (NSPanel): New class variable dialog_return.
4353
4354 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4355 Initialize dialog_return.
4356 (windowShouldClose:): Use stop instead of stopModalWithCode.
4357 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4358 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4359 event.
4360 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4361 modal loop returns.
4362
4363 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4364
4365 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4366 * composite.c (find_composition, composition_gstring_p)
4367 (composition_reseat_it, find_automatic_composition):
4368 * data.c (let_shadows_buffer_binding_p)
4369 (let_shadows_global_binding_p, set_internal, make_blv)
4370 (Fmake_variable_buffer_local, Fmake_local_variable)
4371 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4372 (cons_to_signed, arith_driver):
4373 * dbusbind.c (xd_in_read_queued_messages):
4374 * dired.c (directory_files_internal, file_name_completion):
4375 Use bool for booleans.
4376 * dired.c (file_name_completion):
4377 * process.h (fd_callback):
4378 Omit int (actually boolean) argument. It wasn't being used.
4379 All uses changed.
4380 * composite.h, lisp.h: Reflect above API changes.
4381
4382 * cmds.c, coding.c: Use bool for booleans.
4383 * cmds.c (move_point, Fself_insert_command):
4384 * coding.h (struct composition status, struct coding_system):
4385 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4386 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4387 (emacs_mule_char, decode_coding_emacs_mule)
4388 (encode_coding_emacs_mule, detect_coding_iso_2022)
4389 (decode_coding_iso_2022, encode_invocation_designation)
4390 (encode_designation_at_bol, encode_coding_iso_2022)
4391 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4392 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4393 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4394 (encode_coding_raw_text, detect_coding_charset)
4395 (decode_coding_charset, encode_coding_charset, detect_eol)
4396 (detect_coding, get_translation_table, produce_chars)
4397 (consume_chars, reused_workbuf_in_use)
4398 (make_conversion_work_buffer, code_conversion_save)
4399 (decode_coding_object, encode_coding_object)
4400 (detect_coding_system, char_encodable_p)
4401 (Funencodable_char_position, code_convert_region)
4402 (code_convert_string, code_convert_string_norecord)
4403 (Fset_coding_system_priority):
4404 * fileio.c (Finsert_file_contents):
4405 Use bool for booleans.
4406 * coding.h, lisp.h: Reflect above API changes.
4407 * coding.c: Remove unnecessary static function decls.
4408 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4409 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4410 not a boolean 'int', since callers never look at the return value.
4411 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4412 * coding.h (decoding_buffer_size, encoding_buffer_size)
4413 (emacs_mule_string_char): Remove unused extern decls.
4414 (struct iso_2022_spec, struct coding_system):
4415 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4416 (struct emacs_mule_spec): Remove unused field 'full_support'.
4417 All initializations removed.
4418 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4419
4420 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Fix spare memory change (Bug#12286).
4423 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4424 (valid_lisp_object_p): Likewise.
4425
4426 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4427
4428 * window.c (Fset_window_configuration): Record any window's old
4429 buffer if it's replaced (see Bug#8789). If the new current
4430 buffer doesn't appear in the selected window, go to its old
4431 point (Bug#12208).
4432
4433 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4434
4435 Special MEM_TYPE_SPARE to denote reserved memory.
4436 * alloc.c (enum mem_type): New memory type.
4437 (refill_memory_reserve): Use new type for spare memory.
4438 This prevents live_cons_p and live_string_p from incorrect
4439 detection of uninitialized objects from spare memory as live.
4440
4441 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4442
4443 Spelling fixes.
4444 * Makefile.in (.PHONY): versioclean -> versionclean.
4445
4446 Remove unused external symbols.
4447 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4448 * window.c (Qwindow_valid_p, decode_valid_window):
4449 Now static, not extern.
4450 * data.c (Qinterval): Remove; unused.
4451 (syms_of_data): Do not define 'interval'.
4452 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4453 * window.h (decode_valid_window):
4454 Remove decls.
4455
4456 * character.c, charset.c, chartab.c: Use bool for booleans.
4457 * character.c (lisp_string_width, string_count_byte8)
4458 (string_escape_byte8):
4459 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4460 (load_charset_map_from_file, map_charset_chars)
4461 (Fdefine_charset_internal, define_charset_internal)
4462 (Fdeclare_equiv_charset, find_charsets_in_text)
4463 (Ffind_charset_region, char_charset, Fiso_charset):
4464 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4465 (sub_char_table_set, sub_char_table_set_range)
4466 (char_table_set_range, optimize_sub_char_table)
4467 (map_sub_char_table):
4468 Use bool for boolean.
4469 * character.c (str_to_unibyte): Omit last boolean argument; it was
4470 always 0. All callers changed.
4471 * character.h, charset.h: Adjust to match previous changes.
4472 * character.h (char_printable_p): Remove decl of nonexistent function.
4473 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4474 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4475 are all boolean, so make them single-bit bitfields.
4476
4477 * lisp.h (ASET): Remove attempt to detect side effects.
4478 It was meant to be temporary and it often doesn't work,
4479 because when IDX has side effects the behavior of IDX==IDX
4480 is undefined. See Stefan Monnier in
4481 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4482
4483 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4484
4485 * lisp.h (functionp): New function (extracted from Ffunctionp).
4486 (FUNCTIONP): Use it.
4487 * eval.c (Ffunctionp): Use it.
4488
4489 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4490
4491 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4492 as that's faster and simpler than static storage. Don't bother
4493 with the g_main_context_query overhead if g_main_context_pending
4494 says no events are pending.
4495 (gfds, gfds_size): Remove these static vars.
4496 (xgselect_initialize): Remove; no longer needed.
4497 All uses and decls removed.
4498
4499 * emacs.c (fatal_error_signal_hook): Remove.
4500 All uses removed. This leftover from old code was always 0.
4501
4502 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4503 * casefiddle.c (casify_object, casify_region):
4504 * casetab.c (set_case_table):
4505 * category.c, category.h (word_boundary_p):
4506 * category.h (CHAR_HAS_CATEGORY):
4507 Use bool for booleans, instead of int.
4508
4509 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4510
4511 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4512
4513 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4514
4515 On assertion failure, print backtrace if available.
4516 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4517 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4518 * Makefile.in (LIB_EXECINFO): New macro.
4519 (LIBES): Use it.
4520
4521 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4522 * bytecode.c (exec_byte_code):
4523 * callint.c (check_mark, Fcall_interactively):
4524 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4525 (getenv_internal, sync_process_alive, call_process_exited):
4526 * lisp.h (USE_SAFE_ALLOCA):
4527 Use bool for booleans, instead of int.
4528 * lisp.h, process.h: Adjust prototypes to match above changes.
4529 * callint.c (Fcall_interactively): Don't assume the mark's
4530 offset fits in 'int'.
4531
4532 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4533
4534 * buffer.c, buffer.h: Use bool for boolean.
4535 * buffer.c (reset_buffer_local_variables)
4536 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4537 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4538 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4539 (overlay_touches_p, overlay_strings, Foverlay_put)
4540 (report_overlay_modification, call_overlay_mod_hooks):
4541 (mmap_enlarge, mmap_set_vars):
4542 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4543 Use bool for booleans, instead of int.
4544 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4545 since the 1-or-0 return value is always ignored anyway.
4546 (mmap_initialized_p):
4547 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4548 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4549
4550 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4551
4552 * bidi.c: Use bool for boolean.
4553 This is a bit more readable, and makes the text segment of bidi.o
4554 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4555 Presumably it's faster too.
4556 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4557 Now bool.
4558 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4559 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4560 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4561 (bidi_explicit_dir_char, bidi_level_of_next_char)
4562 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4563 Use bool for booleans, instead of int.
4564 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4565 (bidi_unshelve_cache): Adjust decls to match code.
4566
4567 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4568
4569 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4570 argument.
4571
4572 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4575 * atimer.h: Include <stdbool.h>.
4576
4577 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4578
4579 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4580 compile time tests instead of run time tests on systems that do
4581 not use them.
4582 (FRAME_MAC_P): Remove leftover from deleted code.
4583 * frame.c (syms_of_frame): Remove leftover from deleted code.
4584
4585 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4586
4587 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4588
4589 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4590
4591 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4592 Otherwise, the compiler complains about (A?B:C) where B is void
4593 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4594 (fontset_add): Return void, for FONTSET_ADD.
4595
4596 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4597
4598 * alloc.c: Use bool for booleans.
4599 (gc_in_progress, abort_on_gc)
4600 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4601 (dont_register_blocks) [GC_MALLOC_CHECK]:
4602 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4603 (check_string_bytes, make_specified_string, memory_full)
4604 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4605 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4606 (mark_stack, valid_pointer_p, make_pure_string)
4607 (Fgarbage_collect, survives_gc_p, gc_sweep):
4608 Use bool for booleans, instead of int.
4609 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4610 Remove unused local.
4611 * alloc.c (PURE_POINTER_P):
4612 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4613 * editfns.c (Fformat):
4614 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4615 (Fdo_auto_save):
4616 * fns.c (sweep_weak_table):
4617 * lisp.h (suppress_checking, push_message, survives_gc_p)
4618 (make_pure_string, gc_in_progress, abort_on_gc):
4619 * lread.c (readchar, read1):
4620 * print.c (Fprin1_to_string):
4621 * xdisp.c (push_message):
4622 Use bool for booleans affected directly or indirectly by
4623 alloc.c's changes.
4624
4625 Make recently-introduced setters macros.
4626 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4627 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4628 (set_fontset_default, set_fontset_fallback): Rename from their
4629 upper-case counterparts, and make them functions rather than macros.
4630 This is more consistent with the other recently-introduced setters.
4631 These don't need to be inline, since they're local.
4632
4633 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4634
4635 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4636 the loop (Bug#12247).
4637
4638 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * lisp.h (vcopy): Use memcpy rather than our own loop.
4641 This fixes a performance regression introduced by the recent
4642 addition of vcopy. This means 'vcopy' will need to be modified
4643 for a copying collector, but that's OK. Also, tighten the
4644 checking in the assertion.
4645
4646 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4647
4648 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4649 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4650 non-base glyph for the width of the base character, according to
4651 what x_draw_composite_glyph_string_foreground expects.
4652 Generate WADJUST value according to composition_gstring_width's
4653 expectations, to produce correct width of the composed character.
4654 Reverse the sign of the DU offset produced by ScriptPlace.
4655
4656 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4657
4658 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4659
4660 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4661
4662 Avoid direct writes to contents member of struct Lisp_Vector.
4663 * lisp.h (vcopy): New function to copy data into vector.
4664 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4665 * fns.c (Ffillarray): Use ASET.
4666 * keyboard.c (timer_check_2): Use AREF and ASET.
4667 (append_tool_bar_item, Frecent_keys): Use vcopy.
4668 * lread.c (read_vector): Use ASET.
4669 * msdos.c (Frecent_doskeys): Use vcopy.
4670 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4671 (Finternal_merge_in_global_face): Use ASET and vcopy.
4672 * xfont.c (xfont_list_pattern): Likewise.
4673
4674 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4675
4676 * window.c (Fwindow_point): For the selected window always return
4677 the position of its buffer's point.
4678 (Fset_window_point): For the selected window always go in its
4679 buffer to the specified position.
4680
4681 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 Setter macros for fontsets.
4684 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4685 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4686 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4687 Adjust users.
4688
4689 2012-08-20 Glenn Morris <rgm@gnu.org>
4690
4691 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4692 Don't assume that `ln -f' works.
4693
4694 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4695
4696 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4697 and later about non-assignments with no effect. See discussion at
4698 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4699 details.
4700
4701 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4702
4703 Inline setter functions for Lisp_Objects slots of struct specbinding.
4704 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4705 Adjust users.
4706
4707 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4708
4709 * window.c (select_window): Always make selected window's buffer
4710 current.
4711
4712 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4713
4714 Use AREF and ASET for docstrings of category tables.
4715 * category.h (CATEGORY_DOCSTRING): Use AREF.
4716 (SET_CATEGORY_DOCSTRING): Use ASET.
4717 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4718
4719 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4720
4721 Inline setter functions for hash table members.
4722 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4723 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4724 (set_hash_key_and_value, set_hash_index, set_hash_next)
4725 (set_hash_hash): New functions.
4726 * charset.c, fns.c: Adjust users.
4727
4728 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4729
4730 Inline getter and setter functions for per-buffer values.
4731 * buffer.h (per_buffer_default, set_per_buffer_default)
4732 (per_buffer_value, set_per_buffer_value): New functions.
4733 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4734 * buffer.c, data.c: Adjust users.
4735
4736 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4737
4738 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4739
4740 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4741
4742 Rely on <config.h> + <unistd.h> to declare 'environ',
4743 as gnulib does this if the system doesn't.
4744 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4745 Remove declaration. MS-Windows declares it on stdlib.h which is
4746 included by conf_post.h.
4747 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4748 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4749 * vm-limit.c: Include <unistd.h>, for 'environ'.
4750
4751 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4752 (start_of_data): Remove decl; mem-limits.h provides it.
4753
4754 * xdisp.c (handle_invisible_prop): Make it a bit faster
4755 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4756
4757 2012-08-19 Chong Yidong <cyd@gnu.org>
4758
4759 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4760 ends (Bug#3874).
4761
4762 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4763
4764 * .gdbinit: Use call instead of set when calling a function in the
4765 inferior.
4766
4767 * data.c (set_internal): Don't use set_blv_found.
4768 (Fkill_local_variable): Likewise.
4769
4770 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4771
4772 * nsfont.m (ns_ascii_average_width): Ensure the string
4773 ascii_printable is initialized with a null-terminated character
4774 array. Otherwise, it can contain undesired extra characters.
4775
4776 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4777
4778 port new setting code to Sun C 5.8 2005/10/13
4779 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4780 Return void, not Lisp_Object. Otherwise, the compiler
4781 complains about (A?B:C) where B is void and C is Lisp_Object
4782 when compiling CHAR_TABLE_SET, due to the recent change to
4783 the API of sub_char_table_set_contents.
4784
4785 2012-08-18 Chong Yidong <cyd@gnu.org>
4786
4787 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4788 for the string case (Bug#3874).
4789
4790 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4791
4792 * buffer.h (BSET): Remove (Bug#12215).
4793 Replace all uses with calls to new setter functions.
4794 (bset_bidi_paragraph_direction, bset_case_canon_table)
4795 (bset_case_eqv_table, bset_directory, bset_display_count)
4796 (bset_display_time, bset_downcase_table)
4797 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4798 (bset_last_selected_window, bset_local_var_alist)
4799 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4800 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4801 (bset_width_table):
4802 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4803 (bset_auto_fill_function, bset_auto_save_file_format)
4804 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4805 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4806 (bset_cache_long_line_scans, bset_case_fold_search)
4807 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4808 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4809 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4810 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4811 (bset_header_line_format, bset_indicate_buffer_boundaries)
4812 (bset_indicate_empty_lines, bset_invisibility_spec)
4813 (bset_left_fringe_width, bset_major_mode, bset_mark)
4814 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4815 (bset_name, bset_overwrite_mode, bset_pt_marker)
4816 (bset_right_fringe_width, bset_save_length)
4817 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4818 (bset_scroll_up_aggressively, bset_selective_display)
4819 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4820 (bset_word_wrap, bset_zv_marker):
4821 * category.c (bset_category_table):
4822 * syntax.c (bset_syntax_table):
4823 New setter functions.
4824
4825 * process.h (PSET): Remove (Bug#12215).
4826 Replace all uses with calls to new setter functions.
4827 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4828 (PROCESS_INLINE): New macro.
4829 (pset_childp): New setter function.
4830 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4831 * process.c (PROCESS_INLINE):
4832 Define to EXTERN_INLINE, so that the corresponding functions
4833 are compiled into code.
4834 (pset_buffer, pset_command, pset_decode_coding_system)
4835 (pset_decoding_buf, pset_encode_coding_system)
4836 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4837 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4838 (pset_type, pset_write_queue): New setter functions.
4839
4840 * window.h (WSET): Remove (Bug#12215).
4841 Replace all uses with calls to new setter functions.
4842 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4843 (WINDOW_INLINE): New macro.
4844 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4845 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4846 (wset_total_lines, wset_vertical_scroll_bar)
4847 (wset_window_end_pos, wset_window_end_valid)
4848 (wset_window_end_vpos): New setter functions.
4849 * window.c (WINDOW_INLINE):
4850 Define to EXTERN_INLINE, so that the corresponding functions
4851 are compiled into code.
4852 (wset_combination_limit, wset_dedicated, wset_display_table)
4853 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4854 (wset_new_normal, wset_new_total, wset_next_buffers)
4855 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4856 (wset_prev_buffers, wset_right_fringe_width)
4857 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4858 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4859 (wset_window_parameters):
4860 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4861 (wset_column_number_displayed, wset_region_showing):
4862 New setter functions.
4863
4864 * termhooks.h (TSET): Remove (Bug#12215).
4865 Replace all uses with calls to new setter functions.
4866 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4867 (TERMHOOKS_INLINE): New macro.
4868 (tset_charset_list, tset_selection_alist): New setter functions.
4869 * terminal.c (TERMHOOKS_INLINE):
4870 Define to EXTERN_INLINE, so that the corresponding functions
4871 are compiled into code.
4872 (tset_param_alist): New setter function.
4873
4874 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4875
4876 * keyboard.h (KSET): Remove (Bug#12215).
4877 Replace all uses with calls to new setter functions.
4878 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4879 (KEYBOARD_INLINE): New macro.
4880 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4881 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4882 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4883 New setter functions.
4884 * keyboard.c (KEYBOARD_INLINE):
4885 Define to EXTERN_INLINE, so that the corresponding functions
4886 are compiled into code.
4887 (kset_echo_string, kset_kbd_queue)
4888 (kset_keyboard_translate_table, kset_last_prefix_arg)
4889 (kset_last_repeatable_command, kset_local_function_key_map)
4890 (kset_overriding_terminal_local_map, kset_real_last_command)
4891 (kset_system_key_syms): New setter functions.
4892
4893 * frame.h (FSET): Remove (Bug#12215).
4894 Replace all uses with calls to new setter functions.
4895 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4896 (FRAME_INLINE): New macro.
4897 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4898 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4899 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4900 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4901 (fset_param_alist, fset_root_window, fset_scroll_bars)
4902 (fset_selected_window, fset_title, fset_tool_bar_items)
4903 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4904 * frame.c (FRAME_INLINE):
4905 Define to EXTERN_INLINE, so that the corresponding functions
4906 are compiled into code.
4907 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4908
4909 A few more naming-convention fixes for getters and setters.
4910 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4911 and rename from buffer_overlays_set_before.
4912 (set_buffer_overlays_after): Move here from buffer.h, and rename
4913 from buffer_overlays_set_after.
4914 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4915 All uses changed.
4916 (set_buffer_intervals): Rename from buffer_set_intervals.
4917 * intervals.c (set_interval_object): Move here from intervals.h,
4918 and rename from interval_set_object.
4919 (set_interval_left): Move here from intervals.h, and rename from
4920 interval_set_left.
4921 (set_interval_right): Move here from intervals.h, and rename from
4922 interval_set_right.
4923 (copy_interval_parent): Move here from intervals.h, and rename from
4924 interval_copy_parent.
4925 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4926 (set_interval_plist): Rename from interval_set_plist.
4927 Return void, not Lisp_Object, since no caller uses the result.
4928 * lisp.h (string_intervals): Rename from string_get_intervals.
4929 (set_string_intervals): Rename from string_set_intervals.
4930
4931 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4932 (set_char_table_contents): Rename from char_table_set_contents.
4933 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4934 All uses changed. See the end of
4935 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4936
4937 * lisp.h (CSET): Remove (Bug#12215).
4938 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4939 (set_char_table_purpose): New functions,
4940 replacing CSET. All uses changed. For example, replace
4941 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4942 "set_char_table_parent (char_table, parent);".
4943 The old version was confusing because it used the same name
4944 'parent' for two different things.
4945
4946 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 Functions to get and set Lisp_Object fields of buffer-local variables.
4949 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4950 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4951 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4952 * data.c, eval.c, frame.c: Adjust users.
4953
4954 2012-08-17 Chong Yidong <cyd@gnu.org>
4955
4956 * xfaces.c (merge_face_vectors): If the target font specfies a
4957 font spec, make the font's attributes take precedence over
4958 directly-specified attributes.
4959 (merge_face_ref): Recognize :font.
4960
4961 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4962
4963 Do not use memcpy for copying intervals.
4964 * intervals.c (reproduce_interval): New function.
4965 (reproduce_tree, reproduce_tree_obj): Use it.
4966 (reproduce_tree_obj): Remove prototype.
4967
4968 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 * lisp.h (duration_to_sec_usec): Remove unused decl.
4971
4972 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4973
4974 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4975 to an allocated instance of NSString, not to the class itself.
4976
4977 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4978
4979 * makefile.w32-in (C_CTYPE_H): New macro.
4980 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4981 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4982 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4983
4984 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 Use ASCII tests for character types.
4987 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4988 * xfns.c, xterm.c:
4989 Don't include <ctype.h>; was not needed.
4990 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4991 * sysdep.c, xfaces.c:
4992 Include <c-ctype.h> instead of <ctype.h>.
4993 * nsterm.m: Include <c-ctype.h>.
4994 * charset.c (read_hex):
4995 * doc.c (Fsnarf_documentation):
4996 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4997 (DRIVE_LETTER) [DOS_NT]:
4998 (Ffile_name_directory, Fexpand_file_name)
4999 (Fsubstitute_in_file_name):
5000 * font.c (font_parse_xlfd, font_parse_fcname):
5001 * frame.c (x_set_font_backend):
5002 * gtkutil.c (xg_get_font):
5003 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5004 * nsimage.m (hexchar):
5005 * nsterm.m (ns_xlfd_to_fontname):
5006 * sysdep.c (system_process_attributes):
5007 * xfaces.c (hash_string_case_insensitive):
5008 Use C-locale tests instead of locale-specific tests for character
5009 types, since we want the ASCII interpretation here, not the
5010 interpretation suitable for whatever happens to be the current locale.
5011
5012 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5013
5014 Consistently check windows for validity/liveness
5015 (Bug#11984, Bug#12025, Bug#12026).
5016 * lisp.h (CHECK_VALID_WINDOW): New macro.
5017 * window.c (decode_window): Rename to decode_live_window.
5018 (decode_valid_window, Fwindow_valid_p): New functions.
5019 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5020 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5021 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5022 (Fwindow_prev_sibling, Fwindow_combination_limit)
5023 (Fset_window_combination_limit, Fwindow_use_time)
5024 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5025 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5026 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5027 (Fwindow_hscroll, Fset_window_hscroll)
5028 (Fwindow_redisplay_end_trigger)
5029 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5030 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5031 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5032 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5033 (Fwindow_end, Fset_window_point, Fset_window_start)
5034 (Fpos_visible_in_window_p, Fwindow_line_height)
5035 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5036 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5037 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5038 (Fset_window_parameter, Fwindow_display_table)
5039 (Fset_window_display_table, Fdelete_other_windows_internal)
5040 (Fset_window_buffer, Fset_window_new_total)
5041 (Fset_window_new_normal, Fdelete_window_internal)
5042 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5043 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5044 (Fwindow_scroll_bars): Check whether argument window is a valid or
5045 live window. Update doc-strings.
5046 (syms_of_window): New symbol Qwindow_valid_p.
5047 * keyboard.c (Fposn_at_x_y): Check whether argument
5048 frame_or_window denotes a valid window.
5049
5050 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5051
5052 Fix previous char table change.
5053 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5054 * chartab.c (optimize_sub_char_table): Likewise.
5055
5056 2012-08-16 Chong Yidong <cyd@gnu.org>
5057
5058 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5059
5060 * xfont.c (xfont_open):
5061 * xftfont.c (xftfont_open): Set the font's max_width field.
5062
5063 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5064 min_width to space_width and average_width to the average over
5065 printable ASCII characters.
5066 (ns_char_width): Code cleanup.
5067 (ns_ascii_average_width): New utility function.
5068
5069 * font.h (struct font): Update comments.
5070
5071 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5072
5073 Simple interface to set Lisp_Object fields of character tables.
5074 * lisp.h (CSET): New macro.
5075 (char_table_set_extras, char_table_set_contents)
5076 (sub_char_table_set_contents): New function.
5077 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5078 * syntax.c: Adjust users.
5079
5080 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5081
5082 * eval.c (eval_sub): Bind lexical-binding.
5083 * lread.c (Qlexical_binding): Make non-static.
5084
5085 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5086
5087 * nsmenu.m (popupSession): Remove.
5088 (pop_down_menu): Remove endModalSession.
5089 (timeout_handler:): New method.
5090 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5091 Call runModalForWindow. Check timer_fired when it returns.
5092 If not set, cancel timer and break out of loop.
5093 Otherwise loop again, with a new timeout.
5094
5095 * nsterm.m: Include fcntl.h if present.
5096 (fd_entry, t_readfds, inNsSelect): Remove.
5097 (select_writefds, select_valid, select_timeout, selfds)
5098 (select_mutex, apploopnr): Add.
5099 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5100 Otherwise call kbd_buffer_store_event.
5101 (ns_send_appdefined): Remove release of fd_entry.
5102 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5103 Increment and decrement apploopnr.
5104 (ns_select): If no file descriptors, just do a NSTimer.
5105 Otherwise copy read/write masks and start select thread (fd_handler).
5106 Start main loop and wait for application defined event.
5107 Inform select thread to stop selecting after main loop is exited.
5108 (ns_term_init): Create selfds pipe and set non-blocking.
5109 Initialize select_mutex. Start the select thread (fd_handler).
5110 (fd_handler:): Loop forever, wait for info from the main thread
5111 to either start or stop selecting. When select returns, send
5112 and appdefined event.
5113 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5114 If not call kbd_buffer_store_event.
5115
5116 * nsterm.h (EmacsApp): fd_handler takes id argument.
5117 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5118
5119 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5120
5121 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5122
5123 * region-cache.c (move_cache_gap): Update gap_len using the actual
5124 growth of the boundaries array. Do not change cache_len.
5125 (Bug#12196)
5126
5127 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5128
5129 Generalize and cleanup font subsystem checks.
5130 * font.h (FONT_DEBUG, font_assert): Remove.
5131 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5132 Change font_assert to eassert. Use eassert where appropriate.
5133
5134 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5135
5136 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5137
5138 2012-08-15 Chong Yidong <cyd@gnu.org>
5139
5140 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5141 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5142 extract the font descriptor instead of just the font name.
5143 In that case, return a font spec instead of a string.
5144 (x_last_font_name): Move to this file from xfns.c.
5145
5146 * xfns.c (Fx_select_font): The return value can also be a font
5147 spec. Move x_last_font_name management to gtkutil.c.
5148
5149 * xfaces.c: Make font weight and style symbols non-static.
5150
5151 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5152
5153 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5154 (bug#12117).
5155
5156 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5157
5158 * alloc.c (Fgarbage_collect): Use plural form consistently.
5159
5160 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5161
5162 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5163 iteration through the command loop. Fixes a problem whereby mouse
5164 movements are ignored until the first mouse click.
5165
5166 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 Use bool, not int, for Lisp booleans.
5169 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5170 makes Emacs a bit smaller and presumably a bit faster.
5171 * lisp.h: Include <stdbool.h>.
5172 (struct Lisp_Boolfwd, defvar_bool):
5173 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5174 * regex.c [!emacs]: Include <stdbool.h>.
5175 (false, true): Remove; <stdbool.h> does this for us now.
5176
5177 2012-08-14 Chong Yidong <cyd@gnu.org>
5178
5179 * character.c (Fcharacterp): Doc fix (Bug#12076).
5180
5181 * data.c (Findirect_variable): Doc fix (Bug#11040).
5182
5183 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5184
5185 * editfns.c (Fformat): Doc fix (Bug#12059).
5186 (Fsave_current_buffer): Doc fix (Bug#11542).
5187
5188 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5189
5190 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5191 (bug#12022).
5192
5193 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5194
5195 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5196 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5197 * minibuf.c (choose_minibuf_frame, read_minibuf):
5198 * w32fns.c (x_create_tip_frame):
5199 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5200 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5201
5202 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 * intervals.c (offset_intervals): Remove obsolete comment.
5205
5206 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5207
5208 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5209
5210 2012-08-14 Gergely Risko <gergely@risko.hu>
5211
5212 * coding.c (decode_coding): Record buffer modification before
5213 disabling undo_list (Bug#11773).
5214
5215 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5216
5217 Revert and cleanup some recent overlay changes.
5218 * buffer.h (enum overlay_type): Remove.
5219 (buffer_get_overlays, buffer_set_overlays): Likewise.
5220 (buffer_set_overlays_before, buffer_set_overlays_after):
5221 New function. Adjust users.
5222 (unchain_both): Add eassert.
5223
5224 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5225
5226 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5227
5228 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5229
5230 * gtkutil.c (xg_mark_data): Don't assume C99.
5231
5232 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5233
5234 * gtkutil.c (xg_frame_tb_info): New struct.
5235 (TB_INFO_KEY): New define.
5236 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5237 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5238 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5239 if not present.
5240 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5241 is up to date. Otherwise store new data.
5242 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5243
5244 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5245
5246 Use KSET for write access to Lisp_Object members of struct kboard.
5247 * keyboard.h (KSET): New macro.
5248 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5249 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5250 * xterm.c: Adjust users.
5251
5252 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5253
5254 Use BSET for write access to Lisp_Object members of struct buffer.
5255 * buffer.h (BSET): New macro.
5256 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5257 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5258 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5259 * window.c, xdisp.c, xfns.c: Adjust users.
5260
5261 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5262
5263 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5264
5265 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5266
5267 * nsterm.m (not_in_argv): New function.
5268 (application:openFile, application:openTempFile:):
5269 (application:openFileWithoutUI:, application:openFiles:): Open file
5270 if not_in_argv returns non-zero (bug#12171).
5271
5272 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5273 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5274 Define for Gtk+ versions less than 3.2.
5275 (xg_get_font_name): Use those functions/macros here.
5276 Reported by Frans Oilinki <moilinki@gmail.com>.
5277
5278 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5279
5280 * unexmacosx.c (copy_data_segment): Copy initialized data in
5281 statically linked libraries from input file rather than memory.
5282
5283 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5284 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5285 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5286
5287 2012-08-10 Glenn Morris <rgm@gnu.org>
5288
5289 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5290 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5291
5292 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5293
5294 Fix last change to allow compilation with low optimization levels.
5295 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5296 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5297
5298 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5299
5300 Use common inline syntax in intervals.h.
5301 * intervals.h (INTERVALS_INLINE): New macro.
5302 Change all users from LISP_INLINE.
5303
5304 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5305
5306 Define Qnone once for all platforms.
5307 * frame.c (Qnone): Define here.
5308 (syms_of_frame): DEFSYM it.
5309 * lisp.h (Qnone): New declaration.
5310 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5311 * xfns.c: Remove duplication. Adjust users.
5312
5313 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Remove unused macros from intervals.h.
5316 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5317 * intervals.c: Adjust comment.
5318
5319 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5320
5321 * w32fns.c <w32_unicode_gui>: New static variable.
5322 (globals_of_w32fns): Initialize it according to os_subtype.
5323 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5324 testing os_subtype.
5325
5326 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5327 Eli Zaretskii <eliz@gnu.org>
5328
5329 Fix bug #10299 with Unicode characters sent by customized
5330 keyboards created by MSKLC.
5331 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5332 (w32_init_class): Use it to initialize the Emacs class with either
5333 ANSI or Unicode API calls.
5334 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5335 later.
5336 (w32_wnd_proc): If the character code sent by WM_CHAR or
5337 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5338 original message. Call DefWindowProcW on NT and later.
5339
5340 2012-08-10 Glenn Morris <rgm@gnu.org>
5341
5342 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5343
5344 * lisp.h (DIRECTORY_SEP): Let configure set it.
5345
5346 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5347
5348 Use TSET for write access to Lisp_Object slots of struct terminal.
5349 * termhooks.h (TSET): New macro.
5350 * coding.c, terminal.c, xselect.c: Adjust users.
5351
5352 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5353
5354 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5355 the failing expression, include them in the error message.
5356 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5357 * lisp.h (internal_condition_case_n): Update declaration.
5358
5359 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5360
5361 Inline functions to examine and change buffer overlays.
5362 * buffer.c (unchain_both): New function.
5363 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5364 (buffer_has_overlays): New function.
5365 (enum overlay_type): New enum.
5366 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5367 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5368
5369 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 Inline functions to examine and change buffer intervals.
5372 * alloc.c (mark_interval_tree): Remove.
5373 (MARK_INTERVAL_TREE): Simplify.
5374 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5375 * intervals.c (buffer_balance_intervals): New function.
5376 (graft_intervals_into_buffer): Adjust indentation.
5377 (set_intervals_multibyte): Simplify.
5378 * buffer.h (BUF_INTERVALS): Remove.
5379 (buffer_get_intervals, buffer_set_intervals): New function.
5380 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5381 * intervals.c, textprop.c: Adjust users.
5382
5383 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5384
5385 Inline functions to examine and change string intervals.
5386 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5387 (string_get_intervals, string_set_intervals): New function.
5388 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5389 * lread.c, print.c, textprop.c: Adjust users.
5390
5391 2012-08-08 Glenn Morris <rgm@gnu.org>
5392
5393 * lisp.mk (lisp): Remove language/persian.elc.
5394
5395 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5396
5397 Cleanup intervals.
5398 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5399 (NULL_INTERVAL_P): Likewise. Adjust users.
5400 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5401 Adjust comment. Move under #if 0.
5402 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5403 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5404
5405 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5406
5407 Check total length of intervals with eassert.
5408 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5409 * intervals.c: Change all users to eassert.
5410
5411 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5412
5413 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5414 Rename fields to match removal of FGET and WGET and disuse of
5415 INTERNAL_FIELD in Lisp_Cons.
5416
5417 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5418
5419 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5420 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5421 name since all xname users are fixed long time ago. Do not
5422 use INTERNAL_FIELD.
5423 (set_symbol_name, set_symbol_function, set_symbol_plist):
5424 (set_symbol_next, set_overlay_plist): New function.
5425 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5426 (struct Lisp_Overlay): Likewise.
5427 (CVAR, MVAR, SVAR): Remove.
5428 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5429 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5430 * xterm.c: Adjust users.
5431 * .gdbinit: Change to use name field of struct Lisp_Symbol
5432 where appropriate.
5433
5434 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5435
5436 Basic functions to set Lisp_Object and pointer slots of intervals.
5437 * intervals.h (interval_set_parent, interval_set_object):
5438 (interval_set_left, interval_set_right, interval_set_plist):
5439 (interval_copy_parent): New function.
5440 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5441 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5442 Adjust indentation.
5443 (INTERVAL_SIZE): Remove. Adjust users.
5444 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5445
5446 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5447
5448 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5449 * process.h (PGET): Remove.
5450 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5451 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5452
5453 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5456 * window.h (WGET): Remove.
5457 (struct window): Do not use INTERNAL_FIELD.
5458 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5459 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5460 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5461 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5462 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5463 Adjust users.
5464
5465 2012-08-07 Chong Yidong <cyd@gnu.org>
5466
5467 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5468 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5469 (Fdelete_window_internal): Signal an error if the window is not on
5470 a live frame (Bug#12025).
5471
5472 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5473
5474 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5475 * frame.h (FGET): Remove.
5476 (struct frame): Do not use INTERNAL_FIELD.
5477 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5478 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5479 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5480 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5481
5482 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5483
5484 * w32.c: Silence compiler warnings.
5485 (map_w32_filename): Remove unused variable `is_fat'.
5486 (chase_symlinks): Add parentheses around expression.
5487
5488 2012-08-06 Glenn Morris <rgm@gnu.org>
5489
5490 * sysdep.c: Respect BROKEN_GETWD.
5491
5492 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5493 Let configure handle it.
5494 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5495
5496 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5497
5498 Use GCALIGNMENT where appropriate.
5499 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5500 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5501 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5502
5503 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5504
5505 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5506 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5507
5508 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5509
5510 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5511 that should be sufficient for everyone.
5512
5513 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5514
5515 * keyboard.c (timer_check_2): Add break so timer_check returns next
5516 timeout.
5517
5518 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5519
5520 Fix Windows build errors introduced after converting to WGET and WSET.
5521 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5522 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5523
5524 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5525
5526 * nsterm.m (ns_frame_rehighlight): Use FSET.
5527
5528 * nsmenu.m (ns_update_menubar): Use FSET.
5529
5530 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5531
5532 Separate read and write access to Lisp_Object slots of Lisp_Process.
5533 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5534 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5535
5536 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 Separate read and write access to Lisp_Object slots of struct window.
5539 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5540 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5541 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5542 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5543 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5544 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5545 Adjust users.
5546
5547 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5548
5549 Fix Windows build errors introduced after converting to FGET and FSET.
5550 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5551 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5552 (w32_judge_scroll_bars): Change to use FSET.
5553 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5554
5555 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 Fix replacement typo.
5558 * window.c (replace_window): Set root_window instead of
5559 selected_window. This fixes a total window subsystem
5560 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5561
5562 2012-08-06 Glenn Morris <rgm@gnu.org>
5563
5564 * lisp.mk (lisp): Add language/persian.elc.
5565
5566 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5567
5568 Separate read and write access to Lisp_Object slots of struct frame.
5569 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5570 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5571 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5572 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5573 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5574
5575 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5576
5577 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5578
5579 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5580
5581 Generalize common compile-time constants.
5582 * lisp.h (header_size, bool_header_size, word_size): Now here.
5583 (struct Lisp_Vector): Add comment.
5584 (struct Lisp_Bool_Vector): Move up to define handy constants.
5585 (VECSIZE, PSEUDOVECSIZE): Simplify.
5586 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5587 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5588 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5589 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5590 * xfont.c, xmenu.c: Use word_size where appropriate.
5591
5592 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5593
5594 * search.c (Freplace_match): Treat \? in the replacement text
5595 literally (Bug#8161).
5596
5597 2012-08-05 Chong Yidong <cyd@gnu.org>
5598
5599 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5600 * frame.c (Vdelete_frame_functions):
5601 * emacs.c (Vkill_emacs_hook): Doc fix.
5602
5603 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5604
5605 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5606 --with-x-toolkit=no builds.
5607 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5608
5609 2012-08-04 Chong Yidong <cyd@gnu.org>
5610
5611 * syntax.c (Fmodify_syntax_entry): Doc fix.
5612
5613 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5614
5615 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5616 * w32.c (init_environment): Change the default values of many
5617 environment variables in dflt_envvars[] to NULL, to avoid pushing
5618 them into environment when they were not already defined.
5619 Remove the code that deletes site-lisp subdirectories from the default
5620 value of EMACSLOADPATH, as it is no longer needed.
5621 (check_windows_init_file): Now external, not static.
5622 Use Vload_path as is, without adding anything, as this function is now
5623 called when Vload_path is already set up.
5624
5625 * w32.h (check_windows_init_file): Add prototype.
5626
5627 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5628 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5629 compatibility with Posix platforms.
5630 (main): Move the call to check_windows_init_file to here from
5631 w32.c.
5632 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5633 any, in the DEFALT argument into the root of the Emacs build or
5634 installation tree, as appropriate.
5635
5636 * callproc.c (init_callproc_1): Call decode_env_path instead of
5637 doing its equivalent by hand.
5638 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5639 the code that sets Vexec_path run on MS-Windows.
5640
5641 * lread.c (init_lread): Add comments to #ifdef's.
5642
5643 * msdos.c (dos_set_window_size, IT_update_begin)
5644 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5645 instead of direct references.
5646
5647 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5648
5649 Export DEFAULT_REHASH_* to GDB.
5650 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5651 Now constants, not macros.
5652
5653 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5654
5655 Remove unnecessary casts involving pointers.
5656 These casts are no longer needed now that we assume C89 or later,
5657 since they involve casting to or from void *.
5658 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5659 (make_pure_float, make_pure_vector):
5660 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5661 * macros.c (Fstart_kbd_macro):
5662 * menu.c (find_and_return_menu_selection):
5663 * minibuf.c (read_minibuf_noninteractive):
5664 * sysdep.c (closedir):
5665 * xdisp.c (x_produce_glyphs):
5666 * xfaces.c (compare_fonts_by_sort_order):
5667 * xfns.c (x_real_positions, select_visual):
5668 * xselect.c (x_stop_queuing_selection_requests)
5669 (x_get_window_property, x_get_window_property_as_lisp_data):
5670 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5671 Remove unnecessary pointer casts.
5672 * alloc.c (record_xmalloc): New function.
5673 * lisp.h (record_xmalloc): New decl.
5674 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5675 more like a function. This is because the pointer cast is not
5676 needed. All uses changed.
5677 * print.c (print_string, print_error_message): Avoid length recalc.
5678
5679 Improve fix for macroexp crash with debugging (Bug#12118).
5680 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5681 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5682 not supposed to be invoked from the garbage collector.
5683 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5684 (gc_aset): New function, which is like ASET but can be
5685 used in the garbage collector.
5686 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5687 (set_hash_index): Use it instead of ASET.
5688
5689 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5690
5691 Support symlinks on latest versions of MS-Windows.
5692 * w32.c: Include winioctl.h and aclapi.h.
5693 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5694 (revert_to_self): Forward declarations of static functions.
5695 <static BOOL g_b_init_get_security_info>:
5696 <g_b_init_create_symbolic_link>: New static flags.
5697 (globals_of_w32): Initialize them to zero.
5698 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5699 (map_w32_filename): Improve commentary. Simplify switch.
5700 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5701 headers (most versions of MinGW w32api don't).
5702 (get_security_info, create_symbolic_link)
5703 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5704 New functions.
5705 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5706 in the argument file name.
5707 (sys_access): Call unc_volume_file_attributes only if
5708 GetFileAttributes fails with network-related error codes.
5709 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5710 have the required privileges.
5711 (get_file_security_desc_by_name): Rename from
5712 get_file_security_desc.
5713 (stat_worker): New function, with most of the guts of 'stat', and
5714 with addition of handling of symlinks and support for 'lstat'.
5715 If possible, get file's attributes and security information by
5716 handle, not by name. Produce S_IFLNK bit for symlinks, when
5717 called from 'lstat'.
5718 (stat, lstat): New functions, call 'stat_worker'.
5719 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5720 symlinks when the underlying filesystem supports them.
5721
5722 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 Fix macroexp crash on Windows with debugging (Bug#12118).
5725 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5726 checking subscripts; problem introduced with the recent
5727 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5728 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5729 since it's used in non-static inline functions now.
5730
5731 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5732 Don't assume buffer size fits in 'int'. Remove unused local.
5733
5734 Use C99-style 'extern inline' if available.
5735 * buffer.h (BUFFER_INLINE):
5736 * category.h (CATEGORY_INLINE):
5737 * character.h (CHARACTER_INLINE):
5738 * charset.h (CHARSET_INLINE):
5739 * composite.h (COMPOSITE_INLINE):
5740 * dispextern.h (DISPEXTERN_INLINE):
5741 * lisp.h (LISP_INLINE):
5742 * systime.h (SYSTIME_INLINE):
5743 New macro, replacing 'static inline' in this header.
5744 * buffer.h, category.h, character.h, charset.h, composite.h:
5745 * dispextern.h, lisp.h, systime.h:
5746 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5747 * alloc.c (LISP_INLINE):
5748 * buffer.c (BUFFER_INLINE):
5749 * category.c (CATEGORY_INLINE):
5750 * character.c (CHARACTER_INLINE):
5751 * charset.c (CHARSET_INLINE):
5752 * composite.c (COMPOSITE_INLINE):
5753 * dispnew.c (DISPEXTERN_INLINE):
5754 * sysdep.c (SYSTIME_INLINE):
5755 Define to EXTERN_INLINE, so that the corresponding functions
5756 are compiled into code.
5757 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5758 (INLINE_HEADER_END): New macros.
5759 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5760 since it's used in non-static inline functions now.
5761 (VALMASK) [!USE_LSB_TAG]: Likewise.
5762
5763 2012-08-02 Glenn Morris <rgm@gnu.org>
5764
5765 * s/: Remove empty directory.
5766
5767 * s/ms-w32.h: Move to ../nt/inc.
5768 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5769 Update for new ms-w32.h location.
5770
5771 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 Port to Solaris 8.
5774 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5775
5776 2012-08-02 Glenn Morris <rgm@gnu.org>
5777
5778 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5779 hard-coding the path separator.
5780
5781 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5784 This how ASET and AREF are supposed to work, and makes
5785 it easier to think about future improvements. See
5786 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5787 * charset.h (set_charset_attr): New function.
5788 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5789 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5790 (aref_addr): New function. All uses of &AREF(...) changed.
5791 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5792 (set_hash_index): New functions. All lvalue-style uses of
5793 HASH_KEY etc. changed.
5794 * keyboard.c (set_prop): New function. All lvalue-style uses
5795 of PROP changed.
5796
5797 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5798
5799 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5800 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5801 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5802 * nsfns.m (ns_set_name_as_filename): Likewise.
5803 * nsmenu.m (ns_update_menubar): Likewise.
5804 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5805
5806 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5807
5808 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5809 Adapt to latest changes in field names of the corresponding Lisp
5810 objects.
5811
5812 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5813
5814 2012-08-01 Glenn Morris <rgm@gnu.org>
5815
5816 * s/msdos.h: Remove file.
5817 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5818 * Makefile.in (S_FILE): Remove.
5819 (config_h): Remove S_FILE.
5820
5821 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5822
5823 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5824 Remove; moved to nt/config.nt.
5825
5826 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5827
5828 Use INTERNAL_FIELD for conses and overlays.
5829 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5830 Remove obsolete comment.
5831 (MVAR): New macro.
5832 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5833 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5834
5835 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5836
5837 Use INTERNAL_FIELD for symbols.
5838 * lisp.h (SVAR): New macro. Adjust users.
5839 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5840 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5841
5842 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5843
5844 Use INTERNAL_FIELD for processes.
5845 * process.h (PVAR): New macro. Adjust style.
5846 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5847 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5848
5849 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 Use INTERNAL_FIELD for windows.
5852 * window.h (WVAR): New macro.
5853 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5854 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5855 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5856 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5857 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5858 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5859
5860 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5861
5862 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5863
5864 2012-08-01 Glenn Morris <rgm@gnu.org>
5865
5866 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5867 Move to configure.ac.
5868
5869 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5870
5871 * makefile.w32-in (CONFIG_H): Update dependencies.
5872 (CONF_POST_H): New macro.
5873
5874 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5875
5876 2012-07-31 Glenn Morris <rgm@gnu.org>
5877
5878 * Makefile.in (S_FILE): No longer set by configure.
5879
5880 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5881 is available.
5882 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5883
5884 * process.h (NULL_DEVICE):
5885 * emacs.c (SEPCHAR):
5886 * editfns.c (USER_FULL_NAME): Let configure set them.
5887
5888 * s/README, s/template.h: Remove files.
5889
5890 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5891
5892 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5893 Move to configure.ac.
5894
5895 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5896
5897 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5898 resulting renaming of 'struct frame' members.
5899
5900 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5901
5902 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5903 after introduction of FVAR.
5904
5905 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5906
5907 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5908
5909 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5910 instead of compositeToPoint.
5911 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5912
5913 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5914
5915 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5916
5917 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5918 * lisp.h (INTERNAL_FIELD): New macro.
5919 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5920 (BVAR): Change to use INTERNAL_FIELD.
5921 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5922 (KVAR): Change to use INTERNAL_FIELD.
5923 * frame.h (FVAR): New macro.
5924 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5925 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5926 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5927 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5928 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5929
5930 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5931
5932 Miscellaneous fixes for non-default X toolkits.
5933 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5934 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5935 Move under #ifdef USE_LUCID.
5936 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5937 definition and usage to avoid warnings.
5938
5939 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5940
5941 * nsterm.m (openFiles): Fix previous checkin.
5942
5943 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5944
5945 * indent.c (compute_motion): Remove unused local.
5946
5947 2012-07-31 Glenn Morris <rgm@gnu.org>
5948
5949 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5950
5951 * conf_post.h [USG5_4]:
5952 Move remaining contents of s/usg5-4-common.h here.
5953 * s/usg5-4-common.h: Remove file.
5954
5955 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5956 * s/irix6-5.h: Remove file.
5957
5958 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5959 * s/darwin.h: Remove file.
5960
5961 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5962 * s/hpux10-20.h: Remove file, which is now empty.
5963
5964 2012-07-30 Glenn Morris <rgm@gnu.org>
5965
5966 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5967 * Makefile.in (config_h): Add conf_post.h.
5968 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5969
5970 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5971
5972 * nsterm.m (ns_do_open_file): New variable.
5973 (ns_term_init): Set ns_do_open_file to YES after run returns.
5974 (openFile, openTempFile, openFileWithoutUI, openFiles):
5975 Open files only if ns_do_open_file.
5976
5977 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5978
5979 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5980 This no-op macro hasn't been needed for many years.
5981 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5982
5983 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5984 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5985 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5986 gdb_make_enums_visible.
5987 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5988 (DIRECTORY_SEP): Now a constant, not a macro.
5989
5990 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5991
5992 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5993 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5994
5995 * w32term.c <w32_keyboard_codepage>: Renamed from
5996 keyboard_codepage and now external. All users changed.
5997
5998 * w32term.h: Add declaration of w32_keyboard_codepage.
5999
6000 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6001 the codepage to translate keys to Unicode. If this argument is
6002 -1, use the value returned by GetConsoleCP. All callers changed.
6003
6004 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 Update .PHONY listings in makefiles.
6007 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6008 bootstrap-clean, distclean, maintainer-clean, versioclean,
6009 extraclean, frc.
6010
6011 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6012 This is a bit clearer. Fix some commentary typos.
6013
6014 2012-07-30 Glenn Morris <rgm@gnu.org>
6015
6016 * s/netbsd.h: Let configure include signal.h if needed.
6017 Remove file, which is now empty.
6018
6019 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6020 Let configure set them.
6021 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6022 No more need to undefine.
6023
6024 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6025
6026 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6027 non-single-byte char when adding meta modifier. (Bug#12090)
6028
6029 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6030
6031 Convert safe_call to use variable number of arguments.
6032 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6033 (safe_call2): Fix comment.
6034 * lisp.h (safe_call): Adjust prototype.
6035 * coding.c (encode_coding_object): Change to use safe_call2.
6036 * xfaces.c (merge_face_heights): Change to use safe_call1.
6037
6038 2012-07-30 Glenn Morris <rgm@gnu.org>
6039
6040 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6041 does that unconditionally. Remove file, which is now empty.
6042
6043 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6044 Remove empty files.
6045
6046 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 Export to GDB most of lisp.h's remaining object-like macros.
6049 * lisp.h (min, max): Move earlier, because they're used earlier now.
6050 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6051 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6052 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6053 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6054 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6055 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6056 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6057 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6058 Now constants, for GDB. They need not be macros.
6059 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6060 Now constants, for GDB, as well as macros, for static initializers.
6061 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6062 Move to after the definition of struct Lisp_Char_Table,
6063 since the former now needs that type defined.
6064 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6065 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6066 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6067 New enums, for gdb_make_enums_visible.
6068 (GLYPH_MODE_LINE_FACE): Remove; unused.
6069 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6070 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6071 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6072 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6073 enum maxargs, enum MAX_ALLOCA.
6074 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6075 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6076 no longer needed, now that they are done in lisp.h.
6077
6078 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6079
6080 Cleanup string bytes checking.
6081 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6082 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6083 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6084 (check_sblock, compact_small_strings): Simplify.
6085
6086 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6087
6088 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6089 These macros are confusing and no longer need to be defined, as
6090 the enum values now suffice. All uses replaced with definiens.
6091 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6092
6093 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6094
6095 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6096 ($(BLD)/w32console.$(O)): Update dependencies.
6097
6098 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6099
6100 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6101 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6102 time. Adjust users.
6103 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6104
6105 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6106
6107 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6108 setting sitelisp (Bug#12010).
6109
6110 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6111
6112 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6113
6114 * w32heap.c (cache_system_info):
6115 * w32.c (sys_rename):
6116 * w32proc.c (find_child_console, sys_kill): All users changed.
6117
6118 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6121
6122 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6123
6124 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6125
6126 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6127
6128 Cleanup statistics calculation in Fgarbage_collect.
6129 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6130 Fix zombies percentage calculation. Simplify elapsed time calculation.
6131
6132 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6133
6134 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6135 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6136 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6137 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6138 (replace_range, replace_range_2, del_range_2): Change to eassert.
6139 * marker.c (byte_char_debug_check): Adjust style.
6140
6141 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6144 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6145 long-ago-commented-out code that talks about "WIN32".
6146 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6147 All uses changed.
6148
6149 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6152 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6153 Simplify by using alignof.
6154 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6155 * lisp.h: Include <stdalign.h>.
6156 (GCALIGNMENT): New macro and constant.
6157 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6158 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6159 (stdalign): New macro, if not already defined.
6160
6161 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6162
6163 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6164 * w32inevt.c: Include w32inevt.h.
6165 (w32_read_console_input): New inline function, calls either
6166 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6167 w32_console_unicode_input.
6168 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6169 (w32_kbd_patch_key, key_event): Use the codepage returned by
6170 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6171 (key_event): use uChar.UnicodeChar only if
6172 w32_console_unicode_input is non-zero.
6173
6174 * w32console.c: Include w32heap.h.
6175 <w32_console_unicode_input>: New global variable.
6176 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6177 family of Windows, zero otherwise.
6178
6179 * w32inevt.h: Declare w32_console_unicode_input.
6180
6181 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6182 --without-x. (Bug#11742)
6183
6184 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6185
6186 Adjust GDB to reflect pvec_type changes (Bug#12036).
6187 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6188 2012-07-04 changes to pseudovector representation.
6189 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6190
6191 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6192
6193 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6194 bus address.
6195 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6196
6197 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6198
6199 * alloc.c (listn): Fix the order the arguments are consed onto the
6200 list.
6201
6202 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6203 enumeration constants, as PURE and HEAP are too general, and clash
6204 with other headers and sources, such as gmalloc.c and the
6205 MS-Windows system headers. All users changed.
6206
6207 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6208
6209 Revert last save_excursion_save and save_excursion_restore changes.
6210 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6211 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6212
6213 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 Fix recently-introduced typos in Windows port.
6216 Reported by Martin Rudalics <rudalics@gmx.at>.
6217 * w32.c (init_environment): Replace comma with semicolon.
6218 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6219
6220 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6221
6222 Improve GDB symbol export (Bug#12036).
6223 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6224 arms of an 'if', not using conditional expressions; otherwise GDB
6225 complains about the types in the unevaluated arm when the argument
6226 is an integer literal.
6227 (xgetint): Simplify expression.
6228 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6229 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6230 Zaretskii in <http://bugs.gnu.org/12036#13>.
6231 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6232 needed now that we have gdb_make_enums_visible.
6233 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6234 (enum enum_USE_LSB_TAG):
6235 New enum types, packaging up enums that need to be exported to GDB.
6236
6237 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6238
6239 Utility function to make a list from specified amount of objects.
6240 * lisp.h (enum constype): New datatype.
6241 (listn): New prototype.
6242 * alloc.c (listn): New function.
6243 (Fmemory_use_count, syms_of_alloc): Use it.
6244 * buffer.c (syms_of_buffer): Likewise.
6245 * callint.c (syms_of_callint): Likewise.
6246 * charset.c (define_charset_internal): Likewise.
6247 * coding.c (syms_of_coding): Likewise.
6248 * keymap.c (syms_of_keymap): Likewise.
6249 * search.c (syms_of_search): Likewise.
6250 * syntax.c (syms_of_syntax): Likewise.
6251 * w32.c (init_environment): Likewise.
6252 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6253 * xdisp.c (syms_of_xdisp): Likewise.
6254 * xfns.c (syms_of_xfns): Likewise.
6255
6256 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6257
6258 Fast save_excursion_save and save_excursion_restore.
6259 * lisp.h (struct Lisp_Excursion): New data type.
6260 (PVEC_EXCURSION): New pseudovector type.
6261 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6262 to deal with it. Adjust comments.
6263 (init_marker, attach_marker): New prototype.
6264 (unchain_marker): Adjust prototype.
6265 * marker.c (attach_marker): Change to global.
6266 (init_marker): New function.
6267 * alloc.c (Fmake_marker, build_marker): Use it.
6268 (build_marker): More easserts.
6269 (mark_object): Handle struct Lisp_Excursion.
6270 * editfns.c (save_excursion_save, save_excursion_restore):
6271 Reimplement to use struct Lisp_Excursion. Add comments.
6272
6273 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6274
6275 Fix export of symbols to GDB (Bug#12036).
6276 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6277 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6278 emacs.c, as this is a more-suitable home. Had this been done earlier
6279 the fix for 12036 would have avoided some of the problems noted in
6280 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6281 would have been more obvious.
6282 * emacs.c: Do not include <verify.h>; no longer needed.
6283 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6284 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6285 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6286 Remove; now done in lisp.h.
6287 * lisp.h (PUBLISH_TO_GDB): New macro.
6288 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6289 (DATA_SEG_BITS): Use it.
6290 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6291 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6292 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6293 not be usable in #if. This simplifies things.
6294
6295 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6296
6297 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6298
6299 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6300
6301 Simplify export of symbols to GDB (Bug#12036).
6302 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6303 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6304 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6305 Adjust to changes in lisp.h and emacs.c, by using
6306 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6307 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6308 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6309 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6310 instead of gdb_valbits.
6311 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6312 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6313 instead of gdb_array_mark_flag.
6314 (xboolvector): Get size from $->size, not $->header.size.
6315 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6316 (xreload, hook-run, hookpost-run): Remove.
6317 * emacs.c: Include <verify.h>.
6318 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6319 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6320 Remove.
6321 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6322 (gdb_USE_LSB_TAG): New enum constants.
6323 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6324 Also define these as enum constants, so they're visible to GDB.
6325 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6326 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6327 as constants, so they're visible to GDB.
6328 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6329 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6330 Now enum constants, not macros, so they're visible to GDB.
6331 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6332 more convenient now. All uses changed.
6333 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6334 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6335
6336 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6337
6338 Explicitly free restriction data that are not needed anymore.
6339 * editfns.c (save_restriction_restore): Free restriction data.
6340
6341 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6342
6343 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6344 add argument, tune behavior, and adjust all callers.
6345
6346 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6347
6348 Use typedef for EMACS_INT, EMACS_UINT.
6349 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6350 than macros. This simplifies debugging in the usual case, since
6351 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6352 and it allows expressions involving EMACS_INT casts.
6353 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6354
6355 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6356
6357 * nsterm.m (ns_read_socket): Return early if there is a modal
6358 window (Bug#12043).
6359
6360 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6361
6362 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6363 that FOCUS-FRAME can be omitted.
6364
6365 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6366
6367 Adjust buffer text indirection counters at the end of Fkill_buffer.
6368 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6369 buffer is definitely dead. This should really fix an issue reported
6370 by Christoph Scholtes again. (Bug#12007).
6371 (init_buffer_once): Initialize indirection counters of
6372 buffer_defaults and buffer_local_symbols (for sanity and safety).
6373
6374 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6375
6376 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6377 and continuation glyphs on tooltip frames, leave them at zero.
6378 Avoids continued lines in tooltips. (Bug#11832)
6379
6380 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6381
6382 Simplify copy_overlay.
6383 * buffer.c (copy_overlay): Simplify. Use build_marker.
6384 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6385
6386 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6387
6388 * print.c (print_object): Don't crash when a frame's name is nil
6389 or invalid. (Bug#12025)
6390
6391 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6392 it signals an error when a tooltip frame is being created.
6393
6394 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 Cleanup miscellaneous objects allocation and initialization.
6397 * alloc.c (allocate_misc): Change to static. Add argument to
6398 specify the subtype. Adjust comment and users.
6399 (build_overlay): New function.
6400 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6401 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6402 (allocate_misc): Remove prototype.
6403 (build_overlay): Add prototype.
6404
6405 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6406
6407 Swap buffer text indirection counters in Fbuffer_swap_text.
6408 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6409 This avoids crash reported by Christoph Scholtes at
6410 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6411
6412 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6413
6414 * nsmenu.m (Popdown_data): New struct.
6415 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6416 free Popdown_data.
6417 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6418 (initWithContentRect): Make imgView and contentView non-static
6419 and autorelease them. Also autorelease img and matrix (Bug#12005).
6420 (dealloc): Remove (Bug#12005).
6421
6422 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6423
6424 Adjust consing_since_gc when objects are explicitly freed.
6425 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6426 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6427 (free_cons, free_misc): Subtract object size from consing_since_gc.
6428
6429 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6430
6431 Simplify and cleanup markers positioning code.
6432 * marker.c (attach_marker): More useful eassert.
6433 (live_buffer, set_marker_internal): New function.
6434 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6435 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6436
6437 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6440 as it's limited by the amount of memory, not by INT_MAX.
6441
6442 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6443
6444 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6445 in special-event-map. See the discussion at
6446 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6447 for the reasons.
6448
6449 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6450 info.dwItemData. Fixes crashes on 64-bit Windows.
6451 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6452
6453 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6454
6455 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6456 (conversationIdentifier): Return value is NSInteger.
6457 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6458
6459 2012-07-21 Chong Yidong <cyd@gnu.org>
6460
6461 * window.c (decode_any_window): Signal an error if the window is
6462 on a dead frame (Bug#11984).
6463
6464 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6465
6466 Add indirection counting to speed up Fkill_buffer.
6467 * buffer.h (struct buffer): New member.
6468 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6469 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6470 base buffer indirection counter.
6471 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6472 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6473 through buffer list if indirection counter is 0.
6474
6475 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6476
6477 Extend the value returned by Fgarbage_collect with heap statistics.
6478 * alloc.c (Qheap): New symbol.
6479 (syms_of_alloc): DEFSYM it.
6480 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6481 (Fmemory_free): Remove.
6482 (syms_of_alloc): Don't defsubr it.
6483 * buffer.c (Fcompact_buffer): Remove.
6484 (syms_of_buffer): Don't defsubr it.
6485
6486 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6487
6488 Make maybe_gc inline.
6489 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6490 * lisp.h (consing_since_gc, gc_relative_threshold)
6491 (memory_full_cons_threshold): Revert declaration.
6492 (maybe_gc): Remove prototype, define as inline.
6493 * alloc.c: Remove old commented-out code.
6494 (consing_since_gc, gc_relative_threshold)
6495 (memory_full_cons_threshold): Revert to global.
6496 (maybe_gc): Remove.
6497
6498 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6499
6500 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6501 * lisp.h (build_unibyte_string): New function.
6502 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6503 * sysdep.c, w32fns.c, xfns.c: Use it.
6504 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6505 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6506 Adjust users accordingly.
6507 * font.h (font_open_by_name): Adjust prototype.
6508
6509 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6510
6511 Cleanup calls to Fgarbage_collect.
6512 * lisp.h (maybe_gc): New prototype.
6513 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6514 Remove declarations.
6515 * alloc.c (maybe_gc): New function.
6516 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6517 Make them static.
6518 * bytecode.c (MAYBE_GC): Use maybe_gc.
6519 * eval.c (eval_sub, Ffuncall): Likewise.
6520 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6521 to avoid dependency from auto-save feature.
6522
6523 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6526 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6527 'for_each_per_buffer_object_at'.
6528 All uses changed. It's better to use upper-case for macros that
6529 cannot be implemented as functions, to give the reader a clue
6530 that they're special.
6531
6532 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6533
6534 * alloc.c (Fgarbage_collect): Tweak docstring.
6535
6536 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6537
6538 Tweak the value returned from Fgarbage_collect again.
6539 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6540 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6541 Adjust documentation.
6542 (total_vector_bytes): Rename to total_vector_slots, adjust
6543 accounting.
6544 (total_free_vector_bytes): Rename to total_free_vector_slots,
6545 adjust accounting.
6546 (Qstring_bytes, Qvector_slots): New symbols.
6547 (syms_of_alloc): DEFSYM them.
6548
6549 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6550
6551 Buffer compaction primitive which may be used from Lisp.
6552 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6553 (syms_of_buffer): Register Fcompact_buffer.
6554 * alloc.c (Fgarbage_collect): Use compact_buffer.
6555 * buffer.h (compact_buffer): New prototype.
6556 (struct buffer_text): New member.
6557
6558 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6559
6560 New macro to iterate over all buffers, miscellaneous cleanups.
6561 * lisp.h (all_buffers): Remove declaration.
6562 * buffer.h (all_buffers): Add declaration, with comment.
6563 (for_each_buffer): New macro.
6564 * alloc.c (Fgarbage_collect, mark_object): Use it.
6565 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6566 (init_buffer): Likewise.
6567 * data.c (Fset_default): Likewise.
6568 * coding.c (code_conversion_restore): Remove redundant check
6569 for dead buffer.
6570 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6571
6572 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6573
6574 Fix bug that created negative-length intervals.
6575 * intervals.c (merge_interval_right, merge_interval_left):
6576 Do not zero out this interval if it is absorbed by its children,
6577 as this interval's total length doesn't change in that case. See
6578 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6579
6580 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6581
6582 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6583 when invoking (make-bool-vector N t) and N is a positive
6584 multiple of 8 -- the last 8 bits were mistakenly cleared.
6585
6586 Remove some struct layout assumptions in bool vectors.
6587 * alloc.c (bool_header_size): New constant.
6588 (header_size, word_size): Move earlier, as they're now used earlier.
6589 Use 'word_size' in a few more places, where it's appropriate.
6590 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6591 padding before the data member of a bool vector.
6592 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6593 than doing the check by hand with an abort ().
6594
6595 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6596
6597 * eval.c (Fdefvar): Don't check constants since we only set the var if
6598 it's not yet defined anyway (bug#11904).
6599
6600 * lisp.h (last_undo_boundary): Declare new var.
6601 * keyboard.c (command_loop_1): Set it.
6602 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6603 were auto-added by the command loop (bug#11774).
6604
6605 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6606
6607 * w32font.c (Qsymbol): Remove local definition.
6608 (syms_of_w32font): Don't DEFSYM it.
6609
6610 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6611
6612 Fix sweep_vectors to handle large bool vectors correctly.
6613 * alloc.c (sweep_vectors): Account total_vector_bytes for
6614 bool vectors larger than VBLOCK_BYTES_MAX.
6615
6616 2012-07-18 Chong Yidong <cyd@gnu.org>
6617
6618 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6619 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6620
6621 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Return more descriptive data from Fgarbage_collect.
6624 Suggested by Stefan Monnier in
6625 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6626 * alloc.c (bounded_number): New function.
6627 (total_buffers, total_vectors): New variable.
6628 (total_string_size): Rename to total_string_bytes, adjust users.
6629 (total_vector_size): Rename to total_vector_bytes, adjust users.
6630 (sweep_vectors): Account total_vectors and total_vector_bytes.
6631 (Fgarbage_collect): New return value. Adjust documentation.
6632 (gc_sweep): Account total_buffers.
6633 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6634 (VECTOR_SIZE): Remove.
6635 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6636 (Qinterval, Qmisc): New symbols.
6637 (syms_of_data): Initialize them.
6638 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6639 (Qcons, Qbuffer): New declarations.
6640
6641 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6642
6643 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6644 Round up, not down. Improve doc.
6645
6646 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6647
6648 Restore old code in allocate_string_data to avoid Faset breakage.
6649 Reported by Julien Danjou <julien@danjou.info> in
6650 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6651 * alloc.c (allocate_string_data): Restore old code with minor
6652 adjustments, fix comment to explain this subtle issue.
6653
6654 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6655
6656 Remove FILE_SYSTEM_CASE.
6657 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6658
6659 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6660 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6661 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6662 call-process-region passes it through expand-file-name.
6663
6664 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6665
6666 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6667
6668 Fix crash when creating indirect buffer (Bug#11917)
6669 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6670 Don't handle unbound variables specially if non-zero.
6671 (Fbuffer_local_variables): Pass zero.
6672 (clone_per_buffer_values): Pass non-zero.
6673
6674 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6675
6676 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6677 to make the loop interruptible.
6678
6679 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6680
6681 * gnutls.c (emacs_gnutls_handshake): Only retry if
6682 GNUTLS_E_INTERRUPTED.
6683
6684 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6685
6686 Cleanup and convert miscellaneous checks to eassert.
6687 * alloc.c (mark_interval): Fix comment, partially rephrase
6688 old comment from intervals.h (see below).
6689 * intervals.c (find_interval, adjust_intervals_for_insertion)
6690 (delete_interval, adjust_intervals_for_deletion)
6691 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6692 Convert to eassert.
6693 (adjust_intervals_for_insertion, make_new_interval):
6694 Remove obsolete and unused code.
6695 * intervals.h (struct interval): Remove obsolete comment.
6696 * textprotp.c (erase_properties): Remove unused code.
6697 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6698 (Fremove_list_of_text_properties): Convert to eassert.
6699
6700 2012-07-17 Chong Yidong <cyd@gnu.org>
6701
6702 * editfns.c (Finsert_char): Doc fix.
6703
6704 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6705
6706 Fix previous change to make Fmemory_free always accurate.
6707 * alloc.c (make_interval): Update total_free_intervals.
6708 (make_float): Likewise for total_free_floats.
6709 (free_cons, Fcons): Likewise for total_free_conses.
6710 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6711 Likewise for total_free_vector_bytes.
6712 (Fmake_symbol): Likewise for total_free_symbols.
6713 (bytes_free): Remove.
6714
6715 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6716
6717 Simple free memory accounting feature.
6718 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6719 (sweep_vectors): Accumulate size of free vectors.
6720 (Fgarbage_collect): Setup bytes_free.
6721 (Fmemory_free): New function.
6722 (syms_of_alloc): Register it.
6723
6724 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6725
6726 Cleanup overlays checking.
6727 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6728 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6729 eassert and OVERLAYP.
6730 (sort_overlays): Change to use OVERLAYP.
6731
6732 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6733
6734 * editfns.c (Finsert_char): Make it interactive, and make the
6735 second arg optional. Copy interactive spec and docstring from
6736 ucs-insert.
6737
6738 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6741 Unlike the other wrapped functions, fabs has an unspecified
6742 effect on errno.
6743
6744 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6745
6746 * nsterm.m (keyDown): Interpret flags without left/right bits
6747 as the left key (Bug#11670).
6748
6749 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6750
6751 Remove empty and useless init functions.
6752 * lisp.h (init_character_once, init_fns, init_image)
6753 (init_filelock, init_sound): Remove prototype.
6754 * character.c (init_character_once): Remove.
6755 * filelock.c (init_filelock): Likewise.
6756 * fns.c (init_fns): Likewise.
6757 * image.c (init_image): Likewise.
6758 * sound.c (init_sound): Likewise.
6759 * emacs.c (main): Adjust accordingly.
6760
6761 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6762
6763 * gtkutil.h: Tiny cleanups.
6764 (use_old_gtk_file_dialog): Remove useless declaration.
6765 (xg_uses_old_file_dialog): Add suggested const attribute.
6766
6767 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6768
6769 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6770 (bidi_paragraph_init): Use it to limit search forward for a strong
6771 directional character in abnormally large paragraphs full of
6772 neutral or weak characters. (Bug#11943)
6773
6774 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6775
6776 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6777 the toolbar (Bug#9451).
6778 (xg_make_tool_item): Give the widget event box a transparent
6779 background.
6780
6781 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6782
6783 Cleanup basic allocation variables and functions.
6784 * alloc.c (ignore_warnings, init_intervals, init_float)
6785 (init_cons, init_symbol, init_marker): Remove.
6786 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6787 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6788 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6789 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6790 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6791 (staticidx, init_alloc_once, init_strings, free_ablock):
6792 Remove redundant initialization.
6793 * fns.c (init_weak_hash_tables): Remove.
6794 * lisp.h (init_weak_hash_tables): Remove prototype.
6795
6796 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6797
6798 Use zero_vector where appropriate.
6799 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6800 accordingly.
6801 * lisp.h (zero_vector): New declaration.
6802 * font.c (null_vector): Remove.
6803 (syms_of_font): Remove initialization and staticpro.
6804 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6805 * keymap.c (Faccessible_keymaps): Likewise.
6806
6807 2012-07-15 Leo Liu <sdl.web@gmail.com>
6808
6809 * fringe.c: Fix typo in comments.
6810
6811 2012-07-14 Leo Liu <sdl.web@gmail.com>
6812
6813 * fringe.c: Add a new bitmap exclamation-mark.
6814
6815 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6816
6817 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6818
6819 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6820 (HAVE_MENUS): Don't define, defined by editing config.in with
6821 msdos/sed2v2.inp.
6822 (GMALLOC_INHIBIT_VALLOC): Don't define.
6823 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6824
6825 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6826
6827 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6828
6829 2012-07-14 Glenn Morris <rgm@gnu.org>
6830
6831 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6832 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6833 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6834
6835 2012-07-13 Glenn Morris <rgm@gnu.org>
6836
6837 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6838
6839 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6840 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6841
6842 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6843
6844 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6845 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6846 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6847 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6848 where appropriate.
6849 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6850 as boolean expression.
6851 (x_set_window_size): Remove unused variable toolbar.
6852 (ns_get_color_default, ns_mod_to_lisp): Remove.
6853 (ns_mouse_position): Remove unused variables xchar and ychar.
6854 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6855 (ns_set_vertical_scroll_bar): Remove unused variable count.
6856 (ns_delete_terminal): Remove unused variable i.
6857 (ns_term_init): Remove unused variables r, g and b.
6858 (mouseDown): Remove unused variable window.
6859 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6860 (initFrameFromEmacs): Remove unused variable vbextra.
6861 (mouseEntered): Remove unused variables p and dpyinfo.
6862 (mouseExited): Remove unused variables p and r.
6863 (ns_define_frame_cursor, ns_clear_frame_area)
6864 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6865 (menuDown): Assign [sender tag] to variable and cast the variable.
6866
6867 * nsterm.h (menuDown): Add id as type to argument sender.
6868 (ns_display_info_for_name): Add Lisp_Object argument.
6869 (ns_term_init): Add Lisp_Object argument.
6870 (ns_map_event_to_object): Add void argument.
6871 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6872 prototype with arguments and only declare if __OBJC__.
6873 (nxatoms_of_nsselect): Add void argument.
6874 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6875 (ns_alloc_autorelease_pool): Add void argument.
6876 (ns_release_autorelease_pool): Add void* argument.
6877 (ns_get_defaults_value): Add const char* argument.
6878
6879 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6880 (initFromContents): Use SSDATA where appropriate.
6881 (ns_update_menubar): Add braces to ambigous if-else.
6882 (initWithTitle): Put () around assignment in if statement.
6883 (ns_menu_show): Remove unused variables window and keymap.
6884 (update_frame_tool_bar): Remove unused variable selected_p.
6885 (initWithContentRect): Remove unused variable this_cmd_name.
6886
6887 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6888 appropriate.
6889 (setXBMColor): Remove unused variable len.
6890 (setPixmapData): Put () around assignment in loop statement.
6891
6892 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6893 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6894 where appropriate.
6895 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6896 around assignment in loop statement.
6897 (nsfont_open): Remove unused variable i.
6898 (nsfont_open): Remove unused variable len.
6899 (nsfont_draw): Remove unused variable cs.
6900
6901 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6902 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6903 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6904 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6905 (Fns_font_name, Fns_perform_service)
6906 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6907 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6908 (ns_set_name): Remove unused variable view.
6909 (x_set_menu_bar_lines): Remove unused variable olines.
6910 (x_set_tool_bar_lines): Remove unused variable root_window.
6911 (Fns_list_colors): Put () around assignment in while statement.
6912 (Fns_perform_service): Remove unused variable len.
6913 (Fns_display_usable_bounds): Remove unused variable top.
6914 (syms_of_nsfns): Remove unused variable i.
6915
6916 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6917 memcpy (Bug#11907).
6918
6919 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6920
6921 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6922 and free it with DestroyExceptionInfo (Bug#11558).
6923
6924 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6925
6926 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6927 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6928 Set here, not in nt/config.nt.
6929
6930 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6931
6932 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6933 cursor overflow into the last glyph on display line when the right
6934 fringe is off. (Bug#11832)
6935
6936 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6937
6938 * xdisp.c (produce_special_glyphs): Now static.
6939 * dispextern.h (produce_special_glyphs): Remove decl.
6940
6941 2012-07-13 Glenn Morris <rgm@gnu.org>
6942
6943 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6944 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6945
6946 * s/usg5-4-common.h (USG, USG5):
6947 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6948 * s/sol2-6.h (SOLARIS2):
6949 * s/irix6-5.h (IRIX6_5):
6950 * s/hpux10-20.h (USG, USG5, HPUX):
6951 * s/gnu-linux.h (USG, GNU_LINUX):
6952 * s/freebsd.h (BSD_SYSTEM):
6953 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6954 * s/cygwin.h (CYGWIN):
6955 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6956 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6957
6958 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6959
6960 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6961
6962 2012-07-13 Glenn Morris <rgm@gnu.org>
6963
6964 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6965
6966 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6967
6968 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6969 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6970
6971 2012-07-12 Glenn Morris <rgm@gnu.org>
6972
6973 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6974
6975 * process.c (init_process_emacs): Rename from init_process.
6976 The old name is also the name of a Mach system call.
6977 * lisp.h, emacs.c: Update for this name change.
6978 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6979 longer needed.
6980
6981 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6982
6983 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6984 memmove call that removes glyphs covered by the left truncation
6985 glyph. Improve commentary.
6986 (display_line): Fix display of continuation glyphs on GUI frames
6987 when the right fringe is turned off and variable-size fonts are
6988 used in the window. Move the code that appends a stretch glyph to
6989 produce_special_glyphs, so that it could be used for truncation
6990 and continuation glyphs alike.
6991 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6992 glyph of a suitably computed width, to align the special glyphs at
6993 the window margin. Code moved from display_line. (Bug#11832)
6994
6995 2012-07-12 Glenn Morris <rgm@gnu.org>
6996
6997 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6998
6999 * s/gnu-linux.h, s/hpux10-20.h:
7000 Do not unconditionally define HAVE_XRMSETDATABASE.
7001
7002 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7003
7004 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7005
7006 Fix typos that broke OS X build.
7007 Reported by Randal L. Schwartz in
7008 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7009 * nsterm.m (ns_timeout): Add missing local decl.
7010 (ns_get_color): snprintf -> sprintf, to fix typo.
7011
7012 2012-07-12 Glenn Morris <rgm@gnu.org>
7013
7014 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7015 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7016 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7017 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7018
7019 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7020 Move PTY_OPEN to configure.
7021
7022 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7023 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7024 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7025
7026 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7027
7028 Use empty_unibyte_string where applicable.
7029 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7030 * lread.c (read1): Likewise.
7031 * xsettings.c (syms_of_xsettings): Likewise.
7032
7033 2012-07-12 Glenn Morris <rgm@gnu.org>
7034
7035 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7036 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7037 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7038 * s/hpux10-20.h (RUN_TIME_REMAP):
7039 * s/bsd-common.h (TABDLY): Move to configure.
7040
7041 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7042
7043 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7044
7045 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7046 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7047
7048 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7049
7050 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7051 * s/template.h: Move NARROWPROTO to configure.
7052
7053 2012-07-11 Glenn Morris <rgm@gnu.org>
7054
7055 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7056 unused since 2011-01-17 change to systty.h.
7057
7058 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7059 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7060 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7061
7062 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7063
7064 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7065
7066 2012-07-11 Glenn Morris <rgm@gnu.org>
7067
7068 * s/darwin.h, s/gnu-linux.h, s/template.h:
7069 Move INTERRUPT_INPUT to configure.
7070
7071 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7072
7073 Minor adjustments to interning code.
7074 * lisp.h (intern, intern_c_string): Redefine as static inline
7075 wrappers for intern_1 and intern_c_string_1, respectively.
7076 (intern_1, intern_c_string_1): Rename prototypes.
7077 * lread.c (intern_1, intern_c_string_1, oblookup):
7078 Simplify Vobarray checking.
7079 * font.c (font_intern_prop): Likewise. Adjust comment.
7080 * w32font.c (intern_font_name): Likewise.
7081
7082 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7083
7084 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7085
7086 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7087 of Fcar/Fcdr if possible.
7088 * font.c (check_otf_features): Likewise.
7089 * fontset.c (Fnew_fontset): Likewise.
7090 * gnutls.c (Fgnutls_boot): Likewise.
7091 * minibuf.c (read_minibuf): Likewise.
7092 * msdos.c (IT_set_frame_parameters): Likewise.
7093 * xmenu.c (Fx_popup_dialog): Likewise.
7094 * w32menu.c (Fx_popup_dialog): Likewise.
7095
7096 2012-07-11 Glenn Morris <rgm@gnu.org>
7097
7098 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7099 since nothing has defined it on these platforms.
7100
7101 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7102 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7103
7104 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7105 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7106 Move CLASH_DETECTION to configure.
7107
7108 * s/gnu.h: Remove file, which is now empty.
7109
7110 * s/gnu.h, s/gnu-linux.h:
7111 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7112
7113 2012-07-11 John Wiegley <johnw@newartisans.com>
7114
7115 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7116 function attribute, so we only use it if it exists in the
7117 compiler.
7118
7119 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7120
7121 Avoid call to strlen in fast_c_string_match_ignore_case.
7122 * search.c (fast_c_string_match_ignore_case): Change to use
7123 length argument. Adjust users accordingly.
7124 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7125
7126 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 Assume mkdir, rmdir.
7129 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7130 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7131
7132 Assume rename.
7133 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7134
7135 Assume perror.
7136 * s/hpux10-20.h (HAVE_PERROR): Remove.
7137 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7138 Remove dummy definition, as this problem was obsolete long ago.
7139
7140 Assume strerror.
7141 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7142
7143 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7144
7145 Avoid calls to strlen in font processing functions.
7146 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7147 (font_open_by_name): Change to use length argument.
7148 Adjust users accordingly.
7149 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7150 Adjust prototypes.
7151 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7152 Change to return ptrdiff_t.
7153 (xfont_list_pattern, xfont_match): Use length returned by
7154 xfont_decode_coding_xlfd.
7155 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7156
7157 2012-07-11 Glenn Morris <rgm@gnu.org>
7158
7159 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7160 Move DONT_REOPEN_PTY to configure.
7161
7162 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7163 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7164
7165 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7166
7167 Remove "#define unix" that is no longer needed (Bug#11905).
7168 * s/aix4-2.h (unix): Remove; no longer needed.
7169
7170 EMACS_TIME simplification (Bug#11875).
7171 This replaces macros (which typically do not work in GDB)
7172 with functions, typedefs and enums, making the code easier to debug.
7173 The functional style also makes code easier to read and maintain.
7174 * systime.h: Include <sys/time.h> on all hosts, not just if
7175 WINDOWSNT, since 'struct timeval' is needed in general.
7176 (EMACS_TIME): Now a typedef, not a macro.
7177 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7178 not macros.
7179 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7180 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7181 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7182 (EMACS_TIME_LE): Now functions, not macros.
7183 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7184 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7185 which are not functions. All uses rewritten to use:
7186 (make_emacs_time): New function.
7187 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7188 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7189 not functions. All uses rewritten to use the following, respectively:
7190 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7191 (add_emacs_time, sub_emacs_time): New functions.
7192 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7193 * fileio.c (Fcopy_file):
7194 * xterm.c (XTflash): Get the current time closer to when it's used.
7195 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7196
7197 * bytecode.c (targets): Suppress -Woverride-init warnings.
7198
7199 Simplify by avoiding confusing use of strncpy etc.
7200 * doc.c (Fsnarf_documentation):
7201 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7202 * frame.c (Fmake_terminal_frame):
7203 * gtkutil.c (get_utf8_string):
7204 * lread.c (openp):
7205 * nsmenu.m (ns_update_menubar):
7206 * regex.c (regerror):
7207 Prefer memcpy to strncpy and strncat when either will do.
7208 * fileio.c (Fsubstitute_in_file_name):
7209 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7210 (menu_separator_name_p):
7211 * nsmenu.m (ns_update_menubar):
7212 Prefer memcmp to strncmp when either will do.
7213 * nsterm.m: Include <ftoastr.h>.
7214 (ns_get_color):
7215 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7216 Prefer snprintf to strncpy.
7217 * nsterm.m (ns_term_init):
7218 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7219 * nsterm.m (ns_term_init):
7220 Avoid the need for strncpy, by using build_string or
7221 make_unibyte_string directly. Use dtoastr, not snprintf.
7222 * process.c (Fmake_network_process): Diagnose service names that
7223 are too long, rather than silently truncating them or creating
7224 non-null-terminated names.
7225 (Fnetwork_interface_info): Likewise, for interface names.
7226 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7227 Prefer sprintf to strncat.
7228 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7229 Prefer vsnprintf to vsprintf + strncpy.
7230
7231 2012-07-10 Glenn Morris <rgm@gnu.org>
7232
7233 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7234 Clarify fallback case.
7235
7236 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7237
7238 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7239 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7240 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7241 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7242 where argument type is known to be a Lisp_Cons.
7243
7244 2012-07-10 Tom Tromey <tromey@redhat.com>
7245
7246 * bytecode.c (BYTE_CODE_THREADED): New macro.
7247 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7248 (enum byte_code_op): New type.
7249 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7250 (exec_byte_code): Use them. Use token threading when applicable.
7251
7252 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7253
7254 Optimize pure C strings initialization.
7255 * lisp.h (make_pure_string): Fix prototype.
7256 (build_pure_c_string): New function, defined as static inline. This
7257 provides a better opportunity to optimize away calls to strlen when
7258 the function is called with compile-time constant argument.
7259 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7260 argument, adjust users accordingly. Use build_pure_c_string where
7261 appropriate.
7262 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7263 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7264 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7265
7266 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7267
7268 Avoid calls to strlen in miscellaneous functions.
7269 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7270 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7271 * lread.c (openp): Likewise.
7272
7273 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7274
7275 Avoid calls to strlen in path processing functions.
7276 * fileio.c (file_name_as_directory): Add comment. Change to add
7277 srclen argument and return the length of result. Adjust users
7278 accordingly.
7279 (directory_file_name): Fix comment. Change to add srclen argument,
7280 swap 1st and 2nd arguments to obey the common convention.
7281 Adjust users accordingly.
7282 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7283
7284 2012-07-10 Glenn Morris <rgm@gnu.org>
7285
7286 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7287 Move PENDING_OUTPUT_COUNT definition to configure.
7288
7289 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7290 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7291 * s/gnu.h (DATA_START): Move definitions to configure.
7292
7293 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7294 We include usg5-4-common.h, which defines them both.
7295
7296 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7297 O_RDONLY already includes it).
7298
7299 Stop ns builds setting the EMACSLOADPATH environment variable.
7300 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7301 Now it does not set EMACSLOADPATH, just returns the load-path string.
7302 * nsterm.h: Update accordingly.
7303 * lread.c [HAVE_NS]: Include nsterm.h.
7304 (init_lread) [HAVE_NS]: Use ns_load_path.
7305 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7306
7307 2012-07-09 Glenn Morris <rgm@gnu.org>
7308
7309 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7310 since the included bsd-common.h does so.
7311
7312 Stop ns builds setting the EMACSPATH environment variable.
7313 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7314 (ns_init_paths): Do not set EMACSPATH.
7315 * nsterm.h (ns_exec_path): Add it.
7316 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7317 Use ns_exec_path.
7318
7319 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7320
7321 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 * process.c (wait_reading_process_output): 'waitchannels' was unset
7324 when read_kbd || !NILP (wait_for_cell); fix this.
7325
7326 Add GCC-style 'const' attribute to functions that can use it.
7327 * character.h (char_resolve_modifier_mask):
7328 * keyboard.h (make_ctrl_char):
7329 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7330 (init_character_once, next_almost_prime, init_fns, init_image)
7331 (flush_pending_output, init_sound):
7332 * mem-limits.h (start_of_data):
7333 * menu.h (finish_menu_items):
7334 Add ATTRIBUTE_CONST.
7335 * emacs.c (DEFINE_DUMMY_FUNCTION):
7336 Declare the dummy function with ATTRIBUTE_CONST.
7337 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7338 Add decls with ATTRIBUTE_CONST.
7339
7340 Minor improvements to make_formatted_string.
7341 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7342 where int is good enough, as vsprintf returns an int.
7343 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7344
7345 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7346
7347 Use make_formatted_string to avoid double length calculation.
7348 * lisp.h (make_formatted_string): New prototype.
7349 * alloc.c (make_formatted_string): New function.
7350 * buffer.c (Fgenerate_new_buffer_name): Use it.
7351 * dbusbind.c (syms_of_dbusbind): Likewise.
7352 * editfns.c (Fcurrent_time_zone): Likewise.
7353 * filelock.c (get_boot_time): Likewise.
7354 * frame.c (make_terminal_frame, set_term_frame_name)
7355 (x_report_frame_params): Likewise.
7356 * image.c (gs_load): Likewise.
7357 * minibuf.c (get_minibuffer): Likewise.
7358 * msdos.c (dos_set_window_size): Likewise.
7359 * process.c (make_process): Likewise.
7360 * xdisp.c (ensure_echo_area_buffers): Likewise.
7361 * xsettings.c (apply_xft_settings): Likewise.
7362
7363 2012-07-09 Glenn Morris <rgm@gnu.org>
7364
7365 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7366 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7367 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7368 * nsterm.h (ns_etc_directory): Add it.
7369 * callproc.c [HAVE_NS]: Include nsterm.h.
7370 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7371
7372 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7373
7374 Move marker debugging code under MARKER_DEBUG.
7375 * marker.c (MARKER_DEBUG): Move marker debugging code under
7376 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7377 for bootstrap with --enable-checking (~3x slowdown reported
7378 by Juanma Barranquero <lekktu@gmail.com>).
7379 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7380
7381 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7384 See <http://bugs.gnu.org/11825#29>.
7385
7386 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7387
7388 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7389 has no font, use the frame's font. (Bug#11813)
7390 (display_line): Add commentary about displaying truncation glyphs
7391 on GUI frames.
7392 (produce_special_glyphs): Move here from term.c.
7393
7394 * term.c (produce_special_glyphs): Move to xdisp.c.
7395
7396 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7397 section.
7398
7399 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7400
7401 * xdisp.c (display_line): Avoid warning about implicit declaration
7402 of FRAME_FONT.
7403
7404 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7405
7406 * lisp.h: Remove empty conditional.
7407
7408 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7409
7410 * lread.c (load_path_check): Now static.
7411
7412 Fix some minor --with-ns problems found by static checking.
7413 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7414 (x_set_font) [!HAVE_X_WINDOWS]:
7415 * image.c (xpm_load_image) [HAVE_NS]:
7416 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7417 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7418 Remove unused local.
7419 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7420 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7421 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7422 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7423 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7424 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7425 Fix pointer signedness problem.
7426 * xfaces.c (FRAME_X_FONT_TABLE):
7427 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7428
7429 2012-07-07 Glenn Morris <rgm@gnu.org>
7430
7431 * lread.c (load_path_check): New function, split from init_lread.
7432 (init_lread): Reorganize. Motivation:
7433 If EMACSLOADPATH is set, check/warn about that rather than the
7434 defaults, which we are not going to use. Hence we can remove
7435 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7436 Don't warn if site-lisp directories are missing.
7437 If not installed, start from a blank load-path, since
7438 PATH_LOADSEARCH refers to the eventual installation directories.
7439
7440 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7441
7442 Support truncation and continuation glyphs on GUI frames, when
7443 fringes are disabled. (Bug#11832)
7444 * xdisp.c (init_iterator): Get dimensions of truncation and
7445 continuation glyphs even if on GUI frames.
7446 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7447 or both, are absent.
7448 (start_display, move_it_in_display_line_to): Handle the case of a
7449 GUI frame without a fringe to display continuation or truncation
7450 glyphs.
7451 (insert_left_trunc_glyphs): Support GUI frames: make sure
7452 truncation glyphs overwrite enough glyphs from the current line to
7453 have sufficient space in pixels.
7454 (display_line): Support truncation and continuation glyphs on GUI
7455 frames. If some spare pixels are left on the line after inserting
7456 the truncation glyphs, fill that space with a stretch glyph of a
7457 suitably computed width.
7458
7459 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7460 produce_glyphs, to support GUI sessions.
7461
7462 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7463
7464 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7465
7466 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7467
7468 Do not require float-time's arg to fit in time_t (Bug#11825).
7469 This works better on hosts where time_t is unsigned, and where
7470 float-time is applied to the (negative) difference between two times.
7471 * editfns.c (decode_time_components): Last arg is now double *,
7472 not int *, and means to store all the result as a double, without
7473 worrying about whether the seconds part fits in time_t.
7474 All callers changed.
7475 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7476 All callers changed.
7477 (Ffloat_time): Do not fail merely because the specified time falls
7478 outside of time_t range.
7479
7480 2012-07-07 Glenn Morris <rgm@gnu.org>
7481
7482 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7483 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7484 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7485
7486 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7487
7488 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7489 Update dependencies.
7490
7491 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7492
7493 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7494
7495 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7496 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7497 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7498 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7499 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7500 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7501
7502 * xfont.c (compare_font_names): Redo to omit the need for casts.
7503
7504 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7505
7506 * xfns.c (Fx_change_window_property): Doc fix.
7507 * w32fns.c (Fx_change_window_property): Doc fix.
7508
7509 * w32fns.c (Fx_window_property): Accept the same arguments as the
7510 X Windows version. Doc fix.
7511 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7512
7513 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7514 Eli Zaretskii <eliz@gnu.org>
7515
7516 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7517 Windows-specific code from nt/config.nt moved here.
7518 Obsolete settings removed.
7519
7520 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 * process.c: Avoid unnecessary calls to gettime.
7523 (wait_reading_process_output): Don't get the time of day
7524 when gobbling data immediately and not waiting, as there's no need
7525 for it in that case. This removes a FIXME.
7526
7527 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7528
7529 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7530 is defined (Bug#11768).
7531
7532 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7533
7534 Fix marker debugging code.
7535 * marker.c (byte_char_debug_check): Do not perform the check
7536 if buffer is not multibyte.
7537 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7538 Call byte_char_debug_check with correct arguments.
7539
7540 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7541
7542 Compile marker debugging code only if ENABLE_CHECKING is defined.
7543 * marker.c (byte_char_debug_check, count_markers):
7544 Use only if ENABLE_CHECKING is defined.
7545 (byte_debug_flag): Remove.
7546 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7547 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7548
7549 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7550
7551 Avoid code repetition in marker-related functions.
7552 * marker.c (attach_marker): New function.
7553 (Fset_marker, set_marker_restricted, set_marker_both)
7554 (set_marker_restricted_both): Use it.
7555 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7556 Consistently rename charno to charpos.
7557 (marker_position): Add eassert.
7558 (marker_byte_position): Convert to eassert.
7559
7560 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7561
7562 Simplify list operations in unchain_overlay and unchain_marker.
7563 * buffer.c (unchain_overlay): Simplify. Add comment.
7564 * marker.c (unchain_marker): Simplify. Fix comments.
7565
7566 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7567
7568 Introduce fast path for the widely used marker operation.
7569 * alloc.c (build_marker): New function.
7570 * lisp.h (build_marker): New prototype.
7571 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7572 * composite.c (autocmp_chars): Likewise.
7573 * editfns.c (buildmark): Remove.
7574 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7575 (save_restriction_save): Use build_marker.
7576 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7577 * window.c (save_window_save): Likewise.
7578
7579 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7580
7581 Do not use Fdelete_overlay in delete_all_overlays
7582 to avoid redundant calls to unchain_overlay.
7583 * buffer.c (drop_overlay): New function.
7584 (delete_all_overlays, Fdelete_overlay): Use it.
7585 * minibuf.c (get_minibuffer): Fix comment.
7586
7587 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 Port to OpenBSD 5.1 amd64.
7590 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7591 This is needed for OpenBSD, and should be harmless on all BSD systems.
7592 Also, include <sys/sysctl.h>, as it should be available on all
7593 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7594 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7595 use p_pid member, not kp_proc.pid.
7596
7597 2012-07-06 Glenn Morris <rgm@gnu.org>
7598
7599 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7600
7601 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 More xmalloc and related cleanup.
7604 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7605 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7606 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7607 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7608 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7609 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7610 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7611 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7612 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7613 * xterm.c:
7614 Omit needless casts involving void * pointers and allocation.
7615 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7616 as the former is more robust if P's type is changed.
7617 Prefer xzalloc to xmalloc + memset 0.
7618 Simplify malloc-or-realloc to realloc.
7619 Don't worry about xmalloc returning a null pointer.
7620 Prefer xstrdup to xmalloc + strcpy.
7621 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7622 growing it.
7623 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7624 alloca of a constant.
7625
7626 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7627
7628 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7629 hscroll is larger than the line width. Fixes long and futile
7630 looping inside extend_face_to_end_of_line (on a TTY) producing
7631 glyphs that are not needed and thrown away.
7632
7633 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7634
7635 * marker.c (set_marker_restricted_both): Simplify by using
7636 clip_to_bounds.
7637
7638 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7639
7640 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7641
7642 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7643
7644 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7645 not defined (Bug#11768).
7646 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7647 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7648 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7649 followed by gtk_box_set_homogeneous (Bug#11768).
7650 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7651 (update_theme_scrollbar_width, xg_create_scroll_bar):
7652 Use gtk_scrollbar_new (Bug#11768).
7653 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7654 (is_box_type): New function (Bug#11768).
7655 (xg_tool_item_stale_p): Call is_box_type.
7656 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7657 with default display (Bug#11768).
7658
7659 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7660
7661 * xdisp.c (window_hscroll_limited): New function.
7662 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7663 coordinates when window's hscroll is set to insanely large
7664 values. (Bug#11857)
7665
7666 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7667
7668 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7669 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7670
7671 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7672
7673 Cleanup xmalloc.
7674 * lisp.h (xzalloc): New prototype. Omit needless casts.
7675 * alloc.c (xzalloc): New function. Omit needless casts.
7676 * charset.c: Omit needless casts. Convert all calls to
7677 xmalloc with following memset to xzalloc.
7678 * dispnew.c: Likewise.
7679 * fringe.c: Likewise.
7680 * image.c: Likewise.
7681 * sound.c: Likewise.
7682 * term.c: Likewise.
7683 * w32fns.c: Likewise.
7684 * w32font.c: Likewise.
7685 * w32term.c: Likewise.
7686 * xfaces.c: Likewise.
7687 * xfns.c: Likewise.
7688 * xterm.c: Likewise.
7689 * atimer.c: Omit needless casts.
7690 * buffer.c: Likewise.
7691 * callproc.c: Likewise.
7692 * ccl.c: Likewise.
7693 * coding.c: Likewise.
7694 * composite.c: Likewise.
7695 * doc.c: Likewise.
7696 * doprnt.c: Likewise.
7697 * editfns.c: Likewise.
7698 * emacs.c: Likewise.
7699 * eval.c: Likewise.
7700 * filelock.c: Likewise.
7701 * fns.c: Likewise.
7702 * gtkutil.c: Likewise.
7703 * keyboard.c: Likewise.
7704 * lisp.h: Likewise.
7705 * lread.c: Likewise.
7706 * minibuf.c: Likewise.
7707 * msdos.c: Likewise.
7708 * print.c: Likewise.
7709 * process.c: Likewise.
7710 * region-cache.c: Likewise.
7711 * search.c: Likewise.
7712 * sysdep.c: Likewise.
7713 * termcap.c: Likewise.
7714 * terminal.c: Likewise.
7715 * tparam.c: Likewise.
7716 * w16select.c: Likewise.
7717 * w32.c: Likewise.
7718 * w32reg.c: Likewise.
7719 * w32select.c: Likewise.
7720 * w32uniscribe.c: Likewise.
7721 * widget.c: Likewise.
7722 * xdisp.c: Likewise.
7723 * xmenu.c: Likewise.
7724 * xrdb.c: Likewise.
7725 * xselect.c: Likewise.
7726
7727 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 * fileio.c (time_error_value): Check the right error number.
7730 Problem reported by Troels Nielsen in
7731 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7732
7733 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7736 This should be fixed in a better way; see Eli Zaretskii in
7737 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7738 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7739
7740 * fileio.c (time_error_value): Rename from special_mtime.
7741 The old name's problems were noted by Eli Zaretskii in
7742 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7743
7744 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7745 This variable's comment says Emacs needs at least one GDB-visible
7746 symbol of type enum pvec_type, to work around GDB problems.
7747 The symbol's value doesn't matter.
7748
7749 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7750 that causes compilation to fail on pre-C99 compilers.
7751
7752 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7753
7754 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7755 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7756
7757 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7758
7759 * buffer.c (init_buffer_once): Fix initialization of
7760 headers for buffer_defaults and buffer_local_symbols.
7761 Reported by Juanma Barranquero <lekktu@gmail.com>.
7762
7763 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7764
7765 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7766 * lisp.h (enum pvec_type): Use fewer bits.
7767 (PSEUDOVECTOR_SIZE_BITS): New constant.
7768 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7769 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7770 change in pvec_type.
7771 (PSEUDOVECTOR_TYPEP): New macro.
7772 (TYPED_PSEUDOVECTORP): Use it.
7773 * fns.c (internal_equal): Adapt code to extract pvectype.
7774 * emacs.c (gdb_pvec_type): Update type.
7775 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7776 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7777 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7778 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7779 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7780 abusing vector->header.next.nbytes.
7781 (live_vector_p): Use PVEC_TYPE.
7782 (mark_object): Adapt code to extract pvectype. Use switch.
7783
7784 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7785
7786 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7787 Tighten new eassert a bit.
7788
7789 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7790
7791 Fix compilation with --enable-gcc-warnings and -O1
7792 optimization level.
7793 * doprnt.c (doprnt): Change type of tem to int, initialize
7794 to avoid compiler warning. Add eassert.
7795 * search.c (simple_search): Initialize match_byte to avoid
7796 compiler warning. Add eassert.
7797
7798 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7799
7800 Avoid weird behavior with large horizontal scrolls.
7801 Without this change, for example, large hscroll values would
7802 mess up Emacs's display on Fedora 15 x86, presumably due to
7803 overflows in int calculations in the display code.
7804 Also, if buffers had long lines, Emacs would freeze.
7805 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7806 (set_window_hscroll): New function, containing the old guts of
7807 Fset_window_hscroll. Return the clipped value.
7808 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7809 This avoids the need to check against PTRDIFF_MAX.
7810
7811 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7812
7813 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7814
7815 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7816
7817 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7820 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7821 since GCC 4.4.6 issues a bogus warning for them.
7822
7823 Fix bugs in file timestamp newness comparisons.
7824 * fileio.c (Ffile_newer_than_file_p):
7825 * lread.c (Fload): Use full timestamp resolution of files,
7826 not just the 1-second resolution, so that files that are only
7827 slightly newer still count as newer.
7828 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7829 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7830
7831 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7832
7833 * fileio.c: Improve handling of file time marker. (Bug#11852)
7834 (special_mtime): New function.
7835 (Finsert_file_contents, Fverify_visited_file_modtime):
7836 Use it to set special mtime values consistently.
7837
7838 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7839
7840 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7841 marker for non-existing file. (Bug#11852)
7842
7843 2012-07-03 Glenn Morris <rgm@gnu.org>
7844
7845 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7846 and did not make it into globals.h).
7847
7848 2012-07-03 Tom Tromey <tromey@redhat.com>
7849
7850 * window.c (Fset_window_margins, Fset_window_fringes)
7851 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7852 * textprop.c (Fprevious_property_change): No longer static.
7853 * syntax.c (Fsyntax_table_p): No longer static.
7854 * process.c (Fget_process, Fprocess_datagram_address): No longer
7855 static.
7856 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7857 * keyboard.c (Fcommand_execute): No longer static.
7858 Remove EXFUN.
7859 * insdel.c (Fcombine_after_change_execute): No longer static.
7860 * image.c (Finit_image_library): No longer static.
7861 * fileio.c (Fmake_symbolic_link): No longer static.
7862 * eval.c (Ffetch_bytecode): No longer static.
7863 * editfns.c (Fuser_full_name): No longer static.
7864 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7865 No longer static.
7866 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7867 static.
7868 * dired.c (Ffile_attributes): No longer static.
7869 * composite.c (Fcomposition_get_gstring): No longer static.
7870 * callproc.c (Fgetenv_internal): No longer static.
7871
7872 * ccl.h: Remove EXFUNs.
7873 * buffer.h: Remove EXFUNs.
7874 * dispextern.h: Remove EXFUNs.
7875 * intervals.h: Remove EXFUNs.
7876 * fontset.h: Remove EXFUN.
7877 * font.h: Remove EXFUNs.
7878 * dosfns.c (system_process_attributes): Remove EXFUN.
7879 * keymap.h: Remove EXFUNs.
7880 * lisp.h: Remove EXFUNs.
7881 * w32term.h: Remove EXFUNs.
7882 * window.h: Remove EXFUNs.
7883 * xsettings.h: Remove EXFUN.
7884 * xterm.h: Remove EXFUN.
7885
7886 2012-07-03 Glenn Morris <rgm@gnu.org>
7887
7888 * lisp.h (Frandom): Make it visible to C.
7889 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7890 buffer for invisible buffers. (Bug#1229)
7891
7892 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7893
7894 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7895 values which aren't power of 2.
7896 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7897 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7898 accordingly.
7899
7900 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7901
7902 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7903
7904 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7905
7906 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7907
7908 * alloc.c (allocate_vector_block): Remove redundant
7909 calls to mallopt if DOUG_LEA_MALLOC is defined.
7910 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7911 avoid calls to mallopt if zero_vector is returned.
7912
7913 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7914
7915 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7916 is enabled, avoid dereferencing NULL current_sblock if
7917 running undumped.
7918
7919 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7920
7921 Cleanup basic buffer management.
7922 * buffer.h (struct buffer): Change layout to use generic vector
7923 marking code. Fix some comments. Change type of 'clip_changed'
7924 to bitfield. Remove unused #ifndef old.
7925 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7926 (GET_OVERLAYS_AT): Fix indentation.
7927 (for_each_per_buffer_object_at): New macro.
7928 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7929 (Fbuffer_local_variables): Use it.
7930 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7931 * alloc.c (allocate_buffer): Adjust to match new layout of
7932 struct buffer. Fix comment.
7933 (mark_overlay): New function.
7934 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7935 Lisp area of struct buffer.
7936 (mark_object): Use it. Adjust marking of misc objects
7937 and related comments.
7938
7939 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7942 wrapper that is not needed because the wrapped code is a no-op (zero
7943 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7944 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7945
7946 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7947
7948 * alloc.c (mark_buffer): Simplify. Remove prototype.
7949 (mark_object): Add comment. Reorganize marking of vector-like
7950 objects. Use CHECK_LIVE for all vector-like objects except buffers
7951 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7952 Avoid redundant calls to mark_vectorlike for bool vectors.
7953
7954 2012-06-30 Glenn Morris <rgm@gnu.org>
7955
7956 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7957
7958 * epaths.in (PATH_SITELOADSEARCH): New.
7959 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7960 This is rather than relying on --enable-locallisppath elements
7961 having "site-lisp" in their names. (Bug#10208#25, 11658)
7962
7963 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7964
7965 * w32proc.c (sys_select): Accept and ignore one more argument.
7966
7967 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7968
7969 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7970 (pselect) [!MS_DOS]: Redirect to sys_select.
7971
7972 * sysdep.c: Don't include dos.h and dosfns.h.
7973
7974 * process.c (sys_select):
7975 * msdos.c (sys_select): Accept one more argument and ignore it.
7976
7977 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7978 adapt data types and code to that.
7979
7980 * dosfns.c:
7981 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7982 which clashes with the gnulib function of the same name.
7983
7984 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7985
7986 * font.c (font_style_to_value, font_style_symbolic)
7987 (font_prop_validate_style): Add type checks for values in
7988 font_style_table.
7989
7990 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7991 argument.
7992 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7993 uses.
7994
7995 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7996
7997 * xdisp.c (try_window_id): Undo last change.
7998
7999 * w32.c (getwd): Adjust commentary about startup_dir.
8000 (init_environment): Always call sys_access, even in non-MSVC
8001 builds. Don't chdir to the directory of the Emacs executable.
8002 This undoes code from 1997 which was justified by the need to
8003 "avoid conflicts when removing and renaming directories". But its
8004 downside was that every relative file name was being interpreted
8005 relative to the directory of the Emacs executable, which can never
8006 be TRT. In particular, it broke sys_access when called with
8007 relative file names.
8008 (sys_access): Map GetLastError to errno.
8009
8010 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8011
8012 * window.h (struct window): Change type of 'fringes_outside_margins'
8013 to bitfield. Fix comment. Adjust users accordingly.
8014 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8015 Adjust comment.
8016 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8017 to ptrdiff_t.
8018
8019 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8020
8021 * gnutls.c (emacs_gnutls_handshake):
8022 Add QUIT to make the loop interruptible.
8023
8024 2012-06-29 Glenn Morris <rgm@gnu.org>
8025
8026 * charset.c (init_charset): Make lack of etc/charsets fatal.
8027
8028 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8029
8030 * editfns.c (region_limit): Fix type mismatch.
8031
8032 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8033
8034 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8035 undefined. Convert from xassert to eassert.
8036 * nsmenu.m: Convert from xassert to eassert.
8037 * nsterm.m: Likewise.
8038
8039 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8040
8041 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8042
8043 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8044
8045 Avoid integer overflow on scroll-left and scroll-right.
8046 * window.c (HSCROLL_MAX): New macro.
8047 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8048 overflow when requested scroll falls outside ptrdiff_t range.
8049
8050 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8051
8052 * window.h (struct window): Change type of 'hscroll',
8053 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8054 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8055 Adjust users accordingly.
8056 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8057 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8058 from EMACS_INT to ptrdiff_t.
8059 (make_window): Omit redundant initialization.
8060
8061 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8062
8063 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8064
8065 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8066
8067 * window.h (struct window): Change type of 'use_time' and
8068 'sequence_number' from Lisp_Object to int.
8069 * frame.c (make_frame): Adjust users accordingly.
8070 * print.c (print_object): Likewise.
8071 * window.c (select_window, Fwindow_use_time, make_parent_window)
8072 (make_window): Likewise.
8073
8074 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8075
8076 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8077 enabled with --enable-checking=[all,glyphs] configure option.
8078 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8079 adjust comments accordingly.
8080 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8081 undefined, adjust comments accordingly.
8082 * image.c: Likewise.
8083 * scroll.c: Likewise.
8084 * w32fns.c: Likewise.
8085 * w32term.c: Likewise.
8086 * xdisp.c: Likewise.
8087 * xfaces.c: Likewise.
8088 * xfns.c: Likewise.
8089 * xterm.c: Likewise.
8090
8091 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8092
8093 Generalize run-time debugging checks.
8094 * dispextern.h (XASSERTS): Remove.
8095 * fontset.c (xassert): Remove.
8096 Convert from xassert to eassert.
8097 * alloc.c: Convert from xassert to eassert.
8098 * bidi.c: Likewise.
8099 * dispnew.c: Likewise.
8100 * fns.c: Likewise.
8101 * fringe.c: Likewise.
8102 * ftfont.c: Likewise.
8103 * gtkutil.c: Likewise.
8104 * image.c: Likewise.
8105 * keyboard.c: Likewise.
8106 * menu.c: Likewise.
8107 * process.c: Likewise.
8108 * scroll.c: Likewise.
8109 * sound.c: Likewise.
8110 * term.c: Likewise.
8111 * w32console.c: Likewise.
8112 * w32fns.c: Likewise.
8113 * w32term.c: Likewise.
8114 * window.c: Likewise.
8115 * xdisp.c: Likewise.
8116 * xfaces.c: Likewise.
8117 * xfns.c: Likewise.
8118 * xselect.c: Likewise.
8119 * xterm.c: Likewise.
8120
8121 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8122
8123 * fns.c (maybe_resize_hash_table): Output message when growing the
8124 purify-hashtable.
8125
8126 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8127
8128 * alloc.c (allocate_string_data): Remove dead code.
8129 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8130 avoid GCC warning about unused macro.
8131
8132 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8133
8134 * alloc.c (allocate_string): Omit intervals initialization.
8135 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8136 as in make_pure_string and make_pure_c_string.
8137
8138 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8139
8140 * alloc.c (allocate_string): Fix last change.
8141
8142 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8143
8144 * alloc.c (allocate_string): Remove two redundant calls
8145 to memset, add explicit initialization where appropriate.
8146
8147 2012-06-27 Glenn Morris <rgm@gnu.org>
8148
8149 * lisp.mk (lisp): Remove paths.elc.
8150
8151 2012-06-27 Chong Yidong <cyd@gnu.org>
8152
8153 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8154
8155 2012-06-26 John Wiegley <johnw@newartisans.com>
8156
8157 * unexmacosx.c (copy_data_segment): Add two section names used
8158 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8159
8160 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8161 when building with Clang.
8162
8163 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8164
8165 * eval.c (Fapply): Allow calling it with a single argument.
8166
8167 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8168
8169 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8170 _stricmp and _strnicmp.
8171 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8172
8173 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8174
8175 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8176 allocated window.
8177 (allocate_process): Likewise for new process.
8178 (allocate_terminal): Change to use offsetof.
8179 (allocate_frame): Likewise.
8180 * frame.c (make_frame): Omit redundant initialization.
8181 * window.c (make_parent_window): Use memset.
8182 (make_window): Omit redundant initialization.
8183 * process.c (make_process): Omit redundant initialization.
8184 * terminal.c (create_terminal): Likewise.
8185
8186 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8187
8188 * term.c (delete_tty): Remove redundant call to memset.
8189
8190 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8191
8192 * alloc.c: Remove build_string.
8193 * lisp.h: Define build_string as static inline. This provides
8194 a better opportunity to optimize away calls to strlen when the
8195 function is called with compile-time constant argument.
8196 * image.c (imagemagick_error): Convert to build_string.
8197 * w32proc.c (sys_spawnve): Likewise.
8198 * xterm.c (x_term_init): Likewise.
8199
8200 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 Use sprintf return value instead of invoking strlen on result.
8203 In the old days this wasn't portable, since some sprintf
8204 implementations returned char *. But they died out years ago and
8205 Emacs already assumes sprintf returns int.
8206 Similarly for float_to_string.
8207 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8208 * ccl.c (ccl_driver):
8209 * character.c (string_escape_byte8):
8210 * data.c (Fnumber_to_string):
8211 * doprnt.c (doprnt):
8212 * print.c (print_object):
8213 * xdisp.c (message_dolog):
8214 * xfns.c (syms_of_xfns):
8215 Use sprintf or float_to_string result to avoid need to call strlen.
8216 * data.c (Fnumber_to_string):
8217 Use make_unibyte_string, since the string must be ASCII.
8218 * lisp.h, print.c (float_to_string): Now returns int length.
8219 * term.c (produce_glyphless_glyph):
8220 Use sprintf result rather than recomputing it.
8221
8222 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8223 * Makefile.in (ALL_CFLAGS):
8224 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8225 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8226
8227 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8228
8229 * dispextern.h (xstrcasecmp): Define to library function
8230 strcasecmp if available.
8231 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8232
8233 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8234
8235 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8236 Avoid comma operator.
8237 * menu.c (push_submenu_start, push_submenu_end)
8238 (push_left_right_boundary, push_menu_pane): Likewise.
8239 * msdos.c (dos_rawgetc): Likewise.
8240
8241 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8242
8243 * xfns.c (xic_create_fontsetname): Remove redundant calls
8244 to memset.
8245
8246 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8249 sprintf already null-terminates its output.
8250
8251 * xfns.c (x_window): Remove redundant cast.
8252
8253 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8254
8255 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8256 `const char *' to `char *' to avoid compiler warning.
8257
8258 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8261 instead of truncating it to 63 (admittedly a generous limit).
8262
8263 * process.c: Fix spelling and caps in comments.
8264
8265 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8266
8267 * emacs.c (setpgrp): Remove definition, unused.
8268 * sysdep.c (setpgrp): Remove definition, not used in this file.
8269
8270 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8271
8272 * makefile.w32-in: Update dependencies.
8273
8274 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8275
8276 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8277 (SYSTIME_H): Add nt/inc/sys/time.h.
8278
8279 * systime.h [WINDOWSNT]: Include sys/time.h.
8280
8281 * s/ms-w32.h (struct timespec): Definition moved from
8282 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8283
8284 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8285
8286 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8287 * buffer.h (buffer_slot_type_mismatch):
8288 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8289 * eval.c (unwind_to_catch):
8290 * image.c (my_png_error, my_error_exit):
8291 * keyboard.c (quit_throw_to_read_char, user_error)
8292 (Fexit_recursive_edit, Fabort_recursive_edit):
8293 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8294 (wrong_type_argument, buffer_overflow, __executable_start)
8295 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8296 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8297 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8298 (fatal):
8299 (child_setup) [!DOS_NT]:
8300 * lread.c (end_of_file_error, invalid_syntax):
8301 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8302 * puresize.h (pure_write_error):
8303 * search.c (matcher_overflow):
8304 * sound.c (sound_perror, alsa_sound_perror):
8305 * sysdep.c, syssignal.h (croak):
8306 * term.c (maybe_fatal, vfatal):
8307 * textprop.c (text_read_only):
8308 * undo.c (user_error):
8309 * unexmacosx.c (unexec_error):
8310 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8311 Use _Noreturn rather than NO_RETURN.
8312 No need for separate decl merely because of _Noreturn.
8313 * sound.c (sound_warning, parse_sound):
8314 Remove unnecessary forward decls.
8315
8316 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8319 * lisp.h (WAIT_READING_MAX): New macro.
8320 * dispnew.c (Fsleep_for, sit_for):
8321 * keyboard.c (kbd_buffer_get_event):
8322 * process.c (Faccept_process_output):
8323 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8324 This improves on the previous patch, which introduced a bug
8325 when time_t is unsigned and as wide as intmax_t.
8326 See <http://bugs.gnu.org/9000#51>.
8327
8328 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8329
8330 * dispnew.c (sit_for, Fsleep_for):
8331 * keyboard.c (kbd_buffer_get_event):
8332 * process.c (Faccept_process_output): Avoid compiler warnings when
8333 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8334
8335 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8336
8337 * makefile.w32-in: Update dependencies.
8338
8339 * w32.c (ltime): Add return type and declare static.
8340 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8341
8342 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8343
8344 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8345 Privately reported by Herbert J. Skuhra.
8346 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8347 All uses changed.
8348 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8349 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8350
8351 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8352
8353 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8354 last argument of make_unibyte_string.
8355
8356 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8357 language ID in the event parameters.
8358
8359 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8360 event.code, not the obscure "character set ID".
8361
8362 2012-06-23 Chong Yidong <cyd@gnu.org>
8363
8364 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8365
8366 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8367
8368 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8369 * w32.c (fdutimens): New function.
8370
8371 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8372
8373 * s/ms-w32.h (pselect): Redirect to sys_select.
8374
8375 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8376
8377 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8378 in the logic of incrementing and decrementing the value of
8379 use_relocatable_buffers.
8380
8381 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8382
8383 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8384 Privately reported by Herbert J. Skuhra.
8385 [__FreeBSD__]: Remove "*/" typo after "#include".
8386 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8387 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8388 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8389 Don't assume EMACS_TIME and struct timeval are the same type.
8390
8391 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 Support higher-resolution time stamps (Bug#9000).
8394 The time stamps are only nanosecond-resolution at the C level,
8395 since that's the best that any real-world system supports now.
8396 But they are picosecond-resolution at the Lisp level, as that's
8397 easy, and leaves room for future OS improvements.
8398
8399 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8400 (LIBES): Use it.
8401
8402 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8403 Don't get current time unless it's needed.
8404
8405 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8406 now provides it if it's absent.
8407 (start_atimer): Port to higher-res time stamps.
8408 Check for time stamp overflow. Don't get current time more
8409 often than is needed.
8410
8411 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8412 Include systime.h, not time.h.
8413 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8414
8415 * dired.c: Include stat-time.h.
8416 (Ffile-attributes): File times now have higher resolution.
8417
8418 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8419 (struct image): Timestamp now has higher resolution.
8420
8421 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8422 has at least microseconds now. All uses removed.
8423 (update_frame, update_single_window, update_window, update_frame_1)
8424 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8425 (duration_to_sec_usec): Remove; no longer needed.
8426
8427 * editfns.c (time_overflow): Now extern.
8428 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8429 (float-time, Fformat_time_string, Fcurrent_time_string)
8430 (Fcurrent_time_zone): Accept and generate higher-resolution
8431 time stamps.
8432 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8433 (decode_time_components, lisp_seconds_argument): New functions.
8434 (make_time): Now static.
8435 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8436 Report an error if the time is invalid, rather than having the caller
8437 do that.
8438
8439 * fileio.c: Include <stat-time.h>
8440 (Fcopy_file): Copy higher-resolution time stamps.
8441 Prefer to set the time stamp via a file descriptor if that works.
8442 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8443 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8444 (Fvisited_file_modtime, Fset_visited_file_modtime):
8445 Support higher-resolution time stamps.
8446
8447 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8448
8449 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8450
8451 * image.c (prepare_image_for_display, clear_image_cache)
8452 (lookup_image): Port to higer-resolution time stamps.
8453
8454 * keyboard.c (start_polling, bind_polling_period):
8455 Check for time stamp overflow.
8456 (read_char, kbd_buffer_get_event, timer_start_idle)
8457 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8458 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8459 Port to higher-resolution time stamps. Do not assume time_t is signed.
8460 (decode_timer): New function. Timers are now vectors of length 9,
8461 not 8, to accommodate the picosecond component.
8462 (timer_check_2): Use it.
8463
8464 * nsterm.m (select_timeout, timeval_subtract): Remove.
8465 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8466 as they're a bit more accurate and handle overflow better.
8467 (ns_select): Change prototype to be compatible with pselect.
8468 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8469 * nsterm.h (ns_select): Adjust prototype.
8470
8471 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8472 us-resolution time stamps.
8473 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8474
8475 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8476
8477 * lisp.h (time_overflow): New decl.
8478 (wait_reading_process_output): First arg is now intmax_t, not int,
8479 to accommodate larger waits.
8480
8481 * process.h (struct Lisp_Process.read_output_delay):
8482 Now counts nanoseconds, not microseconds.
8483 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8484 EMACS_HAS_USECS.
8485 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8486 (wait_reading_process_output):
8487 Port to ns-resolution time stamps.
8488 (Faccept_process_output, wait_reading_process_output):
8489 Check for time stamp overflow. Do not assume time_t is signed.
8490 (select_wrapper): Remove; we now use pselect.
8491 (Fprocess_attributes): Now generates ns-resolution time stamps.
8492
8493 * sysdep.c: Include utimens.h. Don't include utime.h
8494 or worry about struct utimbuf; gnulib does that for us now.
8495 (gettimeofday): Remove; gnulib provides a substitute.
8496 (make_timeval): New function.
8497 (set_file_times): Now sets ns-resolution time stamps.
8498 New arg FD; all uses changed.
8499 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8500 (system_process_attributes):
8501 Now returns ns-resolution time stamp. All uses changed.
8502 Check for time stamp overflow.
8503
8504 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8505 provides a substitute now.
8506
8507 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8508 since it guarantees struct timespec.
8509 (EMACS_TIME): Now struct timespec, so that we can support
8510 ns-resolution time stamps.
8511 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8512 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8513 (EMACS_USECS): Remove.
8514 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8515 so multiply the arg by 1000 before storing it.
8516 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8517 New macros.
8518 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8519 Port to ns-resolution time stamps.
8520 (EMACS_TIME_NEG_P): Remove; replaced by....
8521 (EMACS_TIME_SIGN): New macro.
8522 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8523 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8524 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8525 (make_timeval, make_lisp_time, decode_time_components): New decls.
8526 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8527 that it mishandled time_t overflow. You can't compare by subtracting!
8528 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8529 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8530
8531 * term.c: Include <sys/time.h>.
8532 (timeval_to_Time): New function, for proper overflow wraparound.
8533 (term_mouse_position, term_mouse_click): Use it.
8534
8535 * undo.c (record_first_change): Support higher-resolution time stamps
8536 in the undo buffer.
8537 (Fprimitive_undo): Use them when restoring time stamps.
8538
8539 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8540 (w32_get_internal_run_time):
8541 Port to higher-resolution Emacs time stamps.
8542 (ltime): Now accepts single 64-bit integer, as that's more convenient
8543 for callers.
8544
8545 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8546
8547 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8548 for compatibility with pselect. Support ns-resolution time stamps.
8549
8550 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8551
8552 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8553 Check for time stamp overflow, and support ns-resolution time stamps.
8554
8555 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8556 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8557 (timeval_subtract): Remove; no longer needed.
8558 (XTflash, XTring_bell, x_wait_for_event):
8559 Port to ns-resolution time stamps. Don't assume time_t is signed.
8560
8561 2012-06-22 Chong Yidong <cyd@gnu.org>
8562
8563 * xdisp.c (x_consider_frame_title): Revert last change.
8564
8565 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8566
8567 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8568 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8569 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8570 staticidx goes up to 1597 out of 1600 = 0x640.)
8571
8572 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8573
8574 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8575 Otherwise, the umask might be mistakenly 0 while handling input signals.
8576
8577 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8578
8579 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8580
8581 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8582
8583 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8584 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8585 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8586 access to `contents' member of Lisp_Vector objects with AREF and ASET
8587 where appropriate.
8588
8589 2012-06-19 Chong Yidong <cyd@gnu.org>
8590
8591 * frame.c (delete_frame): When selecting a frame on a different
8592 text terminal, do not alter the terminal's top-frame.
8593
8594 * xdisp.c (format_mode_line_unwind_data): Record the target
8595 frame's selected window and its terminal's top-frame.
8596 (unwind_format_mode_line): Restore them.
8597 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8598 Callers changed.
8599 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8600 since tty frames can be explicitly named.
8601 (prepare_menu_bars): Likewise.
8602
8603 * term.c (Ftty_top_frame): New function.
8604
8605 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8606
8607 Port byte-code-meter to modern targets.
8608 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8609 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8610 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8611 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8612 (METER_1, METER_2): Simplify.
8613
8614 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8615
8616 * data.c (Fdefalias): Return `symbol' (bug#11686).
8617
8618 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8619
8620 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8621 gets killed during executing of this function (Bug#11665).
8622 Try to always return Qt when the buffer has been actually killed.
8623 (Vkill_buffer_query_functions): In doc-string say that functions
8624 run by this hook should not change the current buffer.
8625
8626 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 Fix recently-introduced process.c problems found by static checking.
8629 * process.c (write_queue_push, write_queue_pop, send_process):
8630 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8631 (write_queue_pop): Fix pointer signedness problem.
8632 (send_process): Remove unused local.
8633
8634 2012-06-17 Chong Yidong <cyd@gnu.org>
8635
8636 * xdisp.c (redisplay_internal): No need to redisplay terminal
8637 frames that are not on top.
8638
8639 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8640
8641 * process.c (make_process): Initialize write_queue.
8642 (write_queue_push, write_queue_pop): New functions.
8643 (send_process): Use them to maintain correct ordering of process
8644 writes (Bug#10815).
8645
8646 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8647
8648 * lisp.h (eassert): Assume C89 or later.
8649 This removes the need for CHECK.
8650 (CHECK): Remove. Its comments about always evaluating its
8651 argument were confusing, as 'eassert' typically does not evaluate
8652 its argument.
8653
8654 * coding.c (produce_chars): Use ptrdiff_t, not int.
8655
8656 * xterm.c (x_draw_underwave): Check for integer overflow.
8657 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8658
8659 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8660
8661 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8662 referenced (Bug#11583).
8663
8664 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8665
8666 Implement wave-style variant of underlining.
8667 * dispextern.h (face_underline_type): New enum.
8668 (face): Add field for underline type.
8669 * nsterm.m (ns_draw_underwave): New function.
8670 (ns_draw_text_decoration): Use it.
8671 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8672 New functions.
8673 (x_draw_glyph_string): Use them.
8674 * xfaces.c (Qline, Qwave): New Lisp objects.
8675 (check_lface_attrs, merge_face_ref)
8676 (Finternal_set_lisp_face_attribute, realize_x_face):
8677 Handle wave-style underline face attributes.
8678 * xterm.c (x_draw_underwave): New function.
8679 (x_draw_glyph_string): Use it.
8680
8681 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8682
8683 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8684 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8685 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8686 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8687 ($(BLD)/w32select.$(O)): Update dependencies.
8688
8689 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8690
8691 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8692 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8693 * character.c (_fetch_multibyte_char_p): Remove.
8694 * alloc.c: Include "character.h" before "buffer.h".
8695 * bidi.c: Likewise.
8696 * buffer.c: Likewise.
8697 * bytecode.c: Likewise.
8698 * callint.c: Likewise.
8699 * callproc.c: Likewise.
8700 * casefiddle.c: Likewise.
8701 * casetab.c: Likewise.
8702 * category.c: Likewise.
8703 * cmds.c: Likewise.
8704 * coding.c: Likewise.
8705 * composite.c: Likewise.
8706 * dired.c: Likewise.
8707 * dispnew.c: Likewise.
8708 * doc.c: Likewise.
8709 * dosfns.c: Likewise.
8710 * editfns.c: Likewise.
8711 * emacs.c: Likewise.
8712 * fileio.c: Likewise.
8713 * filelock.c: Likewise.
8714 * font.c: Likewise.
8715 * fontset.c: Likewise.
8716 * fringe.c: Likewise.
8717 * indent.c: Likewise.
8718 * insdel.c: Likewise.
8719 * intervals.c: Likewise.
8720 * keyboard.c: Likewise.
8721 * keymap.c: Likewise.
8722 * lread.c: Likewise.
8723 * macros.c: Likewise.
8724 * marker.c: Likewise.
8725 * minibuf.c: Likewise.
8726 * nsfns.m: Likewise.
8727 * nsmenu.m: Likewise.
8728 * print.c: Likewise.
8729 * process.c: Likewise.
8730 * regex.c: Likewise.
8731 * region-cache.c: Likewise.
8732 * search.c: Likewise.
8733 * syntax.c: Likewise.
8734 * term.c: Likewise.
8735 * textprop.c: Likewise.
8736 * undo.c: Likewise.
8737 * unexsol.c: Likewise.
8738 * w16select.c: Likewise.
8739 * w32fns.c: Likewise.
8740 * w32menu.c: Likewise.
8741 * window.c: Likewise.
8742 * xdisp.c: Likewise.
8743 * xfns.c: Likewise.
8744 * xmenu.c: Likewise.
8745 * xml.c: Likewise.
8746 * xselect.c: Likewise.
8747
8748 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8749
8750 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8751 If all the glyphs of the glyph row came from strings, and we have no
8752 cursor positioning clues, put the cursor on the first glyph of the
8753 row.
8754 (handle_face_prop): Use chunk-relative overlay string index when
8755 indexing into it->string_overlays array. (Bug#11653)
8756 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8757 the rightmost. (Bug#11720)
8758
8759 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8760
8761 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8762 (CATEGORY_MEMBER): Enforce 1/0 value.
8763 * category.c (_temp_category_set): Remove.
8764
8765 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8766
8767 * window.c (Fdelete_other_windows_internal)
8768 (Fdelete_window_internal): Don't access frame's mouse highlight
8769 info of the initial frame. (Bug#11677)
8770
8771 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8772
8773 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8774 Assume USE_2_TAGS_FOR_INTS.
8775 (xreload): Adjust $tagmask width to match recent lisp.h change.
8776
8777 Simplify lisp.h in minor ways that should not affect code.
8778 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8779 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8780 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8781 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8782 (INTTYPEBITS): New macro, for clarity.
8783 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8784 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8785 Simplify now that USE_LSB_TAG is always defined.
8786 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8787 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8788
8789 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8790
8791 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8792
8793 2012-06-13 Glenn Morris <rgm@gnu.org>
8794
8795 * s/bsd-common.h (BSD4_3):
8796 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8797
8798 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8799
8800 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8801 instead of union.
8802 (XLI, XIL): Define.
8803 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8804 Use them.
8805 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8806 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8807 * alloc.c (widen_to_Lisp_Object): Remove.
8808 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8809 * frame.c (delete_frame): Remove outdated comment.
8810 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8811 USE_LISP_UNION_TYPE.
8812 (Fw32_unregister_hot_key): Likewise.
8813 (Fw32_toggle_lock_key): Likewise.
8814 * w32menu.c (add_menu_item): Likewise.
8815 (w32_menu_display_help): Use XIL instead of checking
8816 USE_LISP_UNION_TYPE.
8817 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8818 (init_heap): Likewise.
8819 * w32term.c (w32_read_socket): Update comment.
8820
8821 2012-06-13 Glenn Morris <rgm@gnu.org>
8822
8823 * s/usg5-4-common.h, src/s/unixware.h:
8824 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8825
8826 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8827
8828 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8831 * alloc.c (make_number) [!defined make_number]:
8832 Remove, as lisp.h always defines this now.
8833 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8834 (roundup_size): Verify that it is a power of 2.
8835 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8836 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8837 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8838 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8839 USE_LSB_TAG now is always defined to be either 0 or 1.
8840 All uses changed.
8841 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8842 code works fine either way, and efficiency is not a concern here,
8843 as the union type is for debugging, not for production.
8844 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8845 Use an inline function on all platforms when using the union type,
8846 since this is simpler and 'static inline' can be used portably
8847 within Emacs now.
8848 (LISP_INITIALLY_ZERO): New macro.
8849 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8850 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8851
8852 2012-06-12 Glenn Morris <rgm@gnu.org>
8853
8854 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8855
8856 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8857
8858 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8859 Move BROKEN_SIGIO to configure.
8860
8861 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8862 Move NO_TERMIO to configure.
8863
8864 2012-06-12 Chong Yidong <cyd@gnu.org>
8865
8866 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8867 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8868 MagickExportImagePixels is undefined.
8869
8870 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8871
8872 * image.c (imagemagick_load_image): Remove unused label.
8873
8874 2012-06-11 Glenn Morris <rgm@gnu.org>
8875
8876 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8877 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8878 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8879 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8880
8881 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8882
8883 * alloc.c (make_byte_code): New function.
8884 (Fmake_byte_code): Use it. Don't purify here.
8885 * lread.c (read1): Use it as well to avoid extra allocation.
8886
8887 2012-06-11 Chong Yidong <cyd@gnu.org>
8888
8889 * image.c (imagemagick_load_image): Implement transparency.
8890
8891 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8892
8893 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8894 account for preceding backslashes. (Bug#11663)
8895
8896 2012-06-09 Chong Yidong <cyd@gnu.org>
8897
8898 * term.c: Support italics in capable terminals (Bug#9652).
8899 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8900 (turn_on_face): Output using TS_enter_italic_mode if available.
8901 Don't handle unused blinking and alt-charset cases.
8902 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8903 and tty_alt_charset_p cases.
8904 (tty_capable_p, init_tty): Support italics.
8905
8906 * termchar.h (struct tty_display_info): Add field for italics.
8907 Remove unused blink field.
8908
8909 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8910 Handle slant.
8911
8912 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8913 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8914 tty_alt_charset_p. Add tty_italic_p.
8915
8916 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8917
8918 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8919 dbus_type_is_basic if available.
8920 (xd_extract_signed, xd_extract_unsigned): Rename from
8921 extract_signed and extract_unsigned, respectively. Adapt callers.
8922
8923 2012-06-09 Chong Yidong <cyd@gnu.org>
8924
8925 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8926
8927 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8928 case (Bug#9752).
8929
8930 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8931
8932 * xdisp.c (vmessage): Treat frame message as multibyte.
8933 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8934 would generate the diagnostic "Making \302\247 buffer-local while
8935 let-bound!".
8936
8937 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8938
8939 * dispnew.c (showing_window_margins_p): Undo last change, which
8940 was done due to an inadvertent commit.
8941 (adjust_frame_glyphs_for_frame_redisplay): Do call
8942 showing_window_margins_p.
8943
8944 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8945
8946 * eval.c (Fmake_var_non_special): New primitive.
8947 (syms_of_eval): Defsubr it.
8948 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8949
8950 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8951
8952 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8953 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8954
8955 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8956
8957 * alloc.c (allocate_vectorlike): Fix last change.
8958
8959 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8960
8961 Block-based vector allocation of small vectors.
8962 * lisp.h (struct vectorlike_header): New field `nbytes',
8963 adjust comment accordingly.
8964 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8965 to denote vector blocks. Adjust users (live_vector_p,
8966 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8967 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8968 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8969 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8970 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8971 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8972 (roundup_size): New constant.
8973 (struct vector_block): New data type.
8974 (vector_blocks, vector_free_lists, zero_vector): New variables.
8975 (all_vectors): Rename to `large_vectors'.
8976 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8977 (sweep_vectors): New functions.
8978 (allocate_vectorlike): Return `zero_vector' as the only vector of
8979 0 items. Allocate new vector from block if vector size is less than
8980 or equal to VBLOCK_BYTES_MAX.
8981 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8982 (init_alloc_once): Add call to init_vectors.
8983
8984 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8985
8986 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8987
8988 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8989
8990 * doprnt.c (doprnt): Truncate multibyte char correctly.
8991 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8992 would mishandle a string argument "Xc" if X was a multibyte
8993 character of length 2: it would truncate after X's first byte
8994 rather than including all of X.
8995
8996 2012-06-06 Chong Yidong <cyd@gnu.org>
8997
8998 * buffer.c (word_wrap): Doc fix.
8999
9000 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9003
9004 2012-06-03 Glenn Morris <rgm@gnu.org>
9005
9006 * xdisp.c (tool-bar-style): Doc fix.
9007
9008 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9009
9010 * Makefile.in (PAXCTL): Define.
9011 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9012 binary via PaX flags if the paxctl utility is available.
9013 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9014 Restore PaX flags to their default. (Bug#11398)
9015
9016 2012-06-03 Chong Yidong <cyd@gnu.org>
9017
9018 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9019 buffer (Bug#11226).
9020
9021 2012-06-03 Chong Yidong <cyd@gnu.org>
9022
9023 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9024 (note_mode_line_or_margin_highlight): If there is no help echo,
9025 use mode-line-default-help-echo. Handle the case where the mouse
9026 position is past the end of the mode line string.
9027
9028 * buffer.c (buffer_local_value_1): New function, split from
9029 Fbuffer_local_value; can return Qunbound.
9030 (Fbuffer_local_value): Use it.
9031 (Vmode_line_format): Docstring tweaks.
9032
9033 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 * sysdep.c (system_process_attributes): Improve comment.
9036
9037 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9038
9039 * keyboard.c: Export real-this-command to Elisp.
9040 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9041 and DEFVAR it. Update all users.
9042
9043 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9044
9045 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9046
9047 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9048 Convert pctcpu and pctmem to Lisp float properly.
9049 Let the compiler fold better, as 100.0/0x8000 is exact.
9050
9051 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9052
9053 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9054 cons_block.
9055
9056 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9059
9060 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9061
9062 For a 'struct window', replace some Lisp_Object fields to
9063 bitfields where appropriate, remove unused fields.
9064 * window.h (struct window): Remove unused 'last_mark_x' and
9065 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9066 change its type from Lisp_Object to bitfield.
9067 Change type of 'force_start', 'optional_new_start',
9068 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9069 fields from Lisp_Object to bitfield. Adjust users accordingly.
9070
9071 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9072
9073 Pacify gcc -Wdouble-precision when using Xaw.
9074 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9075 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9076 Use 'float' consistently, rather than 'float' in most places
9077 and 'double' in a couple of places.
9078
9079 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9080
9081 * xdisp.c (handle_stop): Detect whether we have overlay strings
9082 loaded by testing it->current.overlay_string_index to be
9083 non-negative, instead of checking whether n_overlay_strings is
9084 positive. (Bug#11587)
9085
9086 2012-05-31 Chong Yidong <cyd@gnu.org>
9087
9088 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9089
9090 * doc.c (Fsubstitute_command_keys): Doc fix.
9091
9092 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9093
9094 * search.c (search_buffer): Remove calls to
9095 r_alloc_inhibit_buffer_relocation, as it is now called by
9096 maybe_unify_char, which was the cause of relocation of buffer text
9097 in bug#11519.
9098
9099 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9100
9101 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9102 for the duration of call to load_charset, to avoid problems with
9103 callers of maybe_unify_char that access buffer text through C
9104 pointers.
9105
9106 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9107 decrement the inhibition flag, instead of just setting or
9108 resetting it.
9109
9110 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9111
9112 Remove obsolete '#define static' cruft.
9113 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9114 This #undef was "temporary" in 2000; it is no longer needed
9115 now that '#define static' has gone away.
9116 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9117 (gray_bitmap_bits): Remove; no longer needed.
9118 All uses replaced with definiens.
9119 * xterm.c: Include "bitmaps/gray.xbm".
9120
9121 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 Clean up __executable_start, monstartup when --enable-profiling.
9124 The following changes affect the code only when profiling.
9125 * dispnew.c (__executable_start): Rename from safe_bcopy.
9126 Define only on platforms that need it.
9127 * emacs.c: Include <sys/gmon.h> when profiling.
9128 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9129 (__executable_start): Remove decl, since lisp.h does it now.
9130 (safe_bcopy): Remove decl; no longer has that name.
9131 (main): Coalesce #if into single bit of code, for simplicity.
9132 Cast pointers to uintptr_t, since standard libraries want integers
9133 and not pointers.
9134 * lisp.h (__executable_start): New decl.
9135
9136 2012-05-31 Glenn Morris <rgm@gnu.org>
9137
9138 * image.c (Fimagemagick_types): Doc fix.
9139
9140 2012-05-30 Jim Meyering <meyering@redhat.com>
9141
9142 * callproc.c (Fcall_process_region): Include directory component
9143 in mkstemp error message (Bug#11586).
9144
9145 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9146
9147 * alloc.c, lisp.h (make_pure_vector): Now static.
9148
9149 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9150
9151 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9152 Move to byte-run.el.
9153 (Fautoload): Do the hash-doc more carefully.
9154 * data.c (Fdefalias): Purify definition, except for keymaps.
9155 (Qdefun): Move from eval.c.
9156 * lisp.h (Qdefun): Remove.
9157 * lread.c (read1): Tiny simplification.
9158
9159 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9160
9161 Do not create empty overlays with the evaporate property (Bug#9642).
9162 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9163 Bug#9642, but explicitly check that the buffer the overlay would
9164 be moved to is live and rearrange lines to make sure that errors
9165 will not put the overlay in an inconsistent state.
9166 (Fdelete_overlay): Cosmetics.
9167
9168 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9169
9170 * w32term.c (my_bring_window_to_top): New function.
9171 (x_raise_frame): Use handle returned by DeferWindowPos, which
9172 could be different from the original one.
9173 Call my_bring_window_to_top instead of my_set_foreground_window.
9174 (Bug#11513)
9175
9176 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9177 by calling BringWindowToTop.
9178
9179 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9180 (WM_EMACS_END): Increase by one.
9181
9182 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9183
9184 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9185 This avoids undefined behavior that might cause the eassert
9186 to not catch an out-of-range value.
9187
9188 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9189
9190 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9191 Update dependencies.
9192
9193 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9194
9195 * bidi.c (bidi_mirror_char): Fix last change.
9196
9197 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9198
9199 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9200 when referring to sectname field in printf format.
9201
9202 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9203
9204 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9205 Only r_alloc_inhibit_buffer_relocation needed to be added;
9206 the others were already declared.
9207
9208 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9209 before checking whether it's out of range. Put the check inside
9210 eassert. See
9211 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9212
9213 2012-05-27 Ken Brown <kbrown@cornell.edu>
9214
9215 * callproc.c (Fcall_process): Restore a line that was accidentally
9216 commented out in the 2011-02-13 change (bug#11547).
9217
9218 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9219
9220 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9221 defined on ralloc.c.
9222
9223 * buffer.c [REL_ALLOC]: Remove prototypes of
9224 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9225 they are now on lisp.h.
9226
9227 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9228
9229 * search.c (search_buffer): Use it to inhibit relocation of buffer
9230 text while re_search_2 is doing its job, because re_search_2 is
9231 passed C pointers to buffer text. (Bug#11519)
9232
9233 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9234 Update value to 24.
9235
9236 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9237 state after an additional call to move_it_in_display_line_to, keep
9238 the values of it->max_ascent and it->max_descent found for the
9239 entire line.
9240 (pos_visible_p): Revert the comparison against bottom_y to what it
9241 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9242 (Bug#11464)
9243
9244 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9245
9246 Fix coding-related core dumps with gcc -ftrapv.
9247 The code was computing A - B, where A and B are pointers, and B is
9248 random garbage. This can lead to core dumps on platforms that
9249 have special pointer registers, and it also leads to core dumps on
9250 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9251 A - B only when B is initialized properly.
9252 * coding.c (coding_set_source, coding_set_destination): Return void.
9253 (coding_change_source, coding_change_destinations): New functions,
9254 with the old behaviors of coding_set_source and coding_set_destination.
9255 All callers that need an offset changed to use these new functions.
9256
9257 2012-05-26 Glenn Morris <rgm@gnu.org>
9258
9259 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9260
9261 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9262
9263 Extend mouse support on W32 text-mode console.
9264 * xdisp.c (draw_row_with_mouse_face):
9265 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9266
9267 * w32console.c: Include window.h.
9268 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9269 New functions.
9270 (initialize_w32_display): Initialize mouse-highlight data.
9271
9272 * w32inevt.c: Include termchar.h and window.h.
9273 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9274 moves, call note_mouse_highlight. If help_echo changed, call
9275 gen_help_event to produce help-echo message in the echo area.
9276 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9277 highlight info.
9278
9279 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 * lread.c (read1): Simplify slightly to avoid an overflow warning
9282 with GCC 4.7.0 on x86-64.
9283
9284 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9285
9286 * bidi.c (bidi_mirror_char): Revert last change: an int is
9287 definitely wide enough here.
9288
9289 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9290
9291 Fix integer width and related bugs (Bug#9874).
9292 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9293 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9294 (string_bytes, check_sblock, allocate_string_data):
9295 (compact_small_strings, Fmake_bool_vector, make_string)
9296 (make_unibyte_string, make_multibyte_string)
9297 (make_string_from_bytes, make_specified_string)
9298 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9299 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9300 (mark_vectorlike):
9301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9302 (allocate_pseudovector):
9303 Use int, not EMACS_INT, where int is wide enough.
9304 (inhibit_garbage_collection, Fgarbage_collect):
9305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9306 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9307 int might not be wide enough.
9308 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9309 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9310 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9311 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9312 (bidi_level_of_next_char, bidi_move_to_visually_next):
9313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9314 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9315 (Fkill_buffer, Fset_buffer_major_mode)
9316 (advance_to_char_boundary, Fbuffer_swap_text)
9317 (Fset_buffer_multibyte, overlays_at, overlays_in)
9318 (overlay_touches_p, struct sortvec, record_overlay_string)
9319 (overlay_strings, recenter_overlay_lists)
9320 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9321 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9322 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9323 (Foverlay_recenter, last_overlay_modification_hooks_used)
9324 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9326 (validate_region): Omit unnecessary test for b <= e,
9327 since that's guaranteed by the previous test.
9328 (adjust_overlays_for_delete): Avoid pos + length overflow.
9329 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9330 (report_overlay_modification):
9331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9332 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9333 Omit pointer cast, which isn't needed anyway, and doesn't work
9334 after the EMACS_INT -> ptrdiff_t change.
9335 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9336 * buffer.h: Adjust decls to match defn changes elsewhere.
9337 (struct buffer_text, struct buffer):
9338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9339 Use EMACS_INT, not int, where int might not be wide enough.
9340 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9341 not int, to avoid needless 32-bit limit on 64-bit hosts.
9342 (exec_byte_code): Use tighter memory-full test, one that checks
9343 for alloca overflow. Don't compute the address of the object just
9344 before an array, as that's not portable. Use EMACS_INT, not
9345 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9346 * callint.c (Fcall_interactively):
9347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9348 * callproc.c (call_process_kill, Fcall_process):
9349 Don't assume pid_t fits into an Emacs fixnum.
9350 (call_process_cleanup, Fcall_process, child_setup):
9351 Don't assume pid_t fits into int.
9352 (call_process_cleanup, Fcall_process, delete_temp_file)
9353 (Fcall_process_region):
9354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9355 (Fcall_process): Simplify handling of volatile integers.
9356 Use int, not EMACS_INT, where int will do.
9357 * casefiddle.c (casify_object, casify_region, operate_on_word)
9358 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9360 (casify_object): Avoid integer overflow when overallocating buffer.
9361 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9362 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9363 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9364 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9365 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9366 integers are now checked earlier. All uses replaced with XINT.
9367 (ccl_driver):
9368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9369 For CCL_MapSingle, check that content and value are in int range.
9370 (ccl_driver, Fregister_code_conversion_map):
9371 Check that Vcode_version_map_vector is a vector.
9372 (resolve_symbol_ccl_program): Check that vector header is in range.
9373 Always copy the vector, so that we can check its contents reliably
9374 now rather than having to recheck each instruction as it's being
9375 executed. Check that vector words fit in 'int'.
9376 (ccl_get_compiled_code, Fregister_ccl_program)
9377 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9378 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9379 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9380 contents are in range.
9381 (Fccl_execute_on_string): Check that status is in range.
9382 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9383 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9384 Accept and return EMACS_INT, not int, because callers can pass values
9385 out of 'int' range.
9386 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9387 (multibyte_chars_in_text, parse_str_as_multibyte)
9388 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9389 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9390 (string_escape_byte8, Fget_byte):
9391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9392 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9393 avoid mishandling large integers.
9394 * character.h: Adjust decls to match defn changes elsewhere.
9395 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9396 (Ffind_charset_region):
9397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9398 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9399 (load_charset_map_from_vector, Fdefine_charset_internal):
9400 Don't assume fixnum fits in int.
9401 (load_charset_map_from_vector, Fmap_charset_chars):
9402 Remove now-unnecessary CHECK_NATNUMs.
9403 (Fdefine_charset_internal): Check ranges here, more carefully.
9404 Don't rely on undefined behavior with signed left shift overflow.
9405 Don't assume unsigned int fits into fixnum, or that fixnum fits
9406 into unsigned int. Don't require max_code to be a valid fixnum;
9407 that's not true for gb10830 4-byte on a 32-bit host. Allow
9408 invalid_code to be a cons, for the same reason. Require code_offset
9409 to be a character. Avoid int overflow if max_char is close
9410 to INT_MAX.
9411 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9412 this is intended anyway and avoids some undefined behavior.
9413 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9414 INDEX_TO_CODE_POINT, as that's what it expects.
9415 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9416 * charset.h (DECODE_CHAR): Return int, not unsigned;
9417 this is what was intended anyway, and it avoids undefined behavior.
9418 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9419 integer-overflow issues.
9420 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9421 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9422 where the argument is EMACS_INT, and this behavior is not intended.
9423 * chartab.c (Fmake_char_table, Fset_char_table_range)
9424 (uniprop_get_decoder, uniprop_get_encoder):
9425 Don't assume fixnum fits in int.
9426 * cmds.c (move_point): New function, that does the gist of
9427 Fforward_char and Fbackward_char, but does so while checking
9428 for integer overflow more accurately.
9429 (Fforward_char, Fbackward_char): Use it.
9430 (Fforward_line, Fend_of_line, internal_self_insert)
9431 (internal_self_insert):
9432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9433 Fix a FIXME, by checking for integer overflow when calculating
9434 target_clm and actual_clm.
9435 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9436 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9437 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9438 (coding_alloc_by_making_gap, alloc_destination)
9439 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9440 (encode_coding_utf_16, detect_coding_emacs_mule)
9441 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9442 (detect_coding_iso_2022, decode_coding_iso_2022)
9443 (encode_invocation_designation, encode_designation_at_bol)
9444 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9445 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9446 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9447 (encode_coding_ccl, encode_coding_raw_text)
9448 (detect_coding_charset, decode_coding_charset)
9449 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9450 (produce_composition, produce_charset, produce_annotation)
9451 (decode_coding, handle_composition_annotation)
9452 (handle_charset_annotation, consume_chars, decode_coding_gap)
9453 (decode_coding_object, encode_coding_object, detect_coding_system)
9454 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9455 (code_convert_region, code_convert_string)
9456 (Fdefine_coding_system_internal)
9457 (coding_set_source, coding_set_destination):
9458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9459 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9460 (Fdefine_coding_system_internal):
9461 Don't assume fixnums fit in int.
9462 (decode_coding_gap, decode_coding_object, encode_coding_object)
9463 (Fread_coding_system, Fdetect_coding_region)
9464 (Funencodable_char_position, Fcheck_coding_systems_region)
9465 (get_translation, handle_composition_annotation, consume_chars):
9466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9467 (consume_chars): Rewrite to not calculate an address outside buffer.
9468 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9469 Don't access memory outside of the args array.
9470 (Fdefine_coding_system_internal): Check for charset-id overflow.
9471 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9472 result of ENCODE_CHAR.
9473 * coding.h: Adjust decls to match defn changes elsewhere.
9474 (struct coding_system):
9475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9476 * composite.c (get_composition_id, find_composition)
9477 (run_composition_function, update_compositions)
9478 (compose_text, composition_gstring_put_cache)
9479 (composition_gstring_p, composition_gstring_width)
9480 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9481 (composition_compute_stop_pos, composition_reseat_it)
9482 (composition_update_it, struct position_record)
9483 (find_automatic_composition, composition_adjust_point)
9484 (Fcomposition_get_gstring, Ffind_composition_internal):
9485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9486 (update_compositions):
9487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9488 * composite.h: Adjust decls to match defn changes elsewhere.
9489 (struct composition):
9490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9491 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9492 Do not attempt to compute the address of the object just before a
9493 buffer; this is not portable.
9494 (Faref, Faset):
9495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9496 (Faset): Use int, not EMACS_INT, where int is wide enough.
9497 (Fstring_to_number): Don't assume fixnums fit in int.
9498 (Frem): Don't assume arg is nonnegative.
9499 * dbusbind.c (xd_append_arg): Check for integers out of range.
9500 (Fdbus_call_method): Don't overflow the timeout int.
9501 (extract_signed, extract_unsigned): New functions.
9502 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9503 (xd_get_connection_references): Return ptrdiff_t, not int.
9504 All uses changed.
9505 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9506 (xd_read_message_1):
9507 Use int, not unsigned, where the dbus API uses int.
9508 (Fdbus_message_internal): Don't overflow mtype.
9509 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9510 * dired.c (directory_files_internal, file_name_completion, scmp)
9511 (file_name_completion_stat):
9512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9513 (file_name_completion): Don't overflow matchcount.
9514 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9515 * dispextern.h: Adjust decls to match defn changes elsewhere.
9516 (struct text_pos, struct glyph, struct bidi_saved_info)
9517 (struct bidi_string_data, struct bidi_it, struct composition_it)
9518 (struct it):
9519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9520 (struct display_pos, struct composition_it, struct it):
9521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9522 * dispnew.c (increment_matrix_positions)
9523 (increment_row_positions, mode_line_string)
9524 (marginal_area_string):
9525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9526 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9528 (duration_to_sec_usec): New function, to check for overflow better.
9529 (Fsleep_for, sit_for): Use it.
9530 * doc.c (get_doc_string, store_function_docstring):
9531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9532 (get_doc_string, Fsnarf_documentation):
9533 Use int, not EMACS_INT, where int is wide enough.
9534 (get_doc_string):
9535 Use SAFE_ALLOCA, not alloca.
9536 Check for overflow when converting EMACS_INT to off_t.
9537 * doprnt.c (doprnt):
9538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9539 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9540 Don't assume uid_t fits into fixnum.
9541 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9542 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9543 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9544 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9545 (general_insert_function)
9546 (Finsert_char, make_buffer_string, make_buffer_string_both)
9547 (update_buffer_properties, Fbuffer_substring)
9548 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9549 (Fsubst_char_in_region, check_translation)
9550 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9551 (transpose_markers, Ftranspose_regions):
9552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9553 (clip_to_bounds): Move to lisp.h as an inline function).
9554 (Fconstrain_to_field): Don't assume integers are nonnegative.
9555 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9556 (Fsubst_char_in_region, Fsave_restriction):
9557 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9558 (Femacs_pid): Don't assume pid_t fits into fixnum.
9559 (lo_time): Use int, not EMACS_INT, when int suffices.
9560 (lisp_time_argument): Check for usec out of range.
9561 (Fencode_time): Don't assume fixnum fits in int.
9562 (Fuser_login_name, Fuser_full_name): Signal an error
9563 if a uid argument is out of range, rather than relying on
9564 undefined behavior.
9565 (Fformat_time_string): Remove now-unnecessary check.
9566 lisp_time_argument checks for out-of-range usec now.
9567 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9568 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9569 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9570 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9571 (init_cmdargs, Fdump_emacs):
9572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9573 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9574 the bottom (typically) 32 bits of the fixnum.
9575 * eval.c (specpdl_size, call_debugger):
9576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9577 (when_entered_debugger, Fbacktrace_debug):
9578 Don't assume fixnum can fit in int.
9579 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9580 the object just before a buffer; this is not portable.
9581 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9582 (grow_specpdl, unbind_to):
9583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9584 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9585 (grow_specpdl): Simplify allocation by using xpalloc.
9586 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9587 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9588 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9589 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9590 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9591 (a_write, e_write):
9592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9593 (Fcopy_file, non_regular_nbytes, read_non_regular)
9594 (Finsert_file_contents):
9595 Use int, not EMACS_INT, where int is wide enough.
9596 (READ_BUF_SIZE): Verify that it fits in int.
9597 (Finsert_file_contents): Check that counts are in proper range,
9598 rather than assuming fixnums fit into ptrdiff_t etc.
9599 Don't assume fixnums fit into int.
9600 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9601 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9602 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9603 (string_char_to_byte, string_byte_to_char)
9604 (string_make_multibyte, string_to_multibyte)
9605 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9606 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9607 (substring_both, Fdelete, internal_equal, Ffillarray)
9608 (Fclear_string, mapcar1)
9609 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9610 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9611 (larger_vector, make_hash_table, maybe_resize_hash_table)
9612 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9613 (Fmaphash, secure_hash):
9614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9615 (concat): Check for string index and length overflow.
9616 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9617 (Frequire):
9618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9619 (larger_vector): New API (vec, incr_min, size_max) replaces old
9620 one (vec, new_size, init). This catches size overflow.
9621 INIT was removed because it was always Qnil.
9622 All callers changed.
9623 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9624 the upper bound on a hash table index size.
9625 (make_hash_table, maybe_resize_hash_table): Use it.
9626 (secure_hash): Computer start_byte and end_byte only after
9627 they're known to be in ptrdiff_t range.
9628 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9629 (Ffont_get_glyphs, Ffont_at):
9630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9631 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9632 (Flist_fonts, Fopen_font):
9633 Don't assume fixnum can fit in int.
9634 (check_gstring): Don't assume index can fit in int.
9635 (font_match_p): Check that fixnum is a character, not a nonnegative
9636 fixnum, since the later code needs to stuff it into an int.
9637 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9638 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9639 conversion overflow issues.
9640 (Fopen_font): Check for integer out of range.
9641 (Ffont_get_glyphs): Don't assume index can fit in int.
9642 * font.h: Adjust decls to match defn changes elsewhere.
9643 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9644 integer overflow.
9645 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9646 printmax_t, where ptrdiff_t is wide enough.
9647 (Finternal_char_font):
9648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9649 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9650 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9651 (Fset_frame_position, x_set_frame_parameters)
9652 (x_set_line_spacing, x_set_border_width)
9653 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9654 Check that fixnums are in proper range for system types.
9655 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9657 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9658 Use SAFE_ALLOCA_LISP, not alloca.
9659 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9660 intptr_t is wide enough.
9661 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9662 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9663 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9664 Check for fixnum out of range.
9665 * ftfont.c (ftfont_list): Don't assume index fits in int.
9666 Check that fixnums are in proper range for system types.
9667 (ftfont_shape_by_flt):
9668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9669 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9671 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9672 Check that fixnums are in proper range for system types.
9673 * gnutls.h: Adjust decls to match defn changes elsewhere.
9674 * gtkutil.c (xg_dialog_run):
9675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9676 (update_frame_tool_bar):
9677 Check that fixnums are in proper range for system types.
9678 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9679 (lookup_image): Check that fixnums are in range for system types.
9680 * indent.c (last_known_column, last_known_column_point):
9681 (current_column_bol_cache):
9682 (skip_invisible, current_column, check_display_width):
9683 (check_display_width, scan_for_column, current_column_1)
9684 (Findent_to, Fcurrent_indentation, position_indentation)
9685 (indented_beyond_p, Fmove_to_column, compute_motion):
9686 (Fcompute_motion, Fvertical_motion):
9687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9688 (last_known_column_modified): Use EMACS_INT, not int.
9689 (check_display_width):
9690 (Fcompute_motion):
9691 Check that fixnums and floats are in proper range for system types.
9692 (compute_motion): Don't assume index or fixnum fits in int.
9693 (compute_motion, Fcompute_motion):
9694 Use int, not EMACS_INT, when it is wide enough.
9695 (vmotion): Omit local var start_hpos that is always 0; that way
9696 we don't need to worry about overflow in expressions involving it.
9697 * indent.h: Adjust decls to match defn changes elsewhere.
9698 (struct position):
9699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9700 Use int, not EMACS_INT, where int is wide enough.
9701 Remove unused members ovstring_chars_done and tab_offset;
9702 all uses removed.
9703 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9704 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9705 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9706 (make_gap, copy_text, insert, insert_and_inherit)
9707 (insert_before_markers, insert_before_markers_and_inherit)
9708 (insert_1, count_combining_before, count_combining_after)
9709 (insert_1_both, insert_from_string)
9710 (insert_from_string_before_markers, insert_from_string_1)
9711 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9712 (adjust_after_replace, adjust_after_insert, replace_range)
9713 (replace_range_2, del_range, del_range_1, del_range_byte)
9714 (del_range_both, del_range_2, modify_region)
9715 (prepare_to_modify_buffer, signal_before_change)
9716 (signal_after_change, Fcombine_after_change_execute):
9717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9718 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9719 (balance_an_interval, split_interval_right, split_interval_left)
9720 (find_interval, next_interval, update_interval)
9721 (adjust_intervals_for_insertion, delete_node, delete_interval)
9722 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9723 (static_offset_intervals, offset_intervals)
9724 (merge_interval_right, merge_interval_left, make_new_interval)
9725 (graft_intervals_into_buffer, temp_set_point_both)
9726 (temp_set_point, set_point, adjust_for_invis_intang)
9727 (set_point_both, move_if_not_intangible, get_property_and_range)
9728 (get_local_map, copy_intervals, copy_intervals_to_string)
9729 (compare_string_intervals, set_intervals_multibyte_1):
9730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9731 * intervals.h: Adjust decls to match defn changes elsewhere.
9732 (struct interval):
9733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9734 * keyboard.c (this_command_key_count, this_single_command_key_start)
9735 (before_command_key_count, before_command_echo_length, echo_now)
9736 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9737 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9738 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9739 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9741 (last_non_minibuf_size, last_point_position, echo_truncate)
9742 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9743 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9744 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9745 (stuff_buffered_input):
9746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9747 (last_auto_save, command_loop_1, read_char):
9748 Use EMACS_INT, not int, to avoid integer overflow.
9749 (record_char): Avoid overflow in total_keys computation.
9750 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9751 * keyboard.h: Adjust decls to match defn changes elsewhere.
9752 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9753 (Fkey_description, Fdescribe_vector, Flookup_key):
9754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9755 (click_position): New function, to check that positions are in range.
9756 (Fcurrent_active_maps):
9757 (describe_command):
9758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9759 (Faccessible_keymaps, Fkey_description):
9760 (preferred_sequence_p):
9761 Don't assume fixnum can fit into int.
9762 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9763 Check for integer overflow in size calculations.
9764 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9765 avoid mishandling large integers.
9766 * lisp.h: Adjust decls to match defn changes elsewhere.
9767 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9768 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9769 (struct Lisp_Marker):
9770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9771 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9772 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9773 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9774 All callers changed.
9775 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9776 Assume the arg has valid form, since it always does.
9777 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9778 unsigned integer system type.
9779 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9780 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9782 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9783 (duration_to_sec_usec): New decl.
9784 * lread.c (read_from_string_index, read_from_string_index_byte)
9785 (read_from_string_limit, readchar, unreadchar, openp)
9786 (read_internal_start, read1, oblookup):
9787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9788 (Fload, readevalloop, Feval_buffer, Feval_region):
9789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9790 (openp): Check for out-of-range argument to 'access'.
9791 (read1): Use int, not EMACS_INT, where int is wide enough.
9792 Don't assume fixnum fits into int.
9793 Fix off-by-one error that can read outside a buffer.
9794 (read_filtered_event): Use duration_to_sec_usec
9795 to do proper overflow checking on durations.
9796 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9797 in size calculation.
9798 (Fexecute_kbd_macro):
9799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9800 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9801 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9802 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9803 (set_marker_both, set_marker_restricted_both, marker_position)
9804 (marker_byte_position, Fbuffer_has_markers_at):
9805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9806 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9807 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9808 It now merely ensures that the menu is large enough, without
9809 necessarily growing it, as this avoids some integer overflow issues.
9810 All callers changed.
9811 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9813 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9814 Use SAFE_ALLOCA_LISP, not alloca.
9815 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9816 to EMACS_INT. Check that fixnums are in proper range for system types.
9817 * minibuf.c (minibuf_prompt_width, string_to_object)
9818 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9819 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9820 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9821 (get_minibuffer, read_minibuf_unwind):
9822 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9823 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9824 this simplifies overflow checking. All callers changed.
9825 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9826 (Ftest_completion):
9827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9828 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9829 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9830 Check that fixnums are in proper range for system types.
9831 (Fx_create_frame, Fx_show_tip):
9832 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9833 * nsfont.m (ns_findfonts, nsfont_list_family):
9834 Don't assume fixnum fits in long.
9835 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9836 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9837 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9838 wide enough.
9839 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9841 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9842 (PRINTDECLARE, PRINTPREPARE):
9843 (strout, print_string):
9844 (print, print_preprocess, print_check_string_charset_prop)
9845 (print_object):
9846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9847 (PRINTDECLARE):
9848 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9849 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9850 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9851 (printchar, strout): Use xpalloc to catch size calculation overflow.
9852 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9853 (print_error_message): Use SAFE_ALLOCA, not alloca.
9854 (print_object): Use int, not EMACS_INT, where int is wide enough.
9855 (print_depth, new_backquote_output, print_number_index):
9856 Use ptrdiff_t, not int, where int might not be wide enough.
9857 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9858 (Fset_process_window_size, Fformat_network_address)
9859 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9860 (sigchld_handler):
9861 Check that fixnums are in proper range for system types.
9862 (Fsignal_process): Simplify by avoiding a goto.
9863 Check for process-ids out of pid_t range rather than relying on
9864 undefined behavior.
9865 (process_tick, update_tick): Use EMACS_INT, not int.
9866 (Fformat_network_address, read_process_output, send_process)
9867 (Fprocess_send_region, status_notify):
9868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9869 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9870 (wait_reading_process_output, read_process_output, exec_sentinel):
9871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9872 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9873 (Faccept_process_output): Use duration_to_sec_usec to do proper
9874 overflow checking on durations.
9875 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9876 Don't assume pid_t fits in int.
9877 * process.h (struct Lisp_Process): Members tick and update_tick
9878 are now of type EMACS_INT, not int.
9879 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9880 configured --with-wide-int.
9881 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9882 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9883 * search.c (looking_at_1, string_match_1):
9884 (fast_string_match, fast_c_string_match_ignore_case)
9885 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9886 (scan_newline, find_before_next_newline, search_command)
9887 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9888 (set_search_regs, wordify):
9889 (Freplace_match):
9890 (Fmatch_data):
9891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9892 (string_match_1, search_buffer, set_search_regs):
9893 (Fmatch_data):
9894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9895 (wordify): Check for overflow in size calculation.
9896 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9897 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9898 Check that fixnums are in proper range for system types.
9899 * sound.c (struct sound_device)
9900 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9902 (Fplay_sound_internal):
9903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9904 * syntax.c (struct lisp_parse_state, find_start_modiff)
9905 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9906 (Fparse_partial_sexp):
9907 Don't assume fixnums can fit in int.
9908 (struct lisp_parse_state, find_start_pos, find_start_value)
9909 (find_start_value_byte, find_start_begv)
9910 (update_syntax_table, char_quoted, dec_bytepos)
9911 (find_defun_start, prev_char_comend_first, back_comment):
9912 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9913 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9914 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9915 (Finternal_describe_syntax_value): Check that match_lisp is a
9916 character, not an integer, since the code stuffs it into int.
9917 (scan_words, scan_sexps_forward):
9918 Check that fixnums are in proper range for system types.
9919 (Fforward_word):
9920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9921 (scan_sexps_forward):
9922 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9923 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9924 * syntax.h: Adjust decls to match defn changes elsewhere.
9925 (struct gl_state_s):
9926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9927 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9928 MOST_POSITIVE_FIXNUM.
9929 * sysdep.c (wait_for_termination_1, wait_for_termination)
9930 (interruptible_wait_for_termination, mkdir):
9931 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9932 (emacs_read, emacs_write):
9933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9934 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9935 and double all fit in int.
9936 * term.c (set_tty_color_mode):
9937 Check that fixnums are in proper range for system types.
9938 * termhooks.h (struct input_event):
9939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9940 * textprop.c (validate_interval_range, interval_of)
9941 (Fadd_text_properties, set_text_properties_1)
9942 (Fremove_text_properties, Fremove_list_of_text_properties)
9943 (Ftext_property_any, Ftext_property_not_all)
9944 (copy_text_properties, text_property_list, extend_property_ranges)
9945 (verify_interval_modification):
9946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9947 (Fnext_single_char_property_change)
9948 (Fprevious_single_char_property_change):
9949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9950 (copy_text_properties):
9951 Check for integer overflow in index calculation.
9952 * undo.c (last_boundary_position, record_point, record_insert)
9953 (record_delete, record_marker_adjustment, record_change)
9954 (record_property_change):
9955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9956 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9957 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9958 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9959 (Fx_hide_tip, Fx_file_dialog):
9960 * w32menu.c (set_frame_menubar):
9961 Use ptrdiff_t, not int, for consistency with rest of code.
9962 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9963 (select_window, Fdelete_other_windows_internal)
9964 (window_scroll_pixel_based, window_scroll_line_based)
9965 (Frecenter, Fset_window_configuration):
9966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9967 (Fset_window_hscroll, run_window_configuration_change_hook)
9968 (set_window_buffer, temp_output_buffer_show, scroll_command)
9969 (Fscroll_other_window, Frecenter):
9970 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9971 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9972 Don't assume fixnum fits in int.
9973 (Fset_window_scroll_bars):
9974 Check that fixnums are in proper range for system types.
9975 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9976 (string_pos, c_string_pos, number_of_chars, init_iterator)
9977 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9978 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9979 (compute_display_string_end, handle_face_prop)
9980 (face_before_or_after_it_pos, handle_invisible_prop)
9981 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9982 (display_prop_intangible_p, string_buffer_position_lim)
9983 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9984 (get_overlay_strings_1, get_overlay_strings)
9985 (iterate_out_of_display_property, forward_to_next_line_start)
9986 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9987 (get_next_display_element, set_iterator_to_next)
9988 (get_visually_first_element, compute_stop_pos_backwards)
9989 (handle_stop_backwards, next_element_from_buffer)
9990 (move_it_in_display_line_to, move_it_in_display_line)
9991 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9992 (add_to_log, message_dolog, message_log_check_duplicate)
9993 (message2, message2_nolog, message3, message3_nolog
9994 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9995 (current_message_1, truncate_echo_area, truncate_message_1)
9996 (set_message, set_message_1, store_mode_line_noprop)
9997 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9998 (text_outside_line_unchanged_p, check_point_in_composition)
9999 (reconsider_clip_changes)
10000 (redisplay_internal, set_cursor_from_row, try_scrolling)
10001 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10002 (redisplay_window, find_last_unchanged_at_beg_row)
10003 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10004 (trailing_whitespace_p, find_row_edges, display_line)
10005 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10006 (display_mode_element, store_mode_line_string)
10007 (pint2str, pint2hrstr, decode_mode_spec)
10008 (display_count_lines, display_string, draw_glyphs)
10009 (x_produce_glyphs, x_insert_glyphs)
10010 (rows_from_pos_range, mouse_face_from_buffer_pos)
10011 (fast_find_string_pos, mouse_face_from_string_pos)
10012 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10014 (safe_call, init_from_display_pos, handle_fontified_prop)
10015 (handle_single_display_spec, load_overlay_strings)
10016 (with_echo_area_buffer, setup_echo_area_for_printing)
10017 (display_echo_area, echo_area_display)
10018 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10019 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10020 (redisplay_window, dump_glyph_row, display_mode_line)
10021 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10022 (handle_display_spec, display_prop_string_p):
10023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10024 (handle_single_display_spec, build_desired_tool_bar_string)
10025 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10026 (get_specified_cursor_type):
10027 Check that fixnums are in proper range for system types.
10028 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10029 (Flookup_image_map):
10030 Don't assume fixnums fit in int.
10031 (compare_overlay_entries):
10032 Avoid mishandling comparisons due to subtraction overflow.
10033 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10034 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10035 (handle_tool_bar_click):
10036 Use int, not unsigned, since we prefer signed and the signedness
10037 doesn't matter here.
10038 (get_next_display_element, next_element_from_display_vector):
10039 Use int, not EMACS_INT, when int is wide enough.
10040 (start_hourglass): Use duration_to_sec_usec to do proper
10041 overflow checking on durations.
10042 * xfaces.c (Fbitmap_spec_p):
10043 Check that fixnums are in proper range for system types.
10044 (compare_fonts_by_sort_order):
10045 Avoid mishandling comparisons due to subtraction overflow.
10046 (Fx_family_fonts, realize_basic_faces):
10047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10048 (Fx_family_fonts):
10049 Don't assume fixnum fits in int.
10050 Use SAFE_ALLOCA_LISP, not alloca.
10051 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10052 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10053 (face_at_buffer_position, face_for_overlay_string)
10054 (face_at_string_position):
10055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10056 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10057 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10058 (Fx_show_tip):
10059 Check that fixnums are in proper range for system types.
10060 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10061 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10063 (Fx_change_window_property): Don't assume fixnums fit in int.
10064 * xfont.c (xfont_chars_supported):
10065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10066 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10067 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10069 * xml.c (parse_region):
10070 * xrdb.c (magic_file_p):
10071 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10072 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10073 (x_get_local_selection, x_reply_selection_request)
10074 (x_handle_selection_request, wait_for_property_change):
10075 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10076 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10077 short is wide enough.
10078 (x_send_client_event): Don't assume fixnum fits in int.
10079 * xterm.c (x_x_to_emacs_modifiers):
10080 Don't assume EMACS_INT overflows nicely into int.
10081 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10082 may come from Lisp.
10083 (handle_one_xevent): NATNUMP can eval its arg twice.
10084 (x_connection_closed):
10085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10086 * xterm.h: Adjust decls to match defn changes elsewhere.
10087 (struct scroll_bar): Use struct vectorlike_header
10088 rather than rolling our own approximation.
10089 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10090
10091 2012-05-25 Glenn Morris <rgm@gnu.org>
10092
10093 * lisp.mk (lisp): Update for more files being compiled now.
10094
10095 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10096
10097 * lread.c: Remove `read_pure' which makes no difference.
10098 (read_pure): Remove var.
10099 (unreadpure): Remove function.
10100 (readevalloop): Don't call read_list with -1 flag.
10101 (read1, read_vector): Don't test read_pure any more.
10102 (read_list): Simplify.
10103
10104 * fileio.c, character.h: Minor style tweaks.
10105
10106 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10107
10108 * window.h (clip_changed): Remove useless declaration.
10109
10110 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10111
10112 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10113 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10114
10115 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 Remove src/m/*.
10118 This directory predates autoconf and is no longer needed nowadays.
10119 Move its few remaining bits of functionality to where they're needed.
10120 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10121 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10122 * m/template.h: Remove.
10123 * Makefile.in (M_FILE): Remove. All uses removed.
10124 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10125 * lisp.h (USE_LSB_TAG):
10126 * mem-limits.h (EXCEEDS_LISP_PTR):
10127 Use VAL_MAX, not VALBITS, in #if.
10128 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10129 (EMACS_UINT): Define unconditionally now.
10130 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10131 (BITS_PER_EMACS_INT): New constants, replacing
10132 what used to be in config.h, but not useful in #if.
10133 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10134 define them any more.
10135 (VAL_MAX): New macro.
10136 (VALMASK): Use it.
10137 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10138 BITS_PER_EMACS_INT, in #if.
10139 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10140 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10141 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10142 * s/ms-w32.h (DATA_START):
10143 Move here from removed file m/intel386.h.
10144 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10145 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10146
10147 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10148
10149 Assume C89 or later.
10150 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10151 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10152 (xrealloc):
10153 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10154 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10155 * textprop.c, tparam.c (NULL): Remove.
10156 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10157 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10158 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10159 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10160 * xterm.c (input_signal_count): Assume volatile works.
10161
10162 2012-05-21 Ken Brown <kbrown@cornell.edu>
10163
10164 * xgselect.c (xg_select): Fix first argument in call to 'select'
10165 (bug#11508).
10166
10167 2012-05-20 Ken Brown <kbrown@cornell.edu>
10168
10169 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10170 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10171
10172 2012-05-19 Ken Brown <kbrown@cornell.edu>
10173
10174 * xfns.c (x_in_use): Remove `static' qualifier.
10175 * xterm.h (x_in_use): Declare.
10176 * xgselect.c: Include xterm.h.
10177 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10178 and `display_arg' (bug#9754).
10179
10180 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10181
10182 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10183
10184 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10185 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10186
10187 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10188
10189 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10190
10191 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10192 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10193
10194 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10195 reference to image_cache->refcount.
10196 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10197
10198 2012-05-17 Juri Linkov <juri@jurta.org>
10199
10200 * search.c (Fword_search_regexp, Fword_search_backward)
10201 (Fword_search_forward, Fword_search_backward_lax)
10202 (Fword_search_forward_lax): Move functions to isearch.el
10203 (bug#10145, bug#11381).
10204
10205 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10208
10209 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10210
10211 * lread.c (init_obarray): Declare Qt and Qnil as special.
10212
10213 2012-05-14 Glenn Morris <rgm@gnu.org>
10214
10215 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10216 Put "libexec" before "bin", for the sake of init_callproc_1.
10217
10218 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10221
10222 * unexaix.c: Port to more-recent AIX compilers.
10223 (report_error, report_error_1, make_hdr, copy_sym)
10224 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10225 Make arguments const char *, not char *, to avoid violations of C
10226 standard and to fix some AIX warnings reported by Gilles Pion.
10227
10228 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10229
10230 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10231 already have overlays loaded.
10232 (handle_single_display_spec): Before returning without displaying
10233 fringe bitmap, synchronize the bidi iterator with the main display
10234 iterator, by calling iterate_out_of_display_property.
10235 (iterate_out_of_display_property): Detect buffer iteration by
10236 testing that it->string is a Lisp string.
10237 (get_next_display_element): When the current object is exhausted,
10238 and there's something on it->stack, call set_iterator_to_next to
10239 proceed with what's on the stack, instead of returning zero.
10240 (set_iterator_to_next): If called at the end of a Lisp string,
10241 proceed to consider_string_end without incrementing string
10242 position. Don't increment display vector index past the end of
10243 the display vector. (Bug#11417)
10244 (pos_visible_p): Don't report a position visible when move_it_to
10245 stopped at the last line of window, which happens to be scanned
10246 backwards by the bidi iteration. (Bug#11464)
10247
10248 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10249
10250 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10251 and right-margin display specs even if the spec is invalid or we
10252 are on a TTY, and thus unable to display on the fringes.
10253 That's because the text with the property will not be displayed anyway,
10254 so we need to signal to the caller that this is a "replacing"
10255 display spec. This fixes display when the spec is invalid or we
10256 are on a TTY.
10257
10258 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 * unexaix.c (make_hdr): Fix typo in prototype.
10261 This bug broke the build on AIX. Problem reported by Gilles Pion.
10262
10263 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10264
10265 * keyboard.c (kbd_buffer_get_event): Read special events also in
10266 batch mode. (Bug#11415)
10267
10268 2012-05-12 Glenn Morris <rgm@gnu.org>
10269
10270 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10271
10272 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10273
10274 * lisp.mk (lisp): Add newcomment.elc.
10275
10276 2012-05-12 Glenn Morris <rgm@gnu.org>
10277
10278 * Makefile.in (MKDIR_P): New, set by configure.
10279 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10280
10281 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10282
10283 Remove unused function hourglass_started.
10284 * dispextern.h (hourglass_started):
10285 * w32fns.c (hourglass_started):
10286 * xdisp.c (hourglass_started): Remove.
10287
10288 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10289
10290 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10291 Update dependencies.
10292
10293 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 * xgselect.c (xg_select): Put maxfds+1 into a var.
10296 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10297
10298 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10299
10300 2012-05-10 Dave Abrahams <dave@boostpro.com>
10301
10302 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10303 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10304
10305 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10306
10307 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10308 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10309 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10310 Initialize xd_registered_buses.
10311
10312 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10313
10314 Untag more efficiently if USE_LSB_TAG.
10315 This is based on a proposal by YAMAMOTO Mitsuharu in
10316 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10317 For an admittedly artificial (nth 8000 longlist) benchmark on
10318 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10319 Emacs's overall text size by 1%.
10320 * lisp.h (XUNTAG): New macro.
10321 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10322 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10323 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10324 * eval.c (Fautoload):
10325 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10326 * frame.h (XFRAME): Use XUNTAG.
10327
10328 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10329 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10330 Remove unportable assumptions about print widths of types like
10331 dbus_uint32_t.
10332 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10333 intptr_t when converting between pointer and integer, to avoid GCC
10334 warnings about wrong width.
10335
10336 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10337
10338 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10339 stack for each reader_thread, instead of defaulting to 8MB
10340 determined by the linker. This avoids failures in creating
10341 subprocesses on Windows 7, see the discussion in this thread:
10342 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10343
10344 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10345
10346 Fix up display of the *Minibuf-0* buffer in the mini window.
10347 * keyboard.c (read_char): Don't clear the echo area if there's no
10348 message to clear.
10349 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10350 contents of *Minibuf-0*) if there's no message displayed in its stead.
10351
10352 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10353
10354 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10355 batch mode.
10356
10357 2012-05-06 Chong Yidong <cyd@gnu.org>
10358
10359 * lisp.mk (lisp): Update.
10360
10361 2012-05-05 Jim Meyering <meyering@redhat.com>
10362
10363 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10364
10365 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10366
10367 * data.c (PUT_ERROR): New macro.
10368 (syms_of_data): Use it. Add new error type `user-error'.
10369 * undo.c (user_error): New function.
10370 (Fprimitive_undo): Use it.
10371 * print.c (print_error_message): Adjust print style for `user-error'.
10372 * keyboard.c (user_error): New function.
10373 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10374
10375 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10376
10377 Do not limit current-time-string to years 1000..9999.
10378 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10379 (Fcurrent_time_string): Support any year that is supported by the
10380 underlying localtime representation. Don't use asctime, as it
10381 has undefined behavior for years outside the range -999..9999.
10382
10383 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 Fix race conditions involving setenv, gmtime, localtime, asctime.
10386 Without this fix, interrupts could mess up code that uses these
10387 nonreentrant functions, since setting TZ invalidates existing
10388 tm_zone or tzname values, and since most of these functions return
10389 pointers to static storage.
10390 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10391 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10392 Grow the critical sections to include not just invoking
10393 localtime/gmtime, but also accessing these functions' results
10394 including their tm_zone values if any, and any related TZ setting.
10395 (format_time_string): Last arg is now struct tm *, not struct tm **,
10396 so that the struct tm is saved in the critical section.
10397 All callers changed. Simplify allocation of initial buffer, partly
10398 motivated by the fact that memory allocation needs to be outside
10399 the critical section.
10400
10401 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10402
10403 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10404 with RESET_INTERVAL.
10405
10406 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10407 Remove duplicated buffer name initialization.
10408
10409 2012-05-02 Jim Meyering <jim@meyering.net>
10410
10411 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10412
10413 * xfns.c (x_window): Use xstrdup (Bug#11375).
10414
10415 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10416
10417 * xdisp.c (pos_visible_p): If already at a newline from the
10418 display string before the 'while' loop, don't walk back the glyphs
10419 from it3.glyph_row. Solves assertion violation when the display
10420 string begins with a newline (egg.el). (Bug#11367)
10421
10422 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10423
10424 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10425 Move to simple.el.
10426
10427 2012-05-01 Glenn Morris <rgm@gnu.org>
10428
10429 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10430 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10431 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10432 All were removed before 23.1.
10433
10434 * dispnew.c: Remove HAVE_LIBNCURSES test;
10435 it is always true on relevant platforms.
10436
10437 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10438 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10439
10440 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10441
10442 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10443
10444 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10445 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10446 Remove.
10447
10448 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 Do not avoid creating empty evaporating overlays (Bug#9642).
10451 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10452 That is, do not delete an evaporating overlay if it becomes
10453 empty after its bounds are adjusted to fit within its buffer.
10454 This fix caused other problems, and I'm reverting it until we get
10455 to the bottom of them.
10456
10457 2012-04-27 Chong Yidong <cyd@gnu.org>
10458
10459 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10460
10461 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10462
10463 * xdisp.c (pos_visible_p): If the window start position is beyond
10464 ZV, start the display from buffer beginning. Prevents assertion
10465 violation in init_iterator when the minibuffer window is scrolled
10466 via the scroll bar.
10467
10468 * window.c (window_scroll_pixel_based): Likewise.
10469
10470 2012-04-27 Chong Yidong <cyd@gnu.org>
10471
10472 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10473
10474 2012-04-27 Glenn Morris <rgm@gnu.org>
10475
10476 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10477 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10478
10479 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10480
10481 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10482 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10483
10484 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10485
10486 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10487 display element, check also the underlying string or buffer
10488 character. (Bug#11341)
10489
10490 * w32menu.c: Include w32heap.h.
10491 (add_menu_item): If the call to AppendMenuW (via
10492 unicode_append_menu) fails, disable Unicode menus only if we are
10493 running on Windows 9X/Me.
10494
10495 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10496
10497 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10498 (xgetint): Add missing shift for LSB tags.
10499
10500 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10501
10502 * keyboard.c (read_char): Don't wipe echo area for select window
10503 events: These might get delayed via `mouse-autoselect-window'
10504 (Bug#11304).
10505
10506 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10507
10508 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10509 manipulation of :loaded-from data.
10510
10511 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10512
10513 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10514 now a cons (bug#11311).
10515
10516 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10517
10518 Do not create empty overlays with the evaporate property (Bug#9642).
10519 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10520 if it becomes empty after its bounds are adjusted to fit within
10521 its buffer. Without this fix, in a nonempty buffer (let ((o
10522 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10523 yields an empty overlay that has the evaporate property, which is
10524 not supposed to happen.
10525
10526 Fix minor GTK3 problems found by static checking.
10527 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10528 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10529 (struct _EmacsFixedClass, emacs_fixed_get_type):
10530 Move decls here from emacsgtkfixed.h, since they needn't be public.
10531 (emacs_fixed_get_type): Now static.
10532 (emacs_fixed_class_init): Omit unused local.
10533 (emacs_fixed_child_type): Remove; unused.
10534 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10535 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10536 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10537 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10538 (EMACS_FIXED_GET_CLASS): Remove; unused.
10539 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10540
10541 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10542 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10543
10544 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10545
10546 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10547 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10548 (__malloc_size_t, __malloc_ptrdiff_t):
10549 Remove. All uses removed, replaced by the definiens if needed,
10550 since we can assume C89 or better now.
10551 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10552 (protect_malloc_state, align, get_contiguous_space)
10553 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10554 (malloc_atfork_handler_child, malloc_enable_thread)
10555 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10556 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10557 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10558 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10559 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10560 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10561 Define using prototypes, not old style.
10562 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10563 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10564 (align): Don't assume that signed integer overflow wraps around.
10565 Omit unused local var.
10566 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10567 (_free_internal_nolock, memalign, mallochook, reallochook):
10568 Omit no-longer-needed casts.
10569 (valloc): Use getpagesize, not __getpagesize.
10570 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10571 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10572
10573 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10574
10575 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10576
10577 Move functions from C to Lisp. Make non-blocking method calls
10578 the default. Implement further D-Bus standard interfaces.
10579
10580 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10581 (QCdbus_request_name_allow_replacement)
10582 (QCdbus_request_name_replace_existing)
10583 (QCdbus_request_name_do_not_queue)
10584 (QCdbus_request_name_reply_primary_owner)
10585 (QCdbus_request_name_reply_in_queue)
10586 (QCdbus_request_name_reply_exists)
10587 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10588 (QCdbus_registered_serial, QCdbus_registered_method)
10589 (QCdbus_registered_signal): New Lisp objects.
10590 (XD_DEBUG_MESSAGE): Use sizeof.
10591 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10592 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10593 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10594 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10595 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10596 (xd_signature, xd_append_arg): Allow float for integer types.
10597 (xd_get_connection_references): New function.
10598 (xd_get_connection_address): Rename from xd_initialize.
10599 Return cached address.
10600 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10601 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10602 level.
10603 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10604 Return number of refcounts.
10605 (Fdbus_get_unique_name): Make stronger parameter check.
10606 (Fdbus_message_internal): New defun.
10607 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10608 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10609 (Fdbus_send_signal, Fdbus_register_service)
10610 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10611 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10612 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10613 (Vdbus_compiled_version, Vdbus_runtime_version)
10614 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10615 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10616 (Vdbus_message_type_signal): New defvars.
10617 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10618 Adapt docstring.
10619
10620 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10621
10622 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10623 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10624 Do not assume ptrdiff_t is the same width as 'int'.
10625
10626 * alloc.c: Handle unusual debugging option combinations.
10627 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10628 since the two debugging options are incompatible.
10629 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10630 is defined.
10631 (mem_init, mem_insert, mem_insert_fixup):
10632 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10633 (NEED_MEM_INSERT): Remove; no longer needed.
10634
10635 2012-04-22 Leo Liu <sdl.web@gmail.com>
10636
10637 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10638
10639 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10640
10641 * sysdep.c [__FreeBSD__]: Minor cleanups.
10642 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10643 Use Emacs indenting style more consistently. Avoid some casts.
10644 Use 'double' consistently rather than mixing 'float' and 'double'.
10645
10646 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10647
10648 * sysdep.c (list_system_processes, system_process_attributes):
10649 Add implementation for FreeBSD (Bug#5243).
10650
10651 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10652
10653 * lisp.mk (lisp): Update.
10654
10655 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10656
10657 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10658 It is never used otherwise.
10659
10660 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10661
10662 * print.c (print_preprocess): Only check print_depth if print-circle
10663 is nil.
10664 (print_object): Check for cycles even when print-circle is nil and
10665 print-gensym is t, but only check print_depth if print-circle is nil.
10666
10667 2012-04-20 Chong Yidong <cyd@gnu.org>
10668
10669 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10670 set the status to "failed" and ensure that sentinel is run.
10671
10672 2012-04-20 Glenn Morris <rgm@gnu.org>
10673
10674 * process.c (Fset_process_inherit_coding_system_flag)
10675 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10676 (Fmake_network_process, Fmake_serial_process): Doc fix.
10677
10678 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10679
10680 * xdisp.c (string_buffer_position_lim): Limit starting position to
10681 BEGV.
10682 (set_cursor_from_row): If called for a mode-line or header-line
10683 row, return zero immediately.
10684 (try_cursor_movement): If inside continuation line, don't back up
10685 farther than the first row after the header line, if any.
10686 Don't consider the header-line row as "partially visible", even if
10687 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10688
10689 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10690
10691 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10692 (bug#11238).
10693
10694 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10695 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10696
10697 configure: new option --enable-gcc-warnings (Bug#11207)
10698 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10699 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10700 (ALL_CFLAGS): Use new macros rather than old.
10701 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10702 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10703 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10704 -Wunused-result, -Wunused-variable. This should go away once
10705 the Emacs and Gnulib regex code is merged.
10706 (xmalloc, xrealloc): Now static.
10707
10708 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10709
10710 * dired.c (Fsystem_groups): Remove unused local.
10711
10712 2012-04-17 Glenn Morris <rgm@gnu.org>
10713
10714 * dired.c (Fsystem_users): Doc fix.
10715
10716 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10717
10718 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10719 (syms_of_dired): Add them.
10720
10721 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10722
10723 Fix minor alloc.c problems found by static checking.
10724 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10725 New extern decls, to avoid calling undeclared functions.
10726 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10727 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10728 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10729 (NEED_MEM_INSERT): New macro.
10730 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10731 Remove one incorrect comment and fix another.
10732
10733 Fix minor ralloc.c problems found by static checking.
10734 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10735 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10736 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10737 (r_alloc_sbrk): Now static.
10738
10739 Improve ralloc.c interface checking.
10740 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10741 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10742 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10743 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10744 [REL_ALLOC]: ... to here, to check interface.
10745 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10746 Remove decls. This fixes an "It stinks!".
10747
10748 * alloc.c (which_symbols): Fix alignment issue / type clash.
10749
10750 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10751
10752 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10753 (struct Lisp_Misc_Any): Likewise.
10754 (struct Lisp_Free): Likewise.
10755 * alloc.c (union aligned_Lisp_Symbol): Define.
10756 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10757 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10758 (union aligned_Lisp_Misc): Define.
10759 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10760 aligned_Lisp_Misc instead of union Lisp_Misc.
10761 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10762
10763 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10764
10765 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10766 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10767 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10768 * s/netbsd.h, s/sol2-6.h:
10769 Remove definition of GC_MARK_STACK, since the default now works.
10770 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10771 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10772 no longer the default.
10773 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10774
10775 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10776
10777 * lread.c (lisp_file_lexically_bound_p):
10778 Fix hang at ";-*-\n" (bug#11238).
10779
10780 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10781
10782 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10783 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10784
10785 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10786
10787 * nsterm.m (constrainFrameRect): Always constrain when there is only
10788 one screen (Bug#10962).
10789
10790 2012-04-13 Ken Brown <kbrown@cornell.edu>
10791
10792 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10793
10794 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10795
10796 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10797
10798 2012-04-11 Daniel Colascione <dancol@dancol.org>
10799
10800 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10801 against is gone. It's better to use vfork now so that when Cygwin
10802 gains a new, working vfork, we use it automatically (bug#10398).
10803
10804 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10805
10806 * window.c (save_window_save): Obey window-point-insertion-type.
10807
10808 2012-04-11 Glenn Morris <rgm@gnu.org>
10809
10810 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10811
10812 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10813
10814 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10815
10816 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10817
10818 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10819 (force_quit_count): New var.
10820 (handle_interrupt): Use it.
10821
10822 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10823
10824 * w32.c (w32_delayed_load): Record the full path of the library
10825 being loaded (bug#10424).
10826
10827 2012-04-09 Glenn Morris <rgm@gnu.org>
10828
10829 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10830 not just in the obarray, before snarfing them. (Bug#11036)
10831
10832 * Makefile.in ($(leimdir)/leim-list.el):
10833 Pass EMACS rather than BUILT_EMACS.
10834
10835 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10836
10837 * process.c (make_process):
10838 * process.h: Add integer `gnutls_handshakes_tried' member to
10839 process struct.
10840
10841 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10842 Add convenience `GNUTLS_LOG2i' macro.
10843
10844 * gnutls.c (gnutls_log_function2i): Convenience log function.
10845 (emacs_gnutls_read): Use new log functions,
10846 `gnutls_handshakes_tried' process member, and
10847 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10848 attempts per process (connection).
10849
10850 2012-04-09 Chong Yidong <cyd@gnu.org>
10851
10852 * eval.c (Fuser_variable_p, user_variable_p_eh)
10853 (lisp_indirect_variable): Functions deleted.
10854 (Fdefvar): Caller changed.
10855
10856 * callint.c (Finteractive, Fcall_interactively):
10857 * minibuf.c (Fread_variable): Callers changed.
10858
10859 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xdisp.c (set_cursor_from_row): If the display string appears in
10862 the buffer at position that is closer to point than the position
10863 after the display string, display the cursor on the first glyph of
10864 the display string. Fixes cursor display when a 'display' text
10865 property immediately follows invisible text. (Bug#11094)
10866
10867 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 composite.c: use 'double' consistently
10870 * composite.c (get_composition_id): Use 'double' consistently
10871 instead of converting 'float' to 'double' and vice versa; this is
10872 easier to understand and avoids a GCC warning.
10873
10874 2012-04-09 Glenn Morris <rgm@gnu.org>
10875
10876 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10877 preparation for dumping it with emacs. (Bug#4789)
10878 (leimdir): New variable.
10879 ($(leimdir)/leim-list.el): New rule.
10880 (emacs$(EXEEXT)): Depend on leim-list.el.
10881
10882 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10883 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10884 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10885
10886 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10887
10888 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10889 proper alignment.
10890
10891 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10892
10893 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10894 Remove unused local variable.
10895
10896 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10897
10898 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10899 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10900 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10901 objects, as mark_maybe_pointer will catch them otherwise.
10902 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10903 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10904
10905 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10906
10907 Fix typo that broke non-Windows builds.
10908 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10909
10910 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10911
10912 Support building on MS-Windows with libxml2.
10913
10914 * makefile.w32-in (OBJ2): Add xml.$(O).
10915 (GLOBAL_SOURCES): Add xml.c.
10916 ($(BLD)/xml.$(O)): New dependency list.
10917
10918 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10919 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10920 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10921 [!WINDOWSNT]: New macros.
10922 (init_libxml2_functions, libxml2_loaded_p): New functions.
10923 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10924 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10925 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10926 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10927 linked in).
10928 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10929 Call init_libxml2_functions before calling libxml2 functions.
10930 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10931
10932 * emacs.c: Don't include libxml/parser.h.
10933 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10934 xmlCleanupParser directly.
10935
10936 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10937
10938 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10939
10940 * indent.c (Fvertical_motion): If there is a display string at
10941 point, use it.vpos to compute how many lines to backtrack after
10942 move_it_to point. (Bug#11133)
10943
10944 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10945
10946 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10947 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10948 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10949 macros related to unification of CJK characters. For the details,
10950 see the discussion following the message here:
10951 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10952
10953 2012-04-04 Chong Yidong <cyd@gnu.org>
10954
10955 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10956
10957 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10958
10959 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10960 instead of alloca. (Bug#11138)
10961
10962 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10963
10964 * w32menu.c (is_simple_dialog): Properly check lisp types.
10965 (Bug#11141)
10966
10967 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10968
10969 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10970 position we get to after a call to move_it_to fails the
10971 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10972 only if we wind up in a string from display property. (Bug#11063)
10973
10974 * window.c (Fdelete_other_windows_internal): Invalidate the row
10975 and column information about mouse highlight, so that redisplay
10976 restores it after reallocating the glyph matrices. (Bug#7464)
10977
10978 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10979 string comes from a `display' text property, use the buffer
10980 position of that property as if we actually saw that position in
10981 the row's glyphs.
10982 (move_it_by_lines): Remove the assertion that
10983 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10984 violated when there's a before-string at the beginning of a line.
10985 (Bug#11063)
10986
10987 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10988
10989 * xdisp.c (append_space_for_newline): If the default face was
10990 remapped, use the remapped face for the appended newline.
10991 (extend_face_to_end_of_line): Use the remapped default face for
10992 extending the face to the end of the line.
10993 (display_line): Call extend_face_to_end_of_line when the default
10994 face was remapped. (Bug#11068)
10995
10996 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10997
10998 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10999
11000 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11001
11002 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11003
11004 2012-03-27 Glenn Morris <rgm@gnu.org>
11005
11006 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11007 Doc fixes.
11008
11009 2012-03-26 Kenichi Handa <handa@m17n.org>
11010
11011 * dispextern.h (struct glyph): Fix previous change. Change the
11012 bit length of glyphless.ch to 25 (Bug#11082).
11013
11014 2012-03-26 Chong Yidong <cyd@gnu.org>
11015
11016 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11017 (command_loop_1): Use it; inhibit selection update for
11018 handle-select-window too (Bug#8996).
11019
11020 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11021
11022 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11023
11024 2012-03-25 Kenichi Handa <handa@m17n.org>
11025
11026 * dispextern.h (struct glyph): Change the bit length of
11027 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11028
11029 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11030
11031 * s/ms-w32.h (tzname): Include time.h before redirecting to
11032 _tzname. Fixes the MSVC build. (Bug#9960)
11033
11034 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11035
11036 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11037 characters.
11038
11039 * xterm.c (XTread_socket): Only modify handling_signal if
11040 !SYNC_INPUT. (Bug#11080)
11041
11042 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11043
11044 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11045 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11046 when fetching a multibyte character consumes more bytes than
11047 CHAR_BYTES returns, due to unification of CJK characters in
11048 string_char. (Bug#11073)
11049
11050 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11051
11052 * process.c (wait_reading_process_output): Handle pty disconnect
11053 by refraining from sending oneself a SIGCHLD (bug#10933).
11054
11055 2012-03-22 Chong Yidong <cyd@gnu.org>
11056
11057 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11058
11059 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11060 Mark string as coming from a prefix property.
11061 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11062 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11063
11064 2012-03-21 Chong Yidong <cyd@gnu.org>
11065
11066 * xfaces.c (Vface_remapping_alist): Doc fix.
11067
11068 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11069
11070 * w32proc.c (Fw32_set_console_codepage)
11071 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11072 Doc fixes.
11073
11074 2012-03-20 Chong Yidong <cyd@gnu.org>
11075
11076 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11077 to reflect default non-nil value of redisplay-dont-pause.
11078
11079 2012-03-19 Kenichi Handa <handa@m17n.org>
11080
11081 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11082 it fit in a valid range (Bug#11003).
11083
11084 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11085
11086 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11087 that is not from display property, accept the row as a "cursor
11088 row" if one of the string's character has a non-nil `cursor'
11089 property. Fixes cursor positioning when there are newlines in
11090 overlay strings, e.g. in icomplete.el. (Bug#11035)
11091
11092 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11093
11094 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11095
11096 2012-03-12 Chong Yidong <cyd@gnu.org>
11097
11098 * eval.c (inhibit_lisp_code): Rename from
11099 inhibit_window_configuration_change_hook; move from window.c.
11100
11101 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11102 * window.c (run_window_configuration_change_hook)
11103 (syms_of_window): Callers changed.
11104
11105 2012-03-11 Chong Yidong <cyd@gnu.org>
11106
11107 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11108
11109 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11110
11111 2012-03-10 Chong Yidong <cyd@gnu.org>
11112
11113 * frame.c (other_visible_frames): Don't assume the selected frame
11114 is visible (Bug#10955).
11115
11116 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11117
11118 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11119
11120 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11121
11122 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11123 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11124 zero (Bug#10954).
11125
11126 2012-03-03 Glenn Morris <rgm@gnu.org>
11127
11128 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11129
11130 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11131
11132 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11133 position past the first glyph_row that ends at ZV. (Bug#10902)
11134 (redisplay_window, next_element_from_string): Fix typos in
11135 comments.
11136 (redisplay_window): Pass to move_it_vertically the margin in
11137 pixels, not in screen lines.
11138
11139 2012-03-02 Glenn Morris <rgm@gnu.org>
11140
11141 * buffer.c (buffer-list-update-hook): Doc fix.
11142
11143 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11144
11145 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11146 push_it before setting up the iterator for the first overlay
11147 string, even if we have an empty string loaded.
11148 (next_overlay_string): If there's an empty string on the iterator
11149 stack, pop the stack. (Bug#10903)
11150
11151 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11152
11153 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11154 Suggested by Stefan Monnier in
11155 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11156 * alloc.c (widen_to_Lisp_Object): New static function.
11157 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11158 and widening them to Lisp_Objects. This would work even if
11159 USE_LSB_TAG is defined and wide integers are used, which might
11160 happen in a future version of Emacs.
11161
11162 2012-02-25 Chong Yidong <cyd@gnu.org>
11163
11164 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11165 Doc fix.
11166
11167 * xselect.c (Fx_selection_exists_p): Doc fix.
11168 (x_clipboard_manager_save_all): Print an informative message
11169 before saving to clipboard manager.
11170
11171 2012-02-24 Chong Yidong <cyd@gnu.org>
11172
11173 * keyboard.c (process_special_events): Handle all X selection
11174 requests in kbd_buffer, not just the next one (Bug#8869).
11175
11176 2012-02-23 Chong Yidong <cyd@gnu.org>
11177
11178 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11179 call when setting menu-bar-lines and tool-bar-lines parameters.
11180 (unwind_create_frame_1): New helper function.
11181
11182 * window.c (inhibit_window_configuration_change_hook): New var.
11183 (run_window_configuration_change_hook): Obey it.
11184 (syms_of_window): Initialize it.
11185
11186 2012-02-22 Chong Yidong <cyd@gnu.org>
11187
11188 * xterm.c (x_draw_image_relief): Add missing type check for
11189 Vtool_bar_button_margin (Bug#10743).
11190
11191 2012-02-21 Chong Yidong <cyd@gnu.org>
11192
11193 * fileio.c (Vfile_name_handler_alist): Doc fix.
11194
11195 * buffer.c (Fget_file_buffer): Protect against invalid file
11196 handler return value.
11197
11198 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11199
11200 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11201 when computing $valmask.
11202
11203 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11204 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11205 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11206 It's useless in that case, and it can cause problems on hosts
11207 that allocate halves of EMACS_INT values separately.
11208 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11209 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11210 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11211 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11212 it avoids undefined behavior on hosts where shifting right by more
11213 than the word width has undefined behavior.
11214
11215 2012-02-19 Chong Yidong <cyd@gnu.org>
11216
11217 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11218 (Funhandled_file_name_directory, Ffile_name_as_directory)
11219 (Fdirectory_file_name, Fexpand_file_name)
11220 (Fsubstitute_in_file_name): Protect against invalid file handler
11221 return values (Bug#10845).
11222
11223 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11224
11225 * .gdbinit (pitx): Fix incorrect references to fields of the
11226 iterator stack.
11227
11228 2012-02-17 Chong Yidong <cyd@gnu.org>
11229
11230 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11231
11232 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11233
11234 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11235 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11236
11237 2012-02-15 Chong Yidong <cyd@gnu.org>
11238
11239 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11240 marked as special. Also, starting docstrings with * is obsolete.
11241
11242 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11243
11244 * gnutls.c (emacs_gnutls_write): Fix last change.
11245
11246 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11247
11248 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11249 send_process.
11250
11251 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11252
11253 * keymap.c (Fsingle_key_description): Handle char ranges.
11254
11255 2012-02-12 Chong Yidong <cyd@gnu.org>
11256
11257 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11258 as that creates a dangerous corner case.
11259
11260 * window.c (Fdelete_window_internal): Invalidate the mouse
11261 highlight (Bug#9904).
11262
11263 2012-02-12 Glenn Morris <rgm@gnu.org>
11264
11265 * xselect.c (Fx_own_selection_internal)
11266 (Fx_get_selection_internal, Fx_disown_selection_internal)
11267 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11268 * nsselect.m (Fx_own_selection_internal)
11269 (Fx_disown_selection_internal, Fx_selection_exists_p)
11270 (Fx_selection_owner_p, Fx_get_selection_internal):
11271 Sync docs and argument specs with the xselect.c versions.
11272
11273 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11274
11275 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11276
11277 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11278
11279 * w32select.c (Fx_selection_exists_p): Sync doc string and
11280 argument list with xselect.c. (Bug#10783)
11281
11282 * w16select.c (Fx_selection_exists_p): Sync doc string and
11283 argument list with xselect.c. (Bug#10783)
11284
11285 2012-02-10 Glenn Morris <rgm@gnu.org>
11286
11287 * fns.c (Fsecure_hash): Doc fix.
11288
11289 2012-02-09 Kenichi Handa <handa@m17n.org>
11290
11291 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11292
11293 2012-02-07 Chong Yidong <cyd@gnu.org>
11294
11295 * buffer.c (Fbuffer_local_variables)
11296 (buffer_lisp_local_variables): Handle unbound vars correctly;
11297 don't let Qunbound leak into Lisp.
11298
11299 2012-02-07 Glenn Morris <rgm@gnu.org>
11300
11301 * image.c (Fimagemagick_types): Doc fix.
11302
11303 * image.c (imagemagick-render-type): Change it from a lisp object
11304 to an integer. Move the doc here from the lisp manual.
11305 Treat all values not equal to 0 the same.
11306
11307 2012-02-06 Chong Yidong <cyd@gnu.org>
11308
11309 * doc.c (store_function_docstring): Avoid applying docstring of
11310 alias to base function (Bug#2603).
11311
11312 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11313
11314 * .gdbinit (pp1, pv1): Remove redundant defines.
11315 (pr): Use pp.
11316
11317 2012-02-04 Chong Yidong <cyd@gnu.org>
11318
11319 * nsterm.m: Declare a global (Bug#10694).
11320
11321 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11322
11323 * w32.c (get_emacs_configuration_options):
11324 Include --enable-checking, if specified, in the return value.
11325
11326 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11327
11328 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11329 after rounding frame sizes. (Bug#9723)
11330
11331 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11332
11333 * keyboard.c (adjust_point_for_property): Don't position point
11334 before BEGV. (Bug#10696)
11335
11336 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11337
11338 Handle overflow when computing char display width (Bug#9496).
11339 * character.c (char_width): Return EMACS_INT, not int.
11340 (char_width, c_string_width): Check for overflow when
11341 computing the width; this is possible now that individual
11342 characters can have unbounded width. Problem introduced
11343 by merge from Emacs 23 on 2012-01-19.
11344
11345 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11346
11347 * dbusbind.c (Fdbus_register_method): Mention the return value
11348 :ignore in the docstring.
11349
11350 2012-02-02 Glenn Morris <rgm@gnu.org>
11351
11352 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11353
11354 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11355 Unconditionally set to t. (Bug#10673)
11356 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11357 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11358 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11359
11360 2012-02-02 Kenichi Handa <handa@m17n.org>
11361
11362 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11363 0, do not call append_composite_glyph.
11364
11365 2012-02-02 Kenichi Handa <handa@m17n.org>
11366
11367 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11368 NULL (Bug#6988).
11369 (x_produce_glyphs): If the component of a composition is a null
11370 string, set it->pixel_width to 1 to avoid zero-width glyph.
11371
11372 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11373
11374 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11375 first 2 arguments are identical. This makes inserting large
11376 output from a subprocess an order of magnitude faster on
11377 MS-Windows, where all sbrk'ed memory is always contiguous.
11378
11379 2012-01-31 Glenn Morris <rgm@gnu.org>
11380
11381 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11382 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11383 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11384
11385 2012-01-29 Glenn Morris <rgm@gnu.org>
11386
11387 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11388
11389 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11390
11391 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11392
11393 2012-01-28 Chong Yidong <cyd@gnu.org>
11394
11395 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11396
11397 2012-01-26 Chong Yidong <cyd@gnu.org>
11398
11399 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11400
11401 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11402 repeat counts (Bug#10507).
11403
11404 2012-01-26 Glenn Morris <rgm@gnu.org>
11405
11406 * lread.c (syms_of_lread): Doc fix.
11407
11408 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11409
11410 * coding.c (encode_designation_at_bol): Change return value to
11411 EMACS_INT.
11412
11413 2012-01-25 Chong Yidong <cyd@gnu.org>
11414
11415 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11416
11417 2012-01-21 Chong Yidong <cyd@gnu.org>
11418
11419 * floatfns.c (Fcopysign): Make the second argument non-optional,
11420 since nil is not allowed anyway.
11421
11422 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11423
11424 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11425 (send_process): Likewise.
11426
11427 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11428
11429 * window.c (save_window_save, Fcurrent_window_configuration)
11430 (Vwindow_persistent_parameters): Do not use Qstate.
11431 Rewrite doc-strings.
11432
11433 2012-01-19 Kenichi Handa <handa@m17n.org>
11434
11435 * character.c (char_width): New function.
11436 (Fchar_width, c_string_width, lisp_string_width):
11437 Use char_width (Bug#9496).
11438
11439 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11440
11441 * window.c (Vwindow_persistent_parameters): New variable.
11442 (Fset_window_configuration, save_window_save): Handle persistent
11443 window parameters.
11444
11445 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11446
11447 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11448 thrashing the stack of the thread. (Bug#9087)
11449
11450 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11451
11452 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11453
11454 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11455
11456 * xdisp.c (rows_from_pos_range): Handle the case where the
11457 highlight ends on a newline. (Bug#10464)
11458 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11459 he end column for display of highlight that ends on a newline
11460 before a R2L line.
11461
11462 2012-01-11 Glenn Morris <rgm@gnu.org>
11463
11464 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11465 from load-path also when installation-directory is nil. (Bug#10208)
11466
11467 2012-01-10 Glenn Morris <rgm@gnu.org>
11468
11469 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11470
11471 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11472 Update template values to be closer to their typical values these days.
11473
11474 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11475
11476 * xdisp.c (rows_from_pos_range): Accept additional argument
11477 DISP_STRING, and accept any glyph in a row whose object is that
11478 string as eligible for mouse highlight. Fixes mouse highlight of
11479 display strings from overlays. (Bug#10464)
11480
11481 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11482
11483 emacs: fix an auto-save permissions race condition (Bug#10400)
11484 * fileio.c (auto_saving_dir_umask): New static var.
11485 (Fmake_directory_internal): Use it.
11486 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11487 creating the directory. The old code temporarily assigns
11488 too-generous permissions to the directory.
11489 (do_auto_save_eh): Clear it.
11490 (Fdo_auto_save): Catch all errors, not just file errors, so
11491 that the var is always cleared.
11492
11493 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11494
11495 * search.c (scan_buffer): Pass character positions to
11496 know_region_cache, not byte positions. (Bug#6540)
11497
11498 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11499
11500 * w32.c (sys_rename): Report EXDEV when rename of a directory
11501 fails because the target is on another logical disk. (Bug#10284)
11502
11503 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11504
11505 * xterm.c (x_embed_request_focus): New function.
11506
11507 * xterm.h: Add prototype.
11508
11509 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11510
11511 2012-01-05 Glenn Morris <rgm@gnu.org>
11512
11513 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11514
11515 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11516
11517 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11518 Load gnutls_transport_set_lowat only if GnuTLS version is below
11519 2.11.1.
11520 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11521 GnuTLS versions below 2.11.1.
11522
11523 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11524
11525 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11526 to the doc string advising against its use for altering the way
11527 windows are scrolled.
11528
11529 2011-12-28 Kenichi Handa <handa@m17n.org>
11530
11531 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11532 coding-system ASCII compatible only when it does not produce BOM
11533 on encoding (Bug#10383).
11534
11535 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11536
11537 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11538 can scroll.
11539 (create_and_show_popup_menu): Always use menu_position_func for
11540 Gtk3 (Bug#10361).
11541
11542 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11543
11544 * callint.c (Fcall_interactively): Don't truncate prompt string.
11545
11546 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11547
11548 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11549 property that ends at ZV, so that the bidi iteration could be
11550 resumed from there (after widening). (Bug#10360)
11551
11552 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11553
11554 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11555
11556 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11557
11558 * nsterm.m (x_free_frame_resources):
11559 Release f->output_data.ns->miniimage.
11560 (ns_index_color): Fix indentation. Do not retain
11561 color_table->colors[i].
11562
11563 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11564 before returning.
11565
11566 * nsfns.m (x_set_background_color): Assign return value from
11567 ns_index_color to face-background instead of NSColor*.
11568 (ns_implicitly_set_icon_type): Fix indentation.
11569 Change assignment in for loop to comparison.
11570
11571 * emacs.c (ns_pool): New variable.
11572 (main): Assign ns_pool.
11573 (Fkill_emacs): Call ns_release_autorelease_pool.
11574
11575 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11576 autorelease fdesc, release fdAttrs and tdict.
11577 (ns_get_covering_families): Release charset.
11578 (ns_findfonts): Release NSFontDescriptor created with new.
11579 (ns_uni_to_glyphs): Fix indentation.
11580 (setString): Release attrStr before assigning new value.
11581
11582 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11583
11584 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11585 and NS_IMPL_COCOA.
11586 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11587 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11588
11589 2011-12-18 David Reitter <reitter@cmu.edu>
11590
11591 * nsterm.m (ns_term_init): Subscribe for notifications
11592 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11593 to method trackingNotification in EmacsMenu.
11594
11595 * nsmenu.m (trackingMenu): New variable.
11596 (trackingNotification): New method (from Aquamacs).
11597 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11598 from Aquamacs (Bug#7030).
11599
11600 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11601
11602 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11603 (symbol_to_nsstring): Fix indentation.
11604 (ns_symbol_to_pb): New function.
11605 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11606 (Fns_rotate_cut_buffers_internal): Remove.
11607 (Fns_store_selection_internal): Rename from
11608 Fns_store_cut_buffer_internal.
11609 (ns_get_foreign_selection, Fx_own_selection_internal)
11610 (Fx_disown_selection_internal, Fx_selection_exists_p)
11611 (Fns_get_selection_internal, Fns_store_selection_internal):
11612 Use ns_symbol_to_pb and check if return value is nil.
11613 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11614 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11615 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11616 renamed to Sns_store_selection_internal.
11617 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11618 and remove this function.
11619 (ns_handle_selection_clear): Remove, never used.
11620 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11621 here.
11622
11623 2011-12-17 Ken Brown <kbrown@cornell.edu>
11624
11625 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11626 GID is unknown (Bug#10257).
11627
11628 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11629
11630 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11631 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11632 which caused a build failure on GNU/Linux IA-64. This problem was
11633 introduced by my 2011-10-07 patch.
11634
11635 2011-12-15 Juri Linkov <juri@jurta.org>
11636
11637 * image.c (imagemagick_error): New function. (Bug#10112)
11638 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11639 Use `imagemagick_error' where ImageMagick functions return
11640 `MagickFalse'.
11641 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11642 proper order.
11643
11644 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11645
11646 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11647 fill background (Bug#8992).
11648
11649 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11650
11651 * window.c (Vwindow_combination_resize)
11652 (Vwindow_combination_limit): Use t instead of non-nil in
11653 doc-strings.
11654 (Vrecenter_redisplay): Add first sentence of doc-string on
11655 separate line.
11656 (Frecenter): Fix doc-string typo.
11657
11658 2011-12-11 Kenichi Handa <handa@m17n.org>
11659
11660 * coding.c (Funencodable_char_position): Pay attention to the
11661 buffer text relocation (Bug#9389).
11662
11663 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11664
11665 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11666 gtk_init (Bug#10100).
11667
11668 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11669
11670 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11671 IT->string is nil. (Bug#10263)
11672
11673 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11674
11675 * nsterm.h (x_free_frame_resources): Declare.
11676
11677 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11678 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11679
11680 * nsterm.h (ns_get_defaults_value): Declare.
11681
11682 * nsterm.m (ns_default): Call ns_get_defaults_value.
11683
11684 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11685
11686 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11687 (Bug#10170)
11688
11689 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11690
11691 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11692 that where the value of an _OBJC_* symbol points to is in the .bss
11693 section (Bug#10240).
11694
11695 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11696
11697 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11698 after the loop to call ccl_driver at least once (Bug#8619).
11699
11700 2011-12-08 Kenichi Handa <handa@m17n.org>
11701
11702 * ftfont.c (get_adstyle_property): Fix previous change
11703 (Bug#10233).
11704
11705 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11706
11707 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11708 dirs from the default value of EMACSLOADPATH (bug#10208).
11709
11710 2011-12-07 Glenn Morris <rgm@gnu.org>
11711
11712 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11713 installation and source directories as well. (Bug#10208)
11714
11715 2011-12-06 Chong Yidong <cyd@gnu.org>
11716
11717 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11718
11719 2011-12-06 Glenn Morris <rgm@gnu.org>
11720
11721 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11722 as an error, not just -1. (Bug#10217)
11723
11724 2011-12-05 Chong Yidong <cyd@gnu.org>
11725
11726 * keyboard.c (process_special_events): New function.
11727 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11728
11729 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11730
11731 * coding.c (encode_designation_at_bol): Don't use uninitialized
11732 local variable (Bug#9318).
11733
11734 2011-12-05 Kenichi Handa <handa@m17n.org>
11735
11736 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11737 return Qnil (Bug#8046, Bug#10193).
11738
11739 2011-12-05 Kenichi Handa <handa@m17n.org>
11740
11741 * coding.c (encode_designation_at_bol): New args charbuf_end and
11742 dst. Return the number of produced bytes. Callers changed.
11743 (coding_set_source): Return how many bytes coding->source was
11744 relocated.
11745 (coding_set_destination): Return how many bytes
11746 coding->destination was relocated.
11747 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11748 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11749
11750 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11751
11752 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11753 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11754 macro (Bug#9318).
11755
11756 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11757
11758 The following changes are to fix Bug#9318.
11759
11760 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11761 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11762 (encode_coding_iso_2022, encode_coding_sjis)
11763 (encode_coding_big5, encode_coding_charset): Use the above macros.
11764
11765 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11766
11767 * lisp.h (process_quit_flag): Fix external declaration.
11768
11769 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11770
11771 Don't macro-inline non-performance-critical code.
11772 * eval.c (process_quit_flag): New function.
11773 * lisp.h (QUIT): Use it.
11774
11775 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11776
11777 * nsfns.m (get_geometry_from_preferences): New function.
11778 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11779
11780 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11781
11782 * emacs.c (Qkill_emacs): Define.
11783 (syms_of_emacs): Initialize it.
11784 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11785 Qquit_flag to `kill-emacs' instead.
11786 (quit_throw_to_read_char): Add parameter `from_signal'.
11787 All callers changed. Call Fkill_emacs if requested and safe.
11788 * lisp.h (QUIT): Call Fkill_emacs if requested.
11789
11790 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11791
11792 * widget.c (update_wm_hints): Return if wmshell is null.
11793 (widget_update_wm_size_hints): New function.
11794
11795 * widget.h (widget_update_wm_size_hints): Declare.
11796
11797 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11798 widget_update_wm_size_hints (Bug#10104).
11799
11800 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11801
11802 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11803 before a newline, prepare the bidi iterator for consuming the
11804 newline, and keep the current paragraph direction. (Bug#10183)
11805 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11806
11807 2011-12-02 Juri Linkov <juri@jurta.org>
11808
11809 * search.c (Fword_search_regexp): New Lisp function created from
11810 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11811 (Fword_search_backward, Fword_search_forward)
11812 (Fword_search_backward_lax, Fword_search_forward_lax):
11813 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11814 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11815
11816 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11817
11818 * fileio.c (Finsert_file_contents): Move after-change-function call
11819 to before the "handled:" label, since all "goto handled" appear in
11820 cases where the *-change-functions have already been properly called
11821 (bug#10117).
11822
11823 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11824
11825 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11826 waiting for input. (Bug#10169)
11827
11828 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11829
11830 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11831 verifies glyph row's hash code--we have just reallocated the
11832 glyphs, so their contents can be complete garbage. (Bug#10164)
11833
11834 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11835
11836 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11837
11838 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11839
11840 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11841 attributes are tested _before_ calling verify_row_hash, to protect
11842 against GCC re-ordering of the tests. (Bug#10164)
11843
11844 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11845
11846 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11847
11848 * xterm.c (handle_one_xevent): Only set async_visible and friends
11849 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11850 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11851 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11852
11853 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11854
11855 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11856 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11857 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11858 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11859 All uses changed to use GCPRO1 etc.
11860 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11861 Revert to old implementation (i.e., before 2011-03-11).
11862
11863 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11864
11865 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11866 of scroll runs so as to avoid assigning disabled bogus rows and
11867 unnecessary graphics copy operations.
11868
11869 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11870
11871 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11872 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11873 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11874 (malloc, free, realloc, calloc): Redirect to e_* only when
11875 compiling Emacs.
11876
11877 * lisp.h (GCTYPEBITS): Move before first use.
11878 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11879 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11880 this macro definition.
11881
11882 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11883 _MSC_VER.
11884
11885 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11886
11887 * gtkutil.c (xg_create_frame_widgets):
11888 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11889 present with Gtk+ 2.0.
11890
11891 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11892
11893 * fileio.c (Finsert_file_contents): Undo previous change; see
11894 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11895
11896 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11897
11898 Rename locals to avoid shadowing.
11899 * fileio.c (Finsert_file_contents):
11900 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11901 * process.c (wait_reading_process_output):
11902 Rename inner 'proc' to 'p' to avoid shadowing.
11903 Indent for consistency with usual Emacs style.
11904
11905 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11906
11907 * xdisp.c (redisplay_window): If cursor row is not fully visible
11908 after recentering, and scroll-conservatively is set to a large
11909 number, scroll window by a few more lines to make the cursor fully
11910 visible and out of scroll-margin. (Bug#10105)
11911 (start_display): Don't move to the next line if the display should
11912 start at a newline that is part of a display vector or an overlay
11913 string. (Bug#10119)
11914
11915 2011-11-24 Juri Linkov <juri@jurta.org>
11916
11917 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11918 after the `MagickPingImage' call. (Bug#10112)
11919
11920 2011-11-23 Chong Yidong <cyd@gnu.org>
11921
11922 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11923
11924 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11925
11926 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11927 making another buffer current. (Bug#10114)
11928
11929 2011-11-23 Glenn Morris <rgm@gnu.org>
11930
11931 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11932
11933 2011-11-23 Chong Yidong <cyd@gnu.org>
11934
11935 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11936 using it (Bug#5984).
11937
11938 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11939
11940 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11941 and header-lines, as they don't have one computed for them.
11942 (Bug#10098)
11943
11944 * .gdbinit (prow): Make displayed values more self-explaining.
11945 Add row's hash code.
11946
11947 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11948
11949 * process.c (wait_reading_process_output): Fix asynchrounous
11950 GnuTLS socket handling on some versions of the GnuTLS library.
11951 (wait_reading_process_output): Add comment and URL.
11952
11953 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11954
11955 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11956
11957 2011-11-21 Chong Yidong <cyd@gnu.org>
11958
11959 * window.c (Fnext_window, Fprevious_window): Doc fix.
11960
11961 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11962
11963 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11964
11965 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11966
11967 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11968
11969 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11970
11971 * window.c (Fset_window_combination_limit): Rename argument
11972 STATUS to LIMIT.
11973 (Vwindow_combination_limit): Remove "status" from doc-string.
11974
11975 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11976
11977 * m/ibms390.h: Remove.
11978 * m/ibms390x.h: Don't include "ibms390.h".
11979
11980 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11981
11982 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11983 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11984
11985 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11986
11987 * casetab.c (Fset_case_table):
11988 * charset.c (Fcharset_after): Fix typos.
11989
11990 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11991
11992 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11993 Otherwise, valgrind does not work on some platforms.
11994 Problem reported by Andreas Schwab in
11995 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11996 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11997 is set, removing the need for VIRT_ADDRESS_VARIES.
11998 (PURE_P): Use a more-efficient implementation that needs just one
11999 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12000 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12001 to 4 (xorl, subq, cmpq, setbe).
12002 * alloc.c (pure): Always extern now, since that's the
12003 VIRT_ADDR_VARIES behavior.
12004 (PURE_POINTER_P): Use a single comparison, not two, for
12005 consistency with the new puresize.h.
12006 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12007 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12008 Remove VIRT_ADDR_VARIES no longer needed.
12009
12010 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12011
12012 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12013 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12014 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12015 behave as if the cursor position were at the window margin.
12016
12017 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12018 and the cursor position is out of bounds, behave as if the cursor
12019 position were at the window margin. (Bug#10075)
12020
12021 2011-11-18 Chong Yidong <cyd@gnu.org>
12022
12023 * window.c (Fwindow_combination_limit): Make first argument
12024 non-optional, since it is meaningless for live windows like the
12025 selected window.
12026
12027 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12028
12029 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12030
12031 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12032
12033 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12034 (graft_intervals_into_buffer): Simplify.
12035
12036 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12037
12038 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12039 hash values of the two rows.
12040 (copy_row_except_pointers): Preserve the used[] arrays and the
12041 hash values of the two rows. (Bug#10035)
12042 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12043
12044 * xdisp.c (row_hash): New function, body extracted from
12045 compute_line_metrics.
12046 (compute_line_metrics): Call row_hash, instead of computing the
12047 hash code inline.
12048
12049 * dispnew.c (verify_row_hash): Call row_hash for computing the
12050 hash code of a row, instead of duplicating code from xdisp.c.
12051
12052 * dispextern.h (row_hash): Add prototype.
12053
12054 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12055
12056 * frame.c (delete_frame): Don't delete the terminal when the last
12057 X frame is closed if emacs is built with GTK toolkit.
12058
12059 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12060
12061 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12062
12063 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12064
12065 * window.c (Vwindow_splits): Rename to
12066 Vwindow_combination_resize. Suggested by Juri Linkov.
12067 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12068 of Vwindow_splits.
12069
12070 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12071
12072 * nsfns.m (Fns_font_name):
12073 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12074
12075 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12076
12077 * window.h (window): Rename slot "nest" to "combination_limit".
12078 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12079 (Fset_window_nest): Rename to Fset_window_combination_limit.
12080 (Vwindow_nest): Rename to Vwindow_combination_limit.
12081 (recombine_windows, make_parent_window, make_window)
12082 (Fsplit_window_internal, saved_window)
12083 (Fset_window_configuration, save_window_save): Rename all
12084 occurrences of window_nest to window_combination_limit.
12085
12086 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12087
12088 * image.c (imagemagick_load_image): Fix typo.
12089
12090 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12091
12092 * xdisp.c (display_line): Move the call to
12093 highlight_trailing_whitespace before the call to
12094 compute_line_metrics, since the latter needs to see the final
12095 faces of all the glyphs to compute ROW's hash value.
12096 Fixes assertion violations in row_equal_p. (Bug#10035)
12097
12098 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12099
12100 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12101 just return (bug#10044).
12102
12103 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12104
12105 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12106 with user-defined heap size. Bump the default size of the temacs
12107 heap to 27MB, to avoid memory warning when running temacs.
12108 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12109
12110 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12111 current_matrix and desired_matrix. (Bug#9990)
12112 (verify_row_hash) [XASSERTS]: New function.
12113 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12114 that the hash value of glyph rows is correct.
12115
12116 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12117
12118 * window.h (window): Remove splits slot.
12119 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12120 (Fdelete_other_windows_internal, make_parent_window)
12121 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12122 (Fset_window_configuration, save_window_save): Don't deal with
12123 split status of windows.
12124 (saved_window): Remove splits slot.
12125 (Vwindow_splits): Rewrite doc-string.
12126
12127 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12128
12129 * xfns.c (unwind_create_frame):
12130 * nsfns.m (unwind_create_frame):
12131 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12132 Vframe_list (Bug#9999).
12133
12134 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12135
12136 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12137
12138 2011-11-11 Kenichi Handa <handa@m17n.org>
12139
12140 * callproc.c (Fcall_process): Set the member dst_multibyte of
12141 process_coding.
12142
12143 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12144
12145 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12146 avoid a crash (bug#9496).
12147
12148 2011-11-09 Chong Yidong <cyd@gnu.org>
12149
12150 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12151 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12152
12153 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12156
12157 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12158
12159 Avoid some portability problems by eschewing 'extern inline' functions.
12160 The trivial performance wins aren't worth the portability hassles; see
12161 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12162 et seq.
12163 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12164 (window_box_width, window_box_left, window_box_left_offset)
12165 (window_box_right, window_box_right_offset): Undo previous change,
12166 by removing the "extern"s.
12167 * intervals.c (adjust_intervals_for_insertion)
12168 (adjust_intervals_for_deletion): Undo previous change,
12169 making these static again.
12170 (offset_intervals, temp_set_point_both, temp_set_point)
12171 (copy_intervals_to_string): No longer inline.
12172 * xdisp.c (window_text_bottom_y, window_box_width)
12173 (window_box_height, window_box_left_offset)
12174 (window_box_right_offset, window_box_left, window_box_right)
12175 (window_box): No longer inline.
12176
12177 2011-11-08 Chong Yidong <cyd@gnu.org>
12178
12179 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12180 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12181 Signal an error if not a live window.
12182 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12183 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12184
12185 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12186
12187 * lisp.h (syms_of_abbrev): Remove declaration.
12188 Reported by CHENG Gao <chenggao@royau.me>.
12189
12190 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12191
12192 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12193 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12194 of temacs in GUI mode.
12195
12196 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12197
12198 * window.h: Declare delete_all_child_windows instead of
12199 delete_all_subwindows.
12200 * window.c (Fwindow_nest, Fset_window_nest)
12201 (Fset_window_new_total, Fset_window_new_normal)
12202 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12203 (delete_all_subwindows): Rename to delete_all_child_windows.
12204 (Fdelete_other_windows_internal, Fset_window_configuration):
12205 Call delete_all_child_windows instead of delete_all_subwindows.
12206 * frame.c (delete_frame): Call delete_all_child_windows instead
12207 of delete_all_subwindows.
12208
12209 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12210
12211 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12212 This is also needed for porting to any host where GC_MARK_STACK is
12213 not GC_MAKE_GCPROS_NOOPS.
12214 (which_symbols): Use it.
12215
12216 2011-11-07 Kenichi Handa <handa@m17n.org>
12217
12218 * coding.c (coding_set_destination): Check coding->src_pos only
12219 when coding->src_object is a buffer (bug#9910).
12220
12221 * process.c (send_process): Set the member src_multibyte of coding
12222 to 0 (bug#9911) when sending a unibyte text.
12223
12224 * callproc.c (Fcall_process): Set the member src_multibyte of
12225 process_coding to 0 (bug#9912).
12226
12227 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12228
12229 * xmenu.c (cleanup_widget_value_tree): New function.
12230 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12231 calling free_menubar_widget_value_tree directly (Bug#9830).
12232
12233 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12234
12235 Fix some portability problems with 'inline'.
12236 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12237 (window_box_width, window_box_left, window_box_left_offset)
12238 (window_box_right, window_box_right_offset): Declare extern.
12239 Otherwise, these inline functions do not conform to C99 and
12240 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12241 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12242 * intervals.c (adjust_intervals_for_insertion)
12243 (adjust_intervals_for_deletion): Now extern, because otherwise the
12244 extern inline functions 'offset_intervals' couldn't refer to it.
12245 (static_offset_intervals): Remove.
12246 (offset_intervals): Rewrite using the old contents of
12247 static_offset_intervals. The old version didn't conform to C99
12248 because an extern inline function contained a reference to an
12249 identifier with static linkage.
12250
12251 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12252
12253 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12254 GC.
12255
12256 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12257
12258 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12259 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12260 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12261 return Qleft_to_right.
12262
12263 2011-11-06 Chong Yidong <cyd@gnu.org>
12264
12265 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12266 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12267 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12268 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12269 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12270 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12271 (Fwindow_vscroll): Doc fix.
12272 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12273 argument, since it makes no sense to pass a live window and for
12274 consistency with window-child.
12275
12276 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12277
12278 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12279 support MSVC.
12280
12281 2011-11-05 Jason Rumney <jasonr@gnu.org>
12282
12283 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12284 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12285 fonts (Bug#6029).
12286 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12287 bitwise arithmetic preventing use of unicode-sip and non-truetype
12288 opentype fonts.
12289
12290 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12291
12292 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12293 "emacs"-only part.
12294
12295 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12296 initialization code to keep similarity to xfns.c after changes
12297 from 2011-11-05.
12298
12299 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12300
12301 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12302 (unwind_create_frame): New function (Bug#9943).
12303 (Fx_create_frame): Restructure code to be more similar to the one in
12304 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12305 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12306 Move terminal->reference_count++ just before making the frame official
12307 (Bug#9943).
12308
12309 * nsterm.m (x_free_frame_resources): New function.
12310 (x_destroy_window): Move code to x_free_frame_resources.
12311
12312 * xfns.c (unwind_create_frame): Fix comment.
12313 (Fx_create_frame, x_create_tip_frame):
12314 Move terminal->reference_count++ just before making the frame
12315 official. Move initialization of image_cache_refcount and
12316 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12317
12318 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12319
12320 Support MSVC build with newer versions of Visual Studio.
12321 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12322 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12323 nt/gmake.defs.
12324
12325 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12326 which are not supported by MSVC.
12327 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12328 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12329 bitfields.
12330 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12331 types in bitfields.
12332 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12333
12334 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12335
12336 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12337
12338 Support MSVC build with newer versions of Visual Studio.
12339 * w32.c: Don't include w32api.h for MSVC.
12340 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12341
12342 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12343 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12344 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12345 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12346 e_* cousins.
12347 (alloca) [_MSC_VER]: Define to _alloca.
12348
12349 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12350
12351 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12352
12353 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12354
12355 * xdisp.c (note_mouse_highlight): If either of
12356 previous/next-single-property-change returns nil, treat that as
12357 the beginning or the end of the buffer. (Bug#9955)
12358
12359 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12360
12361 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12362 label is not null (Bug#9951).
12363 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12364 may be NULL.
12365
12366 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12367
12368 * window.c (Fwindow_body_size): Mention in the doc string that the
12369 return value is in frame's canonical units. (Bug#9949)
12370
12371 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12372
12373 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12374
12375 * w32fns.c (unwind_create_frame): If needed, free the glyph
12376 matrices of the partially constructed frame. (Bug#9943)
12377 * xfns.c (unwind_create_frame): Likewise.
12378
12379 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12380
12381 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12382 Don't stop backward scan on the continuation glyph, even though
12383 its CHARPOS is positive.
12384 (mouse_face_from_buffer_pos, note_mouse_highlight):
12385 Rename cover_string to disp_string.
12386
12387 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12388
12389 * window.c (temp_output_buffer_show): Don't use
12390 Vtemp_buffer_show_specifiers.
12391 (Vtemp_buffer_show_specifiers): Remove unused variable.
12392
12393 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12394
12395 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12396 past the beginning of the current glyph matrix.
12397
12398 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12399
12400 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12401 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12402 HAVE_GTK3 (Bug#9869).
12403
12404 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12405 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12406
12407 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12408
12409 * xterm.c: Declare x_handle_net_wm_state to return int.
12410 (handle_one_xevent): Check if we are iconified but don't have
12411 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12412 (get_current_wm_state): Return non-zero if not hidden,
12413 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12414 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12415 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12416 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12417
12418 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12419
12420 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12421 so that this new function doesn't get optimized away by a
12422 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12423
12424 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12425
12426 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12427
12428 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12429
12430 Fix the `xbytecode' command.
12431 * .gdbinit (xprintbytestr): New command.
12432 (xwhichsymbols): Rename from `which'; all callers changed.
12433 (xbytecode): Print the byte-code string as well.
12434
12435 2011-10-29 Kim Storm <storm@cua.dk>
12436
12437 * alloc.c (which_symbols): New function.
12438
12439 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12440
12441 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12442 line. (Bug#9903)
12443
12444 2011-10-29 Glenn Morris <rgm@gnu.org>
12445
12446 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12447 Not clear what it was for, and it causes various bugs. (Bug#9839)
12448
12449 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12450
12451 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12452 possible random value that matches one of those tested as
12453 condition to clear the mouse face.
12454
12455 2011-10-28 Chong Yidong <cyd@gnu.org>
12456
12457 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12458
12459 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12460
12461 * window.c (make_window): Initialize phys_cursor_on_p.
12462
12463 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12464
12465 * lisp.h (struct Lisp_Symbol): Update comments.
12466
12467 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12468
12469 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12470
12471 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12472
12473 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12474 <oslsachem@gmail.com> for helping to debug this.
12475
12476 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12477 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12478 (g_b_init_get_glyph_outline_w): New static variables.
12479 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12480 (GetGlyphOutlineW_Proc): New typedefs.
12481 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12482 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12483 New functions.
12484 (w32font_open_internal, compute_metrics):
12485 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12486 instead of calling the "wide" APIs directly.
12487
12488 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12489
12490 * w32.h (syms_of_w32font): Add prototype.
12491
12492 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12493
12494 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12495 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12496 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12497 (Fmove_to_window_line): Doc fix.
12498
12499 2011-10-27 Chong Yidong <cyd@gnu.org>
12500
12501 * process.c (make_process): Set gnutls_state to NULL.
12502
12503 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12504 non-NULL, regardless of GNUTLS_INITSTAGE.
12505 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12506 an error. Set process slots as soon as we allocate them.
12507
12508 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12509
12510 2011-10-27 Chong Yidong <cyd@gnu.org>
12511
12512 * gnutls.c (emacs_gnutls_deinit): New function.
12513 Deallocate credentials structures as well as calling gnutls_deinit.
12514 (Fgnutls_deinit, Fgnutls_boot): Use it.
12515
12516 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12517 (deactivate_process): Call emacs_gnutls_deinit.
12518
12519 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12520
12521 * image.c (x_create_x_image_and_pixmap):
12522 * w32.c (sys_rename, w32_delayed_load):
12523 * w32font.c (fill_in_logfont):
12524 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12525
12526 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12527
12528 * w32fns.c (w32_default_color_map): New function,
12529 extracted from Fw32_default_color_map.
12530 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12531
12532 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12533
12534 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12535
12536 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12537
12538 * keyboard.c (test_undefined): New function (bug#9751).
12539 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12540
12541 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12542
12543 * sysdep.c (init_sys_modes): Fix the check for the controlling
12544 terminal (Bug#6649).
12545
12546 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12547
12548 * dispextern.h (struct bidi_it): New member next_en_type.
12549
12550 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12551 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12552 current character, check also for next_en_type being WEAK_EN.
12553 (bidi_resolve_weak): Don't enter the expensive loop if the current
12554 position is before next_en_pos. Record the bidi type of the first
12555 non-ET, non-BN character we find, in addition to its position.
12556 (bidi_level_of_next_char): Invalidate next_en_type when
12557 next_en_pos is over-stepped.
12558
12559 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12560
12561 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12562 * editfns.c: Rewrite current-time-zone so that it invokes
12563 the equivalent of (format-time-string "%Z") to get the time zone name.
12564 This fixes a bug when the time zone name contains characters that
12565 need converting from the system time locale to Emacs internal format.
12566 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12567 that patch fixed format-time-string to do the conversion, but
12568 I forgot to fix current-time-zone.
12569 (format_time_string): New function, containing most of
12570 what Fformat_time_string used to contain.
12571 (Fformat_time_string): Rewrite in terms of format_time_string.
12572 This doesn't change this function's behavior.
12573 (current-time-zone): Rewrite to use format_time_string.
12574 This fixes the bug reported by Michael Schierl in
12575 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12576 Jason Rumney's 2007-06-07 change worked around this bug, but
12577 didn't fix it.
12578 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12579
12580 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12581
12582 * xdisp.c (start_display): If the character at POS is displayed
12583 via a display vector, reset IT->current.dpvec_index to zero.
12584 (try_window_reusing_current_matrix): If a line ends in a display
12585 vector or the next line starts in a display vector, continue
12586 redrawing the window even though the character position of
12587 start_row was reached.
12588 (Bug#9771, part 2)
12589
12590 2011-10-18 Chong Yidong <cyd@gnu.org>
12591
12592 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12593 with nobreak-char-display too.
12594
12595 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12596
12597 Fix part 3 of bug#9771.
12598 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12599 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12600 non-neutral characters if the current character is a paragraph
12601 separator (a.k.a. Newline). This avoids running the same
12602 expensive loop twice, once when we consume the preceding newline
12603 and the other time when the line actually needs to be displayed.
12604 Avoid the loop when we see neutrals on the base embedding level
12605 following a character whose directionality is the same as the
12606 paragraph's. This avoids running the expensive loop when a line
12607 ends in a long sequence of neutrals, like control characters.
12608 Add assertion against STRONG_AL type. Slightly rearrange code
12609 that determines the type of a neutral given the first non-neutral
12610 that follows it.
12611 (bidi_level_of_next_char): Set next_en_pos to zero when
12612 invalidating its info.
12613
12614 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12615
12616 * xdisp.c (push_display_prop): Determine whether to record string
12617 or buffer position by IT->string, not by IT->method. Allow
12618 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12619 (move_it_vertically_backward): Don't look for character position
12620 immediately after the newline when in a continuation line.
12621 (Bug#9771, part 1)
12622
12623 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12624
12625 * window.c (coordinates_in_window): Rewrite and delabelize
12626 vertical border check. (Bug#5357) (Bug#9618)
12627
12628 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12629
12630 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12631 errors in XSetWindowBorder (bug#9310).
12632
12633 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12634
12635 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12636 avoid crash when xmalloc overrun checking is enabled.
12637
12638 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12639
12640 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12641 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12642 cursor motion with <left> and <right> arrow keys.
12643
12644 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12645 some callers set that themselves.
12646
12647 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12648
12649 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12650 display string and the previous row comes from the same string and
12651 is empty. (Bug#9739) (Bug#9738)
12652
12653 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12654
12655 * doc.c (get_doc_string): Encode file name (bug#9735).
12656
12657 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12658
12659 * bidi.c (bidi_level_of_next_char):
12660 * xdisp.c (get_visually_first_element): Remove old incorrect
12661 comments regarding the Unicode Line Separator character.
12662
12663 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12664
12665 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12666
12667 * alloc.c (Fgc_status): Do not access beyond zombies array
12668 boundary if nzombies > MAX_ZOMBIES.
12669 * alloc.c (dump_zombies): Add missing format specifier.
12670
12671 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12672
12673 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12674 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12675
12676 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12677 Some packages use them to denote characters with modifiers.
12678
12679 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12680
12681 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12682 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12683 matching a pp-number. Rename parameter var to var1.
12684
12685 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12686
12687 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12688
12689 2011-10-08 Glenn Morris <rgm@gnu.org>
12690
12691 * callint.c (Fcall_interactively): Give a more explicit error for the
12692 'c' case with a non-character input. (Bug#8479)
12693
12694 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12695
12696 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12697 lines.
12698 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12699 lines that are hscrolled on the left.
12700
12701 * dispnew.c (buffer_posn_from_coords): Account for a possible
12702 presence of header-line. (Bug#4426)
12703
12704 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12705
12706 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12707 Don't advertise functionality which we discourage or doesn't work.
12708
12709 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12710
12711 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12712 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12713 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12714 this makes Emacs dump core during garbage collection on rare
12715 occasions. sizeof is obviously inferior to offsetof here, so
12716 stick with offsetof.
12717 (GC_POINTER_ALIGNMENT): New macro.
12718 (mark_memory): Omit 3rd (offset) arg; caller changed.
12719 Don't assume EMACS_INT alignment is the same as pointer alignment.
12720
12721 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12722
12723 * keyboard.c (read_key_sequence_remapped): New var.
12724 (read_key_sequence): Compute remapping in the right buffer.
12725 (command_loop_1): Use read_key_sequence's remapping directly.
12726
12727 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12728
12729 * dired.c (file_name_completion): Don't expand file name.
12730 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12731 before checking file name handler.
12732
12733 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12734 they've been requested explicitly (bug#9591).
12735
12736 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12737
12738 * keymap.c (Fsingle_key_description): Use make_specified_string
12739 instead of build_string to build string from push_key_description.
12740 (Bug#5193)
12741
12742 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12743
12744 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12745 This fixes a Y2038 bug on 64-bit hosts.
12746 * buffer.c (reset_buffer):
12747 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12748 (Fclear_buffer_auto_save_failure):
12749 Use 0, not -1, to represent an unset failure time, since time_t
12750 might not be signed.
12751
12752 Remove dependency on glibc malloc internals.
12753 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12754 Move back here from lisp.h, but with their new implementations.
12755 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12756 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12757 * charset.c (charset_table_init): New static var.
12758 (syms_of_charset): Use it instead of xmalloc. This removes a
12759 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12760 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12761 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12762 Move back to alloc.c.
12763 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12764 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12765
12766 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12767
12768 * nsterm.m (windowDidResize): Call x_set_window_size only when
12769 ns_in_resize is true. Otherwise set pixelwidth/height and
12770 call change_frame_size (Bug#9628).
12771
12772 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12773
12774 Port --enable-checking=all to Fedora 14 x86-64.
12775 * charset.c (syms_of_charset): Also account for glibc malloc's
12776 internal overhead when calculating the initial malloc maximum.
12777
12778 Port --enable-checking=all to Fedora 14 x86.
12779 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12780 Move to lisp.h.
12781 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12782 (overrun_check_realloc, overrun_check_free):
12783 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12784 That way, xmalloc returns a properly-aligned pointer even if
12785 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12786 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12787 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12788 into account when calculating the initial malloc maximum.
12789 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12790 Move here from alloc.c, so that charset.c can use it too.
12791 Properly align; the old code wasn't right for common 32-bit hosts
12792 when configured with --enable-checking=all.
12793 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12794 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12795
12796 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12797
12798 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12799 use EDOM.
12800
12801 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12802
12803 * xdisp.c (compute_display_string_end): If there's no display
12804 string at CHARPOS, return -1.
12805
12806 * bidi.c (bidi_fetch_char): When compute_display_string_end
12807 returns a negative value, treat the character as a normal
12808 character not covered by a display string. (Bug#9624)
12809
12810 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12811
12812 * lread.c (Fread_from_string): Fix typo in docstring.
12813
12814 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12815
12816 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12817 newline, reseat the iterator instead of bidi-iterating there one
12818 character at a time. (Bug#9610)
12819 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12820 TO_CHARPOS if the bidi iterator is at base embedding level.
12821
12822 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12823
12824 * lread.c (readevalloop): Use correct code for NBSP.
12825 (read1): Likewise. (Bug#9608)
12826
12827 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12828
12829 * dbusbind.c (Fdbus_register_signal): When service is not
12830 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12831
12832 2011-09-25 Glenn Morris <rgm@gnu.org>
12833
12834 * buffer.c (truncate-lines): Doc fix.
12835
12836 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12837
12838 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12839 (Fset_window_next_buffers): Doc fix.
12840
12841 2011-09-24 Glenn Morris <rgm@gnu.org>
12842
12843 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12844
12845 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12846
12847 Fix minor problems found by static checking.
12848 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12849 * indent.c (Fvertical_motion): Fix == vs = typo.
12850
12851 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12852
12853 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12854 Default value is now t. Doc fix.
12855
12856 * indent.c (Fvertical_motion): Compute and apply the overshoot
12857 logic when moving up, not only when moving down. Fix the
12858 confusing name and values of the it_overshoot_expected variable;
12859 logic changes accordingly. (Bug#9254) (Bug#9549)
12860
12861 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12862 CHARPOS is covered by a display string which includes newlines.
12863 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12864 is covered by a display string with embedded newlines.
12865
12866 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12867
12868 * dbusbind.c (Fdbus_register_signal): Add match rule to
12869 Vdbus_registered_objects_table. (Bug#9581)
12870 (Fdbus_register_method, Vdbus_registered_objects_table):
12871 Fix docstring.
12872
12873 2011-09-24 Jim Meyering <meyering@redhat.com>
12874
12875 do not ignore write error for any output size
12876 The previous change was incomplete.
12877 While it makes emacs --batch detect the vast majority of stdout
12878 write failures, errors were still ignored whenever the output size is
12879 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12880 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12881 && echo FAIL: ignored write error
12882 FAIL: ignored write error
12883 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12884 && echo FAIL: ignored write error
12885 FAIL: ignored write error
12886 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12887
12888 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12889
12890 * emacs.c (Fkill_emacs): In noninteractive mode exit
12891 non-successfully if a write error occurred on stdout. (Bug#9574)
12892
12893 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12894
12895 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12896 the xassert test.
12897
12898 * dispextern.h (struct it): Update the comment documenting what
12899 can it->OBJECT be.
12900
12901 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12902
12903 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12904 a display string, extend search for cursor position to end of row.
12905 (find_row_edges): If the row ends in a newline from a display
12906 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12907 Handle the case of a display string with multiple newlines.
12908 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12909 non-empty line. Fixes confusing cursor motion with arrow keys at
12910 the beginning of a line that starts with whitespace.
12911
12912 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12913
12914 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12915 (bug#9493).
12916
12917 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12918
12919 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12920 boolean (Bug#9154).
12921
12922 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12923
12924 * xdisp.c (display_line): Record maximum and minimum buffer
12925 positions even if no glyphs were produced (e.g., by a zero-width
12926 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12927 buffer positions that will be removed from the glyph row because
12928 they don't fit.
12929 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12930 column is beyond frame width: don't subtract 1 "pixel" when
12931 computing width of the stretch.
12932 (reseat_at_next_visible_line_start): Undo the change made on
12933 2011-09-17 that saved paragraph information and restored it after
12934 the call to `reseat'. (Bug#9545)
12935
12936 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12937
12938 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12939 and turn window cursor on if cleared (Bug#9415).
12940
12941 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12942
12943 * search.c (boyer_moore): Take unibyte characters from pattern
12944 literally. (Bug#9458)
12945
12946 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12947
12948 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12949
12950 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12951
12952 Fix minor problem found by static checking.
12953 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12954 initialized, to pacify gcc -Wuninitialized.
12955
12956 * fileio.c: Report proper errno when syscall falls.
12957 (Finsert_file_contents): Save and restore errno,
12958 so that report_file_error outputs the correct diagnostic.
12959 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12960
12961 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12962
12963 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12964
12965 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12966
12967 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12968 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12969
12970 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12971
12972 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12973 about the current paragraph and restore it after the call to reseat.
12974
12975 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12976 (bidi_find_paragraph_start): Search back for paragraph beginning
12977 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12978 (bidi_move_to_visually_next): Only trigger paragraph-related
12979 computations when the last character is a newline or at EOB, not
12980 just any NEUTRAL_B. (Bug#9470)
12981
12982 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12983 truncated lines if point is covered by a display string. (Bug#9524)
12984
12985 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12986
12987 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12988 (cons_to_x_long): New function.
12989 (lisp_data_to_selection_data): Use it. Correct the test for
12990 short-versus-long data; it was negated. Break out of vector
12991 loop, for efficiency, when a long datum is discovered.
12992
12993 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12994
12995 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12996
12997 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12998
12999 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13000 GCC PR/17406) by declaring this function with external scope.
13001
13002 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13003
13004 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13005 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13006
13007 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13008
13009 * editfns.c (Fformat): Correctly handle text properties on "%%".
13010
13011 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13012
13013 * xterm.c (x_draw_composite_glyph_string_foreground):
13014 * w32term.c (x_draw_composite_glyph_string_foreground):
13015 * term.c (encode_terminal_code):
13016 * composite.c (composition_update_it, get_composition_id):
13017 * xdisp.c (get_next_display_element)
13018 (fill_composite_glyph_string): Add comments about special meaning
13019 of TAB characters in a composition.
13020
13021 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13022
13023 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13024 This occurs when processing a multibyte format.
13025 Problem reported by Wolfgang Jenker.
13026
13027 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13028
13029 * xdisp.c (try_cursor_movement): Only check for exact match if
13030 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13031
13032 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13033
13034 Remove unused external symbols.
13035 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13036 * xdisp.c (calc_pixel_width_or_height): Now static.
13037 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13038 * indent.c (check_display_width):
13039 * w32term.c: Fix comment to match code.
13040 * xterm.c, xterm.h (x_catching_errors): Remove.
13041
13042 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13043
13044 * xselect.c: Use signed conversions more consistently (Bug#9498).
13045 (selection_data_to_lisp_data): Assume incoming selection data are
13046 signed integers, not unsigned. This is to be consistent with
13047 outgoing selection data, which was modified to use signed integers
13048 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13049 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13050 expects long, not unsigned long.
13051
13052 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13053
13054 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13055 computation of loop end. Reported by Johan Bockgård
13056 <bojohan@gnu.org>.
13057
13058 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13059
13060 * frame.c (Fother_visible_frames_p): Function deleted.
13061
13062 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13063
13064 * indent.c (compute_motion): Process display vector front to back
13065 rather than the other way around. (Bug#2496)
13066
13067 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13068
13069 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13070
13071 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13072
13073 * minibuf.c (Fread_from_minibuffer): Doc fix.
13074
13075 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13076
13077 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13078 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13079
13080 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13081
13082 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13083 value for non-existent files.
13084
13085 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13086
13087 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13088 set its "size" to -1. This will set the modtime_size field of
13089 the corresponding buffer to -1, which is what
13090 verify-visited-file-modtime expects for files that do not exist.
13091 (Bug#9139)
13092
13093 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13094
13095 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13096 here ...
13097 * lisp.h: ... from here. push_key_description is no longer
13098 defined in keyboard.c, so its declaration should not be in
13099 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13100 logically belongs with push_key_description.
13101
13102 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13103
13104 * buffer.h: Include <sys/types.h> instead of <time.h>.
13105 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13106 Problem reported by Herbert J. Skuhra.
13107
13108 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13109
13110 * xml.c (parse_region): Make the parsing work for
13111 non-comment-starting XML files again (bug#9144).
13112
13113 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13114
13115 * image.c (gif_load): Fix calculation of bottom and right corner.
13116 (Bug#9468)
13117
13118 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13119
13120 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13121 redisplay in small windows.
13122
13123 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13124
13125 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13126
13127 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13128
13129 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13130 Operate on live windows only.
13131
13132 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13133
13134 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13135
13136 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13137
13138 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13139 only under bidi iteration.
13140
13141 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13142
13143 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13144
13145 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13146
13147 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13148 Without this fix, the command to link temacs failed due to an
13149 undefined symbol __builtin_isnan. This is because
13150 /usr/include/iso/math_c99.h #defines isnan(x) to
13151 __builtin_isnan(x), but the bundled gcc, which identifies itself
13152 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13153 a __builtin_isnan.
13154 * floatfns.c (isnan): #undef, and then #define to a clone of
13155 what's in data.c.
13156 (Fisnan): Always define, since it's always available now.
13157 (syms_of_floatfns): Always define isnan at the Lisp level.
13158
13159 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13160
13161 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13162
13163 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13164
13165 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13166 The previous code assumed that file offsets (off_t values) fit in
13167 EMACS_INT variables, which is not true on typical 32-bit hosts.
13168 The code messed up by falsely reporting buffer overflow in cases
13169 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13170 when "big" contains more than 2**29 bytes, even though this
13171 inserts just one byte and does not overflow the buffer.
13172 (Finsert_file_contents): Store file offsets as off_t
13173 values, not as EMACS_INT values. Check for overflow when
13174 converting between EMACS_INT and off_t. When checking for
13175 buffer overflow or for overlap, take the offsets into account.
13176 Don't use EMACS_INT for small values where int suffices.
13177 When checking for overlap, fix a typo: ZV was used where
13178 ZV_BYTE was intended.
13179 (Fwrite_region): Don't assume off_t fits into 'long'.
13180 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13181
13182 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13183
13184 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13185
13186 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13187
13188 sprintf-related integer and memory overflow issues (Bug#9412).
13189
13190 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13191 (esprintf, exprintf, evxprintf): New functions.
13192 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13193 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13194 (modify_event_symbol): Do not assume that the length of
13195 name_alist_or_stem is safe to alloca and fits in int.
13196 (Fexecute_extended_command): Likewise for function name and binding.
13197 (Frecursion_depth): Wrap around reliably on integer overflow.
13198 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13199 since some callers pass EMACS_INT values.
13200 (Fsingle_key_description): Don't crash if symbol name contains more
13201 than MAX_ALLOCA bytes.
13202 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13203 (get_minibuffer): Arg is now EMACS_INT, not int.
13204 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13205 (esprintf, exprintf, evxprintf): New decls.
13206 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13207
13208 * dbusbind.c (signature_cat): New function.
13209 (xd_signature, Fdbus_register_signal):
13210 Do not overrun buffer; instead, report string overflow.
13211
13212 * dispnew.c (add_window_display_history): Don't overrun buffer.
13213 Truncate instead; this is OK since it's just a log.
13214
13215 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13216 even if the time zone offset is outlandishly large.
13217 Don't mishandle offset == INT_MIN.
13218
13219 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13220 when creating daemon; the previous buffer-overflow check was incorrect.
13221
13222 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13223 which has the guts of the old verror function.
13224
13225 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13226 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13227
13228 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13229 (font_unparse_xlfd): Don't blindly alloca long strings.
13230 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13231 fits in int, when using sprintf. Use single snprintf to count
13232 length of string rather than counting it via multiple sprintfs;
13233 that's simpler and more reliable.
13234 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13235 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13236 sprintf, in case result does not fit in int.
13237
13238 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13239 (fontset_from_font): Print it.
13240
13241 * frame.c (tty_frame_count): Now printmax_t, not int.
13242 (make_terminal_frame, set_term_frame_name): Print it.
13243 (x_report_frame_params): In X, window IDs are unsigned long,
13244 not signed long, so print them as unsigned.
13245 (validate_x_resource_name): Check for implausibly long names,
13246 and don't assume name length fits in 'int'.
13247 (x_get_resource_string): Don't blindly alloca invocation name;
13248 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13249 not fit in int.
13250
13251 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13252 (xg_check_special_colors, xg_set_geometry):
13253 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13254
13255 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13256 Use esprintf, not sprintf, in case result does not fit in int.
13257
13258 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13259 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13260 it as a large positive number.
13261 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13262 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13263
13264 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13265 in case result does not fit in int.
13266
13267 * print.c (float_to_string): Detect width overflow more reliably.
13268 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13269 buffer overrun. Don't assume list length fits in 'int'. Treat
13270 print length of 0 as 0, not as infinity; to be consistent with other
13271 uses of print length in this function. Don't overflow print length
13272 index. Don't assume hash table size fits in 'long', or that
13273 vectorlike size fits in 'unsigned long'.
13274
13275 * process.c (make_process): Use printmax_t, not int, to format
13276 process-name gensyms.
13277
13278 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13279
13280 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13281 to avoid potential buffer overrun.
13282
13283 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13284 if X resource line is longer than 512 bytes.
13285
13286 * xfns.c (x_window): Make sprintf buffer a bit bigger
13287 to avoid potential buffer overrun.
13288
13289 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13290
13291 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13292
13293 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13294
13295 Integer overflow fixes for scrolling, etc.
13296 Without these, Emacs silently mishandles large integers sometimes.
13297 For example, "C-u 4294967297 M-x recenter" was treated as if
13298 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13299
13300 * xdisp.c (try_window_id): Check Emacs fixnum range before
13301 converting to 'int'.
13302
13303 * window.c (window_scroll_line_based, Frecenter):
13304 Check that an Emacs fixnum is in range before assigning it to 'int'.
13305 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13306 values converted from Emacs fixnums.
13307 (Frecenter): Don't wrap around a line count if it is out of 'int'
13308 range; instead, treat it as an extreme value.
13309 (Fset_window_configuration, compare_window_configurations):
13310 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13311
13312 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13313 that can exceed INT_MAX. Check that EMACS_INT value is in range
13314 before assigning it to the (possibly-narrower) index.
13315 (match_limit): Don't assume that a fixnum can fit in 'int'.
13316
13317 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13318 exceed INT_MAX.
13319
13320 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13321 (Fvertical_motion): Don't wrap around LINES values that don't fit
13322 in 'int'. Instead, treat them as extreme values. This is good
13323 enough for windows, which can't have more than INT_MAX lines anyway.
13324
13325 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13326
13327 * Require libxml/parser.h to avoid compilation warning.
13328
13329 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13330
13331 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13332 since this reportedly can destroy thread storage.
13333
13334 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13335
13336 * syntax.c (find_defun_start): Update all cache variables if
13337 exiting early (Bug#9401).
13338
13339 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13340
13341 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13342
13343 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13344 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13345 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13346
13347 * term.c (tty_append_glyph): New function.
13348 (produce_stretch_glyph): Static function and its prototype deleted.
13349
13350 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13351 Add prototypes.
13352
13353 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13354
13355 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13356 when checking :margin (Bug#9390).
13357 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13358 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13359 so that the name doesn't mislead. All uses changed.
13360
13361 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13362
13363 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13364 set_tty_hooks.
13365
13366 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13367
13368 * xdisp.c (move_it_to): Don't bail out early when reaching
13369 position beyond to_charpos, if we are scanning backwards.
13370 (move_it_vertically_backward): When DY == 0, make sure we get to
13371 the first character in the line after the newline.
13372
13373 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13374
13375 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13376 (ccl_driver): Do not generate an out-of-range pointer.
13377 (Fccl_execute_on_string): Remove unnecessary check for
13378 integer overflow, noted by Stefan Monnier in
13379 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13380 Remove a FIXME that didn't need fixing.
13381 Simplify the newly-introduced buffer reallocation code.
13382
13383 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13384
13385 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13386
13387 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13388
13389 Integer and memory overflow issues (Bug#9196).
13390
13391 * doc.c (get_doc_string): Rework so that
13392 get_doc_string_buffer_size is the actual buffer size, rather than
13393 being 1 less than the actual buffer size; this makes xpalloc more
13394 convenient.
13395
13396 * image.c (x_allocate_bitmap_record, cache_image):
13397 * xselect.c (Fx_register_dnd_atom):
13398 Simplify previous changes by using xpalloc.
13399
13400 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13401 since either will do and ptrdiff_t is convenient with xpalloc.
13402
13403 * charset.c (charset_table_size)
13404 (struct charset_sort_data.priority): Now ptrdiff_t.
13405 (charset_compare): Don't overflow if priorities differ greatly.
13406 (Fsort_charsets): Don't assume list length fits in int.
13407 Check for size-calculation overflow when allocating sort data.
13408 (syms_of_charset): Allocate an initial charset table that is
13409 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13410
13411 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13412
13413 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13414 The actual value is always <= INT_MAX, and leaving it unsigned made
13415 overflow checking harder.
13416
13417 * dispextern.h (struct glyph_matrix.rows_allocated)
13418 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13419 with xpalloc. The values are still always <= INT_MAX.
13420
13421 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13422
13423 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13424 (SAFE_NALLOCA): New macro.
13425
13426 * region-cache.c (struct boundary.pos, find_cache_boundary)
13427 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13428 (set_cache_region, invalidate_region_cache)
13429 (revalidate_region_cache, know_region_cache, region_cache_forward)
13430 (region_cache_backward, pp_cache):
13431 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13432 so that ptrdiff_t * can be passed to xpalloc.
13433 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13434 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13435 (pp_cache): Don't assume cache_len fits in int.
13436 * region-cache.h: Adjust extern decls to match.
13437
13438 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13439 EMACS_INT, since either will do, for xpalloc.
13440
13441 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13442 (xnmalloc, xnrealloc, xpalloc): New functions.
13443
13444 * bidi.c (bidi_shelve_header_size): New constant.
13445 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13446 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13447
13448 * bidi.c (bidi_cache_shrink):
13449 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13450 (overlay_strings):
13451 Don't update size of array until after memory allocation succeeds,
13452 because xmalloc/xrealloc may not return.
13453 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13454 now that we have proper integer overflow checking.
13455 (record_overlay_string, overlay_strings): Catch overflows when
13456 calculating size of overlay_str_buf.
13457
13458 * callproc.c (Fcall_process): Check for size overflow when
13459 calculating size of args2.
13460 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13461 Normally we prefer signed values, but sticking with ptrdiff_t would
13462 require adding more-complicated checks.
13463
13464 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13465 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13466 Redo buffer-overflow calculations to avoid integer overflow.
13467 Add a FIXME comment where memory seems to be over-allocated.
13468
13469 * character.c (Fstring): Check for size-calculation overflow.
13470
13471 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13472 unnecessary integer overflow. Check for size overflow.
13473 (encode_coding_object): Don't update size until xmalloc succeeds.
13474
13475 * composite.c (get_composition_id): Check for overflow in glyph
13476 length calculations.
13477
13478 Integer and memory overflow fixes for display code.
13479 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13480 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13481 (scrolling_window): Check for overflow in size calculations.
13482 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13483 Don't assume glyph table len fits in int.
13484 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13485 (row_table_size): Now ptrdiff_t, not int.
13486 (scrolling_window): Avoid overflow in size calculations.
13487 Don't update size until allocation succeeds.
13488 * fns.c (concat): Check for overflow in size calculations.
13489 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13490 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13491 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13492
13493 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13494 (get_doc_string): Check for size calculation overflow.
13495 Don't update size until allocation succeeds.
13496 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13497 EMACS_INT, where ptrdiff_t will do.
13498 (Fsubstitute_command_keys): Check for string overflow.
13499
13500 * editfns.c (set_time_zone_rule): Don't assume environment length
13501 fits in int.
13502 (message_length): Now ptrdiff_t, not int.
13503 (Fmessage_box): Don't update size until allocation succeeds.
13504 Don't assume message length fits in int.
13505 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13506
13507 * emacs.c (main): Do not reallocate argv, since there is a null at
13508 the end that can be overwritten, and this way there's no need to
13509 worry about size-calculation overflow.
13510 (sort_args): Check for size-calculation overflow.
13511
13512 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13513 alloc succeeds.
13514 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13515
13516 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13517 (x_set_scroll_bar_width, x_figure_window_size):
13518 Check for integer overflow.
13519 (x_set_alpha): Do not assume XINT fits in int.
13520
13521 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13522 This is for the members text_lines, text_cols, total_lines, total_cols,
13523 where the system imposes an 'int' limit.
13524
13525 * fringe.c (Fdefine_fringe_bitmap):
13526 Don't update size until alloc works.
13527
13528 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13529 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13530
13531 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13532 Check for size-calculation overflow.
13533 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13534 do, as we prefer signed integers.
13535 (id_to_widget.max_size, id_to_widget.used)
13536 (xg_store_widget_in_map, xg_remove_widget_from_map)
13537 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13538 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13539 Use and return ptrdiff_t, not int.
13540 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13541 * gtkutil.h: Change prototypes to match the above.
13542
13543 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13544 are duplicate now that they've been promoted to lisp.h.
13545 (x_allocate_bitmap_record, x_alloc_image_color)
13546 (make_image_cache, cache_image, xpm_load):
13547 Don't update size until alloc is done.
13548 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13549 (x_detect_edges):
13550 Check for size calculation overflow.
13551 (ct_colors_allocated_max): New constant.
13552 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13553 overflow.
13554
13555 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13556 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13557 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13558 Use ptrdiff_t, not int, to count maps.
13559 (read_char_minibuf_menu_prompt): Check for overflow in size
13560 calculations. Don't update size until allocation succeeds.
13561 Redo calculations to avoid overflow.
13562 * keyboard.h: Change prototypes to match the above.
13563
13564 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13565 to count maps.
13566 (current_minor_maps): Check for size calculation overflow.
13567 * keymap.h: Change prototypes to match the above.
13568
13569 * lread.c (read1, init_obarray): Don't update size until alloc done.
13570
13571 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13572 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13573
13574 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13575 Now ptrdiff_t, not int.
13576 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13577 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13578
13579 * process.c (Fnetwork_interface_list): Check for overflow
13580 in size calculation.
13581
13582 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13583
13584 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13585 overflow. Don't bother calling xmalloc when xrealloc will do.
13586
13587 * search.c (Freplace_match): Check for size calculation overflow.
13588 (Fset_match_data): Don't assume list lengths fit in 'int'.
13589
13590 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13591 for command line length. Do not attempt to address one before the
13592 beginning of an array, as that's not portable.
13593
13594 * term.c (max_frame_lines): Remove; unused.
13595 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13596 not int.
13597 (encode_terminal_code, calculate_costs): Check for size
13598 calculation overflow.
13599 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13600 table lengths and related sizes. Don't update size until alloc
13601 done. Redo calculations to avoid overflow.
13602 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13603
13604 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13605 subtracting pointers.
13606 (gobble_line): Check for overflow more carefully. Don't update size
13607 until alloc done.
13608
13609 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13610 Don't update size until alloc done.
13611 Redo size calculations to avoid overflow.
13612 Check for size calculation overflow.
13613 (main) [DEBUG]: Fix typo in invoking tparam1.
13614
13615 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13616 Use ptrdiff_t, not int, for sizes.
13617 (store_mode_line_noprop_char): Don't update size until alloc done.
13618
13619 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13620 Use ptrdiff_t, not int, for sizes.
13621 (Finternal_make_lisp_face, cache_face):
13622 Check for size calculation overflow.
13623 (cache_face): Treat size calculation overflows as if they were
13624 memory exhaustion (the usual treatment), rather than aborting.
13625
13626 * xfns.c (x_encode_text, x_set_name_internal)
13627 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13628 sizes, since they can exceed INT_MAX in size. Check for size
13629 calculation overflow.
13630
13631 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13632 (xg_select): Check for size calculation overflow.
13633 Don't update size until alloc done.
13634
13635 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13636 as sprintf is limited to int lengths.
13637
13638 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13639 (X_LONG_MIN): New macros.
13640 Use them to make the following changes clearer.
13641 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13642 This change doesn't affect the value now, but it may help remind
13643 future maintainers not to raise the value too much later.
13644 (SELECTION_QUANTUM): Remove, replacing with ...
13645 (selection_quantum): ... new function, which avoids overflow.
13646 All uses changed.
13647 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13648 assumption that selection length fits in 'int'.
13649 (x_reply_selection_request, x_handle_selection_request)
13650 (x_get_window_property, receive_incremental_selection)
13651 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13652 (lisp_data_to_selection_data, clean_local_selection_data):
13653 Use ptrdiff_t, not int, to record length of selection.
13654 (x_reply_selection_request, x_get_window_property)
13655 (receive_incremental_selection, x_property_data_to_lisp):
13656 Redo calculations to avoid overflow.
13657 (x_reply_selection_request): When sending hint, ceiling it at
13658 X_LONG_MAX rather than relying on wraparound overflow to send
13659 something.
13660 (x_get_window_property, receive_incremental_selection)
13661 (lisp_data_to_selection_data, x_property_data_to_lisp):
13662 Check for size-calculation overflow.
13663 (x_get_window_property, receive_incremental_selection)
13664 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13665 Don't store size until memory allocation succeeds.
13666 (x_get_window_property): Plug memory leak on memory exhaustion.
13667 Don't double-block input; malloc is safe here. Don't assume 2**34
13668 - 4 fits in unsigned long. Add an xassert to check
13669 XGetWindowProperty overflow. Be more careful about overflow
13670 calculations, and distinguish size from memory overflow better.
13671 (receive_incremental_selection): When tracing, don't assume
13672 unsigned int is less than INT_MAX.
13673 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13674 harmful) conversions of unsigned short to int.
13675 (lisp_data_to_selection_data): Don't assume that integers
13676 in the range -65535 through -1 fit in an X unsigned short.
13677 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13678 result parameters unless successful. Rely on cons_to_unsigned
13679 to report problems with elements; the old code wasn't right anyway.
13680 (x_check_property_data): Check for int overflow; we cannot use
13681 a wider type due to X limits.
13682 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13683
13684 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13685
13686 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13687 (x_term_init): Check for size calculation overflow.
13688 (x_color_cells): Don't store size until memory allocation succeeds.
13689 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13690 Don't assume alloca size is less than MAX_ALLOCA.
13691 (x_term_init): Don't assume length fits in int (sprintf is limited
13692 to int size).
13693
13694 Use ptrdiff_t for composition IDs.
13695 * character.c (lisp_string_width):
13696 * composite.c (composition_table_size, n_compositions)
13697 (get_composition_id, composition_gstring_from_id):
13698 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13699 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13700 * window.c (Frecenter):
13701 Use ptrdiff_t, not int, for composition IDs.
13702 * composite.c (get_composition_id): Check for integer overflow.
13703 * composite.h: Adjust prototypes to match the above changes.
13704
13705 Use ptrdiff_t for hash table indexes.
13706 * category.c (hash_get_category_set):
13707 * ccl.c (ccl_driver):
13708 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13709 * coding.c (coding_system_charset_list, detect_coding_system):
13710 * coding.h (struct coding_system.id):
13711 * composite.c (get_composition_id, gstring_lookup_cache):
13712 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13713 * image.c (xpm_get_color_table_h):
13714 * lisp.h (hash_lookup, hash_put):
13715 * minibuf.c (Ftest_completion):
13716 Use ptrdiff_t for hash table indexes, not int (which is too
13717 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13718 32-bit --with-wide-int hosts).
13719
13720 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13721 Add a FIXME comment about memory leaks.
13722 (syms_of_charset): Don't assume xmalloc returns.
13723
13724 Don't assume that stated character widths fit in int.
13725 * character.c (Fchar_width, c_string_width, lisp_string_width):
13726 * character.h (CHAR_WIDTH):
13727 * indent.c (MULTIBYTE_BYTES_WIDTH):
13728 Use sanitize_char_width to avoid undefined and/or bad behavior
13729 with outlandish widths.
13730 * character.h (sanitize_tab_width): Rename from sanitize_width,
13731 now that we have two such functions. All uses changed.
13732 (sanitize_char_width): New inline function.
13733
13734 Don't assume that tab-width fits in int.
13735 * character.h (sanitize_width): New inline function.
13736 (SANE_TAB_WIDTH): New macro.
13737 (ASCII_CHAR_WIDTH): Use it.
13738 * indent.c (sane_tab_width): Remove. All uses replaced by
13739 SANE_TAB_WIDTH (current_buffer).
13740 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13741
13742 * fileio.c: Integer overflow issues with file modes.
13743 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13744
13745 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13746 Remove unreachable code.
13747 (read_hex, load_charset_map_from_file): Check for integer overflow.
13748
13749 * xterm.c: Don't go over XClientMessageEvent limit.
13750 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13751 (x_send_scroll_bar_event): Likewise. Check that the size does not
13752 exceed limits imposed by XClientMessageEvent, as well as the usual
13753 ptrdiff_t and size_t limits.
13754
13755 * keyboard.c: Overflow, signedness and related fixes.
13756 (make_lispy_movement): Use same integer type in forward decl
13757 that is used in the definition.
13758 (read_key_sequence, keyremap_step):
13759 Change bufsize argument back to int, undoing my 2011-03-30 change.
13760 We prefer signed types, and int is wide enough here.
13761 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13762 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13763 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13764 length, not size_t. Use ptrdiff_t for index, not int.
13765 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13766 possibility of integer overflow.
13767
13768 Overflow, signedness and related fixes for images.
13769
13770 * dispextern.h (struct it.stack[0].u.image.image_id)
13771 (struct_it.image_id, struct image.id, struct image_cache.size)
13772 (struct image_cache.used, struct image_cache.ref_count):
13773 * gtkutil.c (update_frame_tool_bar):
13774 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13775 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13776 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13777 * nsmenu.m (update_frame_tool_bar):
13778 * xdisp.c (calc_pixel_width_or_height):
13779 * xfns.c (image_cache_refcount):
13780 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13781 on typical 64-bit hosts.
13782
13783 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13784 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13785 Omit unnecessary casts to int.
13786 (parse_image_spec): Check that integers fall into 'int' range
13787 when the callers expect that.
13788 (image_ascent): Redo ascent calculation to avoid int overflow.
13789 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13790 (lookup_image): Remove unnecessary tests.
13791 (xbm_image_p): Locals are now of int, not EMACS_INT,
13792 since parse_image_check makes sure they fit into int.
13793 (png_load, gif_load, svg_load_image):
13794 Prefer int to unsigned where either will do.
13795 (tiff_handler): New function, combining the cores of the
13796 old tiff_error_handler and tiff_warning_handler.
13797 This function is rewritten to use vsnprintf and thereby avoid
13798 stack buffer overflows. It uses only the features of vsnprintf
13799 that are common to both POSIX and native Microsoft.
13800 (tiff_error_handler, tiff_warning_handler): Use it.
13801 (tiff_load, gif_load, imagemagick_load_image):
13802 Don't assume :index value fits in 'int'.
13803 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13804 (imagemagick_load_image): Check that crop parameters fit into
13805 the integer types that MagickCropImage accepts. Don't assume
13806 Vimagemagick_render_type has a nonnegative value. Don't assume
13807 size_t fits in 'long'.
13808 (gs_load): Use printmax_t to print the widest integers possible.
13809 Check for integer overflow when computing image height and width.
13810
13811 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13812
13813 * xdisp.c (redisplay_window): Don't force window start if point
13814 will be invisible in the resulting window. (Bug#9324)
13815
13816 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13817
13818 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13819 the display spec is of the form `(space ...)'.
13820 (handle_display_spec): Return the value returned by
13821 handle_single_display_spec, not just 1 or zero.
13822 (handle_single_display_spec): If the display spec is of the form
13823 `(space ...)', and specifies display in the text area, return 2
13824 rather than 1.
13825 (try_cursor_movement): Check for the need to scroll more
13826 accurately, and prefer exact match for point under bidi.
13827 Don't advance `row' beyond the last row of the window.
13828
13829 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13830 into disp_prop; all users changed.
13831
13832 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13833 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13834 for the text covered by the display property.
13835
13836 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13837
13838 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13839 Change return value to nil.
13840 (Frecord_buffer): Delete unused function.
13841
13842 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13843
13844 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13845 buffers, return left-to-right.
13846 (set_cursor_from_row): Consider candidate row a win if its glyph
13847 represents a newline and point is on that newline. Fixes cursor
13848 positioning on the newline at EOL of R2L text within L2R
13849 paragraph, and vice versa.
13850 (try_cursor_movement): Check continued rows, in addition to
13851 continuation rows. Fixes unwarranted scroll when point enters a
13852 continued line of R2L text within an L2R paragraph, or vice versa.
13853 (cursor_row_p): Consider the case of point being equal to
13854 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13855 from the end of a short line to the beginning of a continued line
13856 of R2L text within L2R paragraph.
13857 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13858 composed characters.
13859
13860 * bidi.c (bidi_check_type): Use xassert.
13861 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13862 members.
13863
13864 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13865
13866 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13867 a character.
13868
13869 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13870
13871 * nsfont.m (ns_otf_to_script): Fix typo.
13872
13873 2011-08-22 Kenichi Handa <handa@m17n.org>
13874
13875 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13876 extra slot even if the purpose is char-code-property-table.
13877
13878 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13879
13880 * xdisp.c (redisplay_window): When computing centering_position,
13881 account for the height of the header line. (Bug#8874)
13882
13883 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13884 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13885 candidate is selected by the mouse, and that candidate has a
13886 composed character under the mouse.
13887
13888 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13889 coordinates reported by pos-visible-in-window-p for a composed
13890 character in column zero.
13891
13892 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13893
13894 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13895
13896 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13897
13898 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13899 consider it a hit if to_charpos is anywhere in the range of the
13900 composed buffer positions.
13901
13902 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13903
13904 * image.c (gif_load): Don't assume that each subimage has the same
13905 dimensions as the base image. Handle disposal method that is
13906 "undefined" by the gif spec (Bug#9335).
13907
13908 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13909
13910 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13911 (Fcondition_case): Document `debug' symbol in error handler.
13912
13913 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13914
13915 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13916 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13917 from an Org mode buffer to a Speedbar frame.
13918
13919 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13920 a composition, take its buffer position from IT->cmp_it.charpos.
13921 Fixes cursor positioning at the beginning of a line that begins
13922 with a composed character.
13923
13924 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13925
13926 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13927 character bidirectional type, use STRONG_L instead. Fixes crashes
13928 in a buffer produced by `describe-categories'.
13929
13930 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13931 members before the level stack, so they would be saved and
13932 restored when copying iterator state. Fixes incorrect reordering
13933 around TABs covered by display properties.
13934
13935 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13936
13937 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13938
13939 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13940
13941 * eval.c (internal_condition_case, internal_condition_case_1)
13942 (internal_condition_case_2, internal_condition_case_n):
13943 Remove unnecessary aborts (Bug#9081).
13944
13945 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13946
13947 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13948 has no `load' handler, try opening the file locally. (Bug#9311)
13949
13950 2011-08-16 Ken Brown <kbrown@cornell.edu>
13951
13952 * gmalloc.c: Expand comment.
13953
13954 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13955
13956 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13957 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13958
13959 2011-08-16 Ken Brown <kbrown@cornell.edu>
13960
13961 Fix memory allocation problems in Cygwin build (Bug#9273).
13962
13963 * unexcw.c ( __malloc_initialized): Declare external variable.
13964 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13965
13966 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13967 New variables.
13968 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13969 dumped emacs.
13970 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13971 in the static heap.
13972 [CYGWIN] (special_realloc): New function.
13973 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13974 requests to realloc storage in the static heap.
13975
13976 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13977
13978 * bidi.c (bidi_initialize): Remove unused local.
13979
13980 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13981
13982 * bidimirror.h:
13983 * biditype.h: Remove file.
13984 * makefile.w32-in ($(BLD)/bidi.$(O)):
13985 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13986
13987 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13988
13989 * chartab.c: Improve commentary for the uniprop_table API.
13990
13991 * bidi.c (bidi_paragraph_init): Support zero value of
13992 bidi_ignore_explicit_marks_for_paragraph_level.
13993 (bidi_initialize): Use uniprop_table instead of including
13994 biditype.h and bidimirror.h.
13995
13996 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13997 coordinates of the iterator when restoring from ppos_it.
13998 (Bug#9296)
13999
14000 2011-08-14 Kenichi Handa <handa@m17n.org>
14001
14002 * process.c (create_process): Call setup_process_coding_systems
14003 after the pid of the process is set to -1 (Bug#8162).
14004
14005 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14006
14007 * xdisp.c (move_it_in_display_line_to): Don't invoke
14008 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14009 ppos_it. Fixes vertical cursor motion when line beginning is
14010 covered by an image. (Bug#9296)
14011
14012 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14013
14014 * nsterm.h (ns_run_ascript): Declare.
14015 (NSAPP_DATA2_RUNASSCRIPT): Define.
14016
14017 * nsfns.m (as_script, as_result, as_status): New static variables.
14018 (ns_run_ascript): New function.
14019 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14020 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14021 the event loop. Get status from as_status (Bug#7276).
14022
14023 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14024 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14025 the event loop (Bug#7276).
14026
14027 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14028
14029 * gnutls.c (QCgnutls_bootprop_priority)
14030 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14031 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14032 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14033 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14034 (QCgnutls_bootprop_verify_hostname_error)
14035 (QCgnutls_bootprop_callbacks_verify): Rename from
14036 Qgnutls_bootprop_..., all uses changed.
14037
14038 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14039 uses changed.
14040
14041 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14042
14043 * xfaces.c (Qframe_set_background_mode): Now static.
14044 * dispextern.h (Qframe_set_background_mode): Remove decl.
14045
14046 * process.c (Fnetwork_interface_info): Declare local only if needed.
14047
14048 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14049
14050 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14051 (Fnetwork_interface_list): Allocate in increments of bytes instead
14052 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14053 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14054 sockaddr.
14055 (struct ifflag_def): notrailers is smart on OSX.
14056 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14057 Get hardware address with getifaddrs if available.
14058
14059 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14060
14061 * xdisp.c (iterate_out_of_display_property): xassert that
14062 IT->position is set to within IT->object's boundaries. Break from
14063 the loop as soon as EOB is reached; avoids infloops in redisplay
14064 when IT->position is set up wrongly due to some bug.
14065 Set IT->current to match the bidi iterator unconditionally.
14066 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14067 entry. Force push_it to save on the stack the current
14068 buffer/string position, to be restored by pop_it. Fix flags in
14069 the iterator structure wrt the object coming from a display
14070 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14071 properties. (Bug#9284)
14072
14073 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14074
14075 * fontset.c (fontset_get_font_group): Add proper type checks.
14076 (Bug#9172)
14077
14078 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14079
14080 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14081 and LC_VERSION_MIN_MACOSX.
14082 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14083 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14084
14085 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14086
14087 * xdisp.c (forward_to_next_line_start): Allow to use the
14088 no-display-properties-and-no-overlays under bidi display.
14089 Set disp_pos in the bidi iterator to avoid searches for display
14090 properties and overlays.
14091
14092 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14093
14094 * editfns.c (Fset_time_zone_rule): Document relationship with the
14095 setenv function.
14096
14097 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14098 the font entity extracted from the cache (Bug#8109).
14099
14100 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14101
14102 * composite.c (autocmp_chars): Don't reset point. That is done by
14103 restore_point_unwind (Bug#5984).
14104
14105 2011-08-07 Juri Linkov <juri@jurta.org>
14106
14107 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14108 to show the arg `TIME' instead of `TIMEVAL'.
14109
14110 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14111
14112 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14113 display property strides EOL and includes a newline, as in
14114 longlines-mode. (Bug#9254)
14115 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14116 word-wrap under bidirectional display. (Bug#9224)
14117
14118 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14119 is non-zero, even if the data buffer is NULL. Fixes a crash in
14120 vertical-motion with longlines-mode. (Bug#9254)
14121
14122 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14123
14124 * bidi.c <bidi_cache_total_alloc>: Now static.
14125 (bidi_initialize): Initialize bidi_cache_total_alloc.
14126
14127 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14128 cache. (Bug#9221)
14129
14130 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14131 amount allocated this far in `bidi_cache_total_alloc'.
14132 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14133 non-zero, only free the data buffer without restoring the cache
14134 contents. All callers changed.
14135
14136 * dispextern.h (bidi_unshelve_cache): Update prototype.
14137
14138 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14139 (move_it_in_display_line, move_it_to)
14140 (move_it_vertically_backward, move_it_by_lines): Replace the call
14141 to xfree to an equivalent call to bidi_unshelve_cache.
14142 (move_it_in_display_line_to): Fix logic of returning
14143 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14144
14145 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14146
14147 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14148 came from a string character with a `cursor' property. (Bug#9229)
14149
14150 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14151
14152 * Makefile.in (LIB_PTHREAD): New variable.
14153 (LIBES): Add LIB_PTHREAD (Bug#9216).
14154
14155 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14156 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14157
14158 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14159
14160 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14161
14162 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14163
14164 * xterm.c (x_find_topmost_parent): New function.
14165 (x_set_frame_alpha): Find topmost parent window with
14166 x_find_topmost_parent and set the property there also (bug#9181).
14167 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14168
14169 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14170
14171 * callproc.c (Fcall_process): Avoid vfork clobbering
14172 the local vars buffer, coding_systems, current_dir.
14173
14174 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14175
14176 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14177
14178 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14179
14180 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14181 so that it is not optimized away.
14182
14183 * xdisp.c (compute_display_string_pos): Remove unused local.
14184
14185 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14186
14187 Fix slow cursor motion and scrolling in large buffers with
14188 selective display, like Org Mode buffers. (Bug#9218)
14189
14190 * dispextern.h (struct bidi_it): New member disp_prop_p.
14191
14192 * xdisp.c: Remove one-slot cache of display string positions.
14193 (compute_display_string_pos): Accept an additional argument
14194 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14195 for a display string or property. If found, set DISP_PROP_P
14196 non-zero.
14197
14198 * bidi.c (bidi_fetch_char): Accept an additional argument
14199 DISP_PROP_P, and pass it to compute_display_string_pos.
14200 Only handle text covered by a display string if DISP_PROP_P is returned
14201 non-zero. All callers of bidi_fetch_char changed.
14202
14203 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14204
14205 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14206
14207 2010-12-03 Don March <don@ohspite.net>
14208
14209 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14210 last character M-[char] is translated to ESC [char] (bug#7541).
14211
14212 2011-08-02 Kenichi Handa <handa@m17n.org>
14213
14214 * lisp.h (uniprop_table): Extern it.
14215
14216 * chartab.c (uniprop_table): Make it non-static.
14217
14218 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14219
14220 * xdisp.c (forward_to_next_line_start): Accept additional argument
14221 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14222 on the newline.
14223 (reseat_at_next_visible_line_start): Use the bidi iterator state
14224 returned by forward_to_next_line_start to restore the state of
14225 it->bidi_it after backing up to previous newline. (Bug#9212)
14226
14227 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14228
14229 * regex.c (re_comp): Protoize.
14230 (re_exec): Fix return type.
14231 (regexec): Fix type of `ret'. (Bug#9203)
14232
14233 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14234
14235 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14236 This is needed if max-image-size is a floating-point number.
14237
14238 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14239
14240 * print.c (print_object): Print empty symbol as ##.
14241
14242 * lread.c (read1): Read ## as empty symbol.
14243
14244 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14245
14246 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14247 setting frame foreground color (Bug#9175).
14248 (x_set_background_color): Likewise.
14249
14250 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14251 contents (Bug#9176).
14252 (EmacsTooltip -init): Remove bezels and add shadows to
14253 tooltip windows.
14254
14255 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14256 or scroll bar (Bug#8470).
14257
14258 * nsfont.m (nsfont_open): Remove assignment to voffset and
14259 unnecessary vars hshink, expand, hd, full_height, min_height.
14260 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14261
14262 * nsterm.h (nsfont_info): Remove voffset field.
14263
14264 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14265
14266 Implement strike-through and overline on NextStep (Bug#8863).
14267
14268 * nsfont.m (nsfont_open): Use underline position provided by font,
14269 instead of hard-coded value of 2.
14270 (nsfont_draw): Call ns_draw_text_decoration instead.
14271
14272 * nsterm.h: Add declaration for ns_draw_text_decoration.
14273
14274 * nsterm.m (ns_draw_text_decoration): New function for drawing
14275 underline, overline, and strike-through.
14276 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14277 ns_draw_text_decoration. Change treatment of cursor drawing to
14278 accommodate underlining, etc.
14279
14280 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14281
14282 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14283 default.
14284
14285 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14286
14287 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14288 Without this fix, if a signal arrives just after memory fills up,
14289 'malloc' might be invoked reentrantly.
14290
14291 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14292 In other words, assume that every image size is allowed, on non-X
14293 hosts. This assumption is probably wrong, but it lets Emacs compile.
14294
14295 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14296
14297 * regex.c (re_iswctype): Convert return values to boolean.
14298
14299 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14300
14301 * xdisp.c (compute_display_string_pos): Don't use cached display
14302 string position if the buffer had its restriction changed.
14303 (Bug#9184)
14304
14305 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14306
14307 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14308
14309 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14310
14311 Integer signedness and overflow and related fixes. (Bug#9079)
14312
14313 * bidi.c: Integer size and overflow fixes.
14314 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14315 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14316 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14317 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14318 (bidi_find_other_level_edge):
14319 Use ptrdiff_t instead of EMACS_INT where either will do.
14320 This works better on 32-bit hosts configured --with-wide-int.
14321 (bidi_cache_ensure_space): Check for size-calculation overflow.
14322 Use % rather than repeated addition, for better worst-case speed.
14323 Don't set bidi_cache_size until after xrealloc returns, because it
14324 might not return.
14325 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14326 (bidi_cache_ensure_space): Also check that the bidi cache size
14327 does not exceed that of the largest Lisp string or buffer. See Eli
14328 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14329
14330 * alloc.c (__malloc_size_t): Remove.
14331 All uses replaced by size_t. See Andreas Schwab's note
14332 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14333
14334 * image.c: Improve checking for integer overflow.
14335 (check_image_size): Assume that f is nonnull, since
14336 it is always nonnull in practice. This is one less thing to
14337 worry about when checking for integer overflow later.
14338 (x_check_image_size): New function, which checks for integer
14339 overflow issues inside X.
14340 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14341 This removes the need for a memory_full check.
14342 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14343 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14344 (xbm_read_bitmap_data): Change locals back to 'int', since
14345 their values must fit in 'int'.
14346 (xpm_load_image, png_load, tiff_load):
14347 Invoke x_create_x_image_and_pixmap earlier,
14348 to avoid much needless work if the image is too large.
14349 (tiff_load): Treat overly large images as if
14350 x_create_x_image_and_pixmap failed, not as malloc failures.
14351 (gs_load): Use x_check_image_size.
14352
14353 * gtkutil.c: Omit integer casts.
14354 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14355 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14356
14357 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14358
14359 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14360 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14361 would wrongly return t on a 64-bit host.
14362
14363 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14364 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14365 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14366 and therefore cause GCC to emit a bogus diagnostic in some cases.
14367
14368 * image.c: Integer signedness and overflow and related fixes.
14369 This is not an exhaustive set of fixes, but it's time to
14370 record what I've got.
14371 (lookup_pixel_color, check_image_size): Remove redundant decls.
14372 (check_image_size): Don't assume that arbitrary EMACS_INT values
14373 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14374 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14375 (tiff_load, imagemagick_load_image):
14376 Check for overflow in size calculations.
14377 (x_create_x_image_and_pixmap): Remove unnecessary test for
14378 xmalloc returning NULL; that can't happen.
14379 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14380 (xpm_color_bucket): Use better integer hashing function.
14381 (xpm_cache_color): Don't possibly over-allocate memory.
14382 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14383 (gif_memory_source):
14384 Use ptrdiff_t, not int or size_t, to record sizes.
14385 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14386 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14387 either works, as we prefer signed integers.
14388 (tiff_read_from_memory, tiff_write_from_memory):
14389 Return tsize_t, not size_t, since that's what the TIFF API wants.
14390 (tiff_read_from_memory): Don't fail simply because the read would
14391 go past EOF; instead, return a short read.
14392 (tiff_load): Omit no-longer-needed casts.
14393 (Fimagemagick_types): Don't assume size fits into 'int'.
14394
14395 Improve hashing quality when configured --with-wide-int.
14396 * fns.c (hash_string): New function, taken from sxhash_string.
14397 Do not discard information about ASCII character case; this
14398 discarding is no longer needed.
14399 (sxhash-string): Use it. Change sig to match it. Caller changed.
14400 * lisp.h: Declare it.
14401 * lread.c (hash_string): Remove, since we now use fns.c's version.
14402 The fns.c version returns a wider integer if --with-wide-int is
14403 specified, so this should help the quality of the hashing a bit.
14404
14405 * emacs.c: Integer overflow minor fix.
14406 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14407 Define only if GNU_LINUX.
14408 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14409
14410 * dispnew.c: Integer signedness and overflow fixes.
14411 Remove unnecessary forward decls, that were a maintenance hassle.
14412 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14413 All uses changed.
14414 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14415 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14416 (prepare_desired_row, line_draw_cost):
14417 Use int, not unsigned, where either works.
14418 (save_current_matrix, restore_current_matrix):
14419 Use ptrdiff_t, not size_t, where either works.
14420 (init_display): Check for overflow more accurately, and without
14421 relying on undefined behavior.
14422
14423 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14424 Remove, replacing with the new symbols in lisp.h. All uses changed.
14425 * fileio.c (make_temp_name):
14426 * filelock.c (lock_file_1, lock_file):
14427 * xdisp.c (message_dolog):
14428 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14429 Use pMd etc. instead.
14430 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14431 replacing the pWIDE etc. symbols removed from editfns.c.
14432
14433 * keyboard.h (num_input_events): Now uintmax_t.
14434 This is (very slightly) less likely to mess up due to wraparound.
14435 All uses changed.
14436
14437 * buffer.c: Integer signedness fixes.
14438 (alloc_buffer_text, enlarge_buffer_text):
14439 Use ptrdiff_t rather than size_t when either will do, as we prefer
14440 signed integers.
14441
14442 * alloc.c: Integer signedness and overflow fixes.
14443 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14444 (__malloc_size_t): Default to size_t, not to int.
14445 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14446 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14447 Prefer ptrdiff_t to size_t when either would do, as we prefer
14448 signed integers.
14449 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14450 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14451 Now const. Initialize with values that are in range even if char
14452 is signed.
14453 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14454 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14455 These functions do the right thing with sizes > 2**32.
14456 (check_depth): Now ptrdiff_t, not int.
14457 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14458 Adjust to new way of storing sizes. Check for size overflow bugs
14459 in rest of code.
14460 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14461 slightly wrong anyway, as it missed one instance of
14462 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14463 (refill_memory_reserve): Omit needless cast to size_t.
14464 (mark_object_loop_halt): Mark as externally visible.
14465
14466 * xselect.c: Integer signedness and overflow fixes.
14467 (Fx_register_dnd_atom, x_handle_dnd_message):
14468 Use ptrdiff_t, not size_t, since we prefer signed.
14469 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14470 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14471 x_dnd_atoms_size and x_dnd_atoms_length.
14472
14473 * doprnt.c: Prefer signed to unsigned when either works.
14474 * eval.c (verror):
14475 * doprnt.c (doprnt):
14476 * lisp.h (doprnt):
14477 * xdisp.c (vmessage):
14478 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14479 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14480 prefer signed arithmetic to avoid comparison confusion.
14481 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14482 but is a bit tricky.
14483
14484 Assume freestanding C89 headers, string.h, stdlib.h.
14485 * data.c, doprnt.c, floatfns.c, print.c:
14486 Include float.h unconditionally.
14487 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14488 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14489 * regex.c: Likewise for stddef.h, string.h.
14490 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14491 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14492 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14493 (STDC_HEADERS): Remove obsolete defines.
14494 * sysdep.c: Include limits.h unconditionally.
14495
14496 Assume support for memcmp, memcpy, memmove, memset.
14497 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14498 * regex.c (memcmp, memcpy):
14499 Remove; we assume C89 now.
14500
14501 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14502 (__malloc_safe_bcopy): Remove; no longer needed.
14503
14504 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14505 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14506 well either way, and we prefer signed to unsigned.
14507
14508 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14509
14510 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14511 closes the connection while we're reading (bug#9182).
14512
14513 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14514
14515 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14516 are specified (Bug#9168).
14517
14518 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14519
14520 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14521 Found by GCC static checking and --with-wide-int on a 32-bit host.
14522
14523 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14524
14525 * xdisp.c (compute_display_string_pos): Fix logic of caching
14526 previous display string position. Initialize cached_prev_pos to
14527 -1. Fixes slow-down at the beginning of a buffer.
14528
14529 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14530
14531 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14532 for attrs[LFACE_FONTSET_INDEX].
14533
14534 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14535
14536 * xml.c (parse_region): Remove unused local
14537 that was recently introduced.
14538
14539 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14540
14541 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14542 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14543
14544 * xdisp.c (move_it_in_display_line_to): Record the best matching
14545 position for TO_CHARPOS while scanning the line, and restore it on
14546 exit if none of the characters scanned was an exact match.
14547 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14548 when exact match is impossible due to invisible text, and the
14549 lines are truncated.
14550
14551 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14552
14553 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14554 for OSX >= 10.7.
14555
14556 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14557
14558 Fix a significant slow-down of cursor motion with C-n, C-p,
14559 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14560 auto-repeat under bidi redisplay in fontified buffers.
14561 * xdisp.c (compute_stop_pos_backwards): New function.
14562 (next_element_from_buffer): Call compute_stop_pos_backwards to
14563 find a suitable prev_stop when we find ourselves before
14564 base_level_stop.
14565 (reseat): Don't look for prev_stop, as that could mean a very long
14566 run.
14567 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14568 <cached_disp_overlay_modiff>: Cache for last found display string
14569 position.
14570 (compute_display_string_pos): Return the cached position if asked
14571 about the same buffer in the same area of character positions, and
14572 the buffer wasn't changed since the time the display string
14573 position was cached.
14574
14575 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14576
14577 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14578 is an integer, which is important for empty lines. (Bug#9149)
14579
14580 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14581
14582 * frame.c (Fmodify_frame_parameters): In tty case, update the
14583 default face if necessary (Bug#4238).
14584
14585 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14586
14587 * editfns.c (Fstring_to_char): No need to explain what a character
14588 is in the docstring (Bug#6576).
14589
14590 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14591
14592 * xml.c (parse_region): Make sure we always return a tree.
14593
14594 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14595
14596 * xml.c (parse_region): If a document contains only comments,
14597 return that, too.
14598
14599 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14600
14601 * xml.c (make_dom): Return comments, too.
14602
14603 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14604
14605 Port to OpenBSD.
14606 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14607 and the surrounding thread.
14608 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14609 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14610 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14611 timer goes off.
14612 * s/openbsd.h (BROKEN_SIGIO): Define.
14613 * unexelf.c (unexec) [__OpenBSD__]:
14614 Don't update the .mdebug section of the Alpha COFF symbol table.
14615
14616 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14617
14618 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14619 (bug#8460).
14620
14621 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14622
14623 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14624 This fixes some race conditions on the permissions of any newly
14625 created file.
14626
14627 * alloc.c (valid_pointer_p): Use pipe, not open.
14628 This fixes some permissions issues when debugging.
14629
14630 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14631 If fchown fails to set both uid and gid, try to set just gid,
14632 as that is sometimes allowed. Adjust the file's mode to eliminate
14633 setuid or setgid bits that are inappropriate if fchown fails.
14634
14635 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14636
14637 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14638 to compare Lisp_Objects.
14639 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14640 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14641 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14642
14643 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14644
14645 * lread.c (read_integer): Unread even EOF character.
14646 (read1): Likewise. Properly record start position of symbol.
14647
14648 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14649 symbol character follows.
14650
14651 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14652
14653 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14654 This works around a problem with the previous change to Fcopy_file.
14655 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14656 and without this change, GCC might complain about discarding
14657 fchown's return value.
14658
14659 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14660
14661 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14662
14663 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14664
14665 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14666
14667 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14668
14669 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14670 it's used from the C level.
14671
14672 * process.c: Use the same condition for POLL_FOR_INPUT in both
14673 keyboard.c and process.c (bug#1858).
14674
14675 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14676
14677 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14678 (Fgnutls_boot): Use it.
14679
14680 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14681
14682 * doc.c (Fsubstitute_command_keys): Revert last change.
14683
14684 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14685
14686 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14687 quotes the next character, and doesn't affect other longer
14688 sequences (bug#8935).
14689
14690 * lread.c (syms_of_lread): Clarify that is isn't only
14691 `eval-buffer' and `eval-defun' that's affected by
14692 `lexical-binding' (bug#8460).
14693
14694 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14695
14696 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14697 bidi redisplay when a line includes both an image and is truncated.
14698
14699 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14700
14701 Fix minor problems found by static checking.
14702 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14703 (elsz): Now a signed constant, not a size_t var. We prefer signed
14704 types to unsigned, to avoid integer comparison confusion. Without
14705 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14706 "cannot optimize loop, the loop counter may overflow", a symptom
14707 of the confusion.
14708 * indent.c (Fvertical_motion): Mark locals as initialized.
14709 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14710
14711 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14712
14713 * search.c (Fre_search_backward): Mention `case-fold-search' in
14714 all the re_search_* functions (bug#8138).
14715
14716 * keyboard.c (Fopen_dribble_file): Document when the file is
14717 closed (bug#8056).
14718
14719 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14720
14721 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14722 bidi_cache_idx.
14723
14724 Support bidi reordering of display and overlay strings.
14725 * xdisp.c (compute_display_string_pos)
14726 (compute_display_string_end): Accept additional argument STRING.
14727 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14728 (reseat_to_string): Initialize bidi_it->string.s and
14729 bidi_it->string.schars.
14730 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14731 NULL (avoids a crash in bidi_paragraph_init).
14732 Initialize itb.string.lstring.
14733 (init_iterator): Call bidi_init_it only of a valid
14734 buffer position was specified. Initialize paragraph_embedding to
14735 L2R.
14736 (reseat_to_string): Initialize the bidi iterator.
14737 (display_string): If we need to ignore text properties of
14738 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14739 original value of -1 will not work with bidi.)
14740 (compute_display_string_pos): First arg is now struct
14741 `text_pos *'; all callers changed. Support display properties on
14742 Lisp strings.
14743 (compute_display_string_end): Support display properties on Lisp
14744 strings.
14745 (init_iterator, reseat_1, reseat_to_string): Initialize the
14746 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14747 when iterating on a string not from display properties).
14748 (compute_display_string_pos, compute_display_string_end):
14749 Fix calculation of the object to scan. Fixes an error when using
14750 arrow keys.
14751 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14752 base_level_stop; instead, set base_level_stop to BEGV.
14753 Fixes crashes in vertical-motion.
14754 (next_element_from_buffer): Improve commentary for when
14755 the iterator is before prev_stop.
14756 (init_iterator): Initialize bidi_p from the default value of
14757 bidi-display-reordering, not from buffer-local value. Use the
14758 buffer-local value only if initializing for buffer iteration.
14759 (handle_invisible_prop): Support invisible properties on strings
14760 that are being bidi-reordered.
14761 (set_iterator_to_next): Support bidi reordering of C strings and
14762 Lisp strings.
14763 (next_element_from_string): Support bidi reordering of Lisp
14764 strings.
14765 (handle_stop_backwards): Support Lisp strings as well.
14766 (display_string): Support display of R2L glyph rows.
14767 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14768 (init_iterator): Don't initialize it->bidi_p for strings
14769 here.
14770 (reseat_to_string): Initialize it->bidi_p for strings here.
14771 (next_element_from_string, next_element_from_c_string)
14772 (next_element_from_buffer): Add xassert's for correspondence
14773 between IT's object being iterated and it->bidi_it.string
14774 structure.
14775 (face_before_or_after_it_pos): Support bidi iteration.
14776 (next_element_from_c_string): Handle the case of the first string
14777 character that is not the first one in the visual order.
14778 (get_visually_first_element): New function, refactored from common
14779 parts of next_element_from_buffer, next_element_from_string, and
14780 next_element_from_c_string.
14781 (tool_bar_lines_needed, redisplay_tool_bar)
14782 (display_menu_bar): Force left-to-right direction. Add a FIXME
14783 comment for making that be controlled by a user option.
14784 (push_it, pop_it): Save and restore the state of the
14785 bidi iterator. Save and restore the bidi_p flag.
14786 (pop_it): Iterate out of display property for string iteration as
14787 well.
14788 (iterate_out_of_display_property): Support iteration over strings.
14789 (handle_single_display_spec): Set up it->bidi_it for iteration
14790 over a display string, and call bidi_init_it.
14791 (handle_single_display_spec, next_overlay_string)
14792 (get_overlay_strings_1, push_display_prop): Set up the bidi
14793 iterator for displaying display or overlay strings.
14794 (forward_to_next_line_start): Don't use the shortcut if
14795 bidi-iterating.
14796 (back_to_previous_visible_line_start): If handle_display_prop
14797 pushed the iterator stack, restore the internal state of the bidi
14798 iterator by calling bidi_pop_it same number of times.
14799 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14800 and we are bidi-iterating, don't decrement the iterator position;
14801 instead, set the first_elt flag in the bidi iterator, to produce
14802 the same effect.
14803 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14804 (push_display_prop): xassert that we are iterating a buffer.
14805 (push_it, pop_it): Save and restore paragraph_embedding member.
14806 (handle_single_display_spec, next_overlay_string)
14807 (get_overlay_strings_1, reseat_1, reseat_to_string)
14808 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14809 correctly. Don't assume unibyte strings are not bidi-reordered.
14810 (compute_display_string_pos)
14811 (compute_display_string_end): Fix handling the case of C string.
14812 (push_it, pop_it): Save and restore from_disp_prop_p.
14813 (handle_single_display_spec, push_display_prop): Set the
14814 from_disp_prop_p flag.
14815 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14816 (pop_it): Call iterate_out_of_display_property only if we are
14817 popping after iteration over a string that came from a display
14818 property. Fix a typo in popping stretch info. Add an assertion
14819 for verifying that the iterator position is in sync with the bidi
14820 iterator.
14821 (handle_single_display_spec, get_overlay_strings_1)
14822 (push_display_prop): Fix initialization of paragraph direction for
14823 string when that of the parent object is not yet determined.
14824 (reseat_1): Call bidi_init_it to resync the bidi
14825 iterator with IT's position. (Bug#7616)
14826 (find_row_edges): If ROW->start.pos gives position
14827 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14828 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14829 Reset the from_disp_prop_p flag.
14830 (SAVE_IT, RESTORE_IT): New macros.
14831 (pos_visible_p, face_before_or_after_it_pos)
14832 (back_to_previous_visible_line_start)
14833 (move_it_in_display_line_to, move_it_in_display_line)
14834 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14835 (try_scrolling, redisplay_window, display_line): Use them when
14836 saving a temporary copy of the iterator and restoring it back.
14837 (back_to_previous_visible_line_start, reseat_1)
14838 (init_iterator): Empty the bidi cache "stack".
14839 (move_it_in_display_line_to): If iterator ended up at
14840 EOL, but we never saw any buffer positions smaller than
14841 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14842 motion in bidi-reordered lines.
14843 (move_it_in_display_line_to): Record prev_method and prev_pos
14844 immediately before the call to set_iterator_to_next. Fixes cursor
14845 motion in bidi-reordered lines with stretch glyphs and strings
14846 displayed in margins. (Bug#8133) (Bug#8867)
14847 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14848 TO_CHARPOS.
14849 (pos_visible_p): Support positions in bidi-reordered lines.
14850 Save and restore bidi cache.
14851
14852 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14853 (bidi_paragraph_info): Delete unused struct.
14854 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14855 (bidi_cache_start): New variable.
14856 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14857 to zero.
14858 (bidi_cache_fetch_state, bidi_cache_search)
14859 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14860 (bidi_cache_find, bidi_peek_at_next_level)
14861 (bidi_level_of_next_char, bidi_find_other_level_edge)
14862 (bidi_move_to_visually_next): Compare cache index with
14863 bidi_cache_start rather than with zero.
14864 (bidi_fetch_char): Accept new argument STRING; all callers
14865 changed. Support iteration over a string. Support strings with
14866 display properties. Support unibyte strings. Fix the type of
14867 `len' according to what STRING_CHAR_AND_LENGTH expects.
14868 (bidi_paragraph_init, bidi_resolve_explicit_1)
14869 (bidi_resolve_explicit, bidi_resolve_weak)
14870 (bidi_level_of_next_char, bidi_move_to_visually_next):
14871 Support iteration over a string.
14872 (bidi_set_sor_type, bidi_resolve_explicit_1)
14873 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14874 can now be zero (for strings); special values 0 and -1 were
14875 changed to -1 and -2, respectively.
14876 (bidi_char_at_pos): New function.
14877 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14878 Call it instead of FETCH_MULTIBYTE_CHAR.
14879 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14880 initialized to valid values.
14881 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14882 values.
14883 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14884 the test for valid cached positions. Fix the logic for looking up
14885 the sentinel state in the cache. GCPRO the Lisp string we are
14886 iterating.
14887 (bidi_push_it, bidi_pop_it): New functions.
14888 (bidi_initialize): Initialize the bidi cache start stack pointer.
14889 (bidi_cache_ensure_space): New function, refactored from part of
14890 bidi_cache_iterator_state. Don't assume the required size is just
14891 one BIDI_CACHE_CHUNK away.
14892 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14893 (bidi_count_bytes, bidi_char_at_pos): New functions.
14894 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14895 always valid if bidi_cache_idx is valid.
14896 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14897 is valid if it's going to be used.
14898 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14899 (bidi_cache_fetch_state, bidi_cache_search)
14900 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14901 (bidi_cache_iterator_state, bidi_cache_find)
14902 (bidi_find_other_level_edge, bidi_cache_start_stack):
14903 All variables related to cache indices are now EMACS_INT.
14904
14905 * dispextern.h (struct bidi_string_data): New structure.
14906 (struct bidi_it): New member `string'. Make flag members be 1-bit
14907 fields, and put them last in the struct.
14908 (compute_display_string_pos, compute_display_string_end):
14909 Update prototypes.
14910 (bidi_push_it, bidi_pop_it): Add prototypes.
14911 (struct iterator_stack_entry): New members bidi_p,
14912 paragraph_embedding, and from_disp_prop_p.
14913 (struct it): Member bidi_p is now a bit field 1 bit wide.
14914 (bidi_shelve_cache, bidi_unshelve_cache):
14915 Declare prototypes.
14916
14917 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14918 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14919 and vector-like objects.
14920
14921 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14922 cache around display iteration.
14923
14924 * window.c (Fwindow_end, window_scroll_pixel_based)
14925 (displayed_window_lines, Frecenter): Save and restore the bidi
14926 cache around display iteration.
14927
14928 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14929
14930 * editfns.c (Fdelete_region): Clarify the use of the named
14931 parameters (bug#6788).
14932
14933 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14934
14935 * indent.c (Fvertical_motion): Set and restore w->pointm when
14936 saving and restoring the window's buffer (Bug#9006).
14937
14938 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14939
14940 * editfns.c (Fstring_to_char): Clarify just what is returned
14941 (bug#6576). Text by Eli Zaretskii.
14942
14943 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14944
14945 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14946
14947 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14948
14949 * buffer.c (mmap_find): Fix a typo.
14950
14951 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14952
14953 Fix execution of x selection hooks.
14954 * xselect.c (Qx_lost_selection_functions)
14955 (Qx_sent_selection_functions): New vars.
14956 (syms_of_xselect): DEFSYM them.
14957 (x_handle_selection_request): Pass Qx_sent_selection_functions
14958 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14959 (x_handle_selection_clear,x_clear_frame_selections):
14960 Pass Qx_lost_selection_functions rather than
14961 Vx_lost_selection_functions to Frun_hook_with_args.
14962
14963 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14964
14965 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14966 The old code sometimes used this field without initializing it.
14967
14968 * alloc.c (gc_sweep): Don't read past end of array.
14969 In theory, the old code could also have corrupted Emacs internals,
14970 though it'd be very unlikely.
14971
14972 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14973
14974 * character.c (Fcharacterp): Don't advertise optional ignored
14975 argument. (Bug#4026)
14976
14977 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14978
14979 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14980 key" (bug#4257).
14981
14982 * window.c (Fset_window_start): Doc fix (bug#4199).
14983 (Fset_window_hscroll): Ditto.
14984
14985 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14986
14987 Fix minor new problems caught by GCC 4.6.1.
14988 * term.c (init_tty): Remove unused local.
14989 * xsettings.c (store_monospaced_changed): Define this function only
14990 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14991 not used otherwise.
14992
14993 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14994
14995 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14996
14997 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14998
14999 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15000 are the mini-buffer and the echo area (bug#3320).
15001
15002 * term.c (init_tty): Remove support for supdup, c10 and perq
15003 terminals, which are no longer supported (bug#1482).
15004
15005 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15006
15007 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15008
15009 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15010
15011 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15012 for non-popups (Bug#3642).
15013
15014 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15015
15016 * alloc.c (reset_malloc_hooks): Protoize.
15017 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15018 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15019 * cm.c (losecursor): Likewise.
15020 * data.c (fmod): Likewise.
15021 * dispnew.c (swap_glyphs_in_rows): Likewise.
15022 * emacs.c (memory_warning_signal): Likewise.
15023 * floatfns.c (float_error): Likewise.
15024 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15025 (otf_open, font_otf_capability, generate_otf_features)
15026 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15027 Likewise.
15028 * image.c (pbm_read_file): Likewise.
15029 * indent.c (string_display_width): Likewise.
15030 * intervals.c (check_for_interval, search_for_interval)
15031 (inc_interval_count, count_intervals, root_interval)
15032 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15033 * lread.c (defalias): Likewise.
15034 * ralloc.c (r_alloc_check): Likewise.
15035 * regex.c (set_image_of_range_1, set_image_of_range)
15036 (regex_grow_registers): Likewise.
15037 * sysdep.c (strerror): Likewise.
15038 * termcap.c (valid_filename_p, tprint, main): Likewise.
15039 * tparam.c (main): Likewise.
15040 * unexhp9k800.c (run_time_remap, save_data_space)
15041 (update_file_ptrs, read_header, write_header, calculate_checksum)
15042 (copy_file, copy_rest, display_header): Likewise.
15043 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15044 Likewise.
15045 * xdisp.c (check_it): Likewise.
15046 * xfaces.c (register_color, unregister_color, unregister_colors):
15047 Likewise.
15048 * xfns.c (print_fontset_result): Likewise.
15049 * xrdb.c (member, fatal, main): Likewise.
15050
15051 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15052
15053 Fix minor problems found by static checking (Bug#9031).
15054 * chartab.c (char_table_set_range, map_sub_char_table):
15055 Remove unused locals.
15056 (uniprop_table): Now static.
15057 * composite.c (_work_char): Remove unused static var.
15058
15059 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15060
15061 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15062
15063 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15064
15065 * gtkutil.c (qttip_cb): Remove code without function.
15066
15067 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15068
15069 * w32.c (pthread_sigmask): New stub.
15070
15071 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15072
15073 Use pthread_sigmask, not sigprocmask (Bug#9010).
15074 sigprocmask is portable only for single-threaded applications, and
15075 Emacs can be multi-threaded when it uses GTK.
15076 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15077 (LIBES): Use it.
15078 * callproc.c (Fcall_process):
15079 * process.c (create_process):
15080 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15081 Use pthread_sigmask, not sigprocmask.
15082
15083 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15084
15085 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15086 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15087 wrong (Bug#8591).
15088
15089 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15090
15091 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15092 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15093 (xg_hide_tooltip): Fix comment.
15094
15095 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15096 in registerServicesMenuSendTypes.
15097 (validRequestorForSendType): Don't check ns_return_types.
15098
15099 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15100 ns_return_type.
15101
15102 2011-07-08 Jason Rumney <jasonr@gnu.org>
15103
15104 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15105 SH_SHOW for hidden windows (Bug#5482).
15106
15107 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15108 frame struct members of non-existent frames (Bug#6284).
15109
15110 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15111
15112 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15113 variable firstTime not needed on OSX >= 10.6.
15114 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15115 >= 10.5. Use setKnobProportion, setDoubleValue.
15116
15117 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15118 (MAC_OS_X_VERSION_10_5): Define if not defined.
15119 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15120 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15121 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15122
15123 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15124 cString and lossyCString on OSX >= 10.4.
15125
15126 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15127 sizeToFit on OSX >= 10.2.
15128
15129 * nsimage.m (allocInitFromFile): Don't use deprecated method
15130 bestRepresentationForDevice on OSX >= 10.6.
15131
15132 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15133 to avoid warning.
15134
15135 * emacs.c: Declare unexec_init_emacs_zone.
15136
15137 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15138
15139 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15140
15141 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15142 on svcsMenu (Bug#8842).
15143
15144 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15145 ns_return_types.
15146 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15147
15148 * nsterm.m (QUTF8_STRING): Declare.
15149 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15150 (validRequestorForSendType): Return type is (id).
15151 Change indexOfObjectIdenticalTo to indexOfObject.
15152 Check if we have local selection before returning self (Bug#8842).
15153 (writeSelectionToPasteboard): Put local selection into paste board
15154 if we have a local selection (Bug#8842).
15155 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15156
15157 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15158 (ns_get_local_selection): Declare.
15159
15160 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15161
15162 * keymap.c (describe_map_tree): Don't insert a double newline at
15163 the end of the buffer (bug#1169) and return whether we inserted
15164 something.
15165
15166 * callint.c (Fcall_interactively): Change "reading args" to
15167 "providing args" to try to clarify what it does (bug#1010).
15168
15169 2011-07-07 Kenichi Handa <handa@m17n.org>
15170
15171 * composite.c (composition_compute_stop_pos): Ignore a static
15172 composition starting before CHARPOS (Bug#8915).
15173
15174 * xdisp.c (handle_composition_prop): Likewise.
15175
15176 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15177
15178 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15179 (Bug#9015)
15180
15181 2011-07-07 Kenichi Handa <handa@m17n.org>
15182
15183 * character.h (unicode_category_t): New enum type.
15184
15185 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15186 (Qchar_code_property_table): New variable.
15187 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15188 (UNIPROP_COMPRESSED_FORM_P): New macros.
15189 (char_table_ascii): Uncompress the compressed values.
15190 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15191 Uncompress the compressed values.
15192 (sub_char_table_ref_and_range): Likewise.
15193 (char_table_ref_and_range): Uncompress the compressed values.
15194 (sub_char_table_set): New arg is_uniprop. Callers changed.
15195 Uncompress the compressed values.
15196 (sub_char_table_set_range): Args changed. Callers changed.
15197 (char_table_set_range): Adjuted for the above change.
15198 (map_sub_char_table): Delete args default_val and parent. Add arg
15199 top. Give decoded values to a Lisp function.
15200 (map_char_table): Adjust for the above change. Give decoded
15201 values to a Lisp function. Gcpro more variables.
15202 (uniprop_table_uncompress)
15203 (uniprop_decode_value_run_length): New functions.
15204 (uniprop_decoder, uniprop_decoder_count): New variables.
15205 (uniprop_get_decoder, uniprop_encode_value_character)
15206 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15207 New functions.
15208 (uniprop_encoder, uniprop_encoder_count): New variables.
15209 (uniprop_get_encoder, uniprop_table)
15210 (Funicode_property_table_internal, Fget_unicode_property_internal)
15211 (Fput_unicode_property_internal): New functions.
15212 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15213 Sunicode_property_table_internal, Sget_unicode_property_internal,
15214 and Sput_unicode_property_internal. Defvar_lisp
15215 char-code-property-alist.
15216
15217 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15218 Vunicode_category_table.
15219
15220 * font.c (font_range): Adjust for the change of
15221 Vunicode_category_table.
15222
15223 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15224
15225 * m/iris4d.h: Remove file, move contents ...
15226 * s/irix6-5.h: ... here.
15227
15228 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15229
15230 Remove unportable assumption about struct layout (Bug#8884).
15231 * alloc.c (mark_buffer):
15232 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15233 (clone_per_buffer_values): Don't assume that
15234 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15235 This isn't true in general, and it's particularly not true
15236 if Emacs is configured with --with-wide-int.
15237 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15238 New macros, used in the buffer.c change.
15239
15240 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15241
15242 * xsettings.c: Use both GConf and GSettings if both are available.
15243 (store_config_changed_event): Add comment.
15244 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15245 (store_tool_bar_style_changed): New functions.
15246 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15247 (struct xsettings): Move font inside HAVE_XFT.
15248 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15249 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15250 Move inside HAVE_XFT.
15251 (something_changed_gsettingsCB): Rename from something_changedCB.
15252 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15253 also.
15254 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15255 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15256 (something_changed_gconfCB): Rename from something_changedCB.
15257 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15258 (parse_settings): Move check for font inside HAVE_XFT.
15259 (read_settings, apply_xft_settings): Add comment.
15260 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15261 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15262 call store_font_name_changed.
15263 (xft_settings_event): Add comment.
15264 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15265 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15266 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15267 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15268 (xsettings_initialize): Call init_gsettings last.
15269 (xsettings_get_system_font, xsettings_get_system_normal_font):
15270 Add comment.
15271
15272 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15273
15274 Random fixes. E.g., (random) never returned negative values.
15275 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15276 subseconds part to the entropy, as that's a bit more random.
15277 Prefer signed to unsigned, since the signedness doesn't matter and
15278 in general we prefer signed. When given a limit, use a
15279 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15280 latter isn't right if USE_2_TAGS_FOR_INTS.
15281 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15282 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15283
15284 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15285
15286 * textprop.c (text_property_stickiness):
15287 Obey Vtext_property_default_nonsticky.
15288 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15289 * w32fns.c (syms_of_w32fns):
15290 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15291
15292 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15293
15294 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15295 This is more efficient than Ffile_directory_p and avoids a minor race.
15296
15297 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15298
15299 * buffer.c (Foverlay_put): Say what the return value is
15300 (bug#7835).
15301
15302 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15303 is a directory before asking whether to use the file name
15304 (bug#7564).
15305 (barf_or_query_if_file_exists): Make the "File is a directory"
15306 error be more correct.
15307
15308 * fns.c (Frequire): Remove the mention of the .gz files, since
15309 that's installation-specific, but keep the mention of
15310 `get-load-suffixes'.
15311
15312 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15313
15314 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15315 Report string overflow if the output is too long.
15316
15317 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15318
15319 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15320 (syms_of_gnutls): Remove duplicate DEFSYM for
15321 Qgnutls_bootprop_verify_hostname_error, an error for
15322 Qgnutls_bootprop_verify_error (which is no longer used).
15323
15324 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15325 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15326 Also (re)move comments that are misplaced or no longer relevant.
15327
15328 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15329
15330 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15331
15332 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15333
15334 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15335 and background color parameters if they have been changed.
15336
15337 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15338
15339 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15340
15341 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15342
15343 * xsettings.c (SYSTEM_FONT): Define only when used.
15344 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15345
15346 * keymap.c (access_keymap_1): Now static.
15347
15348 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15349
15350 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15351 leave any prefix arg for the up event (Bug#1586).
15352
15353 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15354
15355 * lread.c (syms_of_lread): Mention single symbols defined by
15356 `defvar' or `defconst' (bug#7154).
15357
15358 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15359 (Frequire): Mention get-load-suffixes.
15360
15361 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15362
15363 * window.h (window): Remove clone_number slot.
15364 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15365 Remove.
15366 (make_parent_window, make_window, saved_window)
15367 (Fset_window_configuration, save_window_save): Don't deal with
15368 clone numbers.
15369 * buffer.c (Qclone_number): Remove declaration.
15370 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15371
15372 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15373
15374 Add multiple inheritance to keymaps.
15375 * keymap.c (Fmake_composed_keymap): New function.
15376 (Fset_keymap_parent): Simplify.
15377 (fix_submap_inheritance): Remove.
15378 (access_keymap_1): New function extracted from access_keymap to handle
15379 embedded parents and handle lists of maps.
15380 (access_keymap): Use it.
15381 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15382 (Fcopy_keymap): Handle embedded parents.
15383 (Fcommand_remapping, define_as_prefix): Simplify.
15384 (Fkey_binding): Simplify.
15385 (syms_of_keymap): Move minibuffer-local-completion-map,
15386 minibuffer-local-filename-completion-map,
15387 minibuffer-local-must-match-map, and
15388 minibuffer-local-filename-must-match-map to Elisp.
15389 (syms_of_keymap): Defsubr make-composed-keymap.
15390 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15391 (parse_menu_item): Trivial simplification.
15392
15393 2011-07-01 Glenn Morris <rgm@gnu.org>
15394
15395 * Makefile.in (SETTINGS_LIBS): Fix typo.
15396
15397 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15398
15399 * coding.c (Fencode_coding_string): Record the last coding system
15400 used, as the function doc string says (bug#8738).
15401
15402 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15403
15404 * xsettings.c (store_monospaced_changed): Take new font as arg and
15405 check for change against current_mono_font.
15406 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15407 (emacs_settings_constructor, emacs_settings_get_property)
15408 (emacs_settings_set_property, emacs_settings_class_init)
15409 (emacs_settings_init, gsettings_obj): Remove.
15410 (something_changedCB): New function for HAVE_GSETTINGS.
15411 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15412 with value as argument.
15413 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15414 g_settings_new (Bug#8967). Do not create gsettings_obj.
15415 Remove calls to g_settings_bind. Connect something_changedCB to
15416 "changed".
15417
15418 * xgselect.c: Add defined (HAVE_GSETTINGS).
15419 (xgselect_initialize): Ditto.
15420
15421 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15422 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15423 xg_select.
15424
15425 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15426
15427 * eval.c (struct backtrace): Simplify and port the data structure.
15428 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15429 signed bit field, as this assumption is not portable and it makes
15430 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15431 "char debug_on_exit : 1" as this is not portable either; instead,
15432 use the portable "unsigned int debug_on_exit : 1". Remove unused
15433 member evalargs. Remove obsolete comments about cc bombing out.
15434
15435 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15436
15437 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15438 Let HAVE_GSETTINGS override HAVE_GCONF.
15439 (store_monospaced_changed): New function.
15440 (EMACS_SETTINGS): A new type derived from GObject to handle
15441 GSettings notifications.
15442 (emacs_settings_constructor, emacs_settings_get_property)
15443 (emacs_settings_set_property, emacs_settings_class_init):
15444 New functions.
15445 (gsettings_client, gsettings_obj): New variables.
15446 (GSETTINGS_SCHEMA): New define.
15447 (something_changedCB): Call store_monospaced_changed.
15448 (init_gsettings): New function.
15449 (xsettings_initialize): Call init_gsettings.
15450 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15451 to NULL.
15452
15453 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15454 GCONF_CFLAGS/LIBS.
15455
15456 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15457
15458 * window.c (resize_root_window, grow_mini_window)
15459 (shrink_mini_window): Rename Qresize_root_window to
15460 Qwindow_resize_root_window and Qresize_root_window_vertically to
15461 Qwindow_resize_root_window_vertically.
15462
15463 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15464
15465 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15466
15467 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * makefile.w32-in: Redesign dependencies so they reflect more
15470 clearly which files are directly included by each source file,
15471 and not through other includes.
15472
15473 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15474
15475 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15476 (sort_overlays, overlay_strings): When an overlay's clone number
15477 matches the window's clone number process the overlay even if
15478 the overlay's window property doesn't match the current window.
15479
15480 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15481 (Fwindow_hchild): Rename to Fwindow_left_child.
15482 (Fwindow_next): Rename to Fwindow_next_sibling.
15483 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15484 (resize_window_check): Rename to window_resize_check.
15485 (resize_window_apply): Rename to window_resize_apply.
15486 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15487 (Fdelete_other_windows_internal, resize_frame_windows)
15488 (Fsplit_window_internal, Fdelete_window_internal)
15489 (grow_mini_window, shrink_mini_window)
15490 (Fresize_mini_window_internal): Fix callers accordingly.
15491
15492 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15493
15494 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15495 (emacs_fixed_set_min_size): Remove.
15496 (emacs_fixed_new): Take frame as argument.
15497
15498 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15499 (_EmacsFixedPrivate): Remove minwidth/height.
15500 Add struct frame *f.
15501 (emacs_fixed_init): Initialize priv->f.
15502 (get_parent_class, emacs_fixed_set_min_size): Remove.
15503 (emacs_fixed_new): Set priv->f to argument.
15504 (emacs_fixed_get_preferred_width)
15505 (emacs_fixed_get_preferred_height): Use min_width/height from
15506 frames size_hint to set minimum and natural (Bug#8919).
15507 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15508 and use min_width/height from frames size_hint to set
15509 min_width/height (Bug#8919).
15510
15511 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15512 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15513 Fix indentation.
15514
15515 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15516
15517 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15518 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15519 called at ZV.
15520
15521 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15522
15523 * process.c (wait_reading_process_output): Bypass select if
15524 waiting for a cell while ignoring keyboard input, and input is
15525 pending. Suggested by Jan Djärv (Bug#8869).
15526
15527 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15528
15529 Use gnulib's dup2 module instead of rolling our own.
15530 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15531
15532 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15533
15534 * dispnew.c (scrolling_window): Before scrolling, turn off a
15535 mouse-highlight in the window being scrolled.
15536
15537 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15538
15539 Move DEFSYM to lisp.h and use everywhere.
15540
15541 * character.h (DEFSYM): Move declaration...
15542 * lisp.h (DEFSYM): ...here.
15543
15544 * gnutls.c:
15545 * minibuf.c:
15546 * w32menu.c:
15547 * w32proc.c:
15548 * w32select.c: Don't include character.h.
15549
15550 * alloc.c (syms_of_alloc):
15551 * buffer.c (syms_of_buffer):
15552 * bytecode.c (syms_of_bytecode):
15553 * callint.c (syms_of_callint):
15554 * casefiddle.c (syms_of_casefiddle):
15555 * casetab.c (init_casetab_once):
15556 * category.c (init_category_once, syms_of_category):
15557 * ccl.c (syms_of_ccl):
15558 * cmds.c (syms_of_cmds):
15559 * composite.c (syms_of_composite):
15560 * dbusbind.c (syms_of_dbusbind):
15561 * dired.c (syms_of_dired):
15562 * dispnew.c (syms_of_display):
15563 * doc.c (syms_of_doc):
15564 * editfns.c (syms_of_editfns):
15565 * emacs.c (syms_of_emacs):
15566 * eval.c (syms_of_eval):
15567 * fileio.c (syms_of_fileio):
15568 * fns.c (syms_of_fns):
15569 * frame.c (syms_of_frame):
15570 * fringe.c (syms_of_fringe):
15571 * insdel.c (syms_of_insdel):
15572 * keymap.c (syms_of_keymap):
15573 * lread.c (init_obarray, syms_of_lread):
15574 * macros.c (syms_of_macros):
15575 * msdos.c (syms_of_msdos):
15576 * print.c (syms_of_print):
15577 * process.c (syms_of_process):
15578 * search.c (syms_of_search):
15579 * sound.c (syms_of_sound):
15580 * syntax.c (init_syntax_once, syms_of_syntax):
15581 * terminal.c (syms_of_terminal):
15582 * textprop.c (syms_of_textprop):
15583 * undo.c (syms_of_undo):
15584 * w32.c (globals_of_w32):
15585 * window.c (syms_of_window):
15586 * xdisp.c (syms_of_xdisp):
15587 * xfaces.c (syms_of_xfaces):
15588 * xfns.c (syms_of_xfns):
15589 * xmenu.c (syms_of_xmenu):
15590 * xsettings.c (syms_of_xsettings):
15591 * xterm.c (syms_of_xterm): Use DEFSYM.
15592
15593 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15594
15595 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15596
15597 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15598
15599 Integer and buffer overflow fixes (Bug#8873).
15600
15601 * print.c (printchar, strout): Check for string overflow.
15602 (PRINTPREPARE, printchar, strout):
15603 Don't set size unless allocation succeeds.
15604
15605 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15606 for sizes. Check for string overflow more accurately.
15607 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15608
15609 * macros.c: Integer and buffer overflow fixes.
15610 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15611 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15612 Use ptrdiff_t, not int, for sizes.
15613 Don't increment bufsize until after realloc succeeds.
15614 Check for size-calculation overflow.
15615 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15616
15617 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15618
15619 * lread.c: Integer overflow fixes.
15620 (read_integer): Radix is now EMACS_INT, not int,
15621 to improve quality of diagnostics for out-of-range radices.
15622 Calculate buffer size correctly for out-of-range radices.
15623 (read1): Check for integer overflow in radices, and in
15624 read-circle numbers.
15625 (read_escape): Avoid int overflow.
15626 (Fload, openp, read_buffer_size, read1)
15627 (substitute_object_recurse, read_vector, read_list, map_obarray):
15628 Use ptrdiff_t, not int, for sizes.
15629 (read1): Use EMACS_INT, not int, for sizes.
15630 Check for size overflow.
15631
15632 * image.c (cache_image): Check for size arithmetic overflow.
15633
15634 * lread.c: Integer overflow issues.
15635 (saved_doc_string_size, saved_doc_string_length)
15636 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15637 Now ptrdiff_t, not int.
15638 (read1): Don't assume doc string length fits in int. Check for
15639 out-of-range doc string lengths.
15640 (read_list): Don't assume file position fits in int.
15641 (read_escape): Check for hex character overflow.
15642
15643 2011-06-22 Leo Liu <sdl.web@gmail.com>
15644
15645 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15646 Move to minibuffer.el.
15647
15648 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15649
15650 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15651 The following patches are for when GLYPH_DEBUG && !XASSERT.
15652 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15653 * dispnew.c (flush_stdout):
15654 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15655 Mark as externally visible.
15656 * dispnew.c (check_window_matrix_pointers): Now static.
15657 * dispnew.c (window_to_frame_vpos):
15658 * xfns.c (unwind_create_frame):
15659 * xterm.c (x_check_font): Remove unused local.
15660 * scroll.c (CHECK_BOUNDS):
15661 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15662 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15663 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15664 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15665 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15666 Now static.
15667 (debug_method_add): Use va_list and vsprintf rather than relying
15668 on undefined behavior with wrong number of arguments.
15669 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15670 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15671 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15672 since we're not interested in debugging glyphs with old libraries.
15673 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15674 GCC 4.6.0's static checking.
15675
15676 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15677
15678 Integer overflow and signedness fixes (Bug#8873).
15679 A few related buffer overrun fixes, too.
15680
15681 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15682
15683 * dispextern.h (struct face.stipple):
15684 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15685 (x_bitmap_mask, x_allocate_bitmap_record)
15686 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15687 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15688 (x_create_bitmap_from_xpm_data):
15689 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15690 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15691 (.bitmaps_last):
15692 * xfaces.c (load_pixmap):
15693 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15694 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15695 (.bitmaps_last, struct x_output.icon_bitmap):
15696 Use ptrdiff_t, not int, for bitmap indexes.
15697 (x_allocate_bitmap_record): Check for size overflow.
15698 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15699
15700 Use ptrdiff_t, not int, for overlay counts.
15701 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15702 * editfns.c (overlays_around, get_pos_property):
15703 * textprop.c (get_char_property_and_overlay):
15704 * xdisp.c (next_overlay_change, note_mouse_highlight):
15705 * xfaces.c (face_at_buffer_position):
15706 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15707 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15708 (Fnext_overlay_change, Fprevious_overlay_change)
15709 (mouse_face_overlay_overlaps, Foverlays_in):
15710 Use ptrdiff_t, not int, for sizes.
15711 (overlays_at, overlays_in): Check for size-calculation overflow.
15712
15713 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15714
15715 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15716 (x_session_initialize): Do not assume string length fits in int.
15717
15718 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15719 This is unlikely, but can occur if DPI is outlandish.
15720
15721 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15722 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15723
15724 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15725 * xrdb.c (magic_file_p, search_magic_path):
15726 Omit last arg SUFFIX; it was always 0. All callers changed.
15727 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15728
15729 * xfont.c (xfont_match): Avoid need for strlen.
15730
15731 * xfns.c: Don't assume strlen fits in int.
15732 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15733
15734 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15735 not unsigned long, as we prefer signed integers. All callers changed.
15736 Detect integer overflow in repeat count.
15737 (message_dolog): Don't assume print length fits in 39 bytes.
15738 (display_mode_element): Don't assume strlen fits in int.
15739
15740 * termcap.c: Don't assume sizes fit in int and never overflow.
15741 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15742 (gobble_line): Check for size-calculation overflow.
15743
15744 * minibuf.c (Fread_buffer):
15745 * lread.c (intern, intern_c_string):
15746 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15747 Don't assume string length fits in int.
15748
15749 * keyboard.c (parse_tool_bar_item):
15750 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15751
15752 * font.c: Don't assume string length fits in int.
15753 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15754 Use ptrdiff_t, not int.
15755 (font_intern_prop): Don't assume string length fits in int.
15756 Don't assume integer property fits in fixnum.
15757 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15758
15759 * filelock.c: Fix some buffer overrun and integer overflow issues.
15760 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15761 Reformulate so as not to need the command string.
15762 Invoke gzip -cd rather than gunzip, as it's more portable.
15763 (lock_info_type, lock_file_1, lock_file):
15764 Don't assume pid_t and time_t fit in unsigned long.
15765 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15766 (current_lock_owner): Prefer signed type for sizes.
15767 Use memcpy, not strncpy, where memcpy is what is really wanted.
15768 Don't assume (via atoi) that time_t and pid_t fit in int.
15769 Check for time_t and/or pid_t out of range, e.g., via a network share.
15770 Don't alloca where an auto var works fine.
15771
15772 * fileio.c: Fix some integer overflow issues.
15773 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15774 Don't assume string length fits in int.
15775 (directory_file_name): Don't assume string length fits in long.
15776 (make_temp_name): Don't assume pid fits in int, or that its print
15777 length is less than 20.
15778
15779 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15780
15781 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15782
15783 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15784
15785 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15786 We prefer signed integers, even for size calculations.
15787
15788 * emacs.c: Don't assume string length fits in 'int'.
15789 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15790 (main): Don't invoke strlen when not needed.
15791
15792 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15793 (XD_DEBUG_MESSAGE): Don't waste a byte.
15794
15795 * callproc.c (getenv_internal_1, getenv_internal)
15796 (Fgetenv_internal):
15797 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15798
15799 * lread.c (invalid_syntax): Omit length argument.
15800 All uses changed. This doesn't fix a bug, but it simplifies the
15801 code away from its former Hollerith-constant appearance, and it's
15802 one less 'int' to worry about when looking at integer-overflow issues.
15803 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15804
15805 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15806 This didn't break anything, but it didn't help either.
15807 It's confusing to put a bogus integer in a place where the actual
15808 value does not matter.
15809 (LIST_END_P): Remove unused macro and its bogus comment.
15810 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15811
15812 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15813 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15814 implementation.
15815 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15816 We prefer signed types, and the value cannot exceed the EMACS_INT
15817 range anyway (because otherwise the length would not be representable).
15818 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15819 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15820 This avoids a GCC warning when WIDE_EMACS_INT.
15821
15822 * indent.c (sane_tab_width): New function.
15823 (current_column, scan_for_column, Findent_to, position_indentation)
15824 (compute_motion): Use it. This is just for clarity.
15825 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15826
15827 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15828
15829 * lisp.h (lint_assume): New macro.
15830 * composite.c (composition_gstring_put_cache):
15831 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15832
15833 * editfns.c, insdel.c:
15834 Omit unnecessary forward decls, to simplify future changes.
15835
15836 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15837
15838 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15839
15840 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15841 Use much-faster test for byte-length change.
15842 Don't assume string byte-length fits in 'int'.
15843 Check that character arg fits in 'int'.
15844 (mapcar1): Declare byte as byte, for clarity.
15845
15846 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15847
15848 * fns.c (concat): Catch string overflow earlier.
15849 Do not rely on integer wraparound.
15850
15851 * dispextern.h (struct it.overlay_strings_charpos)
15852 (struct it.selective): Now EMACS_INT, not int.
15853 * xdisp.c (forward_to_next_line_start)
15854 (back_to_previous_visible_line_start)
15855 (reseat_at_next_visible_line_start, next_element_from_buffer):
15856 Don't arbitrarily truncate the value of 'selective' to int.
15857
15858 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15859
15860 * composite.c: Don't truncate sizes to 'int'.
15861 (composition_gstring_p, composition_reseat_it)
15862 (composition_adjust_point): Use EMACS_INT, not int.
15863 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15864 not EMACS_UINT, for indexes.
15865
15866 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15867
15868 * buffer.c: Include <verify.h>.
15869 (struct sortvec.priority, struct sortstr.priority):
15870 Now EMACS_INT, not int.
15871 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15872 (struct sortstr.size, record_overlay_string)
15873 (struct sortstrlist.size, struct sortlist.used):
15874 Don't truncate size to int.
15875 (record_overlay_string): Check for size-calculation overflow.
15876 (init_buffer_once): Check at compile-time, not run-time.
15877
15878 2011-06-22 Jim Meyering <meyering@redhat.com>
15879
15880 Don't leak an XBM-image-sized buffer
15881 * image.c (xbm_load): Free the image buffer after using it.
15882
15883 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 Port to Sun C.
15886 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15887 that Sun C diagnosed.
15888 * fns.c (secure_hash): Fix pointer signedness issue.
15889 * intervals.c (static_offset_intervals): New function.
15890 (offset_intervals): Use it.
15891
15892 2011-06-21 Leo Liu <sdl.web@gmail.com>
15893
15894 * deps.mk (fns.o):
15895 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15896 sha512.h.
15897
15898 * fns.c (secure_hash): Rename from crypto_hash_function and change
15899 the first arg to accept symbols.
15900 (Fsecure_hash): New primitive.
15901 (syms_of_fns): New symbols.
15902
15903 2011-06-20 Deniz Dogan <deniz@dogan.se>
15904
15905 * process.c (Fset_process_buffer): Clarify return value in
15906 docstring.
15907
15908 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15909
15910 * dispnew.c (add_window_display_history): Use BVAR.
15911
15912 * xdisp.c (debug_method_add): Use BVAR.
15913 (check_window_end, dump_glyph_matrix, dump_glyph)
15914 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15915
15916 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15917 Likewise.
15918
15919 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15920 check till after the cache is created in init_frame_faces.
15921
15922 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15923
15924 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15925
15926 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15927
15928 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15929 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15930 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15931
15932 Improve buffer-overflow checking (Bug#8873).
15933 * fileio.c (Finsert_file_contents):
15934 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15935 Remove the old (too-loose) buffer overflow checks.
15936 They weren't needed, since make_gap checks for buffer overflow.
15937 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15938 The old code merely checked for Emacs fixnum overflow, and relied
15939 on undefined (wraparound) behavior. The new code avoids undefined
15940 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15941
15942 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15943 Tune. Don't use wider integers than needed. Don't use alloca.
15944 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15945
15946 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15947
15948 * insdel.c, lisp.h (buffer_overflow): New function.
15949 (insert_from_buffer_1, replace_range, replace_range_2):
15950 * insdel.c (make_gap_larger):
15951 * editfns.c (Finsert_char):
15952 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15953
15954 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15955
15956 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15957
15958 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15959
15960 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15961 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15962
15963 * fileio.c: Don't assume EMACS_INT fits in off_t.
15964 (emacs_lseek): New static function.
15965 (Finsert_file_contents, Fwrite_region): Use it.
15966 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15967
15968 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15969
15970 * fns.c: Don't overflow int when computing a list length.
15971 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15972 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15973 truncation on 64-bit hosts. Check for QUIT every
15974 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15975 faster and is responsive enough.
15976 (Flength): Report an error instead of overflowing an integer.
15977 (Fsafe_length): Return a float if the value is not representable
15978 as a fixnum. This shouldn't happen except in contrived situations.
15979 (Fnthcdr, Fsort): Don't assume list length fits in int.
15980 (Fcopy_sequence): Don't assume vector length fits in int.
15981
15982 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15983 (header_size, word_size): New constants.
15984 (allocate_vectorlike): Don't check size overflow here.
15985 (allocate_vector): Check it here instead, since this is the only
15986 caller of allocate_vectorlike that could cause overflow.
15987 Check that the new vector's length is representable as a fixnum.
15988
15989 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15990 The previous code was bogus. For example, next_almost_prime (32)
15991 returned 39, which is undesirable as it is a multiple of 3; and
15992 next_almost_prime (24) returned 25, which is a multiple of 5 so
15993 why was the code bothering to check for multiples of 7?
15994
15995 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15996
15997 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15998
15999 Variadic C functions now count arguments with ptrdiff_t.
16000 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16001 Back then I didn't know that the Emacs coding style prefers signed int.
16002 Also, in the meantime I found a few more instances where arguments
16003 were being counted with int, which may truncate counts on 64-bit
16004 machines, or EMACS_INT, which may be unnecessarily wide.
16005 * lisp.h (struct Lisp_Subr.function.aMANY)
16006 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16007 Arg counts are now ptrdiff_t, not size_t.
16008 All variadic functions and their callers changed accordingly.
16009 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16010 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16011 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16012 * callint.c (Fcall_interactively): Check arg count for overflow,
16013 to avoid potential buffer overrun. Use signed char, not 'int',
16014 for 'varies' array, so that we needn't bother to check its size
16015 calculation for overflow.
16016 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16017 * eval.c (apply_lambda):
16018 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16019 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16020 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16021
16022 * callint.c (Fcall_interactively): Don't use index var as event count.
16023
16024 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16025 * mem-limits.h (SIZE): Remove; no longer used.
16026
16027 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16028
16029 Remove unnecessary casts.
16030 * xterm.c (x_term_init):
16031 * xfns.c (x_set_border_pixel):
16032 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16033 These aren't needed now that we assume ANSI C.
16034
16035 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16036 It's more likely to cause problems (due to unsigned overflow)
16037 than to cure them.
16038
16039 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16040
16041 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16042
16043 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16044
16045 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16046
16047 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16048
16049 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16050
16051 GLYPH_CODE_FACE returns EMACS_INT, not int.
16052 * dispextern.h (merge_faces):
16053 * xfaces.c (merge_faces):
16054 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16055 Don't assume EMACS_INT fits in int.
16056
16057 * character.h (CHAR_VALID_P): Remove unused parameter.
16058 * fontset.c, lisp.h, xdisp.c: All uses changed.
16059
16060 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16061
16062 * fns.c (concat): Minor tuning based on overflow analysis.
16063 This doesn't fix any bugs. Use int to hold character, instead
16064 of constantly refetching from Emacs object. Use XFASTINT, not
16065 XINT, for value known to be a character. Don't bother comparing
16066 a single byte to 0400, as it's always less.
16067
16068 * floatfns.c (Fexpt):
16069 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16070
16071 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16072 for characters.
16073
16074 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16075
16076 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16077 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16078 incorrectly succeed when S was a string, because 4294967386 was
16079 truncated before it was used.
16080
16081 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16082 Otherwise, an out-of-range integer could cause undefined behavior
16083 on a 64-bit host.
16084
16085 * composite.c: Use int, not EMACS_INT, for characters.
16086 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16087 EMACS_INT, for values that are known to be in character range.
16088 This doesn't fix any bugs but is the usual style inside Emacs and
16089 may generate better code on 32-bit machines.
16090
16091 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16092 This is for reasons similar to the recent CHAR_STRING fix.
16093 * charset.c (Fencode_char): Check that character arg is actually
16094 a character. Pass an int to ENCODE_CHAR.
16095 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16096 wider than 'int', as a compile-time check to prevent future regressions
16097 in this area.
16098
16099 * character.c (char_string): Remove unnecessary casts.
16100
16101 Make sure a 64-bit char is never passed to CHAR_STRING.
16102 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16103 by silently ignoring the top 32 bits, allowing some values
16104 that were far too large to be valid characters.
16105 * character.h: Include <verify.h>.
16106 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16107 arguments are no wider than unsigned, as a compile-time check
16108 to prevent future regressions in this area.
16109 * data.c (Faset):
16110 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16111 (Fsubst_char_in_region):
16112 * fns.c (concat):
16113 * xdisp.c (decode_mode_spec_coding):
16114 Adjust to CHAR_STRING's new requirement.
16115 * editfns.c (Finsert_char, Fsubst_char_in_region):
16116 * fns.c (concat): Check that character args are actually
16117 characters. Without this test, these functions did the wrong
16118 thing with wildly out-of-range values on 64-bit hosts.
16119
16120 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16121 These casts should not be needed on 32-bit hosts, either.
16122 * keyboard.c (read_char):
16123 * lread.c (Fload): Remove casts to unsigned.
16124
16125 * lisp.h (UNSIGNED_CMP): New macro.
16126 This fixes comparison bugs on 64-bit hosts.
16127 (ASCII_CHAR_P): Use it.
16128 * casefiddle.c (casify_object):
16129 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16130 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16131 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16132 * dispextern.h (FACE_FROM_ID):
16133 * keyboard.c (read_char): Use UNSIGNED_CMP.
16134
16135 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16136 not to EMACS_INT, to avoid GCC warning.
16137
16138 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16139
16140 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16141 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16142 isn't needed on 32-bit machines.
16143
16144 * buffer.c (Fgenerate_new_buffer_name):
16145 Use EMACS_INT for count, not int.
16146 (advance_to_char_boundary): Return EMACS_INT, not int.
16147
16148 * data.c (Qcompiled_function): Now static.
16149
16150 * window.c (window_body_lines): Now static.
16151
16152 * image.c (gif_load): Rename local to avoid shadowing.
16153
16154 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16155 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16156 * alloc.c (make_save_value): Integer argument is now of type
16157 ptrdiff_t, not int.
16158 (mark_object): Use ptrdiff_t, not int.
16159 * lisp.h (pD): New macro.
16160 * print.c (print_object): Use it.
16161
16162 * alloc.c: Use EMACS_INT, not int, to count objects.
16163 (total_conses, total_markers, total_symbols, total_vector_size)
16164 (total_free_conses, total_free_markers, total_free_symbols)
16165 (total_free_floats, total_floats, total_free_intervals)
16166 (total_intervals, total_strings, total_free_strings):
16167 Now EMACS_INT, not int. All uses changed.
16168 (Fgarbage_collect): Compute overall total using a double, so that
16169 integer overflow is less likely to be a problem. Check for overflow
16170 when converting back to an integer.
16171 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16172 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16173 These were 'int' variables that could overflow on 64-bit hosts;
16174 they were never used, so remove them instead of repairing them.
16175 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16176 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16177 Previously, this ceilinged at INT_MAX, but that doesn't work on
16178 64-bit machines.
16179 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16180
16181 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16182 (allocate_vectorlike): Check for ptrdiff_t overflow.
16183 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16184 when a (possibly-narrower) signed value would do just as well.
16185 We prefer using signed arithmetic, to avoid comparison confusion.
16186
16187 * alloc.c: Catch some string size overflows that we were missing.
16188 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16189 for convenience in STRING_BYTES_MAX.
16190 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16191 The definition here is exact; the one in lisp.h was approximate.
16192 (allocate_string_data): Check for string overflow. This catches
16193 some instances we weren't catching before. Also, it catches
16194 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16195 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16196 and ptrdiff_t and EMACS_INT are both 64 bits.
16197
16198 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16199 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16200 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16201
16202 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16203
16204 * alloc.c (Fmake_string): Check for out-of-range init.
16205
16206 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16207
16208 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16209
16210 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16211
16212 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16213 xg_get_default_scrollbar_width.
16214
16215 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16216 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16217 (style_changed_cb): Call update_theme_scrollbar_width and call
16218 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16219 all frames (Bug#8505).
16220 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16221 Call gtk_window_set_resizable if HAVE_GTK3.
16222 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16223 and height if HAVE_GTK3 (Bug#8505).
16224 (scroll_bar_width_for_theme): New variable.
16225 (update_theme_scrollbar_width): New function.
16226 (xg_get_default_scrollbar_width): Move code to
16227 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16228 (xg_initialize): Call update_theme_scrollbar_width.
16229
16230 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16231
16232 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16233
16234 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16235
16236 * frame.c (make_frame): Call other_buffer_safely instead of
16237 other_buffer.
16238
16239 * window.c (temp_output_buffer_show): Call display_buffer with
16240 second argument Vtemp_buffer_show_specifiers and reset latter
16241 immediately after the call.
16242 (Vtemp_buffer_show_specifiers): New variable.
16243 (auto_window_vscroll_p, next_screen_context_lines)
16244 (Vscroll_preserve_screen_position): Remove leading asterisks from
16245 doc-strings.
16246
16247 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16248
16249 Fix minor problems found by GCC 4.6.0 static checking.
16250 * buffer.c (Qclone_number): Remove for now, as it's unused.
16251 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16252 (record_buffer): Remove unused local.
16253 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16254 (set_frame_buffer_list): Remove; unused.
16255 * frame.h (other_visible_frames): Remove decl.
16256 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16257 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16258 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16259 if HAVE_GPM.
16260 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16261 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16262 Define only if HAVE_GPM.
16263 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16264 (update_hints_inhibit): Remove; never set. All uses removed.
16265 * widgetprv.h (emacsFrameClassRec): Remove decl.
16266 * window.c (delete_deletable_window): Now returns void, since it
16267 wasn't returning anything.
16268 (compare_window_configurations): Remove unused locals.
16269 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16270 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16271 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16272 the same widths as pointers. This follows up on the 2011-05-06 patch.
16273 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16274 * xterm.h: Likewise.
16275 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16276
16277 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16278
16279 * makefile.w32-in: Update dependencies.
16280 (LISP_H): Add lib/intprops.h.
16281
16282 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16283
16284 * image.c (gif_load): Add animation frame delay to the metadata.
16285 (syms_of_image): Use DEFSYM. New symbol `delay'.
16286
16287 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16288
16289 * window.c (delete_deletable_window): Re-add.
16290 (Fset_window_configuration): Rewrite to handle dead buffers and
16291 consequently deletable windows.
16292 (window_tree, Fwindow_tree): Remove. Supply functionality in
16293 window.el.
16294 (compare_window_configurations): Simplify code.
16295
16296 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16297
16298 * image.c (imagemagick_load_image): Fix type mismatch.
16299 (Fimagemagick_types): Likewise.
16300
16301 * window.h (replace_buffer_in_windows): Declare.
16302
16303 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16304
16305 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16306 Qclone_number. Remove external declaration of Qdelete_window.
16307 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16308 code.
16309 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16310 Run Qbuffer_list_update_hook if allowed.
16311 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16312 buffer list implementation.
16313 (other_buffer_safely): New function.
16314 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16315 calls to replace_buffer_in_windows and
16316 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16317 if allowed.
16318 (record_buffer): Inhibit quitting and rewrite using quittable
16319 functions. Run Qbuffer_list_update_hook if allowed.
16320 (Frecord_buffer, Funrecord_buffer): New functions.
16321 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16322 Move switch-to-buffer to window.el.
16323 (bury-buffer): Move to window.el.
16324 (Vbuffer_list_update_hook): New variable.
16325
16326 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16327 section.
16328
16329 * window.h (resize_frame_windows): Move up in code.
16330 (Fwindow_frame): Remove EXFUN.
16331 (replace_buffer_in_all_windows): Remove prototype.
16332 (replace_buffer_in_windows_safely): Add prototype.
16333
16334 * window.c: Declare Qdelete_window static again. Move down
16335 declaration of select_count.
16336 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16337 (Fother_window): Move to window.el.
16338 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16339 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16340 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16341 window.el.
16342 (replace_buffer_in_windows): Implement by calling
16343 Qreplace_buffer_in_windows.
16344 (replace_buffer_in_all_windows): Remove with some functionality
16345 moved into replace_buffer_in_windows_safely.
16346 (replace_buffer_in_windows_safely): New function.
16347 (select_window_norecord, select_frame_norecord): Move in front
16348 of run_window_configuration_change_hook. Remove now obsolete
16349 declarations.
16350 (Fset_window_buffer): Rewrite doc-string.
16351 Call Qrecord_window_buffer.
16352 (keys_of_window): Move binding for other-window to window.el.
16353
16354 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16355
16356 * dispextern.h (struct image): Replace data member, whose int_val
16357 and ptr_val fields were not used by anything, with a single
16358 lisp_val object.
16359
16360 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16361 (gif_clear_image, gif_load, imagemagick_load_image)
16362 (gs_clear_image, gs_load): Callers changed.
16363
16364 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16365
16366 * buffer.h: Include <time.h>, for time_t.
16367 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16368
16369 Fix minor problems found by static checking.
16370
16371 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16372
16373 Make identifiers static if they are not used in other modules.
16374 * data.c (Qcompiled_function, Qframe, Qvector):
16375 * image.c (QimageMagick, Qsvg):
16376 * minibuf.c (Qmetadata):
16377 * window.c (resize_window_check, resize_root_window): Now static.
16378 * window.h (resize_window_check, resize_root_window): Remove decls.
16379
16380 * window.c (window_deletion_count, delete_deletable_window):
16381 Remove; unused.
16382 (window_body_lines): Now static.
16383 (Fdelete_other_windows_internal): Mark vars as initialized.
16384 Make sure 'resize_failed' is initialized.
16385 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16386 (resize_window_apply): Remove unused local.
16387 * window.h (delete_deletable_window): Remove decl.
16388
16389 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16390 (imagemagick_load_image): Fix pointer signedness problem by changing
16391 last arg from unsigned char * to char *. All uses changed.
16392 Also, fix a local for similar reasons.
16393 Remove unused locals. Remove locals to avoid shadowing.
16394 (fn_rsvg_handle_free): Remove; unused.
16395 (svg_load, svg_load_image): Fix pointer signedness problem.
16396 (imagemagick_load_image): Don't use garbage pointer image_wand.
16397
16398 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16399
16400 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16401
16402 * image.c (gif_load): Fix omitted cast error introduced by
16403 2011-06-06 change.
16404
16405 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16406
16407 * window.h (resize_proportionally, orig_total_lines)
16408 (orig_top_line): Remove from window structure.
16409 (set_window_height, set_window_width, change_window_heights)
16410 (Fdelete_window): Remove prototypes.
16411 (resize_frame_windows): Remove duplicate declaration.
16412
16413 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16414
16415 * window.h (resize_frame_windows, resize_window_check)
16416 (delete_deletable_window, resize_root_window)
16417 (resize_frame_windows): Declare prototypes.
16418
16419 * window.c (resize_window_apply): Make definition be "static" to
16420 match the prototype.
16421
16422 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16423
16424 * window.c: Remove declarations of Qwindow_size_fixed,
16425 window_min_size_1, window_min_size_2, window_min_size,
16426 size_window, window_fixed_size_p, enlarge_window, delete_window.
16427 Remove static from declaration of Qdelete_window, it's
16428 temporarily needed by Fbury_buffer.
16429 (replace_window): Don't assign orig_top_line and
16430 orig_total_lines.
16431 (Fdelete_window, delete_window): Remove. Window deletion is
16432 handled by window.el.
16433 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16434 Replace Fdelete_window calls with calls to Qdelete_window.
16435 (Fdelete_other_windows): Remove. Deleting other windows is
16436 handled by window.el.
16437 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16438 handled in window.el.
16439 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16440 Window minimum sizes are handled in window.el.
16441 (shrink_windows, size_window, set_window_height)
16442 (set_window_width, change_window_heights, window_height)
16443 (window_width, CURBEG, CURSIZE, enlarge_window)
16444 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16445 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16446 handled in window.el.
16447 (make_dummy_parent): Rename to make_parent_window and give it a
16448 second argument horflag.
16449 (make_window): Don't set resize_proportionally any more.
16450 (Fsplit_window): Remove. Windows are split in window.el.
16451 (save_restore_action, save_restore_orig_size)
16452 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16453 Resize mini windows in window.el.
16454 (grow_mini_window, shrink_mini_window): Implement by calling
16455 Qresize_root_window_vertically, resize_window_check and
16456 resize_window_apply.
16457 (saved_window, Fset_window_configuration, save_window_save):
16458 Do not handle orig_top_line, orig_total_lines, and
16459 resize_proportionally.
16460 (window_min_height, window_min_width): Move to window.el.
16461 (keys_of_window): Move bindings for delete-other-windows,
16462 split-window, delete-window and enlarge-window to window.el.
16463
16464 * buffer.c: Temporarily extern Qdelete_window.
16465 (Fbury_buffer): Temporarily call Qdelete_window instead of
16466 Fdelete_window (Fbury_buffer will move to window.el soon).
16467
16468 * frame.c (set_menu_bar_lines_1): Remove code handling
16469 orig_top_line and orig_total_lines.
16470
16471 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16472 set_window_height but set heights directly.
16473 (change_frame_size_1): Use resize_frame_windows.
16474
16475 * xdisp.c (init_xdisp): Don't use set_window_height but set
16476 heights directly.
16477
16478 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16479 Use resize_frame_windows instead of change_window_heights and run
16480 run_window_configuration_change_hook.
16481
16482 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16483 instead of change_window_heights and run
16484 run_window_configuration_change_hook.
16485
16486 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16487
16488 * window.c (replace_window): Rename second argument REPLACEMENT to
16489 NEW. New third argument SETFLAG. Rewrite.
16490 (delete_window, make_dummy_parent): Call replace_window with
16491 third argument 1.
16492 (window_list_1): Move down in code.
16493 (run_window_configuration_change_hook): Move set_buffer part
16494 before select_frame_norecord part in order to unwind correctly.
16495 Rename count1 to count.
16496 (recombine_windows, delete_deletable_window, resize_root_window)
16497 (Fdelete_other_windows_internal)
16498 (Frun_window_configuration_change_hook, make_parent_window)
16499 (resize_window_check, resize_window_apply, Fresize_window_apply)
16500 (resize_frame_windows, Fsplit_window_internal)
16501 (Fdelete_window_internal, Fresize_mini_window_internal):
16502 New functions.
16503 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16504
16505 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16506
16507 * window.h (window): Add some new members to window structure -
16508 normal_lines, normal_cols, new_total, new_normal, clone_number,
16509 splits, nest, prev_buffers, next_buffers.
16510 (WINDOW_TOTAL_SIZE): Move here from window.c.
16511 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16512
16513 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16514 Remove.
16515 (make_dummy_parent): Set new members of windows structure.
16516 (make_window): Move down in code. Handle new members of window
16517 structure.
16518 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16519 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16520 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16521 (Fset_window_prev_buffers, Fwindow_next_buffers)
16522 (Fset_window_next_buffers, Fset_window_clone_number):
16523 New functions.
16524 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16525 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16526 Doc-string fixes.
16527 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16528 Argument WINDOW can be now internal window too.
16529 (Fwindow_use_time): Move up in code.
16530 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16531 Rewrite doc-string.
16532 (Fset_window_configuration, saved_window)
16533 (Fcurrent_window_configuration, save_window_save): Handle new
16534 members of window structure.
16535 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16536 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16537 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16538 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16539 Qget_mru_window, Qresize_root_window,
16540 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16541 Qauto_buffer_name; staticpro them.
16542
16543 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16544
16545 * window.c (Fwindow_total_size, Fwindow_left_column)
16546 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16547 (Fwindow_list_1): New functions.
16548 (window_box_text_cols): Replace with window_body_cols.
16549 (Fwindow_width, Fscroll_left, Fscroll_right):
16550 Use window_body_cols instead of window_box_text_cols.
16551 (delete_window, Fset_window_configuration):
16552 Call delete_all_subwindows with window as argument.
16553 (delete_all_subwindows): Take a window as argument and not a
16554 structure. Rewrite.
16555 (window_loop): Remove handling of GET_LRU_WINDOW and
16556 GET_LARGEST_WINDOW.
16557 (Fget_lru_window, Fget_largest_window): Move to window.el.
16558
16559 * window.h: Extern window_body_cols instead of
16560 window_box_text_cols. delete_all_subwindows now takes a
16561 Lisp_Object as argument.
16562
16563 * indent.c (compute_motion, Fcompute_motion):
16564 Use window_body_cols instead of window_box_text_cols.
16565
16566 * frame.c (delete_frame): Call delete_all_subwindows with root
16567 window as argument.
16568
16569 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16570
16571 * fns.c (Fputhash): Document return value.
16572
16573 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16574
16575 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16576
16577 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16578
16579 Cons<->int and similar integer overflow fixes (Bug#8794).
16580
16581 Check for overflow when converting integer to cons and back.
16582 * charset.c (Fdefine_charset_internal, Fdecode_char):
16583 Use cons_to_unsigned to catch overflow.
16584 (Fencode_char): Use INTEGER_TO_CONS.
16585 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16586 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16587 * data.c (long_to_cons, cons_to_long): Remove.
16588 (cons_to_unsigned, cons_to_signed): New functions.
16589 These signal an error for invalid or out-of-range values.
16590 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16591 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16592 * font.c (Ffont_variation_glyphs):
16593 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16594 * lisp.h: Include <intprops.h>.
16595 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16596 (cons_to_signed, cons_to_unsigned): New decls.
16597 (long_to_cons, cons_to_long): Remove decls.
16598 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16599 (Fprimitive_undo): Use CONS_TO_INTEGER.
16600 * xfns.c (Fx_window_property): Likewise.
16601 * xselect.c: Include <limits.h>.
16602 (x_own_selection, selection_data_to_lisp_data):
16603 Use INTEGER_TO_CONS.
16604 (x_handle_selection_request, x_handle_selection_clear)
16605 (x_get_foreign_selection, Fx_disown_selection_internal)
16606 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16607 (lisp_data_to_selection_data): Use cons_to_unsigned.
16608 (x_fill_property_data): Use cons_to_signed.
16609 Report values out of range.
16610
16611 Check for buffer and string overflow more precisely.
16612 * buffer.h (BUF_BYTES_MAX): New macro.
16613 * lisp.h (STRING_BYTES_MAX): New macro.
16614 * alloc.c (Fmake_string):
16615 * character.c (string_escape_byte8):
16616 * coding.c (coding_alloc_by_realloc):
16617 * doprnt.c (doprnt):
16618 * editfns.c (Fformat):
16619 * eval.c (verror):
16620 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16621 since they may not be the same number.
16622 * editfns.c (Finsert_char):
16623 * fileio.c (Finsert_file_contents):
16624 Likewise for BUF_BYTES_MAX.
16625
16626 * image.c: Use ptrdiff_t, not int, for sizes.
16627 (slurp_file): Switch from int to ptrdiff_t.
16628 All uses changed.
16629 (slurp_file): Check that file size fits in both size_t (for
16630 malloc) and ptrdiff_t (for sanity and safety).
16631
16632 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16633 if b->modtime has its maximal value.
16634
16635 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16636
16637 Don't assume time_t can fit into int.
16638 * buffer.h (struct buffer.modtime): Now time_t, not int.
16639 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16640 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16641
16642 Minor fixes for signed vs unsigned integers.
16643 * character.h (MAYBE_UNIFY_CHAR):
16644 * charset.c (maybe_unify_char):
16645 * keyboard.c (read_char, reorder_modifiers):
16646 XINT -> XFASTINT, since the integer must be nonnegative.
16647 * ftfont.c (ftfont_spec_pattern):
16648 * keymap.c (access_keymap, silly_event_symbol_error):
16649 XUINT -> XFASTINT, since the integer must be nonnegative.
16650 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16651 since it makes no difference and we prefer signed.
16652 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16653 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16654 nonnegative.
16655
16656 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16657
16658 * window.h (Fwindow_frame): Declare.
16659
16660 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16661
16662 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16663 (SPARE_MEMORY): Always define.
16664 (LARGE_REQUEST): Remove.
16665 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16666
16667 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16668
16669 * lisp.h: Move EXFUNS for Fframe_root_window,
16670 Fframe_first_window and Fset_frame_selected_window to window.h.
16671
16672 * window.h: Move EXFUNS for Fframe_root_window,
16673 Fframe_first_window and Fset_frame_selected_window here from
16674 lisp.h.
16675
16676 * frame.c (Fwindow_frame, Fframe_first_window)
16677 (Fframe_root_window, Fframe_selected_window)
16678 (Fset_frame_selected_window): Move to window.c.
16679 (Factive_minibuffer_window): Move to minibuf.c.
16680 (Fother_visible_frames_p): New function.
16681
16682 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16683
16684 * window.c (decode_window, decode_any_window): Move up in code.
16685 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16686 (inhibit_frame_unsplittable): Remove unused variable.
16687 (Fwindow_buffer): Move up and rewrite doc-string.
16688 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16689 (Fwindow_prev): New functions.
16690 (Fwindow_frame): Move here from frame.c. Accept any window as
16691 argument.
16692 (Fframe_root_window, Fframe_first_window)
16693 (Fframe_selected_window): Move here from frame.c. Accept frame
16694 or arbitrary window as argument. Update doc-strings.
16695 (Fminibuffer_window): Move up in code.
16696 (Fwindow_minibuffer_p): Move up in code and simplify.
16697 (Fset_frame_selected_window): Move here from frame.c.
16698 Marginal rewrite.
16699 (Fselected_window, select_window, Fselect_window): Move up in
16700 code. Minor doc-string fixes.
16701
16702 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16703
16704 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16705 Do not assume that spare memory exists; that assumption is valid
16706 only if SYSTEM_MALLOC.
16707 (LARGE_REQUEST): New macro, so that the issue of large requests
16708 is separated from the issue of spare memory.
16709
16710 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16711
16712 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16713 format. (Bug#8806)
16714
16715 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16716
16717 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16718 before statements.
16719
16720 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16721
16722 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16723
16724 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16725
16726 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16727 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16728
16729 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16730
16731 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16732
16733 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16734
16735 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16736 (x_clipboard_manager_save): Add return value.
16737 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16738 New error handlers.
16739 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16740 Obey Vx_select_enable_clipboard_manager. Catch errors in
16741 x_clipboard_manager_save (Bug#8779).
16742 (Vx_select_enable_clipboard_manager): New variable.
16743 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16744
16745 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16746
16747 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16748
16749 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16750
16751 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16752 in the current matrix if keep_current_p is non-zero.
16753
16754 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16755
16756 * bidi.c (bidi_level_of_next_char): Fix last change.
16757
16758 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16759
16760 Support bidi reordering of text covered by display properties.
16761
16762 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16763 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16764 (bidi_cache_search, bidi_cache_iterator_state)
16765 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16766 (bidi_level_of_next_char, bidi_move_to_visually_next):
16767 Support character positions inside a run of characters covered by a
16768 display string.
16769 (bidi_paragraph_init, bidi_resolve_explicit_1)
16770 (bidi_level_of_next_char): Call bidi_fetch_char and
16771 bidi_fetch_char_advance instead of FETCH_CHAR and
16772 FETCH_CHAR_ADVANCE.
16773 (bidi_init_it): Initialize new members.
16774 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16775 definitions.
16776 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16777 instead of using explicit *_CHAR codes.
16778 (bidi_resolve_explicit, bidi_resolve_weak):
16779 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16780 bidirectional text is supported only in multibyte buffers.
16781 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16782 it to initialize the frame_window_p member of struct bidi_it.
16783 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16784 (bidi_resolve_explicit, bidi_resolve_weak)
16785 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16786 bidi_it->nchars is non-positive.
16787 (bidi_level_of_next_char): Don't try to lookup the cache for the
16788 next/previous character if nothing is cached there yet, or if we
16789 were just reseat()'ed to a new position.
16790
16791 * xdisp.c (set_cursor_from_row): Set start and stop points
16792 according to the row's direction when priming the loop that looks
16793 for the glyph on which to display cursor.
16794 (single_display_spec_intangible_p): Function deleted.
16795 (display_prop_intangible_p): Reimplement to call
16796 handle_display_spec instead of single_display_spec_intangible_p.
16797 Accept 3 additional arguments needed by handle_display_spec.
16798 This fixes incorrect cursor motion across display property with complex
16799 values: lists, `(when COND...)' forms, etc.
16800 (single_display_spec_string_p): Support property values that are
16801 lists with the argument STRING its top-level element.
16802 (display_prop_string_p): Fix the condition for processing a
16803 property that is a list to be consistent with handle_display_spec.
16804 (handle_display_spec): New function, refactored from the
16805 last portion of handle_display_prop.
16806 (compute_display_string_pos): Accept additional argument
16807 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16808 value of a `display' property is a "replacing spec".
16809 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16810 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16811 the display property, but just return a value indicating whether
16812 the display property will replace the characters it covers.
16813 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16814 frame_window_p members of struct bidi_it.
16815 (compute_display_string_pos, compute_display_string_end):
16816 New functions.
16817 (push_it): Accept second argument POSITION, where pop_it should
16818 jump to continue iteration.
16819 (reseat_1): Initialize bidi_it.disp_pos.
16820
16821 * keyboard.c (adjust_point_for_property): Adjust the call to
16822 display_prop_intangible_p to its new signature.
16823
16824 * dispextern.h (struct bidi_it): New member frame_window_p.
16825 (bidi_init_it): Update prototypes.
16826 (display_prop_intangible_p): Update prototype.
16827 (compute_display_string_pos, compute_display_string_end):
16828 Declare prototypes.
16829 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16830 EMACS_INT.
16831
16832 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16833
16834 Malloc failure behavior now depends on size of allocation.
16835 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16836 * lisp.h: Change signatures accordingly.
16837 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16838 All callers changed. (Bug#8762)
16839
16840 * gnutls.c: Use Emacs's memory allocators.
16841 Without this change, the gnutls library would invoke malloc etc.
16842 directly, which causes problems on non-SYNC_INPUT hosts, and which
16843 runs afoul of improving memory_full behavior. (Bug#8761)
16844 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16845 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16846 xfree instead of the default malloc, realloc, free.
16847 (Fgnutls_boot): No need to check for memory allocation failure,
16848 since xmalloc does that for us.
16849
16850 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16851 * category.c (hash_get_category_set):
16852 * ccl.c (ccl_driver):
16853 * charset.c (Fdefine_charset_internal):
16854 * charset.h (struct charset.hash_index):
16855 * composite.c (get_composition_id, gstring_lookup_cache)
16856 (composition_gstring_put_cache):
16857 * composite.h (struct composition.hash_index):
16858 * dispextern.h (struct image.hash):
16859 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16860 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16861 (hashfn_equal, hashfn_user_defined, make_hash_table)
16862 (maybe_resize_hash_table, hash_lookup, hash_put)
16863 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16864 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16865 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16866 * image.c (make_image, search_image_cache, lookup_image)
16867 (xpm_put_color_table_h):
16868 * lisp.h (struct Lisp_Hash_Table):
16869 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16870 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16871 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16872 * alloc.c (allocate_vectorlike):
16873 Check for overflow in vector size calculations.
16874 * ccl.c (ccl_driver):
16875 Check for overflow when converting EMACS_INT to int.
16876 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16877 need to be updated by these changes.
16878 * fns.c (make_hash_table, maybe_resize_hash_table):
16879 Check for integer overflow with large hash tables.
16880 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16881 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16882 (SXHASH_REDUCE): New macro.
16883 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16884 Use it instead of discarding useful hash info with large hash values.
16885 (sxhash_float): New function.
16886 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16887 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16888 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16889 Rewrite to use FIXNUM_BITS, as this simplifies things.
16890 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16891 Adjust signatures to match updated version of code.
16892 (consing_since_gc): Now EMACS_INT, since a single hash table can
16893 use more than INT_MAX bytes.
16894
16895 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16896
16897 Make it possible to build with GCC-4.6+ -O2 -flto.
16898
16899 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16900
16901 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16902
16903 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16904 Call minibuffer-inactive-mode.
16905
16906 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16907
16908 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16909 Update dependencies.
16910
16911 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16912
16913 * data.c (init_data): Remove code for UTS, this system is not
16914 supported anymore.
16915
16916 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16917
16918 Don't force ./temacs to start in terminal mode.
16919
16920 * frame.c (make_initial_frame): Initialize faces in all cases, not
16921 only when CANNOT_DUMP is defined.
16922 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16923
16924 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16925
16926 * dispnew.c (add_window_display_history): Use const for the string
16927 pointer. Remove declaration, not needed.
16928
16929 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16930
16931 Use 'inline', not 'INLINE'.
16932 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16933 * alloc.c, fontset.c (INLINE): Remove.
16934 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16935 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16936 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16937 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16938 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16939
16940 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16941
16942 Make it possible to run ./temacs.
16943
16944 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16945 syms_of_callproc does the same thing. Remove test for
16946 "initialized", do it in the caller.
16947 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16948
16949 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16950
16951 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16952 (read_minibuf): Use get_minibuffer.
16953 (syms_of_minibuf): Use DEFSYM.
16954 (Qmetadata): New var.
16955 * data.c (Qbuffer): Don't make it static.
16956 (syms_of_data): Use DEFSYM.
16957
16958 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16959
16960 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16961 (CCL_CODE_MIN): New macro.
16962
16963 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16964
16965 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16966
16967 * eval.c (Qdebug): Now static.
16968 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16969 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16970 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16971
16972 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16973
16974 * image.c: Various fixes to ImageMagick code comments.
16975 (Fimagemagick_types): Doc fix.
16976
16977 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16978
16979 Minor fixes prompted by GCC 4.6.0 warnings.
16980
16981 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16982
16983 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16984 (x_clipboard_manager_save_all): Move extern decl to ...
16985 * xterm.h: ... here, so that it can be checked for consistency.
16986
16987 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16988
16989 * xselect.c (x_clipboard_manager_save_frame)
16990 (x_clipboard_manager_save_all): New functions.
16991 (Fx_clipboard_manager_save): Lisp function deleted.
16992
16993 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16994 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16995
16996 * xterm.h: Update prototype.
16997
16998 2011-05-28 William Xu <william.xwl@gmail.com>
16999
17000 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17001 exiting (Bug#8239).
17002
17003 2011-05-28 Jim Meyering <meyering@redhat.com>
17004
17005 Avoid a sign-extension bug in crypto_hash_function.
17006 * fns.c (to_uchar): Define.
17007 (crypto_hash_function): Use it to convert some newly-signed
17008 variables to unsigned, to avoid sign-extension bugs. For example,
17009 without this change, (md5 "truc") would evaluate to
17010 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17011 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17012 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17013
17014 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17015
17016 Integer overflow fixes.
17017
17018 * dbusbind.c: Serial number integer overflow fixes.
17019 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17020 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17021 to hold a serial number that is too large for a fixnum.
17022 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17023 Check for serial numbers out of range. Decode any serial number
17024 that was so large that it became a float. (Bug#8722)
17025
17026 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17027 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17028 Use XFASTINT rather than XUINT when numbers are nonnegative.
17029 (xd_append_arg, Fdbus_method_return_internal):
17030 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17031 arguments, check that Lisp number is nonnegative, rather than
17032 silently wrapping negative numbers around. (Bug#8722)
17033 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17034 (Bug#8722)
17035
17036 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17037
17038 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17039
17040 ccl: Add integer overflow checks.
17041 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17042 (IN_INT_RANGE): New macros.
17043 (ccl_driver): Use them to check for integer overflow when
17044 decoding a CCL program. Many of the new checks are whether XINT (x)
17045 fits in int; it doesn't always, on 64-bit hosts. The new version
17046 doesn't catch all possible integer overflows, but it's an
17047 improvement. (Bug#8719)
17048
17049 * alloc.c (make_event_array): Use XINT, not XUINT.
17050 There's no need for unsigned here.
17051
17052 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17053 This follows up to the 2011-05-06 change that substituted uintptr_t
17054 for EMACS_INT. This case wasn't caught back then.
17055
17056 Rework Fformat to avoid integer overflow issues.
17057 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17058 now (part of C89). Include <verify.h>.
17059 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17060 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17061 (Fformat): Avoid the prepass trying to compute sizes; it was only
17062 approximate and thus did not catch overflow reliably. Instead, walk
17063 through the format just once, formatting and computing sizes as we go,
17064 checking for integer overflow at every step, and allocating a larger
17065 buffer as needed. Keep track separately whether the format is
17066 multibyte. Keep only the most-recently calculated precision, rather
17067 than them all. Record whether each argument has been converted to
17068 string. Use EMACS_INT, not int, for byte and char and arg counts.
17069 Support field widths and precisions larger than INT_MAX. Avoid
17070 sprintf's undefined behavior with conversion specifications such as %#d
17071 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17072 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17073 formatting out-of-range floating point numbers with int
17074 formats. (Bug#8668)
17075
17076 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17077
17078 * data.c: Avoid integer truncation in expressions involving floats.
17079 * data.c: Include <intprops.h>.
17080 (arith_driver): When there's an integer overflow in an expression
17081 involving floating point, convert the integers to floating point
17082 so that the resulting value does not suffer from catastrophic
17083 integer truncation. For example, on a 64-bit host (* 4
17084 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17085 Do not rely on undefined behavior after integer overflow.
17086
17087 merge count_size_as_multibyte, parse_str_to_multibyte
17088 * character.c, character.h (count_size_as_multibyte):
17089 Rename from parse_str_to_multibyte; all uses changed.
17090 Check for integer overflow.
17091 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17092 since it's now a duplicate of the other. This is more of
17093 a character than a buffer op, so better that it's in character.c.
17094 * fns.c, print.c: Adjust to above changes.
17095
17096 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17097
17098 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17099
17100 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17101
17102 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17103 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17104 (x_clipboard_manager_save): Now static.
17105 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17106
17107 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17108 (crypto_hash_function): Now static.
17109 Fix pointer signedness problems. Avoid unnecessary initializations.
17110
17111 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17112
17113 * termhooks.h (Vselection_alist): Make it terminal-local.
17114
17115 * terminal.c (create_terminal): Initialize it.
17116
17117 * xselect.c: Support for clipboard managers.
17118 (Vselection_alist): Move to termhooks.h as terminal-local var.
17119 (LOCAL_SELECTION): New macro.
17120 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17121 (symbol_to_x_atom): Remove gratuitous arg.
17122 (x_handle_selection_request, lisp_data_to_selection_data)
17123 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17124 (x_own_selection, x_get_local_selection, x_convert_selection):
17125 New arg, specifying work frame. Use terminal-local Vselection_alist.
17126 (some_frame_on_display): Delete unused function.
17127 (Fx_own_selection_internal, Fx_get_selection_internal)
17128 (Fx_disown_selection_internal, Fx_selection_owner_p)
17129 (Fx_selection_exists_p): New optional frame arg.
17130 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17131 (x_handle_selection_clear): Don't treat other terminals with the
17132 same keyboard specially. Use the terminal-local Vselection_alist.
17133 (x_clear_frame_selections): Use Frun_hook_with_args.
17134
17135 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17136
17137 * xterm.h: Add support for those atoms.
17138
17139 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17140
17141 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17142 (converted_selections, conversion_fail_tag): New global variables.
17143 (x_selection_request_lisp_error): Free the above.
17144 (x_get_local_selection): Remove unnecessary code.
17145 (x_reply_selection_request): Args changed; handle arbitrary array
17146 of converted selections stored in converted_selections.
17147 Separate the XChangeProperty and SelectionNotify steps.
17148 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17149 (x_convert_selection): New function.
17150 (x_handle_selection_event): Simplify.
17151 (x_get_foreign_selection): Don't ignore incoming requests while
17152 waiting for an answer; this will fail when we implement
17153 SAVE_TARGETS, and seems unnecessary anyway.
17154 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17155 (Vx_sent_selection_functions): Doc fix.
17156
17157 2011-05-26 Leo Liu <sdl.web@gmail.com>
17158
17159 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17160
17161 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17162
17163 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17164
17165 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17166 for fringe update if it has periodic bitmap.
17167 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17168 and fringe_bitmap_periodic_p.
17169
17170 * fringe.c (get_fringe_bitmap_data): New function.
17171 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17172 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17173 row. Mark glyph row for fringe update if periodicity changed.
17174
17175 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17176 for fringe update unless it has periodic bitmap.
17177
17178 2011-05-25 Kenichi Handa <handa@m17n.org>
17179
17180 * xdisp.c (get_next_display_element): Set correct it->face_id for
17181 a static composition.
17182
17183 2011-05-24 Leo Liu <sdl.web@gmail.com>
17184
17185 * deps.mk (fns.o):
17186 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17187
17188 * fns.c (crypto_hash_function, Fsha1): New function.
17189 (Fmd5): Use crypto_hash_function.
17190 (syms_of_fns): Add Ssha1.
17191
17192 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17193
17194 * gnutls.c: Remove unused macros.
17195 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17196 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17197 Remove macros that are defined and never used.
17198 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17199
17200 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17201
17202 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17203 (Fx_get_selection_internal): Minor cleanup.
17204 (Fx_own_selection_internal): Rename arguments for consistency with
17205 select.el.
17206
17207 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17208
17209 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17210
17211 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17212
17213 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17214
17215 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17216
17217 * dispnew.c (scrolling_window): Don't exclude the case that the
17218 last enabled row in the desired matrix touches the bottom boundary.
17219
17220 2011-05-21 Glenn Morris <rgm@gnu.org>
17221
17222 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17223 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17224 and add some more files.
17225
17226 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17227
17228 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17229 report_file_error introduced by the change from 2011-05-07.
17230
17231 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17232
17233 * systime.h (Time): Define only if emacs is defined.
17234 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17235 where the include path doesn't have X11/X.h by default. See
17236 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17237
17238 2011-05-20 Kenichi Handa <handa@m17n.org>
17239
17240 * composite.c (find_automatic_composition): Fix previous change.
17241
17242 2011-05-20 Glenn Morris <rgm@gnu.org>
17243
17244 * lisp.mk: New file, split from Makefile.in.
17245 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17246 (shortlisp): Remove.
17247 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17248
17249 2011-05-19 Glenn Morris <rgm@gnu.org>
17250
17251 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17252 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17253 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17254 (lisp): Set the order to that of loadup.el.
17255 (shortlisp): Make it a copy of $lisp.
17256 (SOME_MACHINE_LISP): Remove.
17257 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17258 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17259
17260 2011-05-18 Kenichi Handa <handa@m17n.org>
17261
17262 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17263 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17264 (find_automatic_composition): Mostly rewrite for efficiency.
17265
17266 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17267
17268 * makefile.w32-in: Update dependencies.
17269
17270 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17271
17272 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17273 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17274
17275 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17276
17277 Fix some integer overflow issues, such as string length overflow.
17278
17279 * insdel.c (count_size_as_multibyte): Check for string overflow.
17280
17281 * character.c (lisp_string_width): Check for string overflow.
17282 Use EMACS_INT, not int, for string indexes and lengths; in
17283 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17284 the resulting string length overflows an EMACS_INT; instead,
17285 report a string overflow if no precision given. When checking for
17286 precision exhaustion, use a check that cannot possibly have
17287 integer overflow. (Bug#8675)
17288 * character.h (lisp_string_width): Adjust to new signature.
17289
17290 * alloc.c (string_overflow): New function.
17291 (Fmake_string): Use it. This doesn't change behavior, but saves
17292 a few bytes and will simplify future changes.
17293 * character.c (string_escape_byte8): Likewise.
17294 * lisp.h (string_overflow): New decl.
17295
17296 Fixups, following up to the user-interface timestamp change.
17297 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17298 for UI timestamps, instead of unsigned long.
17299 * msdos.c (mouse_get_pos): Likewise.
17300 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17301 * w32gui.h (Time): Define by including "systime.h" rather than by
17302 declaring it ourselves. (Bug#8664)
17303
17304 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17305 * image.c (clear_image_cache): Likewise.
17306
17307 * term.c (term_mouse_position): Don't assume time_t wraparound.
17308
17309 Be more systematic about user-interface timestamps.
17310 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17311 and sometimes 'EMACS_UINT', to represent these timestamps.
17312 This change causes it to use 'Time' uniformly, as that's what X uses.
17313 This makes the code easier to follow, and makes it easier to catch
17314 integer overflow bugs such as Bug#8664.
17315 * frame.c (Fmouse_position, Fmouse_pixel_position):
17316 Use Time, not unsigned long, for user-interface timestamps.
17317 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17318 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17319 * keyboard.h (last_event_timestamp): Likewise.
17320 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17321 * menu.h (xmenu_show): Likewise.
17322 * term.c (term_mouse_position): Likewise.
17323 * termhooks.h (struct input_event.timestamp): Likewise.
17324 (struct terminal.mouse_position_hook): Likewise.
17325 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17326 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17327 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17328 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17329 what it was before.
17330 * menu.h, termhooks.h: Include "systime.h", for Time.
17331
17332 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17333 Don't assume that the difference between two unsigned long values
17334 can fit into an integer. At this point, we know button_down_time
17335 <= event->timestamp, so the difference must be nonnegative, so
17336 there's no need to cast the result if double-click-time is
17337 nonnegative, as it should be; check that it's nonnegative, just in
17338 case. This bug is triggered when events are more than 2**31 ms
17339 apart (about 25 days). (Bug#8664)
17340
17341 * xselect.c (last_event_timestamp): Remove duplicate decl.
17342 (x_own_selection): Remove needless cast to unsigned long.
17343
17344 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17345 that always fit in int. Use a sentinel instead of a counter, to
17346 avoid a temp and to allay GCC's concerns about possible int overflow.
17347 * frame.h (struct frame): Use int for menu_bar_items_used
17348 instead of EMACS_INT, since it always fits in int.
17349
17350 * menu.c (grow_menu_items): Check for int overflow.
17351
17352 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17353
17354 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17355 Before, the code was not consistent. These values cannot exceed
17356 2**31 - 1 so there's no need to make them unsigned.
17357 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17358 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17359 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17360 as modifiers.
17361 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17362
17363 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17364 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17365 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17366 presumably because the widths might not match.
17367
17368 * window.c (size_window): Avoid needless test at loop start.
17369
17370 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17371
17372 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17373
17374 2011-05-12 Drew Adams <drew.adams@oracle.com>
17375
17376 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17377
17378 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17379
17380 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17381 `width' to `bar_area_x' and `bar_area_width', respectively.
17382 (x_scroll_run): Take account of fringe background extension.
17383
17384 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17385 Rename local vars `left' and `width' to `bar_area_x' and
17386 `bar_area_width', respectively.
17387 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17388 background extension.
17389
17390 2011-05-10 Jim Meyering <meyering@redhat.com>
17391
17392 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17393
17394 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17395
17396 * image.c (Finit_image_library): Return t for built-in image types,
17397 like pbm and xbm. (Bug#8640)
17398
17399 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17400
17401 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17402
17403 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17404
17405 * w32console.c (Fset_screen_color): Doc fix.
17406 (Fget_screen_color): New function.
17407 (syms_of_ntterm): Defsubr it.
17408
17409 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17410 unlink the temporary file if Fcall_process didn't create it in the
17411 first place.
17412 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17413 child process will be redirected to a file specified with `:file'.
17414 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17415 cue to call_process_cleanup not to close that handle.
17416
17417 2011-05-07 Ben Key <bkey76@gmail.com>
17418
17419 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17420 one of two shell specific rules, either bootstrap-temacs-CMD or
17421 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17422 to the previous implementation of the bootstrap-temacs rule.
17423 The bootstrap-temacs-CMD rule is similar to the previous
17424 implementation of the bootstrap-temacs rule except that it
17425 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17426 variable.
17427
17428 These changes, along with some changes to nt/configure.bat,
17429 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17430 earlier fix to add support for --cflags and --ldflags options
17431 that include quotes so that it works whether make uses cmd or
17432 sh as the shell.
17433
17434 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17435
17436 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17437 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17438 is a constant.
17439 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17440 a string. Handle both cases.
17441 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17442 (Fdbus_register_method): Use Qinvalid_function.
17443
17444 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17445
17446 * makefile.w32-in: Update dependencies.
17447 (LISP_H): Add inttypes.h and stdin.h.
17448 (PROCESS_H): Add unistd.h.
17449
17450 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17451
17452 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17453 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17454
17455 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17456
17457 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17458
17459 * term.c (vfatal): Remove stray call to va_end.
17460 It's not needed and the C Standard doesn't allow it here anyway.
17461
17462 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17463 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17464
17465 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17466 bytes.
17467
17468 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17469
17470 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17471
17472 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17473
17474 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17475
17476 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17477
17478 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17479 * charset.c (Fdefine_charset_internal): Don't initialize
17480 charset.code_space[15]. The value was garbage, on hosts with
17481 32-bit int (Bug#8600).
17482
17483 * lread.c (read_integer): Be more consistent with string-to-number.
17484 Use string_to_number to do the actual conversion; this avoids
17485 rounding errors and fixes some other screwups. Without this fix,
17486 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17487 (digit_to_number): Move earlier, for benefit of read_integer.
17488 Return -1 if the digit is out of range for the base, -2 if it is
17489 not a digit in any supported base. (Bug#8602)
17490
17491 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17492
17493 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17494 to match comment at start of function. This also removes a
17495 GCC warning about overflow in a 32+64-bit port.
17496
17497 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17498
17499 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17500 Reported by Stefan Monnier in
17501 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17502 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17503 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17504
17505 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17506 (EMACS_UINTPTR): Likewise, with uintptr_t.
17507
17508 * lisp.h: Prefer 64-bit EMACS_INT if available.
17509 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17510 on 32-bit hosts that have 64-bit int, so that they can access
17511 large files.
17512 However, temporarily disable this change unless the temporary
17513 symbol WIDE_EMACS_INT is defined.
17514
17515 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17516
17517 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17518 This removes an assumption that EMACS_INT and long are the same
17519 width as pointers. The assumption is true for Emacs porting targets
17520 now, but we want to make other targets possible.
17521 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17522 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17523 In the rest of the code, change types of integers that hold casted
17524 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17525 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17526 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17527 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17528 No need to cast type when ORing.
17529 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17530 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17531 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17532 assume EMACS_INT is the same width as char *.
17533 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17534 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17535 Remove no-longer-needed casts.
17536 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17537 (xg_tool_bar_help_callback, xg_make_tool_item):
17538 Use EMACS_INTPTR to hold an integer
17539 that will be cast to void *; this can avoid a GCC warning
17540 if EMACS_INT is not the same width as void *.
17541 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17542 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17543 (current_message_1, set_message_1):
17544 Use a local to convert to proper width without a cast.
17545 * xmenu.c (dialog_selection_callback): Likewise.
17546
17547 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17548 Also, don't assume VALBITS / RAND_BITS is less than 5,
17549 and don't rely on undefined behavior when shifting a 1 left into
17550 the sign bit.
17551 * lisp.h (get_random): Change signature to match.
17552
17553 * lread.c (hash_string): Use size_t, not int, for hash computation.
17554 Normally we prefer signed values; but hashing is special, because
17555 it's better to use unsigned division on hash table sizes so that
17556 the remainder is nonnegative. Also, size_t is the natural width
17557 for hashing into memory. The previous code used 'int', which doesn't
17558 retain enough info to hash well into very large tables.
17559 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17560
17561 * dbusbind.c: Don't possibly lose pointer info when converting.
17562 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17563 Use XPNTR rather than XHASH, so that the high-order bits of
17564 the pointer aren't lost when converting through void *.
17565
17566 * eval.c (Fautoload): Don't double-shift a pointer.
17567
17568 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17569
17570 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17571
17572 * gnutls.c (DEF_GNUTLS_FN):
17573 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17574
17575 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17576
17577 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17578 marker. (Bug#8610)
17579
17580 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17581
17582 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17583 New version that can reserve upto 2GB of heap space.
17584
17585 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17586
17587 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17588
17589 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17590
17591 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17592 `gnutls_certificate_set_x509_key_file'.
17593
17594 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17595
17596 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17597 Update dependencies.
17598
17599 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17600
17601 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17602 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17603 Remove unused parameter `fildes'.
17604 * process.c (read_process_output, send_process): Don't pass it.
17605
17606 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17607
17608 Fix previous change: the library cache is defined in w32.c.
17609 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17610 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17611
17612 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17613
17614 Implement dynamic loading of GnuTLS on Windows.
17615
17616 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17617 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17618 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17619 Declare.
17620
17621 * gnutls.c (Qgnutls_dll): Define.
17622 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17623 (gnutls_*): Declare function pointers.
17624 (init_gnutls_functions): New function to initialize function pointers.
17625 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17626 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17627 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17628 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17629 (emacs_gnutls_write, emacs_gnutls_read)
17630 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17631 (Fgnutls_available_p): New function.
17632 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17633 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17634 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17635
17636 * image.c: Include w32.h.
17637 (Vimage_type_cache): Delete.
17638 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17639 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17640 (w32_delayed_load): Move to w32.c.
17641
17642 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17643
17644 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17645 (w32_delayed_load): Move from image.c. When loading a library, record
17646 its filename in the :loaded-from property of the library id.
17647 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17648 Initialize and staticpro them.
17649 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17650
17651 * process.c: Include lisp.h before w32.h, not after.
17652 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17653 instead of gnutls_record_check_pending.
17654
17655 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17656
17657 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17658
17659 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17660 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17661 as passed in.
17662
17663 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17664
17665 * xterm.c (x_set_frame_alpha): Do not set property on anything
17666 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17667
17668 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17669
17670 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17671
17672 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17673
17674 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17675 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17676 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17677 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17678 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17679 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17680 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17681 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17682 (Qgnutls_bootprop_callbacks_verify): Make static.
17683
17684 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17685
17686 * callproc.c: Indentation fixup.
17687
17688 * sysdep.c (wait_for_termination_1): Make static.
17689 (wait_for_termination, interruptible_wait_for_termination):
17690 Move after wait_for_termination_1.
17691
17692 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17693
17694 * sysdep.c (interruptible_wait_for_termination): New function
17695 which is like wait_for_termination, but allows keyboard
17696 interruptions.
17697
17698 * callproc.c (Fcall_process): Add (:file "file") as an option for
17699 the STDOUT buffer.
17700 (Fcall_process_region): Ditto.
17701
17702 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17703
17704 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17705 rather than `XVECTOR (FOO)->size'.
17706
17707 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17708 inttypes.h, as a gnulib replacement is used if it not available in
17709 system headers.
17710
17711 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17712
17713 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17714 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17715 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17716
17717 * coding.c (coding_alloc_by_realloc): Error out if destination
17718 will grow beyond MOST_POSITIVE_FIXNUM.
17719 (decode_coding_emacs_mule): Abort if there isn't enough place in
17720 charbuf for the composition carryover bytes. Reserve an extra
17721 space for up to 2 characters produced in a loop.
17722 (decode_coding_iso_2022): Abort if there isn't enough place in
17723 charbuf for the composition carryover bytes.
17724
17725 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17726
17727 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17728 aborting when %lld or %lll format is passed.
17729 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17730 %llo or %llx format is passed. (Bug#8545)
17731
17732 * window.c (window_scroll_line_based): Use a marker instead of
17733 simple variables to record original value of point. (Bug#7952)
17734
17735 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17736 produced by %s or %c overflows available buffer space. (Bug#8545)
17737
17738 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17739
17740 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17741 (SIZE_MAX): Move defn after all includes, as they might #define it.
17742
17743 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17744
17745 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17746
17747 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17748
17749 * keyboard.c (Qdelayed_warnings_hook): Define.
17750 (command_loop_1): Run `delayed-warnings-hook'
17751 if Vdelayed_warnings_list is non-nil.
17752 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17753 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17754
17755 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17756
17757 * doprnt.c (doprnt): Don't return value smaller than the buffer
17758 size if the message was truncated. (Bug#8545).
17759
17760 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17761
17762 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17763 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17764
17765 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17766
17767 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17768
17769 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17770
17771 * makefile.w32-in: Update dependencies.
17772
17773 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17774
17775 Improve `doprnt' and its usage. (Bug#8545)
17776 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17777 `format_end'. Remove support for %l as a conversion specifier.
17778 Don't use xrealloc. Improve diagnostics when the %l size modifier
17779 is used. Update the commentary.
17780
17781 * eval.c (verror): Simplify calculation of size_t.
17782
17783 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17784 messages.
17785
17786 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17787
17788 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17789 change.
17790
17791 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17792
17793 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17794 This makes this file independent of the recent pseudovector change.
17795
17796 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17797
17798 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17799
17800 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17801 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17802 Remove unused local.
17803 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17804
17805 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17806 GCC 4.6.0 optimizes based on type-based alias analysis.
17807 For example, if b is of type struct buffer * and v of type struct
17808 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17809 != &v->size, and therefore "v->size = 1; b->size = 2; return
17810 v->size;" must therefore return 1. This assumption is incorrect
17811 for Emacs, since it type-puns struct Lisp_Vector * with many other
17812 types. To fix this problem, this patch adds a new type struct
17813 vectorlike_header that documents the constraints on layout of vectors
17814 and pseudovectors, and helps optimizing compilers not get fooled
17815 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17816 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17817 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17818 the size member.
17819 (XSETPVECTYPE): Rewrite in terms of new macro.
17820 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17821 This is a bit clearer, and further avoids the possibility of
17822 undesirable aliasing.
17823 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17824 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17825 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17826 since Lisp_Subr is a special case (no "next" field).
17827 (ASIZE): Now uses header.size rather than size.
17828 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17829 to avoid the hassle of writing XVECTOR (foo)->header.size.
17830 (struct vectorlike_header): New type.
17831 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17832 object, to help avoid aliasing.
17833 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17834 (SUBRP): Likewise, since Lisp_Subr is a special case.
17835 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17836 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17837 (struct Lisp_Hash_Table): Combine first two members into a single
17838 struct vectorlike_header member. All uses of "size" and "next" members
17839 changed to be "header.size" and "header.next".
17840 * buffer.h (struct buffer): Likewise.
17841 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17842 * frame.h (struct frame): Likewise.
17843 * process.h (struct Lisp_Process): Likewise.
17844 * termhooks.h (struct terminal): Likewise.
17845 * window.c (struct save_window_data, struct saved_window): Likewise.
17846 * window.h (struct window): Likewise.
17847 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17848 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17849 * buffer.c (init_buffer_once): Likewise.
17850 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17851 special case.
17852 * process.c (Fformat_network_address): Use local var for size,
17853 for brevity.
17854
17855 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17856
17857 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17858 * data.c (atof): Remove decl; no longer used or needed.
17859 (digit_to_number): Move to lread.c.
17860 (Fstring_to_number): Use new string_to_number function, to be
17861 consistent with how the Lisp reader treats infinities and NaNs.
17862 Do not assume that floating-point numbers represent EMACS_INT
17863 without losing information; this is not true on most 64-bit hosts.
17864 Avoid double-rounding errors, by insisting on integers when
17865 parsing non-base-10 numbers, as the documentation specifies.
17866 * lisp.h (string_to_number): New decl, replacing ...
17867 (isfloat_string): Remove.
17868 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17869 (read1): Do not accept +. and -. as integers; this
17870 appears to have been a coding error. Similarly, do not accept
17871 strings like +-1e0 as floating point numbers. Do not report
17872 overflow for integer overflows unless the base is not 10 which
17873 means we have no simple and reliable way to continue.
17874 Break out the floating-point parsing into a new
17875 function string_to_number, so that Fstring_to_number parses
17876 floating point numbers consistently with the Lisp reader.
17877 (digit_to_number): Move here from data.c. Make it static inline.
17878 (E_CHAR, EXP_INT): Remove, replacing with ...
17879 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17880 (string_to_number): New function, replacing isfloat_string.
17881 This function checks for valid syntax and produces the resulting
17882 Lisp float number too. Rework it so that string-to-number
17883 no longer mishandles examples like "1.0e+". Use strtoumax,
17884 so that overflow for non-base-10 numbers is reported only when
17885 there's no portable and simple way to convert to floating point.
17886
17887 * textprop.c (set_text_properties_1): Rewrite for clarity,
17888 and to avoid GCC warning about integer overflow.
17889
17890 * intervals.h (struct interval): Use EMACS_INT for members
17891 where EMACS_UINT might cause problems. See
17892 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17893 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17894 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17895 All uses changed.
17896 (offset_intervals): Tell GCC not to worry about length overflow
17897 when negating a negative length.
17898
17899 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17900 (overrun_check_free): Likewise.
17901
17902 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17903 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17904 word size.
17905
17906 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17907 (gnutls_make_error): Rename local to avoid shadowing.
17908 (gnutls_emacs_global_deinit): ifdef out; not used.
17909 (Fgnutls_boot): Use const for pointer to readonly storage.
17910 Comment out unused local. Fix pointer signedness problems.
17911
17912 * lread.c (openp): Don't stuff size_t into an 'int'.
17913 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17914 about possible signed overflow.
17915
17916 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17917 (GDK_KEY_g): Don't define if already defined.
17918 (xg_prepare_tooltip): Avoid pointer signedness problem.
17919 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17920
17921 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17922 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17923
17924 * xfns.c (Fx_window_property): Simplify a bit,
17925 to make a bit faster and to avoid GCC 4.6.0 warning.
17926 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17927
17928 * fns.c (internal_equal): Don't assume size_t fits in int.
17929
17930 * alloc.c (compact_small_strings): Tighten assertion a little.
17931
17932 Replace pEd with more-general pI, and fix some printf arg casts.
17933 * lisp.h (pI): New macro, generalizing old pEd macro to other
17934 conversion specifiers. For example, use "...%"pI"d..." rather
17935 than "...%"pEd"...".
17936 (pEd): Remove. All uses replaced with similar uses of pI.
17937 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17938 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17939 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17940 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17941 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17942 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17943 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17944 64-bit hosts.
17945 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17946 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17947 * print.c (safe_debug_print, print_object): Likewise.
17948 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17949 to int.
17950 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17951 avoiding the 0 flag, which is not portable.
17952 * process.c (Fmake_network_process): Use pI to avoid cast.
17953 * region-cache.c (pp_cache): Likewise.
17954 * xdisp.c (decode_mode_spec): Likewise.
17955 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17956 behavior on 64-bit hosts with printf arg.
17957 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17958 (x_stop_queuing_selection_requests): Likewise.
17959 (x_get_window_property): Don't truncate byte count to an 'int'
17960 when tracing.
17961
17962 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17963 here, since it parses constructs like leading '-' and spaces,
17964 which are not wanted; and it overflows with large numbers.
17965 Instead, simply match F[0-9]+, which is what is wanted anyway.
17966
17967 * alloc.c: Remove unportable assumptions about struct layout.
17968 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17969 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17970 (allocate_vectorlike, make_pure_vector): Use the new macros,
17971 plus offsetof, to remove unportable assumptions about struct layout.
17972 These assumptions hold on all porting targets that I know of, but
17973 they are not guaranteed, they're easy to remove, and removing them
17974 makes further changes easier.
17975
17976 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17977 This doesn't fix a bug but makes the code clearer.
17978 (string_overrun_cookie): Now const. Use initializers that
17979 don't formally overflow signed char, to avoid warnings.
17980 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17981 can cause Emacs to crash when string overrun checking is enabled.
17982 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17983 multiple of sizeof (EMACS_INT); it need not be, if
17984 alignof(EMACS_INT) < sizeof (EMACS_INT).
17985 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17986
17987 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17988
17989 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17990
17991 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17992
17993 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17994 supposed to be handshaking. (Bug#8556)
17995 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17996
17997 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17998
17999 * lisp.h (Qdebug): List symbol.
18000 * eval.c (Qdebug): Restore global linkage.
18001 * keyboard.c (debug-on-event): New variable.
18002 (handle_user_signal): Break into debugger when debug-on-event
18003 matches the current signal symbol.
18004
18005 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18006
18007 * alloc.c (check_sblock, check_string_bytes)
18008 (check_string_free_list): Convert to standard C.
18009
18010 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18011
18012 * w32.c (emacs_gnutls_push): Fix typo.
18013
18014 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18015
18016 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18017 "cast to pointer from integer of different size".
18018
18019 Improve doprnt and its use in verror. (Bug#8545)
18020 * doprnt.c (doprnt): Document the set of format control sequences
18021 supported by the function. Use SAFE_ALLOCA instead of always
18022 using `alloca'.
18023
18024 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18025 is one byte too soon. Don't use xrealloc; instead xfree and
18026 xmalloc anew.
18027
18028 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18029
18030 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18031 callbacks stage.
18032
18033 * gnutls.c: Renamed global_initialized to
18034 gnutls_global_initialized. Added internals for the
18035 :verify-hostname-error, :verify-error, and :verify-flags
18036 parameters of `gnutls-boot' and documented those parameters in the
18037 docstring. Start callback support.
18038 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18039 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18040 on error. Return error code.
18041 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18042 (emacs_gnutls_read): Likewise.
18043 (Fgnutls_boot): Return handshake error code.
18044 (emacs_gnutls_handle_error): New function.
18045 (wsaerror_to_errno): Likewise.
18046
18047 * w32.h (emacs_gnutls_pull): Add prototype.
18048 (emacs_gnutls_push): Likewise.
18049
18050 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18051 (emacs_gnutls_push): Likewise.
18052
18053 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18054
18055 * process.c (wait_reading_process_output): Check if GnuTLS
18056 buffered some data internally if no FDs are set for TLS
18057 connections.
18058
18059 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18060 (LIBS): Link to USER_LIBS.
18061 ($(BLD)/gnutls.$(0)): New target.
18062
18063 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18064
18065 * xdisp.c (handle_single_display_spec): Rename the
18066 display_replaced_before_p argument into display_replaced_p, to
18067 make it consistent with the commentary. Fix typos in the
18068 commentary.
18069
18070 * textprop.c (syms_of_textprop): Remove dead code.
18071 (copy_text_properties): Delete obsolete commentary about an
18072 interface that was deleted long ago. Fix typos in the description
18073 of arguments.
18074
18075 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18076 to changes in oldXMenu/XMenu.h from 2011-04-16.
18077 <menu_help_message, prev_menu_help_message>: Constify.
18078 (IT_menu_make_room): menu->help_text is now `const char **';
18079 adjust.
18080
18081 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18082 to changes in oldXMenu/XMenu.h from 2011-04-16.
18083 (struct XMenu): Declare `help_text' `const char **'.
18084
18085 * xfaces.c <Qunspecified>: Make extern again.
18086
18087 * syntax.c: Include sys/types.h before including regex.h, as
18088 required by POSIX.
18089
18090 * doc.c (get_doc_string): Improve the format passed to `error'.
18091
18092 * doprnt.c (doprnt): Improve commentary.
18093
18094 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18095
18096 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18097 them with etags.
18098
18099 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18100 changes in globals.h immediately force recompilation.
18101 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18102 $(CURDIR)/s/ms-w32.h.
18103 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18104
18105 * character.c (Fchar_direction): Function deleted.
18106 (syms_of_character): Don't defsubr it.
18107 <char-direction-table>: Deleted.
18108
18109 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18110
18111 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18112 * doprnt.c: Include limits.h.
18113 (SIZE_MAX): New macro.
18114 (doprnt): Return a size_t value. 2nd arg is now size_t.
18115 Many local variables are now size_t instead of int or unsigned.
18116 Improve overflow protection. Support `l' modifier for integer
18117 conversions. Support %l conversion. Don't assume an EMACS_INT
18118 argument for integer conversions and for %c.
18119
18120 * lisp.h (doprnt): Restore prototype.
18121
18122 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18123 $(SRC)/character.h.
18124
18125 * Makefile.in (base_obj): Add back doprnt.o.
18126
18127 * deps.mk (doprnt.o): Add back prerequisites.
18128 (callint.o): Depend on character.h.
18129
18130 * eval.c (internal_lisp_condition_case): Include the handler
18131 representation in the error message.
18132 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18133 when breaking from the loop.
18134
18135 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18136
18137 * callint.c (Fcall_interactively): When displaying error message
18138 about invalid control letter, pass the character's codepoint, not
18139 a pointer to its multibyte form. Improve display of the character
18140 in octal and display also its hex code.
18141
18142 * character.c (char_string): Use %x to display the (unsigned)
18143 codepoint of an invalid character, to avoid displaying a bogus
18144 negative value.
18145
18146 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18147 `error', not SYMBOL_NAME itself.
18148
18149 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18150 character arguments to `error'.
18151
18152 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18153 to `error' in error message about FINAL_CHAR argument. Make sure
18154 FINAL_CHAR is a character, and use %c when it is passed as
18155 argument to `error'.
18156
18157 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18158
18159 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18160
18161 * w32.c: Include <time.h>.
18162 (sys_localtime): New function.
18163
18164 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18165
18166 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18167
18168 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18169
18170 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18171
18172 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18173 zombies (Bug#8467).
18174
18175 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18176
18177 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18178 gl_state.e_property when gl_state.object is Qt.
18179
18180 * insdel.c (make_gap_larger): Remove limitation of buffer size
18181 to <= INT_MAX.
18182
18183 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18184
18185 * xdisp.c (lookup_glyphless_char_display)
18186 (produce_glyphless_glyph): Handle cons cell entry in
18187 glyphless-char-display.
18188 (Vglyphless_char_display): Document it.
18189
18190 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18191 glyphless-char-display.
18192
18193 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18194
18195 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18196
18197 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18198
18199 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18200 definition for no-X builds.
18201
18202 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18203
18204 Static checks with GCC 4.6.0 and non-default toolkits.
18205
18206 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18207
18208 * process.c (keyboard_bit_set): Define only if SIGIO.
18209 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18210 (send_process): Repair possible setjmp clobbering.
18211
18212 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18213
18214 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18215
18216 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18217
18218 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18219 Define only if needed.
18220
18221 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18222 by pacifying GCC about it. Maybe it's time to retire it?
18223 * xfaces.c (USG, __TIMEVAL__): Likewise.
18224
18225 * dispextern.h (struct redisplay_interface): Rename param
18226 to avoid shadowing.
18227 * termhooks.h (struct terminal): Likewise.
18228 * xterm.c (xembed_send_message): Likewise.
18229
18230 * insdel.c (make_gap_smaller): Define only if
18231 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18232
18233 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18234 it.
18235
18236 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18237 so that we aren't warned about unused symbols.
18238
18239 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18240
18241 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18242
18243 * xfns.c (x_real_positions): Mark locals as initialized.
18244
18245 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18246
18247 * xterm.c: Fix problems found by static analysis with other toolkits.
18248 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18249 (x_dispatch_event): Declare static if USE_GTK, and
18250 define if USE_GTK || USE_X_TOOLKIT.
18251 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18252 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18253 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18254 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18255
18256 * xmenu.c (menu_help_callback): Pointer type fixes.
18257 Use const pointers when pointing at readonly data. Avoid pointer
18258 signedness clashes.
18259 (FALSE): Remove unused macro.
18260 (update_frame_menubar): Remove unused decl.
18261
18262 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18263
18264 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18265 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18266 (single_menu_item): Rename local to avoid shadowing.
18267
18268 * keyboard.c (make_lispy_event): Remove unused local var.
18269
18270 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18271 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18272
18273 * bitmaps: Change bitmaps from unsigned char back to the X11
18274 compatible char. Avoid the old compiler warnings about
18275 out-of-range initializers by using, for example, '\xab' rather
18276 than 0xab.
18277
18278 * xgselect.c (xgselect_initialize): Check vs interface
18279 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18280
18281 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18282
18283 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18284 to read-only memory.
18285
18286 * fns.c (vector): Remove; this old hack is no longer needed.
18287
18288 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18289 Remove unused var.
18290 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18291
18292 * xrdb.c (x_load_resources): Omit unused local.
18293
18294 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18295 (x_window): Rename locals to avoid shadowing.
18296 (USG): Use the kludged USG macro, to pacify gcc.
18297
18298 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18299 (x_term_init): Remove local to avoid shadowing.
18300
18301 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18302
18303 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18304 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18305
18306 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18307
18308 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18309
18310 Fix regex.c, syntax.c and friends for buffers > 2GB.
18311 * syntax.h (struct gl_state_s): Declare character position members
18312 EMACS_INT.
18313
18314 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18315
18316 * textprop.c (verify_interval_modification, interval_of):
18317 Declare arguments EMACS_INT.
18318
18319 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18320 EMACS_INT.
18321
18322 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18323
18324 * indent.c (Fvertical_motion): Local variable it_start is now
18325 EMACS_INT.
18326
18327 * regex.c (re_match, re_match_2, re_match_2_internal)
18328 (bcmp_translate, regcomp, regexec, print_double_string)
18329 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18330 (re_compile_pattern, re_exec): Declare arguments and local
18331 variables `size_t' and `ssize_t' and return values `regoff_t', as
18332 appropriate.
18333 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18334 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18335 <compile_stack_type>: `size' and `avail' are now `size_t'.
18336
18337 * regex.h <regoff_t>: Use ssize_t, not int.
18338 (re_search, re_search_2, re_match, re_match_2): Arguments that
18339 specify buffer/string position and length are now ssize_t and
18340 size_t. Return type is regoff_t.
18341
18342 2011-04-16 Ben Key <bkey76@gmail.com>
18343
18344 * nsfont.m: Fixed bugs in ns_get_family and
18345 ns_descriptor_to_entity that were caused by using free to
18346 deallocate memory blocks that were allocated by xmalloc (via
18347 xstrdup). This caused Emacs to crash when compiled with
18348 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18349 --enable-checking=xmallocoverrun). xfree is now used to
18350 deallocate these memory blocks.
18351
18352 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18353
18354 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18355
18356 emacs_write: Accept and return EMACS_INT for sizes.
18357 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18358 et seq.
18359 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18360 Accept and return EMACS_INT.
18361 (emacs_gnutls_write): Return the number of bytes written on
18362 partial writes.
18363 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18364 (emacs_read, emacs_write): Remove check for negative size, as the
18365 Emacs source code has been audited now.
18366 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18367 (emacs_read, emacs_write): Use it.
18368 * process.c (send_process): Adjust to the new signatures of
18369 emacs_write and emacs_gnutls_write. Do not attempt to store
18370 a byte offset into an 'int'; it might overflow.
18371 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18372
18373 * sound.c: Don't assume sizes fit in 'int'.
18374 (struct sound_device.period_size, alsa_period_size):
18375 Return EMACS_INT, not int.
18376 (struct sound_device.write, vox_write, alsa_write):
18377 Accept EMACS_INT, not int.
18378 (wav_play, au_play): Use EMACS_INT to store sizes and to
18379 record read return values.
18380
18381 2011-04-15 Ben Key <bkey76@gmail.com>
18382
18383 * keyboard.c (Qundefined): Don't declare static since it is used
18384 in nsfns.m.
18385 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18386 static since they are used in nsfont.m.
18387
18388 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18389
18390 * process.c (Qprocessp): Don't declare static.
18391 * lisp.h (Qprocessp): Declare again.
18392
18393 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18394
18395 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18396
18397 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18398
18399 Improve C-level modularity by making more things 'static'.
18400
18401 Don't publish debugger-only interfaces to other modules.
18402 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18403 (verify_bytepos, count_markers): Move decls to the only modules
18404 that need them.
18405 * region-cache.h (pp_cache): Likewise.
18406 * window.h (check_all_windows): Likewise.
18407 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18408
18409 * sysdep.c (croak): Now static, if
18410 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18411 * syssignal.h (croak): Declare only if not static.
18412
18413 * alloc.c (refill_memory_reserve): Now static if
18414 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18415 * lisp.h (refill_memory_reserve): Declare only if not static.
18416
18417 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18418 Define only if USE_LUCID.
18419
18420 * xrdb.c (x_customization_string, x_rm_string): Now static.
18421
18422 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18423 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18424
18425 * xdisp.c (draw_row_with_mouse_face): Now static.
18426 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18427
18428 * window.h (check_all_windows): Mark externally visible.
18429
18430 * window.c (window_deletion_count): Now static.
18431
18432 * undo.c: Make symbols static if they're not exported.
18433 (last_undo_buffer, last_boundary_position, pending_boundary):
18434 Now static.
18435
18436 * textprop.c (interval_insert_behind_hooks): Now static.
18437 (interval_insert_in_front_hooks): Likewise.
18438
18439 * term.c: Make symbols static if they're not exported.
18440 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18441 (max_frame_lines, tty_set_terminal_modes):
18442 (tty_reset_terminal_modes, tty_turn_off_highlight):
18443 (get_tty_terminal): Now static.
18444 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18445 * termhooks.h (term_mouse_moveto): Do not declare if
18446 HAVE_WINDOW_SYSTEM.
18447 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18448 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18449
18450 * sysdep.c: Make symbols static if they're not exported.
18451 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18452 Now static.
18453 (sigprocmask_set, full_mask): Remove; unused.
18454 (wait_debugging): Mark as visible.
18455 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18456 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18457
18458 * syntax.c (syntax_temp): Define only if !__GNUC__.
18459
18460 * sound.c (current_sound_device, current_sound): Now static.
18461
18462 * search.c (searchbufs, searchbuf_head): Now static.
18463
18464 * scroll.c (scroll_cost): Remove; unused.
18465 * dispextern.h (scroll_cost): Remove decl.
18466
18467 * region-cache.h (pp_cache): Mark as externally visible.
18468
18469 * process.c: Make symbols static if they're not exported.
18470 (process_tick, update_tick, create_process, chan_process):
18471 (Vprocess_alist, proc_buffered_char, datagram_access):
18472 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18473 (deactivate_process): Mark defn as static, as well as decl.
18474 * lisp.h (create_process): Remove decl.
18475 * process.h (chan_process, Vprocess_alist): Remove decls.
18476
18477 * print.c: Make symbols static if they're not exported.
18478 (print_depth, new_backquote_output, being_printed, print_buffer):
18479 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18480 (print_interval, print_number_index, initial_stderr_stream):
18481 Now static.
18482 * lisp.h (Fprinc): Remove decl.
18483 (debug_output_compilation_hack): Mark as externally visible.
18484
18485 * sysdep.c (croak): Move decl from here to syssignal.h.
18486 * syssignal.h (croak): Put it here, so the API can be checked when
18487 'croak' is called from dissociate_if_controlling_tty.
18488
18489 * minibuf.c: Make symbols static if they're not exported.
18490 (minibuf_save_list, choose_minibuf_frame): Now static.
18491 * lisp.h (choose_minibuf_frame): Remove decl.
18492
18493 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18494
18495 * lread.c: Make symbols static if they're not exported.
18496 (read_objects, initial_obarray, oblookup_last_bucket_number):
18497 Now static.
18498 (make_symbol): Remove; unused.
18499 * lisp.h (initial_obarray, make_symbol): Remove decls.
18500
18501 * keyboard.c: Make symbols static if they're not exported.
18502 (single_kboard, recent_keys_index, total_keys, recent_keys):
18503 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18504 (this_single_command_key_start, echoing, last_auto_save):
18505 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18506 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18507 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18508 (Vlispy_mouse_stem, double_click_count):
18509 Now static.
18510 (force_auto_save_soon): Define only if SIGDANGER.
18511 (ignore_mouse_drag_p): Now static if
18512 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18513 (print_help): Remove; unused.
18514 (stop_character, last_timer_event): Mark as externally visible.
18515 * keyboard.h (ignore_mouse_drag_p): Declare only if
18516 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18517 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18518 * lisp.h (echoing): Remove decl.
18519 (force_auto_save_soon): Declare only if SIGDANGER.
18520 * xdisp.c (redisplay_window): Simplify code, to make it more
18521 obvious that ignore_mouse_drag_p is not accessed if !defined
18522 USE_GTK && !defined HAVE_NS.
18523
18524 * intervals.c: Make symbols static if they're not exported.
18525 (merge_properties_sticky, merge_interval_right, delete_interval):
18526 Now static.
18527 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18528
18529 * insdel.c: Make symbols static if they're not exported.
18530 However, leave prepare_to_modify_buffer alone. It's never
18531 called from outside this function, but that appears to be a bug.
18532 (combine_after_change_list, combine_after_change_buffer):
18533 (adjust_after_replace, signal_before_change): Now static.
18534 (adjust_after_replace_noundo): Remove; unused.
18535 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18536 (signal_before_change): Remove decls.
18537
18538 * indent.c (val_compute_motion, val_vmotion): Now static.
18539
18540 * image.c: Make symbols static if they're not exported.
18541 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18542 if USE_GTK.
18543 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18544 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18545
18546 * fringe.c (standard_bitmaps): Now static.
18547 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18548
18549 * frame.c: Make symbols static if they're not exported.
18550 (x_report_frame_params, make_terminal_frame): Now static.
18551 (get_frame_param): Now static, unless HAVE_NS.
18552 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18553 (x_get_resource_string): Remove; not used.
18554 * frame.h (make_terminal_frame, x_report_frame_params):
18555 (x_get_resource_string); Remove decls.
18556 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18557 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18558
18559 * font.c, fontset.c: Make symbols static if they're not exported.
18560 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18561 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18562 * font.c (font_close_object): Now static.
18563 * font.h (font_close_object): Remove.
18564 * fontset.c (FONTSET_OBJLIST): Remove.
18565 (free_realized_fontset) #if-0 the body, which does nothing.
18566 (face_suitable_for_char_p): #if-0, as it's never called.
18567 * fontset.h (face_suitable_for_char_p): Remove decl.
18568 * xfaces.c (face_at_string_position):
18569 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18570 since 0 is always ASCII.
18571
18572 * fns.c (weak_hash_tables): Now static.
18573
18574 * fileio.c: Make symbols static if they're not exported.
18575 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18576 (Vwrite_region_annotation_buffers): Now static.
18577
18578 * eval.c: Make symbols static if they're not exported.
18579 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18580 * lisp.h (backtrace_list): Remove decl.
18581
18582 * emacs.c: Make symbols static if they're not exported.
18583 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18584 (fatal_error_code, fatal_error_signal_hook, standard_args):
18585 Now static.
18586 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18587 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18588 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18589 * lisp.h (fatal_error_signal_hook): Remove decl.
18590 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18591
18592 * editfns.c: Move a (normally-unused) function to its only use.
18593 * editfns.c, lisp.h (get_operating_system_release): Remove.
18594 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18595 worth the hassle of breaking this out.
18596
18597 * xterm.c: Make symbols static if they're not exported.
18598 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18599 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18600 (x_destroy_window, x_delete_display):
18601 Now static.
18602 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18603 (x_mouse_leave): Remove; unused.
18604 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18605 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18606 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18607 Remove decls.
18608 (x_mouse_leave): Declare only if WINDOWSNT.
18609 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18610 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18611 USE_X_TOOLKIT.
18612
18613 * ftxfont.c: Make symbols static if they're not exported.
18614 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18615 HAVE_FREETYPE.
18616 * font.h (ftxfont_driver): Likewise.
18617
18618 * xfns.c: Make symbols static if they're not exported.
18619 (x_last_font_name, x_display_info_for_name):
18620 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18621 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18622 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18623 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18624 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18625 (last_show_tip_args): Now static.
18626 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18627 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18628 (x_screen_planes): Remove; unused.
18629 * dispextern.h (x_screen_planes): Remove decl.
18630
18631 * dispnew.c: Make symbols static if they're not exported.
18632 * dispextern.h (redraw_garbaged_frames, scrolling):
18633 (increment_row_positions): Remove.
18634 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18635 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18636 Now static.
18637 (redraw_garbaged_frames): Remove; unused.
18638
18639 * xfaces.c: Make symbols static if they're not exported.
18640 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18641 Remove decls.
18642 * xterm.h (defined_color): Remove decls.
18643 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18644 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18645 (menu_face_changed_default, defined_color, free_realized_face):
18646 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18647 (ascii_face_of_lisp_face): Remove; unused.
18648
18649 * xdisp.c: Make symbols static if they're not exported.
18650 * dispextern.h (scratch_glyph_row, window_box_edges):
18651 (glyph_to_pixel_coords, set_cursor_from_row):
18652 (get_next_display_element, set_iterator_to_next):
18653 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18654 (show_mouse_face): Remove decls
18655 * frame.h (message_buf_print): Likewise.
18656 * lisp.h (pop_message, set_message, check_point_in_composition):
18657 Likewise.
18658 * xterm.h (set_vertical_scroll_bar): Likewise.
18659 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18660 (message_buf_print, scratch_glyph_row, displayed_buffer):
18661 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18662 (get_next_display_element, show_mouse_face, window_box_edges):
18663 (frame_to_window_pixel_xy, check_point_in_composition):
18664 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18665 (glyph_to_pixel_coords): Remove; unused.
18666
18667 * dired.c (file_name_completion): Now static.
18668
18669 * dbusbind.c (xd_in_read_queued_messages): Now static.
18670
18671 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18672 * data.c (circular_list_error): Remove.
18673
18674 * commands.h (last_point_position, last_point_position_buffer):
18675 (last_point_position_window): Remove decls.
18676 * keyboard.c: Make these variables static.
18677
18678 * coding.h (coding, code_convert_region, encode_coding_gap):
18679 Remove decls.
18680 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18681 (iso_code_class, detect_coding, code_convert_region): Now static.
18682 (encode_coding_gap): Remove; unused.
18683
18684 * chartab.c (chartab_chars, chartab_bits): Now static.
18685
18686 * charset.h (charset_iso_8859_1): Remove decl.
18687 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18688 Now static.
18689
18690 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18691 * ccl.c (Vccl_program_table): Now static.
18692 (check_ccl_update): Remove; unused.
18693
18694 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18695 * category.h: ... from here.
18696 * category.c (check_category_table, set_category_set): Now static.
18697
18698 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18699 * lisp.h: Remove these decls.
18700
18701 * buffer.c (buffer_count): Remove unused var.
18702
18703 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18704 so that it's not optimized away.
18705 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18706 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18707 exported only to the debugger.
18708
18709 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18710 * atimer.h (run_all_atimers): Remove; not exported.
18711
18712 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18713 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18714 was inaccessible from Lisp.
18715 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18716 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18717
18718 alloc.c: Import and export fewer symbols, and remove unused items.
18719 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18720 is defined.
18721 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18722 it's not optimized away by whole-program optimization.
18723 (message_enable_multibyte, free_misc): Remove.
18724 (catchlist, handlerlist, mark_backtrace):
18725 Declare only if BYTE_MARK_STACK.
18726 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18727 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18728 (message_enable_multibyte): Remove decl.
18729 (free_misc, interval_free_list, float_block, float_block_index):
18730 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18731 (cons_free_list, last_marked_index):
18732 Now static.
18733 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18734 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18735 (mark_backtrace): Define only if BYTE_MARK_STACK.
18736 * xdisp.c (message_enable_multibyte): Now static.
18737
18738 Declare Lisp_Object Q* variables to be 'static' if not exported.
18739 This makes it easier for human readers (and static analyzers)
18740 to see whether these variables are used from other modules.
18741 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18742 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18743 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18744 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18745 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18746 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18747 * xmenu.c, xselect.c:
18748 Declare Q* vars static if they are not used in other modules.
18749 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18750 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18751 Remove decls of unexported vars.
18752 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18753
18754 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18755
18756 Make Emacs functions such as Fatom 'static' by default.
18757 This makes it easier for human readers (and static analyzers)
18758 to see whether these functions can be called from other modules.
18759 DEFUN now defines a static function. To make the function external
18760 so that it can be used in other C modules, use the new macro DEFUE.
18761 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18762 (Finit_image_library):
18763 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18764 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18765 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18766 Remove decls, since these functions are now static.
18767 (Funintern, Fget_internal_run_time): New decls, since these functions
18768 were already external.
18769
18770 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18771 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18772 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18773 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18774 * keyboard.c, keymap.c, lread.c:
18775 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18776 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18777 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18778 Mark functions with DEFUE instead of DEFUN,
18779 if they are used in other modules.
18780 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18781 decls for now-static functions.
18782 * buffer.h (Fdelete_overlay): Remove decl.
18783 * callproc.c (Fgetenv_internal): Mark as internal.
18784 * composite.c (Fremove_list_of_text_properties): Remove decl.
18785 (Fcomposition_get_gstring): New forward static decl.
18786 * composite.h (Fcomposite_get_gstring): Remove decl.
18787 * dired.c (Ffile_attributes): New forward static decl.
18788 * doc.c (Fdocumntation_property): New forward static decl.
18789 * eval.c (Ffetch_bytecode): New forward static decl.
18790 (Funintern): Remove extern decl; now in .h file where it belongs.
18791 * fileio.c (Fmake_symbolic_link): New forward static decl.
18792 * image.c (Finit_image_library): New forward static decl.
18793 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18794 * intervals.h (Fprevious_property_change):
18795 (Fremove_list_of_text_properties): Remove decls.
18796 * keyboard.c (Fthis_command_keys): Remove decl.
18797 (Fcommand_execute): New forward static decl.
18798 * keymap.c (Flookup_key): New forward static decl.
18799 (Fcopy_keymap): Now static.
18800 * keymap.h (Flookup_key): Remove decl.
18801 * process.c (Fget_process): New forward static decl.
18802 (Fprocess_datagram_address): Mark as internal.
18803 * syntax.c (Fsyntax_table_p): New forward static decl.
18804 (skip_chars): Remove duplicate decl.
18805 * textprop.c (Fprevious_property_change): New forward static decl.
18806 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18807 Now internal.
18808 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18809 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18810
18811 * editfns.c (Fformat): Remove unreachable code.
18812
18813 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18814
18815 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18816 change. (Bug#8496)
18817
18818 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18819
18820 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18821 when at ZV. (Bug#8487)
18822
18823 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18824
18825 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18826 (Bug#8437)
18827 * keyboard.c (parse_tool_bar_item): Likewise.
18828 * sound.c (sound_cleanup, alsa_close): Likewise.
18829 * termcap.c (tgetent): Likewise.
18830 * xfns.c (x_default_font_parameter): Likewise.
18831 * xsettings.c (read_and_apply_settings): Likewise.
18832
18833 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18834 (overrun_check_free): Protoize.
18835
18836 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18837
18838 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18839 since callers should never pass a negative size.
18840 Change the signature to match that of plain 'read' and 'write'; see
18841 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18842 * lisp.h: Update prototypes of emacs_write and emacs_read.
18843
18844 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18845
18846 * xdisp.c (redisplay_window): Don't try to determine the character
18847 position of the scroll margin if the window start point w->startp
18848 is outside the buffer's accessible region. (Bug#8468)
18849
18850 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18851
18852 Fix write-region and its subroutines for buffers > 2GB.
18853 * fileio.c (a_write, e_write): Modify declaration of arguments and
18854 local variables to support buffers larger than 2GB.
18855 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18856
18857 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18858 argument, local variables, and return value.
18859
18860 * lisp.h: Update prototypes of emacs_write and emacs_read.
18861
18862 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18863
18864 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18865
18866 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18867
18868 Fix more problems found by GCC 4.6.0's static checks.
18869
18870 * xdisp.c (vmessage): Use a better test for character truncation.
18871
18872 * charset.c (load_charset_map): <, not <=, for optimization,
18873 and to avoid potential problems with integer overflow.
18874 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18875 * casetab.c (set_identity, shuffle): Likewise.
18876 * editfns.c (Fformat): Likewise.
18877 * syntax.c (skip_chars): Likewise.
18878
18879 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18880 This also lets GCC 4.6.0 generate slightly better loop code.
18881
18882 * callint.c (Fcall_interactively): <, not <=, for optimization.
18883 (Fcall_interactively): Count the number of arguments produced,
18884 not the number of arguments given. This is simpler and lets GCC
18885 4.6.0 generate slightly better code.
18886
18887 * ftfont.c: Distingish more carefully between FcChar8 and char.
18888 The previous code passed unsigned char * to a functions like
18889 strlen and xstrcasecmp that expect char *, which does not
18890 conform to the C standard.
18891 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18892 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18893 char * when the C standard requires it.
18894
18895 * keyboard.c (read_char): Remove unused var.
18896
18897 * eval.c: Port to Windows vsnprintf (Bug#8435).
18898 Include <limits.h>.
18899 (SIZE_MAX): Define if the headers do not.
18900 (verror): Do not give up if vsnprintf returns a negative count.
18901 Instead, grow the buffer. This ports to Windows vsnprintf, which
18902 does not conform to C99. Problem reported by Eli Zaretskii.
18903 Also, simplify the allocation scheme, by avoiding the need for
18904 calling realloc, and removing the ALLOCATED variable.
18905
18906 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18907
18908 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18909 But keep the doprint source code for now, as we might revamp it
18910 and use it again (Bug#8435).
18911 * lisp.h (doprnt): Remove.
18912 * Makefile.in (base_obj): Remove doprnt.o.
18913 * deps.mk (doprnt.o): Remove.
18914
18915 error: Print 32- and 64-bit integers portably (Bug#8435).
18916 Without this change, on typical 64-bit hosts error ("...%d...", N)
18917 was used to print both 32- and 64-bit integers N, which relied on
18918 undefined behavior.
18919 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18920 * lisp.h (error, verror): Mark as printf-like functions.
18921 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18922 Report overflow in size calculations when allocating printf buffer.
18923 Do not truncate output string at its first null byte.
18924 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18925 Truncate the output at a character boundary, since vsnprintf does not
18926 do that.
18927 * charset.c (check_iso_charset_parameter): Convert internal
18928 character to string before calling 'error', since %c now has the
18929 printf meaning.
18930 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18931 overflow when computing char to be passed to 'error'. Do not
18932 pass Lisp_Object to 'error'; pass the integer instead.
18933 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18934 formatted with plain %d.
18935
18936 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18937
18938 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18939
18940 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18941
18942 * xterm.c (x_catch_errors): Remove duplicate declaration.
18943
18944 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18945
18946 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18947
18948 2011-04-10 Jim Meyering <meyering@redhat.com>
18949
18950 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18951 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18952 return ssize_t not "int", and use size_t as the buffer length.
18953 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18954 * gnutls.h: Update declarations.
18955 * process.c (read_process_output): Use ssize_t, to match.
18956 (send_process): Likewise.
18957
18958 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18959
18960 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18961
18962 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18963
18964 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18965 Use unsigned char, to match FcChar8 type definition.
18966
18967 * xterm.c (handle_one_xevent):
18968 * xmenu.c (create_and_show_popup_menu):
18969 * xselect.c (x_decline_selection_request)
18970 (x_reply_selection_request): Avoid type-punned deref of X events.
18971
18972 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18973
18974 Fix some uses of `int' instead of EMACS_INT.
18975 * search.c (string_match_1, fast_string_match)
18976 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18977 (scan_buffer, find_next_newline_no_quit)
18978 (find_before_next_newline, search_command, Freplace_match)
18979 (Fmatch_data): Make some `int' variables be EMACS_INT.
18980
18981 * xdisp.c (display_count_lines): 3rd argument and return value now
18982 EMACS_INT. All callers changed.
18983 (pint2hrstr): Last argument is now EMACS_INT.
18984
18985 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18986 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18987 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18988 (decode_coding_utf_16, decode_coding_emacs_mule)
18989 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18990 (decode_coding_ccl, decode_coding_charset)
18991 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18992 (decode_coding_iso_2022, decode_coding_emacs_mule)
18993 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18994 <char_offset, last_offset>: Declare EMACS_INT.
18995 (encode_coding_utf_8, encode_coding_utf_16)
18996 (encode_coding_emacs_mule, encode_invocation_designation)
18997 (encode_designation_at_bol, encode_coding_iso_2022)
18998 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18999 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19000 Declare EMACS_INT.
19001 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19002 (encode_invocation_designation): Last argument P_NCHARS is now
19003 EMACS_INT.
19004 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19005 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19006
19007 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19008 All users changed.
19009
19010 * ccl.c (Fccl_execute_on_string): Declare some variables
19011 EMACS_INT.
19012
19013 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19014
19015 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19016
19017 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19018
19019 * process.c (Fformat_network_address): Doc fix.
19020
19021 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19022
19023 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19024
19025 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19026
19027 * keyboard.c (read_char): Call Lisp function help-form-show,
19028 instead of using internal_with_output_to_temp_buffer.
19029 (Qhelp_form_show): New var.
19030 (syms_of_keyboard): Use DEFSYM macro.
19031
19032 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19033
19034 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19035
19036 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19037
19038 * process.c (Flist_processes): Remove to Lisp.
19039 (list_processes_1): Delete.
19040
19041 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19042
19043 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19044
19045 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19046
19047 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19048
19049 Fix more problems found by GCC 4.6.0's static checks.
19050
19051 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19052
19053 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19054
19055 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19056
19057 * xdisp.c (vmessage): Mark as a printf-like function.
19058
19059 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19060
19061 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19062
19063 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19064 printf-like functions.
19065 (tiff_load): Add casts to remove these marks before passing them
19066 to system-supplied API.
19067
19068 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19069
19070 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19071 This avoids several warnings with gcc -Wstrict-overflow.
19072 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19073 directly, rather than having caller test rule sign. This avoids
19074 some unnecessary tests.
19075 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19076 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19077 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19078
19079 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19080 (xfont_open): Avoid unnecessary tests.
19081
19082 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19083
19084 * composite.h, composite.c (composition_gstring_put_cache):
19085 Use EMACS_INT, not int, for length.
19086
19087 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19088 breaking out part of COMPOSITION_DECODE_RULE.
19089 (COMPOSITION_DECODE_RULE): Use it.
19090 * composite.c (get_composition_id): Remove unused local vars,
19091 by using the new macro.
19092
19093 * textprop.c (set_text_properties_1): Change while to do-while,
19094 since the condition is always true at first.
19095
19096 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19097 (interval_deletion_adjustment): Return unsigned value.
19098 All uses changed.
19099
19100 * process.c (list_processes_1, create_pty, read_process_output):
19101 (exec_sentinel): Remove vars that were set but not used.
19102 (create_pty): Remove unnecessary "volatile"s.
19103 (Fnetwork_interface_info): Avoid possibility of int overflow.
19104 (read_process_output): Do adaptive read buffering even if carryover.
19105 (read_process_output): Simplify nbytes computation if buffered.
19106
19107 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19108
19109 * syntax.c (scan_words): Remove var that was set but not used.
19110 (update_syntax_table): Use unsigned instead of int.
19111
19112 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19113 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19114 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19115
19116 * print.c (print_error_message): Avoid int overflow.
19117
19118 * font.c (font_list_entities): Redo for clarity,
19119 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19120
19121 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19122 (font_score): Avoid potential overflow in diff calculation.
19123
19124 * fns.c (substring_both): Remove var that is set but not used.
19125 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19126
19127 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19128
19129 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19130 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19131 can always succeed if overflow has undefined behavior.
19132
19133 * search.c (boyer_moore, wordify): Remove vars set but not used.
19134 (wordify): Omit three unnecessary tests.
19135
19136 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19137 All callers changed. This avoids the need for an unused var.
19138
19139 * casefiddle.c (casify_region): Remove var that is set but not used.
19140
19141 * dired.c (file_name_completion): Remove var that is set but not used.
19142
19143 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19144
19145 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19146 (Finsert_file_contents): Remove unnecessary code checking fd.
19147
19148 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19149 Check for integer overflow on size calculations.
19150
19151 * buffer.c (Fprevious_overlay_change): Remove var that is set
19152 but not used.
19153
19154 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19155 Remove vars that are set but not used.
19156 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19157 (timer_check_2): Mark vars as initialized.
19158
19159 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19160
19161 * image.c (lookup_image): Remove var that is set but not used.
19162 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19163
19164 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19165 that are set but not used.
19166
19167 * xfns.c (make_invisible_cursor): Don't return garbage
19168 if XCreateBitmapFromData fails (Bug#8410).
19169
19170 * xselect.c (x_get_local_selection, x_handle_property_notify):
19171 Remove vars that are set but not used.
19172
19173 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19174 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19175
19176 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19177 Remove var that is set but not used.
19178 (scroll_bar_windows_size): Now size_t, not int.
19179 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19180 Check for overflow.
19181
19182 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19183 (map_tty_color) [!defined MSDOS]: Likewise.
19184
19185 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19186
19187 * coding.c: Remove vars that are set but not used.
19188 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19189 All callers changed.
19190 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19191 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19192 (decode_coding_charset): Remove vars that are set but not used.
19193
19194 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19195 that is set but not used.
19196
19197 * print.c (print_object): Remove var that is set but not used.
19198
19199 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19200 The gnulib version avoids calling malloc in the usual case,
19201 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19202 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19203 * filelock.c (current_lock_owner): Likewise.
19204 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19205 * sysdep.c: Include allocator.h, careadlinkat.h.
19206 (emacs_no_realloc_allocator): New static constant.
19207 (emacs_readlink): New function.
19208 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19209 ../lib/careadlinkat.h.
19210
19211 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19212
19213 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19214 first non-nil return value).
19215
19216 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19217
19218 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19219 if not defined (Bug#8403).
19220
19221 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19222
19223 * xdisp.c (display_count_lines): Remove parameter `start',
19224 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19225 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19226 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19227 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19228 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19229 and thereabouts. All callers changed.
19230 (get_per_char_metric): Remove parameter `f', unused since
19231 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19232
19233 2011-04-02 Jim Meyering <meyering@redhat.com>
19234
19235 do not dereference NULL upon failed strdup
19236 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19237 (ns_get_family): Likewise.
19238
19239 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19240
19241 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19242
19243 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19244
19245 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19246 later (Bug#8403).
19247
19248 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19249
19250 Add lexical binding.
19251
19252 * window.c (Ftemp_output_buffer_show): New fun.
19253 (Fsave_window_excursion):
19254 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19255
19256 * lread.c (lisp_file_lexically_bound_p): New function.
19257 (Fload): Bind Qlexical_binding.
19258 (readevalloop): Remove `evalfun' arg.
19259 Bind Qinternal_interpreter_environment.
19260 (Feval_buffer): Bind Qlexical_binding.
19261 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19262 Mark as dynamic.
19263 (syms_of_lread): Declare `lexical-binding'.
19264
19265 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19266
19267 * keyboard.c (eval_dyn): New fun.
19268 (menu_item_eval_property): Use it.
19269
19270 * image.c (parse_image_spec): Use Ffunctionp.
19271
19272 * fns.c (concat, mapcar1): Accept byte-code-functions.
19273
19274 * eval.c (Fsetq): Handle lexical vars.
19275 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19276 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19277 (FletX, Flet): Obey lexical binding.
19278 (Fcommandp): Handle closures.
19279 (Feval): New `lexical' arg.
19280 (eval_sub): New function extracted from Feval. Use it almost
19281 everywhere where Feval was used. Look up vars in lexical env.
19282 Handle closures.
19283 (Ffunctionp): Move from subr.el.
19284 (Ffuncall): Handle closures.
19285 (apply_lambda): Remove `eval_flags'.
19286 (funcall_lambda): Handle closures and new byte-code-functions.
19287 (Fspecial_variable_p): New function.
19288 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19289 but without exporting it to Lisp.
19290
19291 * doc.c (Fdocumentation, store_function_docstring):
19292 * data.c (Finteractive_form): Handle closures.
19293
19294 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19295 interactive spec.
19296
19297 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19298 New byte-codes.
19299 (exec_byte_code): New function extracted from Fbyte_code to handle new
19300 calling convention for byte-code-functions. Add new byte-codes.
19301
19302 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19303
19304 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19305
19306 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19307
19308 * xdisp.c (redisplay_internal): Fix prototype.
19309
19310 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19311
19312 * xdisp.c (SCROLL_LIMIT): New macro.
19313 (try_scrolling): Use it when setting scroll_limit.
19314 Limit scrolling to 100 screen lines.
19315 (redisplay_window): Even when falling back on "recentering",
19316 position point in the window according to scroll-conservatively,
19317 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19318
19319 (try_scrolling): When point is above the window, allow searching
19320 as far as scroll_max, or one screenful, to compute vertical
19321 distance from PT to the scroll margin position. This prevents
19322 try_scrolling from unnecessarily failing when
19323 scroll-conservatively is set to a value slightly larger than the
19324 window height. Clean up the case of PT below the margin at bottom
19325 of window: scroll_max can no longer be INT_MAX. When aggressive
19326 scrolling is in use, don't let point enter the opposite scroll
19327 margin as result of the scroll.
19328 (syms_of_xdisp) <scroll-conservatively>: Document the
19329 threshold of 100 lines for never-recentering scrolling.
19330
19331 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19332
19333 * dispextern.h (move_it_by_lines):
19334 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19335 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19336 (message_log_check_duplicate): Remove parameters `prev_bol' and
19337 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19338 (redisplay_internal): Remove parameter `preserve_echo_area',
19339 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19340
19341 * indent.c (Fvertical_motion):
19342 * window.c (window_scroll_pixel_based, Frecenter):
19343 Don't pass `need_y_p' to `move_it_by_lines'.
19344
19345 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19346
19347 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19348 steal a few bits to be more compact.
19349 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19350 Remove unneeded casts.
19351
19352 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19353
19354 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19355
19356 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19357 binding" message (bug#7967).
19358
19359 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19360
19361 Fix more problems found by GCC 4.6.0's static checks.
19362
19363 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19364 Remove unused local var.
19365
19366 * editfns.c (Fmessage_box): Remove unused local var.
19367
19368 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19369 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19370 Omit unused local vars.
19371 * window.c (shrink_windows): Omit unused local var.
19372 * menu.c (digest_single_submenu): Omit unused local var.
19373 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19374 Omit unused local var.
19375
19376 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19377 Don't assume string length fits in int.
19378 (keyremap_step, read_key_sequence): Use size_t for sizes.
19379 (read_key_sequence): Don't check last_real_key_start redundantly.
19380
19381 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19382 instead of alloca (Bug#8344).
19383
19384 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19385 (Fbacktrace_frame): Don't assume nframes fits in int.
19386
19387 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19388
19389 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19390 concerns.
19391
19392 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19393
19394 * cm.c (calccost): Turn while-do into do-while, for clarity.
19395
19396 * keyboard.c (syms_of_keyboard): Use the same style as later
19397 in this function when indexing through an array. This also
19398 works around GCC bug 48267.
19399
19400 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19401
19402 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19403
19404 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19405 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19406
19407 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19408 This avoids undefined behavior on integer overflow, and is a bit
19409 more convenient anyway since it is compared to a size_t variable.
19410
19411 Variadic C functions now count arguments with size_t, not int.
19412 This avoids an unnecessary limitation on 64-bit machines, which
19413 caused (substring ...) to crash on large vectors (Bug#8344).
19414 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19415 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19416 All variadic functions and their callers changed accordingly.
19417 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19418 * data.c (arith_driver, float_arith_driver): Likewise.
19419 * editfns.c (general_insert_function): Likewise.
19420 * eval.c (struct backtrace.nargs, interactive_p)
19421 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19422 (funcall_lambda, mark_backtrace): Likewise.
19423 * fns.c (concat): Likewise.
19424 * frame.c (x_set_frame_parameters): Likewise.
19425 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19426 0 if not found, not -1. All callers changed.
19427
19428 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19429 (stack_copy_size): Now size_t, not int.
19430 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19431
19432 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19433
19434 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19435 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19436 All callers changed.
19437
19438 * lisp.h (multibyte_char_to_unibyte):
19439 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19440 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19441 * character.h (CHAR_TO_BYTE8):
19442 * cmds.c (internal_self_insert):
19443 * editfns.c (general_insert_function):
19444 * keymap.c (push_key_description):
19445 * search.c (Freplace_match):
19446 * xdisp.c (message_dolog, set_message_1): All callers changed.
19447
19448 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19449
19450 * keyboard.c (safe_run_hook_funcall): New function.
19451 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19452 don't set the hook to nil, but remove the offending function instead.
19453 (Qcommand_hook_internal): Remove, unused.
19454 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19455 Vcommand_hook_internal.
19456
19457 * eval.c (enum run_hooks_condition): Remove.
19458 (funcall_nil, funcall_not): New functions.
19459 (run_hook_with_args): Call each function through a `funcall' argument.
19460 Remove `cond' argument, now redundant.
19461 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19462 (Frun_hook_with_args_until_failure): Adjust accordingly.
19463 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19464
19465 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19466
19467 * dispextern.h (string_buffer_position): Remove declaration.
19468
19469 * print.c (strout): Remove parameter `multibyte', unused since
19470 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19471
19472 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19473 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19474 All callers changed.
19475
19476 * w32.c (_wsa_errlist): Use braces for struct initializers.
19477
19478 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19479 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19480 All callers changed.
19481 (string_buffer_position): Likewise. Also, make static (it's never
19482 used outside xdisp.c).
19483 (cursor_row_p): Remove parameter `w', unused since
19484 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19485 (decode_mode_spec): Remove parameter `precision', introduced during
19486 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19487 All callers changed.
19488
19489 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19490
19491 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19492
19493 2011-03-27 Anders Lindgren <andlind@gmail.com>
19494
19495 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19496 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19497 (ns_update_auto_hide_menu_bar): New functions.
19498 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19499 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19500 ns_constrain_all_frames.
19501 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19502 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19503
19504 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19505
19506 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19507
19508 2011-03-27 Glenn Morris <rgm@gnu.org>
19509
19510 * syssignal.h: Replace RETSIGTYPE with void.
19511 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19512 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19513 Replace SIGTYPE with void everywhere.
19514 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19515 * s/template.h (SIGTYPE): Remove commented out definition.
19516
19517 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19518
19519 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19520 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19521
19522 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19523
19524 * w32.c (read_unc_volume): Use parameter `henum', instead of
19525 global variable `wget_enum_handle'.
19526
19527 * keymap.c (describe_vector): Remove parameters `indices' and
19528 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19529 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19530
19531 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19532
19533 * keyboard.c (timer_check): Remove parameter `do_it_now',
19534 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19535 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19536 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19537
19538 * keyboard.c (read_char):
19539 * w32menu.c (w32_menu_display_help):
19540 * xmenu.c (show_help_event, menu_help_callback):
19541 Adjust calls to `show_help_echo'.
19542
19543 * gtkutil.c (xg_maybe_add_timer):
19544 * keyboard.c (readable_events):
19545 * process.c (wait_reading_process_output):
19546 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19547
19548 * insdel.c (adjust_markers_gap_motion):
19549 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19550 (gap_left, gap_right): Don't call it.
19551
19552 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19553
19554 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19555 incurred during fontification.
19556
19557 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19558
19559 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19560 (DEFVAR_PER_BUFFER): Don't pass it.
19561
19562 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19563 (scrolling_window): Don't pass it.
19564
19565 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19566
19567 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19568
19569 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19570 and `suffix'.
19571 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19572 of variables specific to SELinux and computation of `encoded_absname'.
19573
19574 * image.c (XPutPixel): Remove unused variable `height'.
19575
19576 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19577
19578 * unexw32.c (get_section_info): Remove unused variable `section'.
19579
19580 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19581 (system_process_attributes): Remove unused variable `sess'.
19582 (sys_read): Remove unused variable `err'.
19583
19584 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19585 (w32_wnd_proc): Remove unused variable `isdead'.
19586 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19587 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19588 (x_create_tip_frame): Remove unused variable `tem'.
19589
19590 * w32inevt.c (w32_console_read_socket):
19591 Remove unused variable `no_events'.
19592
19593 * w32term.c (x_draw_composite_glyph_string_foreground):
19594 Remove unused variable `width'.
19595
19596 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19597
19598 * w32term.c (x_set_glyph_string_clipping):
19599 Don't pass uninitialized region to CombineRgn.
19600
19601 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19602
19603 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19604 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19605 (Fx_close_connection): Remove unused variable `i'.
19606
19607 * w32font.c (w32font_draw): Return number of glyphs.
19608 (w32font_open_internal): Remove unused variable `i'.
19609 (w32font_driver): Add missing initializer.
19610
19611 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19612 (fill_in_menu): Remove unused variable `items_added'.
19613
19614 * w32term.c (last_mouse_press_frame): Remove static global variable.
19615 (w32_clip_to_row): Remove unused variable `f'.
19616 (x_delete_terminal): Remove unused variable `i'.
19617
19618 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19619 (NOTHING): Remove unused static global variable.
19620 (uniscribe_check_otf): Remove unused variable `table'.
19621 (uniscribe_font_driver): Add missing initializers.
19622
19623 2011-03-23 Julien Danjou <julien@danjou.info>
19624
19625 * term.c (Fsuspend_tty, Fresume_tty):
19626 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19627 * window.c (temp_output_buffer_show):
19628 * insdel.c (signal_before_change):
19629 * frame.c (Fhandle_switch_frame):
19630 * fileio.c (Fdo_auto_save):
19631 * emacs.c (Fkill_emacs):
19632 * editfns.c (save_excursion_restore):
19633 * cmds.c (internal_self_insert):
19634 * callint.c (Fcall_interactively):
19635 * buffer.c (Fkill_all_local_variables):
19636 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19637 Use Frun_hooks.
19638 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19639 unconditionally since it does the check itself.
19640
19641 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19642
19643 Fix more problems found by GCC 4.5.2's static checks.
19644
19645 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19646 the first time through the loop, since we know p0 < p1 then.
19647 This also avoids a gcc -Wstrict-overflow warning.
19648
19649 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19650 leading to a memory leak, possible in functions like
19651 load_charset_map_from_file that can allocate an unbounded number
19652 of objects (Bug#8318).
19653
19654 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19655 that could (at least in theory) be that large.
19656
19657 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19658 This is less likely to overflow, and avoids undefined behavior if
19659 overflow does occur. All callers changed. Use strtoul to scan
19660 for the unsigned long integer.
19661 (pint2hrstr): Simplify and tune code slightly.
19662 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19663
19664 * scroll.c (do_scrolling): Work around GCC bug 48228.
19665 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19666
19667 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19668 This also avoids a warning with gcc -Wstrict-overflow.
19669 (validate_x_resource_name): Simplify count usage.
19670 This also avoids a warning with gcc -Wstrict-overflow.
19671
19672 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19673 fail (Bug#8306).
19674
19675 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19676
19677 * process.c (Fmake_network_process): Use socklen_t, not int,
19678 where POSIX says socklen_t is required in portable programs.
19679 This fixes a porting bug on hosts like 64-bit HP-UX, where
19680 socklen_t is wider than int (Bug#8277).
19681 (Fmake_network_process, server_accept_connection):
19682 (wait_reading_process_output, read_process_output):
19683 Likewise.
19684
19685 * process.c: Rename or move locals to avoid shadowing.
19686 (list_processes_1, Fmake_network_process):
19687 (read_process_output_error_handler, exec_sentinel_error_handler):
19688 Rename or move locals.
19689 (Fmake_network_process): Define label "retry_connect" only if needed.
19690 (Fnetwork_interface_info): Fix pointer signedness.
19691 (process_send_signal): Add cast to avoid pointer signedness problem.
19692 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19693 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19694
19695 Make tparam.h and terminfo.c consistent.
19696 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19697 Include tparam.h instead, since it declares them.
19698 * cm.h (PC): Remove extern decl; tparam.h now does this.
19699 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19700 * terminfo.c: Include tparam.h, to check interfaces.
19701 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19702 (tparam): Adjust signature to match interface in tparam.h;
19703 this removes some undefined behavior. Check that outstring and len
19704 are zero, which they always are with Emacs.
19705 * tparam.h (PC, BC, UP): New extern decls.
19706
19707 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19708 (xftfont_open): Rename locals to avoid shadowing.
19709
19710 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19711 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19712 (OTF_TAG_SYM): Omit macro if not needed.
19713 (ftfont_list): Remove unused local.
19714 (get_adstyle_property, ftfont_pattern_entity):
19715 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19716 Rename locals to avoid shadowing.
19717
19718 * xfont.c (xfont_list_family): Mark var as initialized.
19719
19720 * xml.c (make_dom): Now static.
19721
19722 * composite.c (composition_compute_stop_pos): Rename local to
19723 avoid shadowing.
19724 (composition_reseat_it): Remove unused locals.
19725 (find_automatic_composition, composition_adjust_point): Likewise.
19726 (composition_update_it): Mark var as initialized.
19727 (find_automatic_composition): Mark vars as initialized,
19728 with a FIXME (Bug#8290).
19729
19730 character.h: Rename locals to avoid shadowing.
19731 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19732 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19733 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19734 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19735 to avoid shadowing.
19736
19737 * textprop.c (property_change_between_p): Remove; unused.
19738
19739 * intervals.c (interval_start_pos): Now static.
19740
19741 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19742
19743 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19744 Rename locals to avoid shadowing.
19745
19746 * sound.c (wav_play, au_play, Fplay_sound_internal):
19747 Fix pointer signedness.
19748 (alsa_choose_format): Remove unused local var.
19749 (wav_play): Initialize a variable to 0, to prevent undefined
19750 behavior (Bug#8278).
19751
19752 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19753
19754 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19755
19756 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19757 clobbering (Bug#8298).
19758 * sysdep.c (sys_subshell): Likewise.
19759 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19760
19761 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19762 This should get cleaned up, so that child_setup has the
19763 same signature on all platforms.
19764
19765 * callproc.c (call_process_cleanup): Now static.
19766 (relocate_fd): Rename locals to avoid shadowing.
19767
19768 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19769
19770 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19771 not to be necessary, and produces flickering.
19772
19773 2011-03-20 Glenn Morris <rgm@gnu.org>
19774
19775 * config.in: Remove file.
19776
19777 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19778
19779 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19780 are now in src/globals.h.
19781 (syms_of_minibuf): Remove spurious & from previous change.
19782
19783 2011-03-20 Leo Liu <sdl.web@gmail.com>
19784
19785 * minibuf.c (completing-read-function): New variable.
19786 (completing-read-default): Rename from completing-read.
19787 (completing-read): Call completing-read-function.
19788
19789 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19790
19791 * xfaces.c (Fx_load_color_file):
19792 Read color file from absolute filename (bug#8250).
19793
19794 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19795
19796 * makefile.w32-in: Update dependencies.
19797
19798 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19799
19800 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19801
19802 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19803
19804 Fix more problems found by GCC 4.5.2's static checks.
19805
19806 * process.c (make_serial_process_unwind, send_process_trap):
19807 (sigchld_handler): Now static.
19808
19809 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19810 That way, the code declares only the vars that it needs.
19811 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19812 * s/cygwin.h (PTY_ITERATION): Likewise.
19813 * s/darwin.h (PTY_ITERATION): Likewise.
19814 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19815
19816 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19817 * process.c (allocate_pty): Don't declare stb unless it's needed.
19818
19819 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19820 (CONSTANTLIM): Remove; unused.
19821 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19822 Define only if needed.
19823
19824 * unexelf.c (unexec): Name an expression,
19825 to avoid gcc -Wbad-function-cast warning.
19826 Use a different way to cause a compilation error if anyone uses
19827 n rather than nn, a way that does not involve shadowing.
19828 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19829
19830 * deps.mk (unexalpha.o): Remove; unused.
19831
19832 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19833 * unexec.h: New file.
19834 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19835 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19836 Depend on unexec.h.
19837 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19838 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19839 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19840 Change as necessary to match prototype in unexec.h.
19841
19842 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19843 shadowing.
19844 (back_comment, skip_chars): Mark vars as initialized.
19845
19846 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19847 Rename locals to avoid shadowing.
19848
19849 * lread.c (read1): Rewrite so as not to use empty "else".
19850 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19851
19852 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19853
19854 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19855 warning when compiling print.c.
19856
19857 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19858 instead of using an uninitialized var.
19859 (font_sort_entities): Mark var as initialized.
19860
19861 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19862
19863 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19864 pointers to constants.
19865 (font_parse_fcname): Remove unused vars.
19866 (font_delete_unmatched): Now static.
19867 (font_get_spec): Remove; unused.
19868 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19869 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19870 Rename or move locals to avoid shadowing.
19871
19872 * fns.c (require_nesting_list, require_unwind): Now static.
19873 (Ffillarray): Rename locals to avoid shadowing.
19874
19875 * floatfns.c (domain_error2): Define only if needed.
19876 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19877
19878 * alloc.c (mark_backtrace): Move decl from here ...
19879 * lisp.h: ... to here, so that it can be checked.
19880
19881 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19882 (Fdefvar): Rewrite so as not to use empty "else".
19883 (lisp_indirect_variable): Name an expression,
19884 to avoid gcc -Wbad-function-cast warning.
19885 (Fdefvar): Rename locals to avoid shadowing.
19886
19887 * callint.c (quotify_arg, quotify_args): Now static.
19888 (Fcall_interactively): Rename locals to avoid shadowing.
19889 Use const pointer when appropriate.
19890
19891 * lisp.h (get_system_name, get_operating_system_release):
19892 Move decls here, to check interfaces.
19893 * process.c (get_operating_system_release): Move decl to lisp.h.
19894 * xrdb.c (get_system_name): Likewise.
19895 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19896 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19897 some of which prompt warnings from gcc -Wbad-function-cast.
19898 (Fformat_time_string, Fencode_time, Finsert_char):
19899 (Ftranslate_region_internal, Fformat):
19900 Rename or remove local vars to avoid shadowing.
19901 (Ftranslate_region_internal): Mark var as initialized.
19902
19903 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19904 avoid shadowing.
19905
19906 * lisp.h (eassert): Check that the argument compiles, even if
19907 ENABLE_CHECKING is not defined.
19908
19909 * data.c (Findirect_variable): Name an expression, to avoid
19910 gcc -Wbad-function-cast warning.
19911 (default_value, arithcompare, arith_driver, arith_error): Now static.
19912 (store_symval_forwarding): Rename local to avoid shadowing.
19913 (Fmake_variable_buffer_local, Fmake_local_variable):
19914 Mark variables as initialized.
19915 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19916
19917 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19918 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19919 Rename locals to avoid shadowing.
19920 (mark_stack): Move local variables into the #ifdef region where
19921 they're used.
19922 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19923 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19924 needed otherwise.
19925 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19926 (GC_STRING_CHARS): Remove; not used.
19927 (Fmemory_limit): Cast sbrk's returned value to char *.
19928
19929 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19930 avoids undefined behavior in theory.
19931
19932 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19933
19934 Use functions, not macros, for up- and down-casing (Bug#8254).
19935 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19936 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19937 to use the following functions instead of these macros.
19938 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19939 EMACS_INT, since callers assume the returned value fits in int.
19940 (upcase1): Likewise, for UPCASE_TABLE.
19941 (uppercasep, lowercasep, upcase): New static inline functions.
19942 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19943 the race-condition problem in the old DOWNCASE.
19944
19945 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19946 Rename locals to avoid shadowing.
19947 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19948 (regex_compile, re_search_2, re_match_2_internal):
19949 Remove unused local vars.
19950 (FREE_VAR): Rewrite so as not to use empty "else",
19951 which gcc can warn about.
19952 (regex_compile, re_match_2_internal): Mark locals as initialized.
19953 (RETALLOC_IF): Define only if needed.
19954 (WORDCHAR_P): Likewise. This one is never needed, but is used
19955 only in a comment talking about a compiler bug, so put inside
19956 the #if 0 of that comment.
19957 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19958 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19959 Remove; unused.
19960
19961 * search.c (boyer_moore): Rename locals to avoid shadowing.
19962 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19963 (PREV_CHAR_BOUNDARY): Likewise.
19964
19965 * search.c (simple_search): Remove unused var.
19966
19967 * dired.c (compile_pattern): Move decl from here ...
19968 * lisp.h: ... to here, so that it can be checked.
19969 (struct re_registers): New forward decl.
19970
19971 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19972
19973 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19974 All uses changed.
19975 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19976 Rename locals to avoid shadowing.
19977 (Fvertical_motion): Mark locals as initialized.
19978
19979 * casefiddle.c (casify_object, casify_region): Now static.
19980 (casify_region): Mark local as initialized.
19981
19982 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19983
19984 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19985 New macros, so that the caller can use some names other than
19986 gcpro1, gcpro2, etc.
19987 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19988 of the new macros.
19989 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19990 argument, for consistency with GCPRO2_VAR, etc: it is now the
19991 prefix of the variable, not the variable itself. All uses
19992 changed.
19993 * dired.c (directory_files_internal, file_name_completion):
19994 Rename locals to avoid shadowing.
19995
19996 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19997 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19998 dired.c's scmp function, had undefined behavior.
19999 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20000 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20001 * buffer.h: ... to here, because these macros use current_buffer,
20002 and the new implementation with inline functions needs to have
20003 current_buffer in scope now, rather than later when the macros
20004 are used.
20005 (downcase, upcase1): New static inline functions.
20006 (DOWNCASE, UPCASE1): Reimplement using these functions.
20007 This avoids undefined behavior in expressions like
20008 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20009 from race conditions in accessing the global variables
20010 case_temp1 and case_temp2.
20011 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20012 * lisp.h (case_temp1, case_temp2): Remove their decls.
20013 * character.h (ASCII_CHAR_P): Move from here ...
20014 * lisp.h: ... to here, so that the inline functions mentioned
20015 above can use them.
20016
20017 * dired.c (directory_files_internal_unwind): Now static.
20018
20019 * fileio.c (file_name_as_directory, directory_file_name):
20020 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20021 Now static.
20022 (file_name_as_directory): Use const pointers when appropriate.
20023 (Fexpand_file_name): Likewise. In particular, newdir might
20024 point at constant storage, so make it a const pointer.
20025 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20026 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20027 signedness issues.
20028 (Fset_file_times, Finsert_file_contents, auto_save_error):
20029 Rename locals to avoid shadowing.
20030
20031 * minibuf.c (choose_minibuf_frame_1): Now static.
20032 (Ftry_completion, Fall_completions): Rename or remove locals
20033 to avoid shadowing.
20034
20035 * marker.c (bytepos_to_charpos): Remove; unused.
20036
20037 * lisp.h (verify_bytepos, count_markers): New decls,
20038 so that gcc does not warn that these functions aren't declared.
20039
20040 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20041 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20042 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20043 (copy_text): Remove unused local var.
20044
20045 * filelock.c (within_one_second): Now static.
20046 (lock_file_1): Rename local to avoid shadowing.
20047
20048 * buffer.c (fix_overlays_before): Mark locals as initialized.
20049 (fix_start_end_in_overlays): Likewise. This function should be
20050 simplified by using pointers-to-pointers, but that's a different
20051 matter.
20052 (switch_to_buffer_1): Now static.
20053 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20054 (report_overlay_modification): Rename locals to avoid shadowing.
20055
20056 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20057 Fix pointer signedness issue.
20058 (sys_subshell): Mark local as volatile if checking for lint,
20059 to suppress a gcc -Wclobbered warning that does not seem to be right.
20060 (MAXPATHLEN): Define only if needed.
20061
20062 * process.c (serial_open, serial_configure): Move decls from here ...
20063 * systty.h: ... to here, so that they can be checked.
20064
20065 * fns.c (get_random, seed_random): Move extern decls from here ...
20066 * lisp.h: ... to here, so that they can be checked.
20067
20068 * sysdep.c (reset_io): Now static.
20069 (wait_for_termination_signal): Remove; unused.
20070
20071 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20072 (copy_keymap_item, append_key, push_text_char_description):
20073 Now static.
20074 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20075 (DENSE_TABLE_SIZE): Remove; unused.
20076 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20077 (describe_map_tree):
20078 Rename locals to avoid shadowing.
20079
20080 * keyboard.c: Declare functions static if they are not used elsewhere.
20081 (echo_char, echo_dash, cmd_error, top_level_2):
20082 (poll_for_input, handle_async_input): Now static.
20083 (read_char, kbd_buffer_get_event, make_lispy_position):
20084 (make_lispy_event, make_lispy_movement, apply_modifiers):
20085 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20086 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20087 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20088 (read_key_sequence, read_char): Mark locals as initialized.
20089 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20090
20091 * keyboard.h (make_ctrl_char): New decl.
20092 (mark_kboards): Move decl here ...
20093 * alloc.c (mark_kboards): ... from here.
20094
20095 * lisp.h (force_auto_save_soon): New decl.
20096
20097 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20098 (DEFINE_DUMMY_FUNCTION): New macro.
20099 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20100 Use it.
20101 (main): Add casts to avoid warnings
20102 if GCC considers string literals to be constants.
20103
20104 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20105
20106 * dbusbind.c: Pointer signedness fixes.
20107 (xd_signature, xd_append_arg, xd_initialize):
20108 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20109 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20110 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20111 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20112
20113 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20114 if GCC considers string literals to be constants.
20115 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20116
20117 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20118
20119 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20120 (print_preprocess, print_object): New macro to fix last change.
20121
20122 * print.c (print_preprocess): Don't forget font objects.
20123
20124 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20125
20126 * emacs.c (USAGE3): Doc fixes.
20127
20128 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20129
20130 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20131 structure.
20132
20133 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20134
20135 * lisp.h (VWindow_system, Qfile_name_history):
20136 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20137 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20138 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20139
20140 * w32select.c: Don't #include "keyboard.h".
20141 (run_protected): Add extern declaration for waiting_for_input.
20142
20143 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20144 * w32console.c (detect_input_pending, read_input_pending)
20145 (encode_terminal_code):
20146 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20147 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20148 (w32_system_caret_y, Qfile_name_history):
20149 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20150 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20151 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20152 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20153 * w32proc.c (Qlocal, report_file_error):
20154 * w32term.c (Vwindow_system, updating_frame):
20155 * w32uniscribe.c (initialized, uniscribe_font_driver):
20156 Remove unneeded extern declarations.
20157
20158 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20159
20160 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20161
20162 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20163
20164 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20165 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20166 These macros can no longer be used for assignment.
20167
20168 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20169 Assign struct members directly, instead of using BUF_BEGV etc.
20170 (record_buffer_markers, fetch_buffer_markers): New functions for
20171 recording and fetching special buffer markers.
20172 (set_buffer_internal_1, set_buffer_temp): Use them.
20173
20174 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20175
20176 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20177
20178 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20179 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20180
20181 * xdisp.c (hscroll_window_tree):
20182 (reconsider_clip_changes): Use PT instead of BUF_PT.
20183
20184 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20185
20186 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20187 $(EMACS_ROOT)/lib/intprops.h.
20188
20189 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20190
20191 Fix more problems found by GCC 4.5.2's static checks.
20192
20193 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20194 to unsigned char * to avoid compiler diagnostic.
20195 (xg_free_frame_widgets): Make it clear that a local variable is
20196 needed only if USE_GTK_TOOLTIP.
20197 (gdk_window_get_screen): Make it clear that this macro is needed
20198 only if USE_GTK_TOOLTIP.
20199 (int_gtk_range_get_value): New function, which avoids a diagnostic
20200 from gcc -Wbad-function-cast.
20201 (xg_set_toolkit_scroll_bar_thumb): Use it.
20202 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20203 diagnostic from gcc -Wbad-function-cast.
20204 (get_utf8_string, xg_get_file_with_chooser):
20205 Rename locals to avoid shadowing.
20206 (create_dialog): Move locals to avoid shadowing.
20207
20208 * xgselect.c (xg_select): Remove unused var.
20209
20210 * image.c (four_corners_best): Mark locals as initialized.
20211 (gif_load): Initialize transparent_p to zero (Bug#8238).
20212 Mark another local as initialized.
20213 (my_png_error, my_error_exit): Mark with NO_RETURN.
20214
20215 * image.c (clear_image_cache): Now static.
20216 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20217 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20218 (x_edge_detection): Remove unnecessary cast that
20219 gcc -Wbad-function-cast diagnoses.
20220 (gif_load): Fix pointer signedness.
20221 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20222 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20223
20224 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20225
20226 Improve quality of tests for time stamp overflow.
20227 For example, without this patch (encode-time 0 0 0 1 1
20228 1152921504606846976) returns the obviously-bogus value (-948597
20229 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20230 reports time overflow. See
20231 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20232 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20233 * editfns.c: Include limits.h and intprops.h.
20234 (TIME_T_MIN, TIME_T_MAX): New macros.
20235 (time_overflow): Move earlier, to before first use.
20236 (hi_time, lo_time): New functions, for an accurate test for
20237 out-of-range times.
20238 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20239 (Fget_internal_run_time): Don't assume time_t fits in int.
20240 (make_time): Use list2 instead of Fcons twice.
20241 (Fdecode_time): More accurate test for out-of-range times.
20242 (check_tm_member): New function.
20243 (Fencode_time): Use it, to test for out-of-range times.
20244 (lisp_time_argument): Don't rely on undefined left-shift and
20245 right-shift behavior when checking for time stamp overflow.
20246
20247 * editfns.c (time_overflow): New function, refactoring common code.
20248 (Fformat_time_string, Fdecode_time, Fencode_time):
20249 (Fcurrent_time_string): Use it.
20250
20251 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20252 * dired.c (make_time): Move to ...
20253 * editfns.c (make_time): ... here.
20254 * systime.h: Note the move.
20255
20256 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20257
20258 * fringe.c (update_window_fringes): Remove unused variables.
20259
20260 * unexmacosx.c (copy_data_segment): Also copy __got section.
20261 (Bug#8223)
20262
20263 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20264
20265 * termcap.c [MSDOS]: Include "msdos.h".
20266 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20267 Constify `char *' arguments and their references according to
20268 prototypes in tparam.h.
20269
20270 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20271
20272 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20273 Adapt all references accordingly.
20274
20275 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20276
20277 2011-03-11 Tom Tromey <tromey@redhat.com>
20278
20279 * buffer.c (syms_of_buffer): Remove obsolete comment.
20280
20281 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20282
20283 * termhooks.h (encode_terminal_code): Declare prototype.
20284
20285 * msdos.c (encode_terminal_code): Don't declare prototype.
20286
20287 * term.c (encode_terminal_code): Now external again, used by
20288 w32console.c and msdos.c.
20289
20290 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20291 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20292
20293 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20294
20295 Fix some minor problems found by GCC 4.5.2's static checks.
20296
20297 * fringe.c (update_window_fringes): Mark locals as initialized
20298 (Bug#8227).
20299 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20300
20301 * alloc.c (mark_fringe_data): Move decl from here ...
20302 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20303 to check its interface.
20304 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20305
20306 * fontset.c (free_realized_fontset): Now static.
20307 (Fset_fontset_font): Rename local to avoid shadowing.
20308 (fontset_font): Mark local as initialized.
20309 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20310
20311 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20312
20313 * xselect.c (x_disown_buffer_selections): Remove; not used.
20314 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20315 (x_own_selection, Fx_disown_selection_internal): Rename locals
20316 to avoid shadowing.
20317 (x_handle_dnd_message): Remove local to avoid shadowing.
20318
20319 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20320 so that the caller can use some name other than gcpro1.
20321 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20322 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20323 (Fx_backspace_delete_keys_p):
20324 Use them to avoid shadowing, and rename vars to avoid shadowing.
20325 (x_decode_color, x_set_name, x_window): Now static.
20326 (Fx_create_frame): Add braces to silence GCC warning.
20327 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20328 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20329 Remove unused locals.
20330 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20331 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20332 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20333 macros.
20334
20335 * xterm.h (x_mouse_leave): New decl.
20336
20337 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20338 Remove unused functions.
20339 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20340 (x_calc_absolute_position): Now static.
20341 (XTread_socket): Don't define label "out" unless it's used.
20342 Don't declare local "event" unless it's used.
20343 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20344 unless they are used.
20345 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20346 (x_fatal_error_signal): Remove; not used.
20347 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20348 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20349 (x_error_catcher, x_connection_closed, x_error_handler):
20350 (x_error_quitter, xembed_send_message, x_iconify_frame):
20351 (my_log_handler): Rename locals to avoid shadowing.
20352 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20353 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20354
20355 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20356 Rename or move locals to avoid shadowing.
20357 (tty_defined_color, merge_face_heights): Now static.
20358 (free_realized_faces_for_fontset): Remove; not used.
20359 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20360 does not deduce is never used uninitialized.
20361 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20362 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20363
20364 * terminal.c (store_terminal_param): Now static.
20365
20366 * xmenu.c (menu_highlight_callback): Now static.
20367 (set_frame_menubar): Remove unused local.
20368 (xmenu_show): Rename parameter to avoid shadowing.
20369 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20370 since they might point to immutable storage.
20371 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20372 since it's unused otherwise.
20373
20374 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20375 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20376 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20377 avoids a gcc -Wuninitialized diagnostic.
20378 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20379 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20380 does not deduce are never used uninitialized.
20381
20382 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20383
20384 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20385 * window.c (window_loop, size_window):
20386 (run_window_configuration_change_hook, enlarge_window): Likewise.
20387
20388 * window.c (display_buffer): Now static.
20389 (size_window): Mark variables that gcc -Wuninitialized
20390 does not deduce are never used uninitialized.
20391 * window.h (check_all_windows): New decl, to forestall
20392 gcc -Wmissing-prototypes diagnostic.
20393 * dispextern.h (bidi_dump_cached_states): Likewise.
20394
20395 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20396 shadowing.
20397 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20398 Include <limits.h>.
20399 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20400 and to avoid gcc -Wuninitialized warning.
20401 (load_charset_map): Mark variables that gcc -Wuninitialized
20402 does not deduce are never used uninitialized.
20403 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20404
20405 * coding.c (coding_set_source, coding_set_destination):
20406 Use "else { /* comment */ }" rather than "else /* comment */;"
20407 for clarity, and to avoid gcc -Wempty-body warning.
20408 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20409 a block, when the outer 'i' will do.
20410 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20411 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20412 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20413 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20414 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20415 Rename locals to avoid shadowing.
20416 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20417 * coding.c (emacs_mule_char, encode_invocation_designation):
20418 Now static, since they're not used elsewhere.
20419 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20420 (decode_coding_object, encode_coding_object, detect_coding_system):
20421 (decode_coding_emacs_mule): Mark variables that gcc
20422 -Wuninitialized does not deduce are never used uninitialized.
20423 (detect_coding_iso_2022): Initialize a local variable that might
20424 be used uninitialized. Leave a FIXME because it's not clear that
20425 this initialization is needed. (Bug#8211)
20426 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20427 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20428 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20429 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20430 Remove unused macros.
20431
20432 * category.c (hash_get_category_set): Remove unused local var.
20433 (copy_category_table): Now static, since it's not used elsewhere.
20434 * character.c (string_count_byte8): Likewise.
20435
20436 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20437 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20438
20439 * chartab.c (copy_sub_char_table): Now static, since it's not used
20440 elsewhere.
20441 (sub_char_table_ref_and_range, char_table_ref_and_range):
20442 Rename locals to avoid shadowing.
20443 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20444
20445 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20446 (BIDI_BOB): Remove unused macro.
20447
20448 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20449 deduce are never used uninitialized.
20450 * term.c (encode_terminal_code): Likewise.
20451
20452 * term.c (encode_terminal_code): Now static. Remove unused local.
20453
20454 * tparam.h: New file.
20455 * term.c, tparam.h: Include it.
20456 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20457 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20458 Move these decls to tparam.h, and make them agree with what
20459 is actually in tparam.c. The previous trick of using incompatible
20460 decls in different modules does not conform to the C standard.
20461 All callers of tparam changed to use tparam's actual API.
20462 * tparam.c (tparam1, tparam, tgoto):
20463 Use const pointers where appropriate.
20464
20465 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20466 * cm.h (struct cm): Likewise.
20467 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20468 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20469 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20470 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20471 (turn_on_face, init_tty): Likewise.
20472 * termchar.h (struct tty_display_info): Likewise.
20473
20474 * term.c (term_mouse_position): Rename local to avoid shadowing.
20475
20476 * alloc.c (mark_ttys): Move decl from here ...
20477 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20478
20479 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20480
20481 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20482
20483 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20484
20485 * search.c (compile_pattern_1): Remove argument regp, unused since
20486 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20487 (compile_pattern): Don't pass it.
20488
20489 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20490
20491 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20492 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20493 for ! HAVE_GTK3.
20494 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20495
20496 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20497
20498 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20499 gdk_window_get_screen, gdk_window_get_geometry,
20500 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20501 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20502 (xg_get_pixbuf_from_pixmap): New function.
20503 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20504 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20505 Call xg_get_pixbuf_from_pixmap instead of
20506 gdk_pixbuf_get_from_drawable.
20507 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20508 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20509 (xg_check_special_colors): Use GtkStyleContext and its functions
20510 for HAVE_GTK3.
20511 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20512 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20513 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20514 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20515 Call gtk_widget_get_preferred_size.
20516 (xg_frame_resized): gdk_window_get_geometry only takes 5
20517 parameters.
20518 (xg_win_to_widget, xg_event_is_for_menubar):
20519 Call gdk_x11_window_lookup_for_display.
20520 (xg_set_widget_bg): New function.
20521 (delete_cb): New function.
20522 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20523 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20524 (xg_set_background_color): Call xg_set_widget_bg.
20525 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20526 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20527 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20528 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20529 if ! HAVE_GTK3.
20530 (update_frame_tool_bar): Call gtk_widget_hide.
20531 (xg_initialize): Use GDK_KEY_g.
20532
20533 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20534 if ! HAVE_GTK3
20535 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20536
20537 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20538 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20539 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20540
20541 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20542
20543 * w32xfns.c (select_palette): Check success of RealizePalette against
20544 GDI_ERROR, not zero.
20545
20546 See ChangeLog.11 for earlier changes.
20547
20548 ;; Local Variables:
20549 ;; coding: utf-8
20550 ;; End:
20551
20552 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20553
20554 This file is part of GNU Emacs.
20555
20556 GNU Emacs is free software: you can redistribute it and/or modify
20557 it under the terms of the GNU General Public License as published by
20558 the Free Software Foundation, either version 3 of the License, or
20559 (at your option) any later version.
20560
20561 GNU Emacs is distributed in the hope that it will be useful,
20562 but WITHOUT ANY WARRANTY; without even the implied warranty of
20563 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20564 GNU General Public License for more details.
20565
20566 You should have received a copy of the GNU General Public License
20567 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.