]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Merge from emacs-24; up to 2012-11-24T16:58:43Z!cyd@gnu.org
[gnu-emacs] / src / ChangeLog
1 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2
3 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4 fails, signal an error instead of continuing with an empty
5 string. (Bug#13079)
6 Encode expanded temp file pattern before passing it to mkstemp or
7 mktemp.
8
9 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
10 Encode the file name before passing it to dostounix_filename, in
11 case it will downcase it (under w32-downcase-file-names).
12 (Bug#12933)
13
14 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
15
16 Minor call-process cleanups.
17 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
18 at the same time as other platforms, to simplify analysis.
19 No need for fd0_volatile since we have synch_process_fd.
20 Avoid needless emacs_close; arg is always negative.
21
22 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
23
24 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
25 processes.
26
27 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
28
29 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
30 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
31 and mouse_face_hidden members to a bitfields.
32 * frame.h (struct frame): Remove set-but-not-used space_width member.
33 (FRAME_SPACE_WIDTH): Remove.
34 * nsterm.m, w32term.c, xterm.c: Adjust users.
35 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
36 member. Adjust users. Convert term_initted, delete_in_insert_mode,
37 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
38 members to a bitfields.
39
40 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
41
42 Don't let call-process be a zombie factory (Bug#12980).
43 Fixing this bug required some cleanup of the signal-handling code.
44 As a side effect, this change also fixes a longstanding rare race
45 condition whereby Emacs could mistakenly kill unrelated processes,
46 and it fixes a bug where a second C-g does not kill a recalcitrant
47 synchronous process in GNU/Linux and similar platforms.
48 The patch should also fix the last vestiges of Bug#9488,
49 a bug which has mostly been fixed on the trunk by other changes.
50 * callproc.c, process.h (synch_process_alive, synch_process_death)
51 (synch_process_termsig, sync_process_retcode):
52 Remove. All uses removed, to simplify analysis and so that
53 less consing is done inside critical sections.
54 * callproc.c (call_process_exited): Remove. All uses replaced
55 with !synch_process_pid.
56 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
57 These take the role of what used to be in unwind-protect arg.
58 All uses changed.
59 (block_child_signal, unblock_child_signal):
60 New functions, to avoid races that could kill innocent-victim processes.
61 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
62 (call_process_kill): Record killed processes as deleted, so that
63 zombies do not clutter up the system. Do this inside a critical
64 section, to avoid a race that would allow the clutter.
65 (call_process_cleanup): Fix code so that the second C-g works again
66 on common platforms such as GNU/Linux.
67 (Fcall_process): Create the child process in a critical section,
68 to fix a race condition. If creating an asynchronous process,
69 record it as deleted so that zombies do not clutter up the system.
70 Do unwind-protect for WINDOWSNT too, as that's simpler in the
71 light of these changes. Omit unnecessary call to emacs_close
72 before failure, as the unwind-protect code does that.
73 * callproc.c (call_process_cleanup):
74 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
75 * process.c (record_deleted_pid): New function, containing
76 code refactored out of Fdelete_process.
77 (Fdelete_process): Use it.
78 (process_status_retrieved): Remove. All callers changed to use
79 child_status_change.
80 (record_child_status_change): Remove, folding its contents into ...
81 (handle_child_signal): ... this signal handler. Now, this
82 function is purely a handler for SIGCHLD, and is not called after
83 a synchronous waitpid returns; the synchronous code is moved to
84 wait_for_termination. There is no need to worry about reaping
85 more than one child now.
86 * sysdep.c (get_child_status, child_status_changed): New functions.
87 (wait_for_termination): Now takes int * status and bool
88 interruptible arguments, too. Do not record child status change;
89 that's now the caller's responsibility. All callers changed.
90 Reimplement in terms of get_child_status.
91 (wait_for_termination_1, interruptible_wait_for_termination):
92 Remove. All callers changed to use wait_for_termination.
93 * syswait.h: Include <stdbool.h>, for bool.
94 (record_child_status_change, interruptible_wait_for_termination):
95 Remove decls.
96 (record_deleted_pid, child_status_changed): New decls.
97 (wait_for_termination): Adjust to API changes noted above.
98
99 * bytecode.c, lisp.h (Qbytecode): Remove.
100 No longer needed after 2012-11-20 interactive-p changes.
101
102 2012-12-03 Eli Zaretskii <eliz@gnu.org>
103
104 * xdisp.c (redisplay_window): If the cursor is visible, but inside
105 the scroll margin, move point outside the margin. (Bug#13055)
106
107 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
108
109 * gtkutil.c (my_log_handler): New function.
110 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
111
112 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
113
114 * lisp.h (modify_region): Rename to...
115 (modify_region_1): ...new prototype.
116 * textprop.c (modify_region): Now static. Adjust users.
117 * insdel.c (modify_region): Rename to...
118 (modify_region_1): ...new function to work with current buffer.
119 Adjust comment and users. Use true and false for booleans.
120
121 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
122
123 * alloc.c (free_save_value): New function.
124 (safe_alloca_unwind): Use it.
125 * lisp.h (free_save_value): New prototype.
126 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
127 Add comment.
128 (save_excursion_restore): Adjust to match saved data structure.
129 Use free_save_value to offload some work from GC. Drop obsolete
130 #if 0 code.
131
132 2012-12-03 Chong Yidong <cyd@gnu.org>
133
134 * fileio.c (Vauto_save_list_file_name): Doc fix.
135
136 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
137
138 * w32fns.c: Remove prototype of atof.
139 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
140 builds.
141 (file_dialog_callback): Declared UINT_PTR.
142
143 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
144 with 64-bit builds.
145
146 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
147 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
148 defined.
149
150 2012-12-03 Glenn Morris <rgm@gnu.org>
151
152 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
153
154 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
155
156 Fix xpalloc confusion after memory is exhausted.
157 * alloc.c (xpalloc): Comment fix.
158 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
159 and signals an error, do not clear charset_table_size, as
160 charset_table is still valid.
161 * doprnt.c (evxprintf): Clear *BUF after freeing it.
162
163 Use execve to avoid need to munge environ (Bug#13054).
164 * callproc.c (Fcall_process):
165 * process.c (create_process):
166 Don't save and restore environ; no longer needed.
167 * callproc.c (child_setup):
168 Use execve, not execvp, to preserve environ.
169
170 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
171
172 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
173
174 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
175
176 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
177 display for sliced images (Bug#10500).
178
179 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
180
181 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
182
183 * doc.c (Fdocumentation): Re-add handling of function-documentation,
184 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
185
186 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
187
188 * xdisp.c (window_outdated): Remove eassert since it hits
189 some suspicious corner cases (see Bug#13007 and Bug#13012).
190 (mode_line_update_needed): New function.
191 (redisplay_internal, redisplay_window): Use it.
192 (ensure_selected_frame): New function.
193 (redisplay_internal, unwind_redisplay): Use it.
194 (redisplay_internal): Move comment about buffer_shared...
195 (buffer_shared_and_changed): ...near to its real use.
196
197 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
198
199 * callproc.c (Fcall_process): Don't misreport vfork failure.
200
201 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
202
203 * callproc.c (Fcall_process): Fix vfork portability problems.
204 Do not assume that fd[0], count, filefd, and save_environ survive
205 vfork. Fix bug whereby wrong errno value could be reported for
206 pipe failure. Some minor cleanups, too, as follows. Move buf and
207 bufsize to the context where they're needed. Change new_argv to
208 be of type char **, as this is more convenient and avoids casts.
209 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
210 Now local constants, not macros.
211
212 2012-11-18 Kenichi Handa <handa@gnu.org>
213
214 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
215 for the variable "f".
216
217 2012-11-13 Kenichi Handa <handa@gnu.org>
218
219 * font.c (font_unparse_xlfd): Exclude special characters from the
220 generating XLFD name.
221
222 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
223
224 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
225 * dired.c (stat_uname, stat_gname):
226 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
227
228 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
229 * dired.c (directory_files_internal, file_name_completion):
230 Assume EAGAIN and EINTR are defined.
231
232 * fileio.c (Fcopy_file): Assume EISDIR is defined.
233 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
234 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
235 * lread.c (readbyte_from_file): Assume EINTR is defined.
236 * process.c (wait_reading_process_output, send_process) [subprocesses]:
237 Assume EIO and EAGAIN are defined.
238 * unexcoff.c (write_segment): Assume EFAULT is defined.
239
240 2012-11-27 Eli Zaretskii <eliz@gnu.org>
241
242 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
243 (Bug#11964)
244
245 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
246 highlighting on the frame was cleared. Prevents assertion
247 violations when repeatedly clicking on the "Top" link of the
248 "bread-crumbs" in Info buffers.
249
250 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
251
252 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
253
254 2012-11-24 Ken Brown <kbrown@cornell.edu>
255
256 * keyboard.c (HAVE_MOUSE):
257 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
258 were always defined.
259
260 2012-11-24 Eli Zaretskii <eliz@gnu.org>
261
262 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
263 between bpos_covered and bpos_max. This fixes cursor display when
264 several display strings follow each other.
265
266 * .gdbinit (pgx): If the glyph's object is a string, display the
267 pointer to string data, rather than the value of the string object
268 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
269
270 * indent.c (Fvertical_motion): If the starting position is covered
271 by a display string, return to one position before that, to avoid
272 overshooting it inside move_it_to. (Bug#12930)
273
274 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
275
276 * frame.h (struct frame): Remove display_preempted member
277 since all users are dead long ago.
278 * nsterm.h (struct x_output): Use the only dummy member.
279 * w32menu.c (pending_menu_activation): Remove since not
280 really used.
281 (set_frame_menubar): Adjust user.
282 * w32term.h (struct x_output): Drop outdated #if 0 code.
283 (struct w32_output): Use bitfields for explicit_parent,
284 asked_for_visible and menubar_active members. Drop
285 unused pending_menu_activation member.
286 * xterm.h (struct x_output): Drop outdated #if 0 code.
287 Use bitfields for explicit_parent, asked_for_visible,
288 has_been_visible and net_wm_state_hidden_seen members.
289
290 2012-11-23 Eli Zaretskii <eliz@gnu.org>
291
292 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
293 of a literal "/". (Bug#12955)
294 (gl-stamp): Invoke fc.exe directly, not through cmd.
295
296 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
297
298 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
299 * dired.c: Assume HAVE_DIRENT_H.
300 (NAMLEN): Remove, replacing with ...
301 (dirent_namelen): New function. All uses changed. Use the GNU macro
302 _D_EXACT_NAMELEN if available, as it's faster than strlen.
303 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
304 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
305 * makefile.w32-in (DIR_H): Remove. All uses replaced with
306 $(NT_INC)/dirent.h.
307 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
308 * ndir.h: Rename to ../nt/inc/dirent.h.
309 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
310 Do not include <dirent.h>; no longer needed.
311 * w32.c: Include <dirent.h> rather than "ndir.h".
312
313 2012-11-23 Chong Yidong <cyd@gnu.org>
314
315 * xftfont.c (xftfont_open): Remove duplicate assignment.
316
317 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
318
319 * alloc.c (Fgarbage_collect): Unblock input after clearing
320 gc_in_progress to avoid note_mouse_highlight glitch with GC.
321 * frame.h (FRAME_MOUSE_UPDATE): New macro.
322 * msdos.c (IT_frame_up_to_date): Use it here...
323 * w32term.c (w32_frame_up_to_date): ...here...
324 * xterm.c (XTframe_up_to_date): ...and here...
325 * nsterm.m (ns_frame_up_to_date): ...but not here.
326 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
327 Adjust users.
328 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
329 Do not check whether GC is in progress.
330
331 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
332
333 * xdisp.c (window_buffer_changed): New function.
334 (update_menu_bar, update_tool_bar): Use it to
335 simplify large 'if' statements.
336 (redisplay_internal): Generalize commonly used
337 'tail' and 'frame' local variables.
338
339 2012-11-22 Eli Zaretskii <eliz@gnu.org>
340
341 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
342 with Windows system header.
343
344 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
345
346 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
347 * alloc.c: Assume unistd.h exists.
348 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
349 * sysdep.c (get_current_dir_name): Assume getcwd exists.
350 (getwd) [USG]: Remove; no longer needed.
351 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
352 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
353 * w32.h (getcwd): Remove decl.
354
355 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
356
357 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
358 Make it set selected_window as well.
359 (update_tool_bar): Use it.
360
361 2012-11-21 Ken Brown <kbrown@cornell.edu>
362
363 * emacs.c (main): Set the G_SLICE environment variable for all
364 Cygwin builds, not just GTK builds. See
365 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
366
367 2012-11-21 Eli Zaretskii <eliz@gnu.org>
368
369 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
370 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
371 Define for the MSVC compiler.
372
373 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
374
375 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
376 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
377 dostounix_filename. Prevents crashes down the road, because
378 dostounix_filename assumes it gets a unibyte string. Reported by
379 Michel de Ruiter <michel@sentient.nl>, see
380 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
381
382 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
383
384 Conflate Qnil and Qunbound for `symbol-function'.
385 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
386 * lread.c (init_obarray): Set `function' fields to Qnil.
387 * eval.c (Fcommandp): Ignore Qunbound.
388 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
389 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
390 Test NILP rather than Qunbound.
391 (Ffmakunbound): Set to Qnil.
392 (Fsymbol_function): Never signal an error.
393 (Finteractive_form): Ignore Qunbound.
394
395 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
396
397 * eval.c (interactive_p): Remove no-longer-used decl.
398
399 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
400
401 * xdisp.c (buffer_shared): Adjust comment.
402 (buffer_shared_and_changed): New function.
403 (prepare_menu_bars, redisplay_internal): Use it to
404 decide whether all windows or frames should be updated.
405 (window_outdated): New function.
406 (text_outside_line_unchanged_p, redisplay_window): Use it.
407 (redisplay_internal): Likewise. Fix indentation.
408
409 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
410
411 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
412 (syms_of_eval): Remove corresponding defsubr.
413 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
414
415 2012-11-19 Daniel Colascione <dancol@dancol.org>
416
417 * w32fns.c (Fx_file_dialog):
418 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
419 cygwin_convert_file_name*.
420
421 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
422 Rename cygwin_convert_path* to cygwin_convert_file_name*.
423
424 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
425
426 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
427
428 2012-11-18 Eli Zaretskii <eliz@gnu.org>
429
430 * w32select.c: Include w32common.h before w32term.h, so that
431 windows.h gets included before w32term.h uses some of its
432 features, see below.
433
434 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
435 New typedefs.
436 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
437 New prototypes.
438 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
439
440 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
441
442 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
443 (ns_select): Return at once if events are held (Bug#12834).
444
445 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
446
447 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
448 Needed following 2012-10-20 change. (Bug#12902)
449
450 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
451
452 * w32proc.c (waitpid): Remove unused label get_result.
453
454 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
455
456 * makefile.w32-in (SYSWAIT_H): New macro.
457 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
458 ($(BLD)/sysdep.$(O)): Update dependencies.
459
460 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
461
462 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
463 * callproc.c (relocate_fd): Assume F_DUPFD.
464 * emacs.c, term.c (O_RDWR): Remove.
465 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
466 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
467 * nsterm.m: Assume <fcntl.h> exists.
468 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
469 (create_pty, Fmake_network_process, server_accept_connection)
470 (wait_reading_process_output, init_process_emacs):
471 Assume O_NONBLOCK.
472 (wait_reading_process_output): Put in a special case for WINDOWSNT
473 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
474 It's not clear this is needed, but it's a more-conservative change.
475 (create_process): Assume FD_CLOEXEC.
476 (create_process, create_pty): Assume O_NOCTTY.
477 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
478 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
479 Omit if not DOS_NT, since F_GETFL is not defined there.
480 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
481 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
482 (O_NOCTTY): Remove.
483 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
484 lack it, since gnulib guarantees this.
485 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
486
487 2012-11-17 Eli Zaretskii <eliz@gnu.org>
488
489 * w32.c (faccessat): Pretend that directories have the execute bit
490 set. Emacs expects that, e.g., in files.el:cd-absolute.
491
492 * w32proc.c (create_child): Don't clip the PID of the child
493 process to fit into an Emacs integer, as this is no longer a
494 restriction.
495 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
496 reaping only the process specified by PID argument, if that is
497 positive. Use PID instead of dead_child to know which process to
498 reap. Wait for the child to die only if WNOHANG is not in
499 OPTIONS.
500 (sys_select): Don't set dead_child.
501
502 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
503 as it is no longer needed.
504
505 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
506 no longer needed.
507 (record_child_status_change): Remove the setting of
508 record_at_most_one_child for the !WNOHANG case.
509
510 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
511
512 Fix problems in ns port found by static checking.
513 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
514 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
515 not to process group.
516 (ns_select): Use emacs_write, not write, as that's more robust
517 in the presence of signals.
518 (fd_handler:): Check for read errors.
519
520 2012-11-16 Glenn Morris <rgm@gnu.org>
521
522 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
523
524 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
525
526 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
527
528 2012-11-16 Eli Zaretskii <eliz@gnu.org>
529
530 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
531 use the same value of thread handle.
532 (start_timer_thread): If the timer thread exited (due to error),
533 clean up by closing the two handles it used. Duplicate the caller
534 thread's handle here, so it gets duplicated only once, when
535 launching the timer thread. Set priority of the timer thread, not
536 the caller thread.
537 (getitimer): Don't duplicate the caller thread's handle here.
538 (Bug#12832)
539
540 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
541
542 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
543 called (Bug#12834).
544
545 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
546
547 Remove no-longer-used pty_max_bytes variable.
548 * process.c (pty_max_bytes): Remove; unused.
549 (send_process): Do not set it.
550
551 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
552
553 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
554 Update dependencies.
555
556 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
557
558 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
559 This follows up on the 2012-09-29 patch that removed indirection
560 for the 'function' field. Reported by Sergey Vinokurov in
561 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
562
563 2012-11-14 Eli Zaretskii <eliz@gnu.org>
564
565 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
566 different name, as the MS runtime does not have such a function,
567 and probably never will.) All callers changed. Ignore DIRFD
568 value if PATH is an absolute file name, to match Posix spec
569 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
570 symlinks.
571
572 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
573
574 * xdisp.c (echo_area_display, redisplay_internal):
575 Omit redundant check whether frame_garbaged is set.
576
577 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
578
579 Use faccessat, not access, when checking file permissions (Bug#12632).
580 This fixes a bug that has been present in Emacs since its creation.
581 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
582 which must set some sort of record. (Torek's bug report was against
583 a predecessor of GNU Emacs, but GNU Emacs happened to have the
584 same common flaw.) See Torek's Usenet posting
585 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
586 Posted: Fri Apr 8 14:18:56 1983.
587 * Makefile.in (LIB_EACCESS): New macro.
588 (LIBES): Use it.
589 * callproc.c (init_callproc):
590 * charset.c (init_charset):
591 * fileio.c (check_existing, check_executable, check_writable)
592 (Ffile_readable_p):
593 * lread.c (openp, load_path_check):
594 * process.c (allocate_pty):
595 * xrdb.c (file_p):
596 Use effective UID when checking permissions, not real UID.
597 * callproc.c (init_callproc):
598 * charset.c (init_charset):
599 * lread.c (load_path_check, init_lread):
600 Test whether directories are accessible, not merely whether they exist.
601 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
602 * fileio.c (check_existing, check_executable, check_writable)
603 (Ffile_readable_p):
604 Use symbolic names instead of integers for the flags, as they're
605 portable now.
606 (check_writable): New arg AMODE. All uses changed.
607 Set errno on failure.
608 (Ffile_readable_p): Use faccessat, not stat + open + close.
609 (Ffile_writable_p): No need to call check_existing + check_writable.
610 Just call check_writable and then look at errno. This saves a syscall.
611 dir should never be nil; replace an unnecessary runtime check
612 with an eassert. When checking the parent directory of a nonexistent
613 file, check that the directory is searchable as well as writable, as
614 we can't create files in unsearchable directories.
615 (file_directory_p): New function, which uses 'stat' on most platforms
616 but faccessat with D_OK (for efficiency) if WINDOWSNT.
617 (Ffile_directory_p, Fset_file_times): Use it.
618 (file_accessible_directory_p): New function, which uses a single
619 syscall for efficiency.
620 (Ffile_accessible_directory_p): Use it.
621 * xrdb.c (file_p): Use file_directory_p.
622 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
623 * lread.c (openp): When opening a file, use fstat rather than
624 stat, as that avoids a permissions race. When not opening a file,
625 use file_directory_p rather than stat.
626 (dir_warning): First arg is now a usage string, not a format.
627 Use errno. All uses changed.
628 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
629 that merely introduced a race.
630 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
631 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
632 and similarly for the other O_* flags.
633 * w32.c (sys_faccessat): Rename from sys_access and switch to
634 faccessat's API. All uses changed.
635 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
636 (magic_db): Rename from magic_file_p.
637 (magic_db, search_magic_path): Return an XrmDatabase rather than a
638 char *, so that we don't have to test for file existence
639 separately from opening the file for reading. This removes a race
640 fixes a permission-checking problem, and simplifies the code.
641 All uses changed.
642 (file_p): Remove; no longer needed.
643
644 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
645
646 Omit glyphs initialization at startup.
647 * dispnew.c (glyphs_initialized_initially_p): Remove.
648 (adjust_frame_glyphs_initially): Likewise. Adjust users.
649 (Fredraw_frame): Move actual code from here...
650 (redraw_frame): ...to here. Add eassert. Adjust comment.
651 (Fredraw_display): Use redraw_frame.
652 * xdisp.c (clear_garbaged_frames): Likewise.
653
654 2012-11-13 Eli Zaretskii <eliz@gnu.org>
655
656 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
657 passed to pint2str and pint2hrstr to be at most the size of the
658 frame's decode_mode_spec_buffer. This avoids crashes with very
659 large values of FIELD_WIDTH argument to decode_mode_spec.
660 (Bug#12867)
661
662 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
663
664 Fix a race with verify-visited-file-modtime (Bug#12863).
665 Since at least 1991 Emacs has ignored an mtime difference of no
666 more than one second, but my guess is that this was to work around
667 file system bugs that were fixed long ago. Since the race is
668 causing problems now, let's remove that code.
669 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
670 whose time stamp is off by no more than a second. Insist that the
671 file time stamps match exactly.
672
673 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
674
675 * frame.h (struct frame): Convert external_tool_bar member to
676 1-bit unsigned bitfield.
677 * termhooks.h (struct terminal): Remove mouse_moved member since
678 all users are long dead. Adjust comment on mouse_position_hook.
679
680 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
681
682 Simplify by using FOR_EACH_FRAME here and there.
683 * frame.c (next_frame, prev_frame, other_visible_frames)
684 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
685 * w32term.c (x_window_to_scroll_bar): Likewise.
686 * window.c (window_list): Likewise.
687 * xdisp.c (x_consider_frame_title): Likewise.
688 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
689 * xfns.c (x_window_to_frame, x_any_window_to_frame)
690 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
691 * xmenu.c (menubar_id_to_frame): Likewise.
692 * xselect.c (frame_for_x_selection): Likewise.
693 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
694 (x_window_to_menu_bar): Likewise.
695 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
696
697 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
698
699 * data.c (Qdefalias_fset_function): Now static.
700
701 Another tweak to vectorlike_header change.
702 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
703 Remove, and replace all uses with ...
704 (next_in_free_list, set_next_in_free_list):
705 New functions, which respect C's aliasing rules better.
706
707 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
708
709 * window.c (list4i): Rename from 'quad'. All uses changed.
710 Needed because <sys/types.h> defines 'quad' on Solaris 10.
711
712 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
713
714 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
715 warning about mixing declarations and code in ISO C90.
716
717 2012-11-10 Martin Rudalics <rudalics@gmx.at>
718
719 * window.c (Fsplit_window_internal): Set combination limit of
720 new parent window to t iff Vwindow_combination_limit is t;
721 fixing a regression introduced with the change from 2012-09-22.
722 (Fset_window_combination_limit): Fix doc-string.
723
724 2012-11-10 Eli Zaretskii <eliz@gnu.org>
725
726 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
727 amount when the scroll margins are too large. When scrolling
728 backwards in the buffer, give up if cannot reach point or the
729 scroll margin within a reasonable number of screen lines.
730 Fixes point position in window under scroll-up/down-aggressively when
731 point is positioned many lines beyond the window top/bottom.
732 (Bug#12811)
733
734 * ralloc.c (relinquish): If real_morecore fails to return memory
735 to the system, don't crash; instead, leave the last heap
736 unchanged and return. (Bug#12774)
737
738 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
739
740 * lisp.h (AUTOLOADP): New macro.
741 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
742 * data.c (Ffset): Remove special ad-advice-info handling.
743 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
744 (Fsubr_arity): CSE.
745 (Finteractive_form): Simplify.
746 (Fquo): Don't insist on having at least 2 arguments.
747 (Qdefalias_fset_function): New var.
748
749 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
750
751 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
752
753 * nsfont.m (Qcondensed, Qexpanded): New variables.
754 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
755 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
756
757 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
758
759 Fix recently introduced crash on MS-Windows (Bug#12839).
760 * w32term.h (struct scroll_bar): Use convenient header.
761 (SCROLL_BAR_VEC_SIZE): Remove.
762 * w32term.c (x_scroll_bar_create): Use VECSIZE.
763
764 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
765
766 Tweak last vectorlike_header change.
767 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
768 vectorlike object on the free list. This is introduced to avoid
769 some (but not all) pointer casting and aliasing problems, see
770 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
771 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
772 objects.
773 (xvectype, xvecsize): Use them to examine Lisp_Object values.
774
775 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
776
777 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
778 been removed, so remove them here also.
779
780 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
781
782 * doc.c (Fdocumentation): Handle new property
783 dynamic-docstring-function to replace the old ad-advice-info.
784
785 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
786
787 * fns.c (Qeql, hashtest_eq): Now static.
788
789 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
790
791 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
792 * fns.c (hashfn_eq, hashfn_eql, sxhash):
793 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
794 * buffer.c (compare_overlays): Use XLI rather than XHASH.
795
796 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
797
798 Use same hash function for hashfn_profiler as for hash_string etc.
799 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
800 * lisp.h (sxhash_combine): New inline function, with the contents
801 of the old SXHASH_COMBINE.
802 * profiler.c (hashfn_profiler): Use it, instead of having a
803 special hash function containing a comparison that always yields 1.
804
805 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
806
807 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
808 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
809 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
810 Remove unused vars.
811
812 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
813
814 * image.c (xpm_make_color_table_h): Fix compiler error because
815 make_hash_table changed.
816
817 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
818
819 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
820
821 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
822
823 Use ad-hoc comparison function for the profiler's hash-tables.
824 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
825 (make_log): Use them.
826 (handle_profiler_signal): Don't inhibit quit any longer since we don't
827 call Fequal any more.
828 (Ffunction_equal): New function.
829 (cmpfn_profiler, hashfn_profiler): New functions.
830 (syms_of_profiler): Initialize them.
831 * lisp.h (struct hash_table_test): New struct.
832 (struct Lisp_Hash_Table): Use it.
833 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
834 * fns.c (make_hash_table): Take a struct to describe the test.
835 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
836 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
837 (hash_lookup, hash_remove_from_table): Move assertion checking of
838 hashfn result here. Check hash-equality before calling cmpfn.
839 (Fmake_hash_table): Adjust call to make_hash_table.
840 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
841 (syms_of_fns): Initialize them.
842 * emacs.c (main): Move syms_of_fns earlier.
843 * xterm.c (syms_of_xterm):
844 * category.c (hash_get_category_set): Adjust call to make_hash_table.
845 * print.c (print_object): Adjust to new hash-table struct.
846 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
847
848 2012-11-08 Eli Zaretskii <eliz@gnu.org>
849
850 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
851 value of w32-scroll-lock-modifier is neither nil nor one of the
852 known key modifiers. (Bug#12806)
853
854 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
855
856 Shrink struct vectorlike_header to the only size field.
857 * lisp.h (enum pvec_type): Avoid explicit enum member values.
858 Adjust comment.
859 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
860 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
861 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
862 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
863 information from the vector header. Adjust comment.
864 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
865 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
866 layout.
867 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
868 (struct vectorlike_header): Remove next member. Adjust comment.
869 (struct Lisp_Subr): Add convenient header. Adjust comment.
870 (allocate_pseudovector): Adjust prototype.
871 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
872 (sweep_string, lisp_malloc): Remove useless prototypes.
873 (enum mem_type): Adjust comment.
874 (NEXT_IN_FREE_LIST): New macro.
875 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
876 (Fmake_bool_vector): Likewise.
877 (struct large_vector): New type to represent allocation unit for
878 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
879 (large_vectors): Change type to struct large_vector.
880 (allocate_vector_from_block): Simplify.
881 (PSEUDOVECTOR_NBYTES): Replace with...
882 (vector_nbytes): ...new function. Adjust users.
883 (sweep_vectors): Adjust processing of large vectors.
884 (allocate_vectorlike): Likewise.
885 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
886 Add easserts. Adjust XSETPVECTYPESIZE usage.
887 (allocate_buffer): Use BUFFER_PVEC_INIT.
888 (live_vector_p): Adjust to match large vector.
889 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
890 * buffer.h (struct buffer): Add next member.
891 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
892 New macros.
893 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
894 * fns.c (internal_equal): Adjust to match enum pvec_type change.
895 (copy_hash_table): Adjust to match vector header change.
896 * lread.c (defsubr): Use XSETPVECTYPE.
897 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
898 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
899 (xvecsize): New command.
900
901 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
902
903 * keyboard.c (event_to_kboard): Do not dereference
904 frame_or_window field of SELECTION_REQUEST_EVENT
905 and SELECTION_CLEAR_EVENT events (Bug#12814).
906 * xterm.h (struct selection_input_event): Adjust comment.
907
908 2012-11-07 Eli Zaretskii <eliz@gnu.org>
909
910 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
911 such as Scroll Lock, if the respective keys are treated as
912 function keys, not as modifiers. This avoids destroying non-ASCII
913 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
914
915 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
916
917 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
918
919 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
920
921 Restore some duplicate definitions (Bug#12814).
922 This undoes part of the 2012-11-03 changes. Some people build
923 with plain -g rather than with -g3, and they need the duplicate
924 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
925 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
926 Define as macros, as well as as enums or as constants.
927
928 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
929
930 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
931 to keypad keys (Bug#12816).
932
933 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
934
935 Minor adjustments of recently-changed frame functions.
936 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
937 known to be a frame (we're in the FRAMEP branch).
938 * lisp.h (Qframep): Remove decl. frame.h declares this.
939 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
940 since they're meant for Lisp fixnum values.
941
942 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
943
944 * window.c (Fwindow_combination_limit): Revert to the only
945 required argument and adjust docstring as suggested in
946 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
947 by Martin Rudalics <rudalics@gmx.at>.
948
949 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
950
951 Widely used frame validity and checking functions.
952 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
953 * frame.c (decode_live_frame, decode_any_frame): New functions.
954 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
955 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
956 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
957 (Fframe_pointer_visible_p): Use decode_any_frame.
958 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
959 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
960 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
961 (Fframe_focus): Likewise. Allow zero number of arguments.
962 Adjust docstring.
963 (frame_buffer_list, frame_buffer_predicate): Remove.
964 * lisp.h (frame_buffer_predicate): Remove prototype.
965 * buffer.c (Fother_buffer): Use decode_any_frame.
966 * xdisp.c (Ftool_bar_lines_needed): Likewise.
967 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
968 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
969 (Fclose_font, Ffont_info): Use decode_live_frame.
970 * fontset.c (check_fontset_name): Likewise.
971 * terminal.c (Fframe_terminal): Likewise.
972 * w32fns.c (check_x_frame): Likewise.
973 * window.c (Fminibuffer_window, Fwindow_at)
974 (Fcurrent_window_configuration): Likewise.
975 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
976 Likewise. Allow zero number of arguments. Adjust docstring.
977 * dispnew.c (Fredraw_frame): Likewise.
978 * xfaces.c (frame_or_selected_frame): Remove.
979 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
980 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
981 (Fframe_face_alist): Use decode_live_frame.
982 * xfns.c (check_x_frame): Likewise.
983
984 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
985
986 * window.c (quad): New function.
987 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
988 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
989 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
990 (Fwindow_line_height): Use it.
991 (Fwindow_fringes): Use list3.
992 (Fwindow_scroll_bars): Use list4.
993 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
994 (Fwindow_combination_limit): Allow zero number of arguments.
995
996 2012-11-05 Eli Zaretskii <eliz@gnu.org>
997
998 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
999
1000 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1001 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1002 file descriptor 2 for standard error. (Bug#12805)
1003
1004 2012-11-05 Chong Yidong <cyd@gnu.org>
1005
1006 * process.c (wait_reading_process_output): Revert previous change.
1007
1008 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1009
1010 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1011 This removes code that has been obsolete since around 1990.
1012 * callproc.c (Fcall_process):
1013 * emacs.c (main):
1014 * process.c (create_process):
1015 * term.c (dissociate_if_controlling_tty):
1016 Assume setsid exists.
1017 * callproc.c (child_setup): Assume setpgid exists and behaves as
1018 per POSIX.1-1988 or later.
1019 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1020 * emacs.c (shut_down_emacs):
1021 * sysdep.c (sys_suspend, init_foreground_group):
1022 Assume getpgrp behaves as per POSIX.1-1998 or later.
1023 * msdos.c (setpgrp): Remove.
1024 (tcgetpgrp, setpgid, setsid): New functions.
1025 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1026 * term.c (no_controlling_tty): Remove; unused.
1027 * w32proc.c (setpgrp): Remove.
1028 (setsid, tcgetpgrp): New functions.
1029
1030 Simplify by assuming __fpending.
1031 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1032 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1033 Do not assume that __fpending's result fits in int.
1034
1035 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1036
1037 Remove EMACS_OUTQSIZE+sleep hack.
1038 * dispnew.c (update_frame_1): Remove hack for terminals slower
1039 than 2400 bps, which throttled Emacs by having it sleep.
1040 This code hasn't worked since at least 2007, when the multi-tty stuff
1041 was added, and anyway those old terminals are long dead.
1042 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1043 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1044
1045 Fix data-loss with --version (Bug#9574).
1046 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1047 as we can't assume that emacs_strerror is initialized, and strerror
1048 is good enough here.
1049 (main): Invoke atexit earlier, to catch earlier instances of
1050 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1051
1052 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1053
1054 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1055 (keyDown): Remap keypad keys to X11 virtual key codes.
1056
1057 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1058
1059 Fix data-loss with --batch (Bug#9574).
1060 * emacs.c: Include <close-stream.h>.
1061 (close_output_streams): New function.
1062 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1063 and handles errors appropriately.
1064 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1065 does that now.
1066
1067 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1068 The symptom is a diagnostic "GLib-WARNING **: In call to
1069 g_spawn_sync(), exit status of a child process was requested but
1070 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1071 waitpid(), so exit status can't be returned." The diagnostic
1072 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1073 The real bug is a race condition between Emacs and glib: Emacs
1074 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1075 so that glib can't find it. Work around the bug by invoking
1076 waitpid only on subprocesses that Emacs itself creates.
1077 * process.c (create_process, record_child_status_change):
1078 Don't use special value -1 in pid field, as the caller now must
1079 know the pid rather than having the callee infer it.
1080 The inference was sometimes incorrect anyway, due to another race.
1081 (create_process): Set new 'alive' member if child is created.
1082 (process_status_retrieved): New function.
1083 (record_child_status_change): Use it.
1084 Accept negative 1st argument, which means to wait for the
1085 processes that Emacs already knows about. Move special-case code
1086 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1087 processes that have already been waited for, by testing and
1088 clearing new 'alive' member.
1089 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1090 now does this internally.
1091 (handle_child_signal): Let record_child_status_change do all
1092 the work, since we do not want to reap all exited child processes,
1093 only the child processes that Emacs itself created.
1094 * process.h (Lisp_Process): New boolean member 'alive'.
1095
1096 Omit duplicate definitions no longer needed with gcc -g3.
1097 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1098 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1099 Define only as macros. There's no longer any need to also define
1100 these symbols as enums or as constants, since we now assume
1101 gcc -g3 when debugging.
1102
1103 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1104
1105 * lisp.mk: Adjust comments to the fact that term/internal is now
1106 loaded from loadup.el.
1107
1108 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1109 (msdos_fatal_signal): New function.
1110 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1111 its argument list.
1112
1113 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1114 for GCC versions before 4.
1115 (emacs_raise): Define to call msdos_fatal_signal.
1116
1117 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1118 iterator when starting in the middle of a display or overlay
1119 string. (Bug#12745)
1120
1121 2012-11-03 Chong Yidong <cyd@gnu.org>
1122
1123 * process.c (wait_reading_process_output): Clean up the last
1124 change.
1125
1126 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1127
1128 * process.c (wait_reading_process_output): Avoid a race condition
1129 with SIGIO delivery (Bug#11536).
1130
1131 2012-11-03 Chong Yidong <cyd@gnu.org>
1132
1133 * buffer.c (cursor_type): Untabify docstring.
1134
1135 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1136
1137 * frame.h (struct frame): Drop can_have_scroll_bars member
1138 which is meaningless for a long time. Adjust comments.
1139 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1140 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1141
1142 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1143
1144 * window.c (decode_next_window_args): Update window arg after
1145 calling decode_live_window and so fix crash reported at
1146 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1147 by Juanma Barranquero <lekktu@gmail.com>.
1148 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1149 * font.c (Ffont_at): Likewise.
1150
1151 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1152
1153 * widget.c (resize_cb): New function.
1154 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1155 (EmacsFrameResize): Check if all is up to date before changing frame
1156 size.
1157
1158 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1159
1160 Implement backtrace output for fatal errors on MS-Windows.
1161 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1162 (BACKTRACE_LIMIT_MAX): New macro.
1163 (w32_backtrace): New function.
1164 (emacs_abort): Use w32_backtrace when the user chooses not to
1165 attach a debugger. Update the text of the abort dialog.
1166
1167 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1168
1169 Window-related stuff cleanup here and there.
1170 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1171 Use decode_any_window.
1172 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1173 * xdisp.c (Fformat_mode_line): Likewise.
1174 * font.c (Ffont_at): Use decode_live_window.
1175 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1176 * window.c (decode_next_window_args): Likewise.
1177 (decode_any_window): Remove static.
1178 * window.h (decode_any_window): Add prototype.
1179 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1180 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1181 respectively.
1182
1183 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1184
1185 Remove pad from struct input_event.
1186 * termhooks.h (struct input_event): Remove padding field.
1187 Adjust comment.
1188 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1189 member is never cons for a long time. Adjust comment.
1190 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1191 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1192 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1193 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1194
1195 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1196
1197 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1198
1199 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1200
1201 Fix crash when using Emacs as commit editor for git (Bug#12697).
1202 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1203 and it is configured in conf_post.h.
1204 (Fcall_process): Don't invoke both setsid and setpgid; the former
1205 is enough, if it exists.
1206 * callproc.c (Fcall_process, child_setup):
1207 * process.c (create_process): Use setpgid.
1208 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1209 for the real thing.
1210 * dispnew.c (init_display): Initialize the foreground group
1211 if we are running a tty display.
1212 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1213 * lisp.h (init_foreground_group): New decl.
1214 * sysdep.c (inherited_pgroup): New static var.
1215 (init_foreground_group, tcsetpgrp_without_stopping)
1216 (narrow_foreground_group, widen_foreground_group): New functions.
1217 (init_sys_modes): Narrow foreground group.
1218 (reset_sys_modes): Widen foreground group.
1219
1220 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1221
1222 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1223
1224 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1225
1226 * minibuf.c (read_minibuf): Restore current buffer since
1227 choose_minibuf_frame calling Fset_frame_selected_window may
1228 change it (Bug#12766).
1229
1230 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1231
1232 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1233
1234 2012-10-30 Kenichi Handa <handa@gnu.org>
1235
1236 * font.c (Ffont_at): If WINDOW is specified and it is not
1237 displaying the current buffer, signal an error.
1238
1239 2012-10-29 Daniel Colascione <dancol@dancol.org>
1240
1241 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1242 In preparation for fixing bug#12739, move these functions from
1243 here...
1244
1245 * coding.h, coding.c: ... to here, and compile them only when
1246 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1247 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1248
1249 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1250
1251 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1252 (timer_loop, getitimer, setitimer): Use it instead of
1253 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1254 'clock'.
1255 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1256 literal 10000.
1257
1258 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1259
1260 * nsterm.m (NO_APPDEFINED_DATA): New define.
1261 (last_appdefined_event_data): New variable
1262 (last_appdefined_event): Remove.
1263 (ns_select): Initialize t from last_appdefined_event_data instead
1264 of [last_appdefined_event data1].
1265 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1266 remove last_appdefined_event (Bug#12698).
1267
1268 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1269
1270 * frame.c (x_set_font): Catch internal error.
1271
1272 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1273
1274 Avoid overflow in w32 implementation of interval timers.
1275 When possible, for ITIMER_PROF count only times the main thread
1276 actually executes.
1277 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1278 'volatile ULONGLONG' types. All the other data which was
1279 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1280 (GetThreadTimes_Proc): New typedef.
1281 (w32_get_timer_time): New function, returns a suitable time value
1282 for the timer.
1283 (timer_loop): Enter critical section when accessing ULONGLONG
1284 values of the itimer_data struct, as these accesses are no longer
1285 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1286 Remove unused variable.
1287 (init_timers): Initialize s_pfn_Get_Thread_Times.
1288 (start_timer_thread): Don't assign itimer->caller_thread here.
1289 (getitimer): Assign itimer->caller_thread here.
1290 (setitimer): Always call getitimer to get the value of ticks_now.
1291 (sys_spawnve): Avoid compiler warning about format mismatch.
1292
1293 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1294
1295 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1296 mouse movement events if the menu bar is active. This avoids
1297 producing a busy "hour-glass" cursor by Windows if the mouse
1298 pointer is positioned over a tooltip shown for some menu item.
1299
1300 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 Don't assume process IDs fit in int.
1303 * emacs.c (shut_down_emacs) [!DOS_NT]:
1304 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1305 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1306 Use pid_t, not int, to store process IDs, as 'int'
1307 is not wide enough on a few platforms (e.g., AIX and IRIX).
1308
1309 2012-10-23 Kenichi Handa <handa@gnu.org>
1310
1311 The following change is to make face-font-rescale-alist work
1312 correctly for non-ASCII fonts.
1313
1314 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1315 (font_open_for_lface): Handle Vface_font_rescale_alist.
1316
1317 2012-10-23 Chong Yidong <cyd@gnu.org>
1318
1319 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1320
1321 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1322
1323 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1324 for screen font.
1325 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1326
1327 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1328 event (Bug#12681).
1329
1330 2012-10-21 Glenn Morris <rgm@gnu.org>
1331
1332 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1333
1334 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1335
1336 Port to OpenBSD 5.1.
1337 * frame.c (Fmouse_position, Fmouse_pixel_position):
1338 * xdisp.c (produce_stretch_glyph):
1339 Declare local vars only when they're needed.
1340 This is clearer and avoids a warning on OpenBSD about unused vars.
1341 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1342 This is safer, and avoids OpenBSD warnings about unused vars.
1343 * keyboard.c (record_menu_key): Remove unnecessary decl.
1344 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1345 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1346 as our definition clashes with OpenBSD's.
1347 * xfaces.c (load_face_colors, check_lface_attrs)
1348 (get_lface_attributes_no_remap, get_lface_attributes)
1349 (lface_fully_specified_p, x_supports_face_attributes_p)
1350 (tty_supports_face_attributes_p, face_fontset, realize_face)
1351 (realize_x_face, realize_tty_face):
1352 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1353 merely Lisp_Object *. This is more informative and avoids
1354 a warning on OpenBSD about accessing beyond an object's size.
1355
1356 2012-10-20 Chong Yidong <cyd@gnu.org>
1357
1358 * lread.c (Fload): Doc fix (Bug#12592).
1359
1360 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1361
1362 * font.c (Ffont_at): Fix previous change.
1363
1364 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1365
1366 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1367 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1368 for the reasons.
1369
1370 * alloc.c (NSTATICS): Decrease to 0x800.
1371
1372 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1373
1374 * fns.c (Fnreverse): Include the problem element when signalling an
1375 error (bug#12677).
1376
1377 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1378
1379 * nsterm.m (ns_select): Check writefds before call to
1380 FD_ISSET (Bug#12668).
1381
1382 2012-10-18 Daniel Colascione <dancol@dancol.org>
1383
1384 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1385 (staticpro): If we run out of staticpro slots, die with an
1386 informative error instead of just calling emacs_abort.
1387
1388 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1389
1390 Fix two flaws reported by Dmitry Antipov.
1391 * window.c (Ftemp_output_buffer_show): Remove.
1392 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1393 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1394
1395 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1396
1397 * makefile.w32-in ($(BLD)/w32.$(O)):
1398 ($(BLD)/vm-limit.$(O)):
1399 ($(BLD)/term.$(O)):
1400 ($(BLD)/unexw32.$(O)):
1401 ($(BLD)/fileio.$(O)):
1402 ($(BLD)/dispnew.$(O)): Update dependencies.
1403
1404 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1405 Add prototypes.
1406
1407 * w32proc.c: Include ctype.h.
1408
1409 * w32.h (init_environment, check_windows_init_file)
1410 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1411 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1412 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1413 (sys_link): Add prototypes.
1414
1415 * w32.c: Include w32select.h.
1416 (sys_access, e_malloc, sys_select): Add prototypes.
1417 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1418
1419 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1420
1421 * unexw32.c: Include lisp.h and w32.h.
1422
1423 * term.c [WINDOWSNT]: Include w32term.h.
1424
1425 * process.c [WINDOWSNT]: Add prototype of sys_select.
1426
1427 * fileio.c [WINDOWSNT]: Include w32.h.
1428
1429 * dispnew.c [WINDOWSNT]: Include w32.h.
1430
1431 * cygw32.c (Fcygwin_convert_path_to_windows)
1432 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1433 Lisp_Object values. (Bug#12661)
1434
1435 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1436 to Lisp_Object. (Bug#12661)
1437
1438 2012-10-17 Kenichi Handa <handa@gnu.org>
1439
1440 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1441 invalidate.
1442
1443 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1444
1445 * buffer.c (Fkill_buffer): When unchaining the marker,
1446 reset its buffer pointer to NULL (Bug#12652).
1447
1448 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1449
1450 Do not verify indirection counters of killed buffers (Bug#12579).
1451 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1452 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1453
1454 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 * alloc.c (Fmake_byte_code): Fix typo in comment.
1457 * print.c (print_interval): Define as static to match prototype.
1458 * indent.c (disptab_matches_widthtab, recompute_width_table):
1459 Convert to eassert.
1460
1461 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1462
1463 * editfns.c (get_system_name): Remove.
1464 * lisp.h (get_system_name): Remove prototype.
1465 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1466 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1467
1468 2012-10-15 Daniel Colascione <dancol@dancol.org>
1469
1470 * dbusbind.c: Add comment explaining reason for previous change.
1471
1472 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1473
1474 * window.c (Fwindow_end): Rewrite check whether cached position
1475 can be used (Bug#12600).
1476 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1477 Set windows_or_buffers_changed.
1478
1479 2012-10-15 Daniel Colascione <dancol@dancol.org>
1480
1481 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1482 enabled by undefining the symbol "interface", which the platform
1483 headers define to something incompatible.
1484
1485 2012-10-14 Daniel Colascione <dancol@dancol.org>
1486
1487 * image.c (init_tiff_functions, init_imagemagick_functions)
1488 (init_svg_functions): Fix cygw32 build break by using these
1489 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1490
1491 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1492
1493 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1494
1495 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1496
1497 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1498
1499 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1500
1501 * coding.c (detect_coding): Set coding->id before calling
1502 this->detector.
1503
1504 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1505
1506 * fileio.c: Formatting fixes.
1507
1508 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1509
1510 Fix some stat-related races.
1511 * fileio.c (Fwrite_region): Avoid race condition if a file is
1512 removed or renamed by some other process immediately after Emacs
1513 writes it but before Emacs stats it. Do not assume that stat (or
1514 fstat) succeeds.
1515 * image.c (slurp_file): Resolve the file name with fopen + fstat
1516 rather than stat + fopen.
1517 (pbm_read_file) [0]: Remove unused code with stat race.
1518 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1519 Remove ineffective code with stat race.
1520
1521 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1522
1523 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1524
1525 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1526
1527 * nsterm.m (hold_event_q): New static variable.
1528 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1529 ! q_event_ptr.
1530 (hold_event): New function.
1531 (ns_read_socket): If hold_event_q have events, store them and
1532 return (Bug#12384).
1533 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1534 is zero (Bug#12384).
1535
1536 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1537
1538 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1539
1540 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1541
1542 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1543
1544 * fileio.c (check_existing): New function.
1545 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1546 instead of calling 'stat', when what's needed is to check whether
1547 a file exists. This avoids expensive system calls on MS-Windows.
1548 (Bug#12587)
1549
1550 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1551
1552 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1553 determine whether a file exists and is not a directory.
1554
1555 * lisp.h (check_existing): Add prototype.
1556
1557 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1558
1559 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1560
1561 2012-10-12 Glenn Morris <rgm@gnu.org>
1562
1563 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1564
1565 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1566
1567 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1568
1569 * eval.c (Fautoload): Remember previous autoload status in load-history.
1570
1571 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1572
1573 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1574 * lread.c (load_each_byte, new_backquote_flag, readchar)
1575 (read_filtered_event, lisp_file_lexically_bound_p)
1576 (safe_to_load_version, Fload, complete_filename_p, openp)
1577 (build_load_history, readevalloop, read_escape, read1)
1578 (string_to_number, read_vector, read_list):
1579 * macros.c (Fstart_kbd_macro):
1580 * marker.c (CONSIDER):
1581 * menu.c (parse_single_submenu, digest_single_submenu)
1582 (find_and_return_menu_selection, Fx_popup_menu):
1583 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1584 (Ftry_completion):
1585 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1586 (ns_menu_show):
1587 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1588 (xmenu_show, xdialog_show):
1589 Use bool for booleans.
1590 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1591 as it's not a predicate. All uses changed. Omit unnecessary
1592 buffer termination.
1593
1594 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1597 (save_excursion_restore): Do not restore mark if it was not saved.
1598
1599 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1600
1601 * marker.c (cached_modiff): EMACS_INT, not int.
1602
1603 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1604 instead of having a wrong decl.
1605 * nsmenu.m (waiting_for_input): Remove wrong decl.
1606
1607 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1608
1609 keyboard.c, keymap.c: Use bool for booleans.
1610 * dispnew.c (sit_for): Distinguish between 3-way display_option
1611 and boolean do_display.
1612 * keyboard.c (single_kboard, this_command_key_count_reset)
1613 (waiting_for_input, echoing, immediate_quit, input_pending)
1614 (interrupt_input, interrupts_deferred, pop_kboard)
1615 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1616 (command_loop_1, adjust_point_for_property)
1617 (safe_run_hooks_error, input_polling_used, read_char):
1618 (help_char_p, readable_events, kbd_buffer_events_waiting)
1619 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1620 (lucid_event_type_list_p, get_input_pending):
1621 (gobble_input, menu_separator_name_p, menu_bar_item)
1622 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1623 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1624 (keyremap_step, test_undefined, read_key_sequence)
1625 (detect_input_pending, detect_input_pending_ignore_squeezables)
1626 (detect_input_pending_run_timers, requeued_events_pending_p)
1627 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1628 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1629 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1630 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1631 (accessible_keymaps_1, Fkey_description, push_key_description):
1632 (shadow_lookup, struct where_is_internal_data)
1633 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1634 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1635 (describe_map, describe_vector):
1636 * menu.c (single_menu_item):
1637 * nsmenu.m (ns_update_menubar):
1638 * process.c (wait_reading_process_output):
1639 * search.c (scan_buffer, scan_newline):
1640 Use bool for boolean.
1641 * keyboard.c (timers_run, swallow_events)
1642 (detect_input_pending_run_timers):
1643 * process.c (wait_reading_process_output):
1644 Use unsigned for counter where wraparound-on-overflow is desired,
1645 since unsigned is guaranteed to have that behavior and signed is not.
1646 (read_char): Use ptrdiff_t for string length.
1647 (get_input_pending): Remove first argument, since it was always
1648 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1649 and behave as if it had that value. Return new value of
1650 input_pending. All callers changed.
1651 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1652 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1653 a string length.
1654 * keymap.c (push_key_description): Omit last arg, which was always 1.
1655 All callers changed.
1656
1657 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1658
1659 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1660
1661 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1662 ($(BLD)/term.$(O)): Update dependencies.
1663
1664 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1665
1666 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1667 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1668 initializer for PVEC_NORMAL_VECTOR.
1669
1670 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1671
1672 Clean out old termopts cruft.
1673 * termopts.h (flow_control, meta_key): Remove unused decls.
1674 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1675 Don't include termopts.h.
1676
1677 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1678
1679 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1680
1681 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 * commands.h (immediate_quit): Remove duplicate decl.
1684
1685 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1686
1687 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1688 caching.
1689 (nsfont_open): Remove setting of Vfonts_in_cache.
1690 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1691
1692 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1693
1694 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1695 match what GetLastError returns. Explain why the function is
1696 needed.
1697
1698 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1699 'is_tooltip_frame', to avoid confusion with its global namesake.
1700
1701 2012-10-08 Daniel Colascione <dancol@dancol.org>
1702
1703 * xdisp.c (start_hourglass): Call w32_note_current_window when
1704 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1705 build that caused Emacs to display the hourglass cursor forever.
1706
1707 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1708 which is broken under remote desktop, calculate the number of
1709 colors available for a display based on the display's number of
1710 planes and number of bits per pixel per plane. (bug#10397).
1711
1712 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1713
1714 * nsfont.m (Vfonts_in_cache): New variable.
1715 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1716 are used. Add cached fonts to Vfonts_in_cache.
1717 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1718
1719 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1720
1721 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1722 in nt/config.nt.
1723 (FONT_H): Define after FRAME_H.
1724 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1725 Update dependencies.
1726
1727 * w32term.c: Remove leftover declaration of keyboard_codepage.
1728
1729 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1730
1731 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1732 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1733 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1734 (GLOBAL_SOURCES): Add cygw32.c.
1735 ($(BLD)/unexw32.$(O)):
1736 ($(BLD)/w32.$(O)):
1737 ($(BLD)/w32console.$(O)):
1738 ($(BLD)/w32fns.$(O)):
1739 ($(BLD)/w32heap.$(O)):
1740 ($(BLD)/w32menu.$(O)):
1741 ($(BLD)/w32proc.$(O)): Add w32common.h.
1742
1743 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1744 'const char *'.
1745 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1746
1747 2012-10-08 Daniel Colascione <dancol@dancol.org>
1748
1749 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1750 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1751 accidental message numbering hole. Change other messages to
1752 match.
1753
1754 * w32select.h (HAVE_W32SELECT): Remove.
1755
1756 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1757 w32common.h instead of w32heap.h.
1758
1759 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1760 (get_allocation_unit, get_processor_type, get_w32_major_version)
1761 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1762 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1763 (OS_NT, os_subtype, cache_system_info): Move declarations to
1764 w32common.
1765
1766 * w32heap.c: Include w32common.h.
1767 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1768 (w32_minor_version, w32_build_number, w32_subtype):
1769 Remove duplicate definitions.
1770
1771 * w32fns.c: Include w32common.h; include w32heap.h only in
1772 WINDOWSNT.
1773
1774 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1775 Use `report_file_error' instead of `error' in order to better
1776 inform users of what went wrong. Increase NTGUI_UNICODE file
1777 dialog box file name length to 32k, the maximum allowed by the NT
1778 kernel.
1779
1780 * w32common.h: New file.
1781 (ROUND_UP, ROUND_DOWN, get_page_size)
1782 (get_allocation_unit, get_processor_type, get_w32_major_version)
1783 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1784 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1785 (OS_NT, os_subtype, cache_system_info): Move here.
1786
1787 * unexw32.c, unexcw.c: Include w32common.h.
1788
1789 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1790 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1791 to call syms_of_w32select.
1792
1793 * cygw32.h: Remove obsolete EXFUN declarations.
1794
1795 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1796
1797 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1798 of w32inevt.o from SOME_MACHINE_OBJECTS.
1799
1800 2012-10-08 Daniel Colascione <dancol@dancol.org>
1801
1802 * image.c: Permanent fix for JPEG compilation issue --- limit
1803 jpeglib `boolean' redefinition to Cygwin builds.
1804
1805 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1806
1807 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1808
1809 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1810 Cygwin.
1811
1812 2012-10-08 Daniel Colascione <dancol@dancol.org>
1813
1814 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1815 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1816 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1817 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1818 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1819 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1820 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1821 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1822 now a supported configuration.
1823
1824 * Makefile.in: consolidate image variables into LIBIMAGE; add
1825 W32_OBJ and W32_LIBS. Compile new files.
1826
1827 * conf_post.h:
1828 (_DebPrint) declare tracing facility for W32 debugging. We need
1829 to unify tracing later.
1830
1831 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1832 unconditional use of W32 Unicode functions. Cygwin runs only on
1833 100% Unicode operating systems.
1834
1835 * cygw32.c: New file. Define Cygwin-specific facilities.
1836 (Fcygwin_convert_path_to_windows)
1837 (Fcygwin_convert_path_from_windows): New user functions for
1838 accessing Cygwin path-munging routines.
1839
1840 * cygw32.h: New file.
1841 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1842 UTF-16LE strings temporarily inside non-Lisp-visible string
1843 objects.
1844
1845 (w32_strerror): Just what it says on the tin.
1846
1847 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1848 also run for Cygwin; both systems have the same problem with using
1849 GUI facilities in a forked child. Also call syms_of_cygw32,
1850 syms_of_w32select in correct places.
1851
1852 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1853 needs fork-then-exec for daemon launching.
1854
1855 * font.h: Include frame.h.
1856
1857 * image.c: Use the image library cache machinery only when we're
1858 compiling for native WINDOWSNT; Cygwin can use shared libraries
1859 like any other Unixlike system.
1860
1861 * keyboard.c: Clarify a comment regarding the input loop.
1862
1863 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1864 functions directly instead of trying to detect at runtime that our
1865 host operating system supports them. We make this change for two
1866 reasons: Cygwin lacks support for the multibyte character
1867 conversion functions used by the legacy menu code, and Cygwin
1868 never needs to rely on non-Unicode APIs.
1869
1870 * unexw32.c (hinst): Declare extern.
1871
1872 * w32.c: Change header order;
1873 (w32_strerror): Move to w32fns.c because we need it for
1874 non-WINDOWSNT builds.
1875
1876 * w32.h: Add #error macro to make sure we don't include w32.h for
1877 Cygwin builds. Remove w32select declarations.
1878
1879 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1880 w32fns.c. w32console.c is WINDOWSNT-only.
1881
1882 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1883 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1884 POSIXy alternative.
1885 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1886 (w32_major_version, w32_minor_version, w32_build_number)
1887 (os_subtype, sound_type): Define here
1888 (w32_defined_color): Make color parameter const for consistency
1889 with other _defined_color functions.
1890 (w32_createwindow): Unconditionally call w32_init_class instead of
1891 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1892 through the code is complex and unnecessary because class
1893 registration is practically free.
1894 (w32_name_of_message): New EMACSDEBUG-only function.
1895 (Fset_message_beep): Move here
1896 (Fx_open_connection): Require that the display name for Windows be
1897 "w32" for consistency, emacsclient disambiguation, and maybe, one
1898 day, multi-window-system support.
1899 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1900 Cygwin files for W32 GUI facilities, since these clearly don't
1901 expect Cygwin names.
1902 (_DebPrint): Define.
1903 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1904 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1905 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1906 (w32_last_error): Remove.
1907
1908 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1909
1910 * w32heap.c (syspage_mask): Declare here.
1911 (cache_system_info): Remove.
1912
1913 * w32inevt.c (faked_key): Define globally, not statically.
1914 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1915 (w32_console_toggle_lock_key): Move to w32fns.c.
1916
1917 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1918
1919 * w32proc.c (_DebPrint): Move to w32fns.c.
1920 * w32select.c: Include string.h, stdio.h for Cygwin.
1921 * w32select.h: New File.
1922
1923 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1924 get_osfhandle.
1925 (w32_message_fd): New variable. Under Cygwin, holds the file
1926 descriptor the system used to tell us about pending thread
1927 messages.
1928
1929 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1930 that prevented compilation under non-WINDOWSNT systems.
1931
1932 (w32_initialize): Open /dev/windows and assign it to
1933 w32_message_fd. Provide w32 feature.
1934
1935 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1936 (WM_EMACS_INPUT_READY): add.
1937 (prepend_msg, w32_message_fd): Declare globally.
1938
1939 * w32xfns.c:
1940 (keyboard_handle): Use only when WINDOWSNT.
1941 (notify_msg_ready): New function. Posts a message to the main
1942 thread's message queue under CYGWIN, which wakes up the main
1943 thread from select(2) by making the /dev/windows file descriptor
1944 ready. Under WINDOWSNT, it sets an event the same way the old
1945 code did.
1946
1947 (post, prepend_msg): Actually call notify_msg_ready instead of
1948 setting the input event directly.
1949
1950 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1951
1952 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1953 but it still has blocs in it, don't return it to the system,
1954 instead of aborting. (Bug#12402)
1955
1956 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1957
1958 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1959
1960 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1961 MAC_OS_X_VERSION_10_6.
1962 (syms_of_nsterm): Remove comment about Panther and above for
1963 ns-antialias-text.
1964 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1965 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1966 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1967
1968 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1969 MAC_OS_X_VERSION_10_4.
1970
1971 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1972 MAC_OS_X_VERSION_10_2.
1973
1974 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1975
1976 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1977 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1978
1979 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1980 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1981 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1982 Remove ns_in_resize check.
1983 (ns_clear_frame_area): Remove resize handle code.
1984
1985 * nsfns.m (ns_in_resize): Remove.
1986 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1987 Remove ns_in_resize check.
1988
1989 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 Improve sys_siglist detection.
1992 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1993 defined as a macro, as is done in Solaris.
1994 (sys_siglist_entries): New macro.
1995 (save_strsignal): Use it.
1996 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1997 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1998
1999 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2000
2001 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2002 fullscreen/Fullscreen.
2003
2004 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2005 tobar_height is new.
2006
2007 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2008 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2009 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2010 (windowDidResize:): Check for correct window if old style fullscreen.
2011 Capitalize word in comment. Remove incorrect comment.
2012 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2013 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2014 error in drawing background.
2015 (toggleFullScreen:): Remove comment. Rearrange calls.
2016 Set toolbar values to zero, save old height in tobar_height.
2017 Restore tool bar height when leaving fullscreen.
2018 (canBecomeMainWindow): New function.
2019
2020 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2023
2024 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2025
2026 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2027
2028 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2029 that time stamps of directories could also be changed.
2030 Don't request the too broad GENERIC_WRITE, only the more restrictive
2031 FILE_WRITE_ATTRIBUTES access rights.
2032
2033 * fileio.c (Fset_file_times): Special-case ignoring errors for
2034 directories only on MSDOS, not on MS-Windows.
2035
2036 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2037
2038 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2039
2040 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2041
2042 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2043 see whether CreateFile failed.
2044
2045 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2046
2047 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2048 to avoid similar races.
2049 * keyboard.c (pending_signals): Now bool, not int.
2050
2051 Port timers to OpenBSD, plus check for timer failures.
2052 OpenBSD problem reported by Han Boetes.
2053 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2054 and/or setitimer.
2055 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2056 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2057 like OpenBSD, which has timer_settime but does not declare it.
2058 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2059 whether to use itimerspec-related primitives. All uses of
2060 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2061
2062 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2063
2064 * profiler.c (handle_profiler_signal): Fix a malloc race
2065 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2066
2067 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2068
2069 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2070
2071 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2072
2073 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2074 consistent with the change in return value of 'safe_strsignal'.
2075
2076 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2077
2078 Prefer plain 'static' to 'static inline' (Bug#12541).
2079 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2080 (bidi_set_sor_type, bidi_push_embedding_level)
2081 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2082 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2083 (bidi_cache_search, bidi_cache_ensure_space)
2084 (bidi_cache_iterator_state, bidi_cache_find)
2085 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2086 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2087 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2088 Now 'static', not 'static inline'.
2089
2090 Count overruns when profiling; change units to ns.
2091 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2092 Give extra weight to samples after overruns, to attempt to count
2093 the time more accurately.
2094 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2095 the underlying primitives nominally do ns.
2096 (Fprofiler_cpu_start): Document the change. Mention that
2097 the sampling intervals are only approximate.
2098
2099 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2100
2101 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2102
2103 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2104 case for the special 0 coding-system.
2105
2106 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2107 (Fmake_overlay): Remove redundant tests.
2108 (fix_start_end_in_overlays): Remove redundant recentering.
2109
2110 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2111
2112 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2113 Update dependencies.
2114
2115 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 Fix a malloc race condition involving strsignal.
2118 A signal can arrive in the middle of a malloc, and Emacs's signal
2119 handler can invoke strsignal, which can invoke malloc, which is
2120 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2121 Fix it by altering the signal handler so that it does not invoke
2122 strsignal.
2123 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2124 * process.c (status_message): Use const pointer, in case strsignal
2125 is #defined to safe_strsignal.
2126 * sysdep.c (sys_siglist, init_signals): Always define and
2127 initialize a substitute sys_siglist if the system does not define
2128 one, even if HAVE_STRSIGNAL.
2129 (safe_strsignal): Rename from strsignal. Always define,
2130 using sys_siglist. Return a const pointer.
2131 * syssignal.h (safe_strsignal): New decl.
2132 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2133
2134 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2135
2136 * w32proc.c (timer_loop): Fix code that waits for timer
2137 expiration, to avoid high CPU usage.
2138
2139 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2140
2141 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2142 (sweep_weak_table): Remove redundant prototypes.
2143
2144 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2145
2146 * emacs.c: Move the inclusion of TERM_HEADER after including
2147 windows.h on WINDOWSNT. This avoids compilation problems with
2148 MSVC.
2149
2150 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2151
2152 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2153 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2154 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2155 as the previous version used 'void *'.
2156
2157 * ralloc.c (ROUNDUP): Fix last change.
2158 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2159 'size_t'.
2160
2161 * w32proc.c <disable_itimers>: New static flag.
2162 (init_timers): Initialize it to zero, after creating the critical
2163 sections used by the timer threads.
2164 (term_timers): Set to 1 before deleting the critical sections.
2165 (getitimer, setitimer): If disable_itimers is non-zero, return an
2166 error indication without doing anything. Reported by Fabrice
2167 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2168 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2169 return results.
2170 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2171 support timers.
2172
2173 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2174 term_ntproc after all the other bookkeeping, to get timers working
2175 as long as possible.
2176
2177 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2178
2179 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2180 Suggested by Juri Linkov in
2181 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2182
2183 Prefer plain 'static' to 'static inline' (Bug#12541).
2184 With static functions, modern compilers inline pretty well by
2185 themselves; advice from programmers often hurts as much as it helps.
2186 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2187 this change shrinks the text size of the Emacs executable by 1.1%
2188 without affecting CPU significantly in my benchmark.
2189 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2190 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2191 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2192 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2193 (bset_auto_fill_function, bset_auto_save_file_format)
2194 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2195 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2196 (bset_cache_long_line_scans, bset_case_fold_search)
2197 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2198 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2199 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2200 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2201 (bset_header_line_format, bset_indicate_buffer_boundaries)
2202 (bset_indicate_empty_lines, bset_invisibility_spec)
2203 (bset_left_fringe_width, bset_major_mode, bset_mark)
2204 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2205 (bset_name, bset_overwrite_mode, bset_pt_marker)
2206 (bset_right_fringe_width, bset_save_length)
2207 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2208 (bset_scroll_up_aggressively, bset_selective_display)
2209 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2210 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2211 (set_buffer_overlays_after):
2212 * category.c (bset_category_table):
2213 * charset.c (read_hex):
2214 * coding.c (produce_composition, produce_charset)
2215 (handle_composition_annotation, handle_charset_annotation)
2216 (char_encodable_p):
2217 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2218 (assign_row, set_frame_matrix_frame, make_current)
2219 (add_row_entry):
2220 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2221 * fns.c (maybe_resize_hash_table):
2222 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2223 * gmalloc.c (register_heapinfo):
2224 * image.c (lookup_image_type):
2225 * intervals.c (set_interval_object, set_interval_left)
2226 (set_interval_right, copy_interval_parent, rotate_right)
2227 (rotate_left, balance_possible_root_interval):
2228 * keyboard.c (kset_echo_string, kset_kbd_queue)
2229 (kset_keyboard_translate_table, kset_last_prefix_arg)
2230 (kset_last_repeatable_command, kset_local_function_key_map)
2231 (kset_overriding_terminal_local_map, kset_real_last_command)
2232 (kset_system_key_syms, clear_event, set_prop):
2233 * lread.c (digit_to_number):
2234 * marker.c (attach_marker, live_buffer, set_marker_internal):
2235 * nsterm.m (ns_compute_glyph_string_overhangs):
2236 * process.c (pset_buffer, pset_command)
2237 (pset_decode_coding_system, pset_decoding_buf)
2238 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2239 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2240 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2241 * syntax.c (bset_syntax_table, dec_bytepos):
2242 * terminal.c (tset_param_alist):
2243 * textprop.c (interval_has_some_properties)
2244 (interval_has_some_properties_list):
2245 * window.c (wset_combination_limit, wset_dedicated)
2246 (wset_display_table, wset_hchild, wset_left_fringe_width)
2247 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2248 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2249 (wset_right_fringe_width, wset_right_margin_cols)
2250 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2251 (wset_vertical_scroll_bar_type, wset_window_parameters):
2252 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2253 (wset_column_number_displayed, wset_region_showing)
2254 (window_box_edges, run_window_scroll_functions)
2255 (append_glyph_string_lists, prepend_glyph_string_lists)
2256 (append_glyph_string, set_glyph_string_background_width)
2257 (append_glyph, append_composite_glyph)
2258 (take_vertical_position_into_account):
2259 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2260 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2261 (lface_hash, lface_same_font_attributes_p, lookup_face):
2262 * xml.c (libxml2_loaded_p):
2263 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2264 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2265 Now 'static', not 'static inline'.
2266
2267 * bidi.c: Tune.
2268 (bidi_copy_it): Do the whole copy with a single memcpy.
2269 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2270
2271 Revert the FOLLOW-SYMLINKS change for file-attributes.
2272 Doing it right would require several changes to Tramp, and there's
2273 not enough time to get that tested before the freeze today.
2274 * dired.c (directory_files_internal, Ffile_attributes):
2275 Undo last change.
2276
2277 * frame.c (x_report_frame_params): Port better to wider ints.
2278 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2279 or that pointers can be printed in 15 decimal digits.
2280 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2281
2282 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2283
2284 Support x64 build on MS-Windows.
2285 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2286 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2287 compatibility with x64.
2288 (x_get_focus_frame): Add prototype.
2289
2290 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2291 defining an XRectangle structure.
2292
2293 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2294 arithmetics for compatibility with x64.
2295
2296 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2297 compatibility with x64.
2298
2299 * w32heap.h: Adjust prototypes and declarations.
2300
2301 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2302 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2303 DWORD, long, and unsigned long, for compatibility with x64.
2304 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2305 (sbrk): Argument is now of type ptrdiff_t.
2306
2307 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2308 less than 0x0500.
2309 (w32_msg_pump): Use WPARAM type for 'result'.
2310
2311 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2312 architecture.
2313 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2314 compatibility with x64.
2315
2316 * vm-limit.c (lim_data): Now size_t.
2317 (check_memory_limits): Adjust prototypes of real_morecore and
2318 __morecore to receive argument of type ptrdiff_t. Use size_t for
2319 five_percent and data_size.
2320
2321 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2322 variables, for compatibility with x64.
2323 (rva_to_section, offset_to_section, relocate_offset)
2324 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2325 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2326 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2327 for compatibility with x64.
2328
2329 * sysdep.c (STDERR_FILENO): Define if not already defined.
2330
2331 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2332 (__morecore): Argument type is now ptrdiff_t.
2333 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2334 (relinquish): Use ptrdiff_t type for 'excess'.
2335 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2336
2337 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2338 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2339 instead of a literal number.
2340
2341 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2342 (min): Define only if not already defined.
2343
2344 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2345 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2346 hosts.
2347
2348 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2349 'bitmaps' is a pointer.
2350
2351 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2352
2353 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2354
2355 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2358 * dired.c (directory_files_internal, Ffile_attributes):
2359 New arg follow_symlinks. All uses changed.
2360
2361 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2362
2363 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2364
2365 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2366
2367 Support atimers and CPU profiler via profile.c on MS-Windows.
2368 * w32proc.c (sig_mask, crit_sig): New static variables.
2369 (sys_signal): Support SIGALRM and SIGPROF.
2370 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2371 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2372 sigfillset, and sigprocmask are no longer no-ops.
2373 (sigismember): New function.
2374 (struct itimer_data): New definition.
2375 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2376 (crit_prof): New static variables.
2377 (MAX_SINGLE_SLEEP): New definition.
2378 (timer_loop, stop_timer_thread, term_timers, init_timers)
2379 (start_timer_thread, getitimer, setitimer): New functions.
2380 (alarm): No longer a no-op, calls setitimer.
2381
2382 * w32.c (term_ntproc): Call term_timers.
2383 (init_ntproc): Make sure all signals are unblocked at startup, to
2384 erase any traces of dumping. Call init_timers.
2385
2386 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2387 Windows-specific code to display the hourglass mouse pointer is no
2388 longer used.
2389 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2390 to hourglass timer expiration.
2391 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2392 Remove, no longer used.
2393 (w32_note_current_window, show_hourglass, hide_hourglass):
2394 New functions, in support of hourglass cursor display similar to other
2395 window systems.
2396 (syms_of_w32fns): Don't initialize hourglass_timer.
2397
2398 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2399 WINDOWSNT as well.
2400 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2401
2402 * w32.h (init_timers, term_timers): Add prototypes.
2403
2404 2012-09-30 Kenichi Handa <handa@gnu.org>
2405
2406 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2407 to the buffer relocation which may be caused by ccl_driver.
2408
2409 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2410
2411 * xfns.c (Fx_file_dialog): Update comment.
2412
2413 * w32fns.c (Fx_file_dialog): Update comment.
2414
2415 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2416 Initialize panel name field if OSX >= 10.6.
2417
2418 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2419
2420 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2421
2422 * nsterm.m (NEW_STYLE_FS): New define.
2423 (ns_fullscreen_hook, windowWillEnterFullScreen)
2424 (windowDidEnterFullScreen, windowWillExitFullScreen)
2425 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2426 (setFSValue): New functions.
2427 (EmacsFSWindow): New implementation.
2428 (canBecomeKeyWindow): New function for EmacsFSWindow.
2429 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2430 (dealloc): Release nonfs_window if in fullscreen.
2431 (updateFrameSize:): Call windowDidMove to update top/left.
2432 (windowWillResize:toSize:): Check if frame is still maximized.
2433 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2434 next_maximized, maximized_width, maximized_height and nonfs_window.
2435 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2436 tbar_height.
2437 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2438 fullscreen. Set maximized_width/height. Act on next_maximized.
2439
2440 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2441 (EmacsView): Add variables for fullscreen.
2442 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2443 (EmacsFSWindow): New interface for fullscreen.
2444
2445 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2446
2447 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2448
2449 2012-09-30 Chong Yidong <cyd@gnu.org>
2450
2451 * fns.c (Frandom): Doc fix.
2452
2453 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2454
2455 * window.c (Vwindow_combination_limit): New default value.
2456 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2457
2458 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2459
2460 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2461 Suggested by Eli Zaretskii in
2462 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2463
2464 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2465
2466 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2467 HAVE_TIMER_SETTIME is defined.
2468
2469 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2470
2471 Profiler improvements: more-accurate timers, overflow checks.
2472 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2473 signal.h, setjmp.h. Include systime.h instead.
2474 (saturated_add): New function.
2475 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2476 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2477 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2478 New static vars.
2479 (enum profiler_cpu_running): New enum.
2480 (profiler_cpu_running): Now of that enum type, not bool.
2481 All uses changed to store the new value.
2482 (handle_profiler_signal): Rename from sigprof_handler_1,
2483 for consistency with other handlers. Do not check whether
2484 cpu_log is a hash-table if garbage collecting, since it
2485 doesn't matter in that case.
2486 (deliver_profiler_signal): Rename from sigprof_handler,
2487 for consistency with other handlers.
2488 (setup_cpu_timer): New function, with much of what used to be in
2489 Fprofiler_cpu_start. Check for out-of-range argument.
2490 Prefer timer_settime if available, and prefer
2491 thread cputime clocks, then process cputime clocks, then
2492 monotonic clocks, to the old realtime clock. Use make_timeval
2493 to round more-correctly when falling back to setitimer.
2494 (Fprofiler_cpu_start): Use it.
2495 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2496 Don't assume that passing NULL as the 2nd argument of setitimer
2497 is the same as passing a pointer to all-zero storage.
2498 Ignore SIGPROF afterwards.
2499 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2500 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2501 non-fatal signal handlers. Ignore SIGPROF on startup.
2502 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2503 in profiler.c, since sysdep.c now uses it.
2504
2505 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2506 Suggested by Eli Zaretskii in
2507 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2508
2509 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2510
2511 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2512
2513 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2514
2515 * lisp.h (struct backtrace): Remove indirection for `function' field.
2516 * xdisp.c (redisplay_internal):
2517 * profiler.c (record_backtrace, sigprof_handler_1):
2518 * alloc.c (Fgarbage_collect):
2519 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2520 (Fbacktrace_frame): Adjust accordingly.
2521
2522 2012-09-28 Glenn Morris <rgm@gnu.org>
2523
2524 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2525 (Frun_hook_with_args_until_failure): Doc fixes.
2526
2527 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2528
2529 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2530 Qautomatic_redisplay and change the symbol name. All users changed.
2531
2532 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2533
2534 * profiler.c (sigprof_handler): Fix race condition.
2535
2536 2012-09-28 Glenn Morris <rgm@gnu.org>
2537
2538 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2539
2540 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2541
2542 Check more robustly for timer_settime.
2543 * Makefile.in (LIB_TIMER_TIME): New macro.
2544 (LIBES): Add it.
2545 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2546 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2547 call timer_settime.
2548
2549 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2550
2551 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2552
2553 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2554
2555 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2556
2557 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2558
2559 * character.h (MAYBE_UNIFY_CHAR): Remove.
2560 * charset.c, charset.h (maybe_unify_char): Now static.
2561 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2562 Since this stuff is now private to charset.c, there's no need for
2563 a public macro and no need to inline by hand.
2564
2565 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2566 Stefan Monnier <monnier@iro.umontreal.ca>
2567 Juanma Barranquero <lekktu@gmail.com>
2568
2569 * profiler.c: New file.
2570 * Makefile.in (base_obj): Add profiler.o.
2571 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2572 ($(BLD)/profiler.$(O)): New target.
2573 * emacs.c (main): Call syms_of_profiler.
2574 * alloc.c (Qautomatic_gc): New constant.
2575 (MALLOC_PROBE): New macro.
2576 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2577 (total_bytes_of_live_objects): New function.
2578 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2579 Call malloc_probe for the memory profiler.
2580 (syms_of_alloc): Define Qautomatic_gc.
2581 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2582 race condition.
2583 (struct backtrace): Move definition...
2584 * lisp.h (struct backtrace): ..here.
2585 (Qautomatic_gc, profiler_memory_running): Declare vars.
2586 (malloc_probe, syms_of_profiler): Declare functions.
2587 * xdisp.c (Qautomatic_redisplay): New constant.
2588 (redisplay_internal): Record itself in backtrace_list.
2589 (syms_of_xdisp): Define Qautomatic_redisplay.
2590
2591 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2592 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2593
2594 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2595
2596 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2597
2598 Prefer POSIX timers if available.
2599 They avoid a race if the timer is too close to the current time.
2600 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2601 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2602 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2603
2604 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2605
2606 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2607 CHAR_STRING_ADVANCE.
2608 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2609 STRING_CHAR_ADVANCE.
2610
2611 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2612
2613 Move Vlibrary_cache to emacs.c and reset before dumping.
2614
2615 * lisp.h (reset_image_types): Declare.
2616 [WINDOWSNT] (Vlibrary_cache): Declare.
2617
2618 * image.c (reset_image_types): New function.
2619
2620 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2621 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2622 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2623
2624 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2625 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2626
2627 * w32.h (Vlibrary_cache): Do not declare.
2628
2629 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2630
2631 * w32proc.c (sys_signal): Handle all signals defined by the
2632 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2633 handlers for signals supported by Windows. Don't override
2634 term_ntproc as the handler for SIGABRT.
2635 (sigaction): Rewrite to call sys_signal instead of duplicating its
2636 code.
2637 (sys_kill): Improve commentary.
2638
2639 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2640 consistency with a signature of a signal handler. All callers
2641 changed.
2642 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2643 install term_ntproc as a signal handler for SIGABRT, as that
2644 should be done by the dumped Emacs.
2645
2646 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2647
2648 * w32select.c (term_w32select): Protect against repeated
2649 invocation by setting clipboard_owner to NULL after calling
2650 DestroyWindow.
2651
2652 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2653 and term_ntproc to their modified signatures.
2654
2655 * character.c (char_string, string_char): Remove calls to
2656 MAYBE_UNIFY_CHAR. See the discussion starting at
2657 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2658 for the details.
2659
2660 2012-09-25 Chong Yidong <cyd@gnu.org>
2661
2662 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2663
2664 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2665
2666 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2667 when encountering an unknown bytecode.
2668
2669 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2670
2671 image.c, indent.c: Use bool for booleans.
2672 * dispextern.h (struct image_type): Members valid_p, load, init
2673 now return bool, not int. All uses changed.
2674 * image.c: Omit unnecessary static decls.
2675 (x_create_bitmap_mask, x_build_heuristic_mask):
2676 Return void, not int, since callers don't care about the return value.
2677 (x_create_bitmap_mask, define_image_type, valid_image_p)
2678 (struct image_keyword, parse_image_spec, image_spec_value)
2679 (check_image_size, image_background)
2680 (image_background_transparent, x_clear_image_1)
2681 (postprocess_image, lookup_image, x_check_image_size)
2682 (x_create_x_image_and_pixmap, xbm_image_p)
2683 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2684 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2685 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2686 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2687 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2688 (png_image_p, init_png_functions, png_load_body, png_load)
2689 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2690 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2691 (init_gif_functions, gif_load, imagemagick_image_p)
2692 (imagemagick_load_image, imagemagick_load, svg_image_p)
2693 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2694 (gs_load):
2695 * nsimage.m (ns_load_image):
2696 * nsterm.m (ns_defined_color):
2697 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2698 * xfns.c (x_defined_color):
2699 * xterm.c (x_alloc_lighter_color_for_widget)
2700 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2701 (x_alloc_lighter_color):
2702 * indent.c (disptab_matches_widthtab, current_column)
2703 (scan_for_column, string_display_width, indented_beyond_p)
2704 (compute_motion, vmotion, Fvertical_motion):
2705 Use bool for booleans.
2706
2707 2012-09-24 Chong Yidong <cyd@gnu.org>
2708
2709 * chartab.c (Fset_char_table_default): Obsolete function removed.
2710
2711 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2712
2713 Move pid_t related decls out of lisp.h.
2714 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2715 (interruptible_wait_for_termination):
2716 Move these decls from lisp.h to syswait.h, since they use pid_t.
2717 Needed on FreeBSD; see Herbert J. Skuhra in
2718 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2719 * callproc.c: Include syswait.h.
2720
2721 gnutls.c, gtkutil.c: Use bool for boolean.
2722 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2723 (emacs_gnutls_handle_error):
2724 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2725 (xg_hide_tooltip, xg_create_frame_widgets)
2726 (create_dialog, xg_uses_old_file_dialog)
2727 (xg_get_file_with_chooser, xg_get_file_with_selection)
2728 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2729 (xg_item_label_same_p, xg_update_menubar)
2730 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2731 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2732 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2733 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2734 (update_frame_tool_bar, free_frame_tool_bar):
2735 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2736 * nsmenu.m (ns_update_menubar):
2737 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2738 * xfns.c (Fx_show_tip) [USE_GTK]:
2739 Use bool for boolean.
2740 * gtkutil.c (xg_update_frame_menubar):
2741 * xmenu.c (update_frame_menubar):
2742 Return void, not int, since caller ignores return value.
2743 * gtkutil.c (xg_change_toolbar_position):
2744 Return void, not 1.
2745
2746 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2747
2748 * makefile.w32-in (BLOCKINPUT_H): Remove.
2749 (SYSSIGNAL_H): New macro.
2750 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2751 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2752 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2753 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2754 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2755 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2756 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2757 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2758 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2759 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2760 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2761 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2762 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2763 ($(BLD)/w32xfns.$(O)): Update dependencies.
2764
2765 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2766
2767 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2768 fatal_error_backtrace.
2769
2770 * w32proc.c (sys_kill): Undo last change: don't do anything when
2771 invoked to deliver SIGABRT to our own process. This is now
2772 handled by emacs_raise.
2773
2774 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2775
2776 * w32term.c (w32_read_socket): Remove leftover reference to
2777 interrupt_input_pending.
2778
2779 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2780
2781 Do not use SA_NODEFER.
2782 Problem reported by Dani Moncayo in
2783 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2784 * alloc.c (die):
2785 * sysdep.c (emacs_abort): Do not reset signal handler.
2786 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2787 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2788 wanted even on POSIXish hosts, and it doesn't work on Windows.
2789
2790 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2791
2792 * xterm.c (x_term_init): Call fixup_locale before and after calling
2793 gtk_init (Bug#12392).
2794
2795 2012-09-23 Chong Yidong <cyd@gnu.org>
2796
2797 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2798 Vdynamic_library_alist.
2799
2800 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2801 (Fgnutls_available_p): Caller changed.
2802
2803 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2804 (Flibxml_parse_xml_region): Likewise.
2805
2806 * dispextern.h (struct image_type): Remove arg from init function.
2807
2808 * image.c (Finit_image_library, lookup_image_type)
2809 (define_image_type): Remove now-unneeded second arg.
2810 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2811 (init_tiff_functions, init_gif_functions, init_svg_functions):
2812 Arglist and w32_delayed_load calling convention changed.
2813 (gs_type): Remove init_gs_functions; there is no such function.
2814 (valid_image_p, make_image): Fix caller to lookup_image_type.
2815
2816 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2817
2818 Simplify and avoid signal-handling races (Bug#12471).
2819 * alloc.c (die):
2820 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2821 Avoid recursive loop if there's a fatal error in the function itself.
2822 * atimer.c (pending_atimers):
2823 * blockinput.h: Don't include "atimer.h"; no longer needed.
2824 (interrupt_input_pending): Remove. All uses removed.
2825 pending_signals now counts both atimers and ordinary interrupts.
2826 This is less racy than having three separate pending-signal flags.
2827 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2828 (input_blocked_p):
2829 Rename from their upper-case counterparts BLOCK_INPUT,
2830 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2831 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2832 This makes it easier to access volatile variables more accurately.
2833 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2834 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2835 that's more reliable if the code is buggy and sets
2836 interrupt_input_blocked to a negative value. All uses changed.
2837 * atimer.c (deliver_alarm_signal):
2838 Remove. No need to deliver this to the parent; any thread can
2839 handle this signal now. All uses replaced by underlying handler.
2840 * atimer.c (turn_on_atimers):
2841 * dispnew.c (handle_window_change_signal):
2842 * emacs.c (handle_danger_signal):
2843 * keyboard.c (kbd_buffer_get_event):
2844 Don't reestablish signal handler; not needed with sigaction.
2845 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2846 (UNBLOCK_INPUT_TO):
2847 Rework to avoid unnecessary accesses to volatile variables.
2848 (UNBLOCK_INPUT_TO): Now a function.
2849 (totally_unblock_input, unblock_input): New decls.
2850 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2851 (init_data): Remove. Necessary stuff now done in init_signal.
2852 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2853 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2854 (fatal_error_code): Remove; no longer needed.
2855 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2856 it doesn't always backtrace. All uses changed. No need to reset
2857 signal to default, since sigaction and/or die does that for us now.
2858 Use emacs_raise (FOO), not kill (getpid (), FOO).
2859 (main): Check more-accurately whether we're dumping.
2860 Move fatal-error setup to sysdep.c
2861 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2862 * gtkutil.c (xg_get_file_name, xg_get_font):
2863 Remove no-longer-needed signal-mask manipulation.
2864 * keyboard.c, process.c (POLL_FOR_INPUT):
2865 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2866 * keyboard.c (read_avail_input): Remove.
2867 All uses replaced by gobble_input.
2868 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2869 (kbd_buffer_store_event_hold, gobble_input):
2870 (record_asynch_buffer_change) [USABLE_SIGIO]:
2871 (store_user_signal_events):
2872 No need to mess with signal mask.
2873 (gobble_input): If blocking input and there are terminals, simply
2874 set pending_signals to 1 and return. All hooks changed to not
2875 worry about whether input is blocked.
2876 (process_pending_signals): Clear pending_signals before processing
2877 them, in case a signal comes in while we're processing.
2878 By convention callers now test pending_signals before calling us.
2879 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2880 New functions, to support changes to blockinput.h.
2881 (handle_input_available_signal): Now extern.
2882 (reinvoke_input_signal): Remove. All uses replaced by
2883 handle_async_input.
2884 (quit_count): Now volatile, since a signal handler uses it.
2885 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2886 All callers changed. Block SIGINT only if not already blocked.
2887 Clear sigmask reliably, even if Fsignal returns, which it can.
2888 Omit unnecessary accesses to volatile var.
2889 (quit_throw_to_read_char): No need to restore sigmask.
2890 * keyboard.c (gobble_input, handle_user_signal):
2891 * process.c (wait_reading_process_output):
2892 Call signal-handling code rather than killing ourselves.
2893 * lisp.h: Include <float.h>, for...
2894 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2895 (pending_signals): Now volatile.
2896 (syms_of_data): Now const if IEEE floating point.
2897 (handle_input_available_signal) [USABLE_SIGIO]:
2898 (terminate_due_to_signal, record_child_status_change): New decls.
2899 * process.c (create_process): Avoid disaster if memory is exhausted
2900 while we're processing a vfork, by tightening the critical section
2901 around the vfork.
2902 (send_process_frame, process_sent_to, handle_pipe_signal)
2903 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2904 ignores SIGPIPE.
2905 (send_process): No need for setjmp/longjmp any more, since the
2906 SIGPIPE stuff is now gone. Instead, report an error if errno
2907 is EPIPE.
2908 (record_child_status_change): Now extern. PID and W are now args.
2909 Return void, not bool. All callers changed.
2910 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2911 Remove. All uses removed. This bug should be fixed now in a
2912 different way.
2913 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2914 and record the child status change directly. This avoids the
2915 need to futz with the signal mask.
2916 (process_fatal_action): Move here from emacs.c.
2917 (emacs_sigaction_flags): New function, containing
2918 much of what used to be in emacs_sigaction_init.
2919 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2920 caught by emacs, to make races less likely.
2921 (deliver_process_signal): Rename from handle_on_main_thread.
2922 All uses changed.
2923 (BACKTRACE_LIMIT_MAX): Now at top level.
2924 (thread_backtrace_buffer, threadback_backtrace_pointers):
2925 New static vars.
2926 (deliver_thread_signal, deliver_fatal_thread_signal):
2927 New functions, for more-accurate delivery of thread-specific signals.
2928 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2929 (deliver_arith_signal): Handle in this thread, not
2930 in the main thread, since it's triggered by this thread.
2931 (maybe_fatal_sig): New function.
2932 (init_signals): New arg DUMPING so that we can be more accurate
2933 about whether we're dumping. Caller changed.
2934 Treat thread-specific signals differently from process-general signals.
2935 Block all signals while handling fatal error; that's safer.
2936 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2937 on IEEE hosts.
2938 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2939 Ignore SIGPIPE unless batch.
2940 (emacs_backtrace): Output backtrace for the appropriate thread,
2941 which is not necessarily the main thread.
2942 * syssignal.h: Include <stdbool.h>.
2943 (emacs_raise): New macro.
2944 * xterm.c (x_connection_signal): Remove; no longer needed
2945 now that we use sigaction.
2946 (x_connection_closed): No need to mess with sigmask now.
2947 (x_initialize): No need to reset SIGPIPE handler here, since
2948 init_signals does this for us now.
2949
2950 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2951
2952 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2953 background rect may be larger (Bug#12245).
2954
2955 2012-09-23 Chong Yidong <cyd@gnu.org>
2956
2957 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2958
2959 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2960
2961 * .gdbinit: Just stop at fatal_error_backtrace.
2962 See Stefan Monnier's request in
2963 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2964 Remove no-longer-used query of system type.
2965
2966 2012-09-22 Chong Yidong <cyd@gnu.org>
2967
2968 * search.c (Freplace_match): Doc fix (Bug#12325).
2969
2970 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2971
2972 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2973 (Fline_end_position): Doc fix.
2974
2975 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2976
2977 2012-09-22 Chong Yidong <cyd@gnu.org>
2978
2979 * dispextern.h (struct image_type): Add new slot, storing a type
2980 initialization function.
2981
2982 * image.c (define_image_type): Call the image initializer function
2983 if it is defined. Arguments and return value changed.
2984 (valid_image_p, make_image): Callers changed.
2985 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2986 (gif_type, imagemagick_type, svg_type, gs_type):
2987 Add initialization functions.
2988 (Finit_image_library): Call lookup_image_type.
2989 (CHECK_LIB_AVAILABLE): Macro deleted.
2990 (lookup_image_type): Call define_image_type here, rather than via
2991 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2992 (syms_of_image): Move define_image_type calls for xbm_type and
2993 pbm_type to lookup_image_type.
2994
2995 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2996
2997 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2998 'idle_timers' from here ...
2999 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3000 lists, to avoid infloops when the timer does something stupid,
3001 like reinvoke itself with the same or smaller time-out.
3002 (Bug#12447)
3003
3004 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3005
3006 * window.c (Fsplit_window_internal): Handle only Qt value of
3007 Vwindow_combination_limit separately.
3008 (Qtemp_buffer_resize): New symbol.
3009 (Vwindow_combination_limit): New default value.
3010 Rewrite doc-string.
3011
3012 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3013
3014 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3015 the new overlay string. (Bug#10159)
3016
3017 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3018
3019 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3020 or that fprintf is async-signal-safe. POSIX doesn't require
3021 either assumption.
3022
3023 2012-09-22 Chong Yidong <cyd@gnu.org>
3024
3025 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3026 (Bug#8207).
3027
3028 2012-09-22 Kenichi Handa <handa@gnu.org>
3029
3030 * composite.c (composition_reseat_it): Handle the case that a
3031 grapheme cluster is not covered by a single font (Bug#12352).
3032
3033 2012-09-21 Chong Yidong <cyd@gnu.org>
3034
3035 * image.c (define_image_type): Avoid adding duplicate types to
3036 image_types (Bug#12463). Suggested by Jörg Walter.
3037
3038 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3039
3040 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3041 (print_load_command_name): Add case LC_DATA_IN_CODE.
3042 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3043
3044 2012-09-21 Glenn Morris <rgm@gnu.org>
3045
3046 * eval.c (Frun_hook_with_args_until_success)
3047 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3048
3049 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3050
3051 * fileio.c (Ffile_selinux_context): Only call freecon when
3052 lgetfilecon succeeded.
3053 (Fset_file_selinux_context): Likewise. (Bug#12444)
3054
3055 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3056
3057 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3058 reordering, locate the cursor by calling set_cursor_from_row; if
3059 that fails, clear the desired glyph matrix before returning a
3060 failure indication to the caller. Fixes leaving garbled display
3061 when fast scrolling with a down-key. (Bug#12403)
3062 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3063 scrolling through multibyte text.
3064
3065 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3066
3067 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3068 calling mark_vectorlike since that's the one that marks the window.
3069 (mark_discard_killed_buffers): Mark the final cdr.
3070 * window.h (struct window): Move prev/next_buffers to the
3071 non-standard fields.
3072 * window.c (make_window): Initialize prev/next_buffers manually.
3073
3074 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 Omit unused arg EXPECTED from socket hooks.
3077 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3078 * nsterm.m (ns_term_init):
3079 * termhooks.h (struct terminal.read_socket_hook):
3080 * w32inevt.c (w32_console_read_socket):
3081 * w32term.c (w32_read_socket):
3082 * xterm.c (XTread_socket):
3083 Omit unused arg EXPECTED. All callers changed.
3084 (store_user_signal_events): Return void, not int, since callers no
3085 longer care about the return value. All uses changed.
3086
3087 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3088
3089 * w32gui.h (XParseGeometry): Do not declare.
3090
3091 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3094 Ignore 'expected'. See Eli Zaretskii in
3095 <http://bugs.gnu.org/12471#8> (last line).
3096
3097 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3098 (XParseGeometry): Now static. Substitute extremal values for
3099 values that are out of range.
3100
3101 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3102
3103 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3104
3105 * nsfns.m (XParseGeometry): Remove.
3106 (Fx_create_frame): Call x_set_offset to correctly interpret
3107 top_pos in geometry.
3108
3109 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3110 (Fx_parse_geometry): If there is a space in string, call
3111 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3112
3113 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3114
3115 * search.c (scan_buffer): Use character positions in calls to
3116 region_cache_forward and region_cache_backward, not byte
3117 positions. (Bug#12196)
3118
3119 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3120 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3121
3122 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3123 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3124 emacs_blocked_malloc, now deleted.
3125
3126 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3127
3128 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3129 The workaround was for improving performance on Solaris 2.4, but
3130 is getting in the way now. Emacs will still work if someone is
3131 still running Solaris 2.4 in a museum somewhere; Sun dropped
3132 support for Solaris 2.4 in 2003.
3133 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3134 * process.c (create_process) [HAVE_WORKING_VFORK]:
3135 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3136 since Emacs no longer uses vfork on that platform.
3137
3138 2012-09-17 Glenn Morris <rgm@gnu.org>
3139
3140 * emacs.c: Use COPYRIGHT.
3141
3142 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3143
3144 Remove configure's --without-sync-input option (Bug#12450).
3145 When auditing signal-handling in preparation for cleaning it up,
3146 I found that SYNC_INPUT has race conditions and would be a real
3147 pain to fix. Since it's an undocumented and deprecated
3148 configure-time option, now seems like a good time to remove it.
3149 Also see <http://bugs.gnu.org/11080#16>.
3150 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3151 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3152 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3153 (malloc_hysteresis):
3154 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3155 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3156 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3157 (dont_register_blocks, bytes_used_when_reconsidered)
3158 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3159 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3160 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3161 Remove. All uses removed.
3162 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3163 implementation, one that depends on whether the new macro
3164 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3165 is defined.
3166 * atimer.c (run_timers, handle_alarm_signal):
3167 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3168 (handle_async_input, process_pending_signals)
3169 (handle_input_available_signal, init_keyboard):
3170 * nsterm.m (ns_read_socket):
3171 * process.c (wait_reading_process_output):
3172 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3173 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3174 (emacs_write):
3175 * xterm.c (XTread_socket):
3176 Assume SYNC_INPUT.
3177 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3178 * eval.c (handling_signal): Remove. All uses removed.
3179 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3180 All uses replaced with the SYNC_INPUT version.
3181 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3182 Remove decls.
3183 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3184 Now static.
3185
3186 * font.c (Ffont_shape_gstring): Remove unused local.
3187
3188 2012-09-16 Glenn Morris <rgm@gnu.org>
3189
3190 * Makefile.in (clean): No longer run nextstep's clean.
3191
3192 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3193 (ns_frag): Remove.
3194 (ns-app): Move here from ns.mk, and simplify.
3195 (clean): Simplify nextstep entry.
3196 * ns.mk: Remove file.
3197
3198 2012-09-17 Kenichi Handa <handa@gnu.org>
3199
3200 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3201 not covert the last few charactes.
3202
3203 2012-09-16 Kenichi Handa <handa@gnu.org>
3204
3205 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3206 here, but just check the validity of glyphs in the glyph-string.
3207
3208 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3209
3210 * window.c (Fwindow_parameter, Fset_window_parameter):
3211 Accept any window as argument (Bug#12452).
3212
3213 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3214
3215 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3216 to ns_term_init to avoid memory leak.
3217
3218 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3219 explicit retain/release.
3220 (ns_term_init): Only allow one display. Initialize outerpool and
3221 ns_*_types.
3222
3223 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3224
3225 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3226 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3227 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3228 the Microsoft problem in a different way, by altering ../nt/config.nt.
3229
3230 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3231
3232 * w32xfns.c:
3233 * w32uniscribe.c:
3234 * w32term.c:
3235 * w32select.c:
3236 * w32reg.c:
3237 * w32proc.c:
3238 * w32menu.c:
3239 * w32inevt.c:
3240 * w32heap.c:
3241 * w32font.c:
3242 * w32fns.c:
3243 * w32console.c:
3244 * w32.c:
3245 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3246 by lisp.h. This completes removal of setjmp.h inclusion
3247 erroneously announced in the previous commit. (Bug#12446)
3248
3249 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3250 more accurate.
3251
3252 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3253 not defined as a macro. The latter happens on MS-Windows.
3254 (Bug#12446)
3255
3256 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3257
3258 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3259 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3260 Some instances of '#include <setjmp.h>' removed, if the
3261 only reason for the instance was because "lisp.h" was included.
3262 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3263 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3264 and _longjmp with the new symbols. Emacs already uses _setjmp if
3265 available, so this change affects only POSIXish hosts that have
3266 sigsetjmp but not _setjmp, such as some versions of Solaris and
3267 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3268 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3269 (png_load_body) [HAVE_PNG]:
3270 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3271 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3272 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3273 since PNG requires jmp_buf. This is the only exception to the
3274 general rule that we now use sys_setjmp and sys_longjmp.
3275 This exception is OK since this code does not change the signal
3276 mask or longjmp out of a signal handler.
3277
3278 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3281 Include "syssignal.h", for 'main_thread'.
3282
3283 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3284
3285 Avoid out-of-range marker position (Bug#12426).
3286 * insdel.c (replace_range, replace_range_2):
3287 Adjust markers before overlays, as suggested by comments.
3288 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3289 Remove redundant check before calling offset_intervals.
3290
3291 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3292
3293 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3294 current buffer (Bug#12387).
3295
3296 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3297
3298 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3299
3300 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3301
3302 Use a more backwards-compatible timer format (Bug#12430).
3303 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3304 vector element, not from the 4th, since PSECS is now at the end.
3305 (Fcurrent_idle_time): Doc fix.
3306
3307 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3308
3309 Function to mark objects and remove killed buffers at once.
3310 * alloc.c (discard_killed_buffers): Rename to ...
3311 (mark_discard_killed buffers) ... new name. Add marking
3312 of remaining objects. Fix comment. Adjust users.
3313 (mark_object): Do not touch frame buffer lists here.
3314 * frame.c (delete_frame): Reset frame buffer lists here.
3315
3316 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3317
3318 Better workaround for GNOME bug when --enable-gcc-warnings.
3319 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3320 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3321 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3322
3323 Simplify SIGIO usage (Bug#12408).
3324 The code that dealt with SIGIO was crufty and confusing, e.g., it
3325 played tricks like "#undef SIGIO" but these tricks were not used
3326 consistently. Simplify mostly by not #undeffing standard symbols,
3327 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3328 or not as we please) rather than "defined SIGIO" (standard symbol
3329 that we probably shouldn't #undef).
3330 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3331 Modules that need it can include it.
3332 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3333 * dispextern.h (ignore_sigio): New decl.
3334 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3335 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3336 * emacs.c (shut_down_emacs):
3337 * keyboard.c (kbd_buffer_store_event_hold):
3338 Use ignore_sigio rather than invoking 'signal' directly.
3339 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3340 for FIONREAD.
3341 (FIONREAD, SIGIO): Do not #undef.
3342 (tty_read_avail_input): Use #error rather than a syntax error.
3343 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3344 for I_PIPE, used by SETUP_SLAVE_PTY.
3345 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3346 * sysdep.c (croak): Remove; no longer needed. This bit of
3347 temporary code, with Fred N. Fish's comment that it's temporary,
3348 has been in Emacs since at least 1992!
3349 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3350 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3351 * syssignal.h (croak): Remove decl.
3352 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3353 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3354 now that we're termios-only.
3355 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3356 * term.c (dissociate_if_controlling_tty): Use #error rather than
3357 a run-time error.
3358
3359 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3360 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3361 to work around GNOME bug 683906.
3362 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3363 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3364 This works around GCC bug 54561.
3365
3366 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3367
3368 More fixes for 'volatile' and setjmp/longjmp.
3369 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3370 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3371 (png_load_body) [HAVE_PNG]:
3372 (jpeg_load_body) [HAVE_JPEG]:
3373 New function, with most of the old parent function's body.
3374 (png_load) [HAVE_PNG]:
3375 (jpeg_load) [HAVE_JPEG]:
3376 Invoke the new function, to avoid longjmp munging our locals.
3377 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3378 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3379 longjmp is passed 2, as the C standard doesn't guarantee this.
3380 Instead, store the failure code into mgr->failure_code.
3381
3382 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3383
3384 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3385 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3386 (syms_of_keyboard): Remove support for unread-command-char.
3387
3388 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3389
3390 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3391 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3392 violation. (Bug#12426)
3393
3394 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3397
3398 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3399
3400 * eval.c: Add `inhibit-debugger'.
3401 (Qinhibit_debugger): New symbol.
3402 (call_debugger): Bind it instead of Qdebug_on_error.
3403 (maybe_call_debugger): Test Vinhibit_debugger.
3404 (syms_of_eval): Define inhibit-debugger.
3405 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3406 (syms_of_xdisp): Remove inhibit-debug-on-message.
3407
3408 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3409
3410 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3411 If a nonvolatile local variable is written before a _longjmp to
3412 the frame containing the variable, and is read after the _longjmp,
3413 the value read is indeterminate. Some local variables of type
3414 'struct handler' and 'struct catchtag' are used in this way, so
3415 mark each of their slots as volatile if the slot can be set before
3416 _longjmp and read afterwards.
3417 * lisp.h (struct handler): var and chosen_clause are now volatile.
3418 (struct catchtag): val, next, and pdlcount are now volatile.
3419
3420 * bidi.c (bidi_push_it, bidi_pop_it):
3421 * fns.c (copy_hash_table):
3422 * image.c (define_image_type):
3423 * keyboard.c (kbd_buffer_store_event_hold):
3424 * process.c (Fprocess_send_eof):
3425 * xfaces.c (x_create_gc) [HAVE_NS]:
3426 * xgselect.c (xg_select):
3427 Prefer assignment to memcpy when either will do.
3428
3429 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3430 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3431 time an item is removed. No need to mark this function 'inline';
3432 the compiler knows better than we do.
3433
3434 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3435
3436 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3437 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3438 to change_frame_size (Bug#12388).
3439 (windowDidResize:): Pass YES to updateFrameSize.
3440
3441 * nsterm.h: Add delay parameter to updateFrameSize.
3442
3443 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3444
3445 Discard killed buffers from deleted window and frame objects.
3446 This reduces an amount of references to killed buffers and
3447 helps GC to reclaim them faster.
3448 * alloc.c (discard_killed_buffers): New function.
3449 (mark_object): Use it for deleted windows and frames.
3450 (mark_object): If symbol's value is set up for a killed buffer
3451 or deleted frame, restore its global binding.
3452 * data.c (swap_in_global_binding): Add GC notice.
3453 (swap_in_symval_forwarding): Use convenient set_blv_where.
3454 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3455 * window.h: ... to here.
3456
3457 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 Convenient macro to check whether the buffer is live.
3460 * buffer.h (BUFFER_LIVE_P): New macro.
3461 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3462 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3463
3464 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3465
3466 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3467 composition cases (Bug#12364).
3468
3469 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3470 overhang of succeeding glyphs overlapping box cursor.
3471
3472 * w32term.c (x_draw_glyph_string): Likewise.
3473
3474 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3475
3476 Simplify, document, and port floating-point (Bug#12381).
3477 The porting part of this patch fixes bugs on non-IEEE platforms
3478 with frexp, ldexp, logb.
3479 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3480 Now static.
3481 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3482 support, by removing commented-out code and briefly listing the
3483 C89 functions excluded. The commented-out stuff was confusing
3484 maintenance, e.g., we thought we needed cbrt but it was commented out.
3485 (logb): Remove decl; no longer needed.
3486 (isfinite): New macro, if not already supplied.
3487 (isnan): Don't replace any existing macro.
3488 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3489 are present on all C89 platforms.
3490 (Ffrexp): Do not special-case zero, as frexp does the right thing
3491 for that case.
3492 (Flogb): Do not use logb, as it doesn't have the desired meaning
3493 on hosts that use non-base-2 floating point. Instead, stick with
3494 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3495 frexp, to avoid getting an unspecified result.
3496
3497 * xdisp.c (Qinhibit_debug_on_message): Now static.
3498
3499 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3500
3501 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3502 NSBezierPath (Bug#12131).
3503
3504 2012-09-10 Chong Yidong <cyd@gnu.org>
3505
3506 * fns.c (Fdelq, Fdelete): Doc fix.
3507
3508 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3509
3510 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3511 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3512
3513 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3514
3515 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3516 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3517 Use it.
3518
3519 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3520
3521 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3522 left fringe if the window has a left margin. This avoids leaving
3523 traces of the cursor because its leftmost pixel is not drawn over.
3524
3525 * dispnew.c (update_window_line): When the left margin area of a
3526 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3527 that screen line. (Bug#12277)
3528
3529 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3530
3531 Assume C89 or later for math functions (Bug#12381).
3532 This simplifies the code, and makes it a bit smaller and faster,
3533 and (most important) makes it easier to clean up signal handling
3534 since we can stop worring about floating-point exceptions in
3535 library code. That was a problem before C89, but the problem
3536 went away many years ago on all practical Emacs targets.
3537 * data.c, image.c, lread.c, print.c:
3538 Don't include <math.h>; no longer needed.
3539 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3540 might be autoconfigured, as that never happens.
3541 * data.c (fmod):
3542 * doprnt.c (DBL_MAX_10_EXP):
3543 * print.c (DBL_DIG):
3544 Remove. C89 or later always defines these.
3545 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3546 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3547 (arith_error, domain_error, domain_error2):
3548 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3549 no longer needed -- we simply return what C returns. All uses removed.
3550 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3551 the wrapped code.
3552 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3553 Remove. All uses expanded, as these macros are no longer used
3554 more than once and are now more trouble than they're worth.
3555 (Ftan): Use tan, not sin / cos.
3556 (Flogb): Assume C89 frexp.
3557 (fmod_float): Assume C89 fmod.
3558 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3559 (init_floatfns): Remove. All uses removed.
3560
3561 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3562
3563 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3564 compositeToPoint for OSX < 10.6 (Bug#12390).
3565
3566 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3569 This produces more-accurate results.
3570
3571 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3572
3573 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3574 changes (Bug#12088).
3575
3576 2012-09-08 Chong Yidong <cyd@gnu.org>
3577
3578 * syntax.c (Fstring_to_syntax): Doc fix.
3579
3580 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3581
3582 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3583 in the internal border.
3584 (x_set_window_size): Remove static variables and their usage.
3585 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3586 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3587 Remove fringe/internal border adjustment (Bug#11052).
3588 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3589 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3590 (ns_fix_rect_ibw): Remove.
3591 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3592 (ns_dumpglyphs_box_or_relief): Ditto.
3593 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3594 adjustment.
3595 (ns_dumpglyphs_image): Ditto.
3596 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3597 border adjustment.
3598 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3599 their usage. Add fringe_extended_p and its use as in other terms.
3600 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3601 scroll bar was removed.
3602 (updateFrameSize): New function.
3603 (windowDidResize): Move code to updateFrameSize and call it.
3604
3605 * nsterm.h (EmacsView): Add updateFrameSize.
3606
3607 2012-09-07 Chong Yidong <cyd@gnu.org>
3608
3609 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3610
3611 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3612
3613 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 More signal-handler cleanup (Bug#12327).
3616 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3617 Problem introduced when merging patches. Noted by Eli Zaretskii in
3618 <http://bugs.gnu.org/12327#67>.
3619 * floatfns.c: Comment fix.
3620 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3621 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3622 and anyway the declaration is harmless even if SIGDANGER is not defined.
3623 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3624 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3625 source files not surprisingly expected syssignal.h to define, or
3626 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3627 Include <sys/ioctl.h>, for FIONREAD.
3628 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3629 This eliminates a problem whereby other files mysteriously had
3630 to include "syssignal.h" before including "systty.h" if they
3631 wanted to use "#ifdef SIGIO".
3632
3633 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3634
3635 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3636
3637 * w32.c (sigemptyset): Empty the set.
3638 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3639
3640 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3641
3642 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3643
3644 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3645 (mark_object): Likewise for frame objects.
3646
3647 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3648
3649 * syssignal.h (handle_on_main_thread): Always declare,
3650 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3651 This ports to platforms without HAVE_PTHREAD.
3652
3653 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3654
3655 Signal-handler cleanup (Bug#12327).
3656 Emacs's signal handlers were written in the old 4.2BSD style with
3657 sigblock and sigmask and so forth, and this led to some
3658 inefficiencies and confusion. Rewrite these to use
3659 pthread_sigmask etc. without copying signal sets around. Also,
3660 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3661 'signal', and instead use functions that do not attempt to take
3662 over the system name space. This patch causes Emacs's text
3663 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3664 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3665 Do not include <signal.h> or "syssignal.h", as these
3666 modules do not use signals.
3667 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3668 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3669 Do not include <signal.h>, as "syssignal.h" does that for us now.
3670 * atimer.c (sigmask_atimers): New function.
3671 (block_atimers, unblock_atimers): New functions,
3672 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3673 All uses replaced.
3674 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3675 no longer needed here.
3676 * emacs.c (main): Inspect existing signal handler with sigaction,
3677 so that there's no need to block and unblock SIGHUP.
3678 * sysdep.c (struct save_signal): New member 'action', replacing
3679 old member 'handler'.
3680 (save_signal_handlers, restore_signal_handlers):
3681 Use sigaction instead of 'signal' to save and restore.
3682 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3683 New function. All users of 'signal' modified to use set_sighandler
3684 if they're writeonly, and to use sys_signal if they're read+write.
3685 (emacs_sigaction_init, forwarded_signal): New functions.
3686 (sys_signal): Remove. All uses replaced by calls to sigaction
3687 and emacs_sigaction_init, or by direct calls to 'signal'.
3688 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3689 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3690 all uses replaced by pthread_sigmask etc. calls.
3691 * syssignal.h: Include <signal.h>.
3692 (emacs_sigaction_init, forwarded_signal): New decls.
3693 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3694 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3695 (sigmask, sys_sigmask): Remove; no longer needed.
3696 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3697 (sigblock, sigunblock, sigfree):
3698 (sigsetmask) [!defined sigsetmask]:
3699 Remove. All uses replaced by pthread_sigmask.
3700 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3701 no longer need to be replaced, and its typical old uses
3702 are now done via emacs_sigaction_init and sigaction.
3703 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3704 (sys_sigdel): Remove; unused.
3705 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3706
3707 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3708
3709 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3710 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3711
3712 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Explicitly mark buffer_defaults and buffer_local_symbols.
3715 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3716 mark_local_symbols here.
3717 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3718 since special buffers aren't marked here any more.
3719 (allocate_buffer): Chain new buffer with all_buffers here...
3720 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3721 not here.
3722 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3723 (syms_of_buffer): Remove staticpro of the above.
3724 (init_buffer_once): Set names for buffer_defaults and
3725 buffer_local_symbols.
3726
3727 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3728
3729 Use bool for booleans in font-related modules.
3730 * font.c (font_intern_prop, font_style_to_value)
3731 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3732 (generate_otf_features, font_check_otf_features, font_check_otf)
3733 (font_match_p, font_list_entities, font_at):
3734 * fontset.c (fontset_id_valid_p, reorder_font_vector
3735 (fontset_find_font, Fset_fontset_font)
3736 (face_suitable_for_char_p) [0]:
3737 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3738 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3739 (m17n_flt_initialized, ftfont_shape_by_flt):
3740 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3741 * nsfont.m (nsfont_draw):
3742 * w32font.c (w32font_draw):
3743 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3744 Use bool for booleans.
3745 * font.h: Adjust to above API changes.
3746 (struct font, struct font_driver, struct font_driver_list):
3747 Use bool for booleans.
3748 (struct font): Remove useless member encoding_type.
3749 All users removed.
3750 * fontset.c, xftfont.c: Omit unnecessary static decls.
3751
3752 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3753
3754 * alloc.c (mark_object): Revert window marking code
3755 since it's unsafe for the Fset_window_configuration.
3756
3757 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 Fix race conditions with signal handlers and errno (Bug#12327).
3760 Be more systematic about preserving errno whenever a signal
3761 handler returns, even if it's not in the main thread. Do this by
3762 renaming signal handlers to distinguish between signal delivery
3763 and signal handling. All uses changed.
3764 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3765 * data.c (deliver_arith_signal): Rename from arith_error.
3766 * dispnew.c (deliver_window_change_signal): Rename from
3767 window_change_signal.
3768 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3769 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3770 * keyboard.c (deliver_input_available_signal): Rename from
3771 input_available_signal.
3772 (deliver_user_signal): Rename from handle_user_signal.
3773 (deliver_interrupt_signal): Rename from interrupt_signal.
3774 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3775 (deliver_child_signal): Rename from sigchld_handler.
3776 * atimer.c (handle_alarm_signal):
3777 * data.c (handle_arith_signal):
3778 * dispnew.c (handle_window_change_signal):
3779 * emacs.c (handle_fatal_signal, handle_danger_signal):
3780 * keyboard.c (handle_input_available_signal):
3781 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3782 * process.c (handle_pipe_signal, handle_child_signal):
3783 New functions, with the actual signal-handling code taken from the
3784 original respective signal handlers, sans the sporadic attempts to
3785 preserve errno, since that's now done by handle_on_main_thread.
3786 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3787 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3788 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3789 Move to sysdep.c.
3790 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3791 Move initialization of main_thread to sysdep.c's init_signals.
3792 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3793 our usage, and simplifies the mainline code.
3794 (record_child_status_change): New static function, as a helper
3795 for handle_child_signal, and with most of the old child handler's
3796 contents.
3797 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3798 (handle_child_signal): Use the above.
3799 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3800 Moved here from emacs.c.
3801 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3802 code moved here from emacs.c's main function.
3803 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3804 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3805 This lets callers save and restore errno properly.
3806
3807 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3808
3809 Remove redundant or unused things here and there.
3810 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3811 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3812 * editfns.c (Fcompare_buffer_substrings): Likewise.
3813 * frame.h (struct terminal, struct font_driver_list):
3814 Remove redundant declarations.
3815 * window.h (Qleft, Qright): Likewise.
3816
3817 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3818
3819 Do not mark objects from deleted buffers, windows and frames.
3820 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3821 (mark_object): Likewise for windows and frames.
3822
3823 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3824
3825 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3826 buffer_defaults and buffer_local_symbols as valid objects.
3827 Return special value to denote them.
3828
3829 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3832 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3833 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3834 (file_name_absolute_p, Fsubstitute_in_file_name):
3835 (check_executable, check_writable, Ffile_accessible_directory_p)
3836 (Fset_file_selinux_context, Fdefault_file_modes)
3837 (Finsert_file_contents, choose_write_coding_system)
3838 (Fwrite_region, build_annotations, a_write, e_write)
3839 (Fdo_auto_save):
3840 * filelock.c (boot_time_initialized, get_boot_time)
3841 (get_boot_time_1, lock_file_1, within_one_second):
3842 * floatfns.c (in_float):
3843 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3844 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3845 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3846 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3847 * window.c (compare_window_configurations):
3848 Use bool for booleans.
3849 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3850 (Fdefault_file_modes): Now mode_t, not int, for modes.
3851 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3852 (internal_delete_file): Now returns void, not a (boolean) int,
3853 since nobody was looking at the return value.
3854 * lisp.h, window.h: Adjust to above API changes.
3855
3856 * xdisp.c (set_message): Simplify and reindent last change.
3857
3858 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3859
3860 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3861
3862 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3863
3864 * eval.c (call_debugger): Make the function non-static so that we
3865 can call it from set_message.
3866
3867 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3868 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3869
3870 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 Give more-useful info on a fatal error (Bug#12328).
3873 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3874 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3875 of doing the work ourselves.
3876 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3877 do most of the work.
3878 (fatal_error_backtrace): New function, taken from the guts
3879 of the old fatal_error_signal, but with a new option to output
3880 a backtrace.
3881 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3882 info about the signal than just its number.
3883 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3884 * sysdep.c: Include <execinfo.h>
3885 (emacs_backtrace): New function, taken partly from the previous
3886 code of the 'die' function.
3887 (emacs_abort): Call fatal_error_backtrace rather than abort.
3888
3889 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3890
3891 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3892 eager (load-time) macro-expansion.
3893 * lisp.mk (lisp): Add macroexp.
3894
3895 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3896
3897 Simplify redefinition of 'abort' (Bug#12316).
3898 Do not try to redefine the 'abort' function. Instead, redo
3899 the code so that it calls 'emacs_abort' rather than 'abort'.
3900 This removes the need for the NO_ABORT configure-time macro
3901 and makes it easier to change the abort code to do a backtrace.
3902 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3903 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3904 Remove; sysdep.c's emacs_abort now takes its place.
3905 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3906 'abort' changed to use 'emacs_abort'.
3907 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3908 (abort) [!defined abort]: Rename to ...
3909 (emacs_abort): ... new name.
3910 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3911 the place of the old 'abort' in emacs.c.
3912 * w32.c, w32fns.c (abort): Do not #undef.
3913 * w32.c (emacs_abort): Rename from w32_abort.
3914
3915 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3916
3917 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3918 offsets[j].dv, since the y axis of the screen coordinates points
3919 down, while the y axis of the font definition coordinates points
3920 up. This fixes display of Arabic diacritics such as KASRA and
3921 KASRATAN. (Bug#11860)
3922
3923 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3924
3925 Be more systematic about _setjmp vs setjmp.
3926 * alloc.c (test_setjmp, mark_stack):
3927 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3928 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3929 (png_load, my_error_exit, jpeg_load):
3930 * process.c (send_process_trap, send_process):
3931 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3932 The underscored versions are up to 30x faster on some hosts.
3933 Formerly, the code used setjmp+longjmp sometimes and
3934 _setjmp+_longjmp at other times, with no particular reason to
3935 prefer setjmp+longjmp.
3936
3937 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 Fix minor problem found by static checking.
3940 * buffer.c (Fdelete_all_overlays): Return nil.
3941
3942 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3943
3944 * buffer.c (Fdelete_all_overlays): New function.
3945
3946 2012-09-03 Chong Yidong <cyd@gnu.org>
3947
3948 * gtkutil.c: Add extern decl for Qxft.
3949
3950 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3951
3952 * emacs.c, eval.c: Use bool for boolean.
3953 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3954 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3955 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3956 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3957 (main, decode_env_path, Fdaemon_initialized):
3958 * eval.c (call_debugger, Finteractive_p, interactive_p):
3959 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3960 (maybe_call_debugger, Fbacktrace):
3961 * process.c (read_process_output, exec_sentinel):
3962 Use bool for booleans.
3963 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3964 All callers changed.
3965 * eval.c (interactive_p): Omit always-true boolean argument
3966 EXCLUDE_SUBRS_P. All callers changed.
3967 * dispextern.h, lisp.h: Reflect above API changes.
3968 * firstfile.c (dummy): Use the address of 'main', whose signature
3969 won't change, instead of the address of 'initialize', whose
3970 signature just changed from int to bool.
3971 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3972 * msdos.c (fatal_error_in_progress): ... from here.
3973 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3974 of incrementing it.
3975 (redisplay_internal, unwind_redisplay): Simply clear
3976 REDISPLAYING_P when unwinding, instead of saving its previous,
3977 always-false value and then restoring it.
3978
3979 Clean up some extern decls.
3980 Mostly, this hoists extern decls out of .c files and into .h files.
3981 That way, we're more likely to catch errors if the interfaces change.
3982 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3983 declare xg_mark_data.
3984 * dispextern.h (x_frame_parm_handlers):
3985 * font.h (Qxft):
3986 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3987 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3988 (Qultra_bold, Qoblique, Qitalic):
3989 Move extern decl here from .c file.
3990 * alloc.c (xg_mark_data) [USE_GTK]:
3991 * doc.c (Qclosure):
3992 * eval.c (Qlexical_binding):
3993 * fns.c (time) [!HAVE_UNISTD_H]:
3994 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3995 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3996 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3997 * lread.c (Qinternal_interpreter_environment):
3998 * minibuf.c (Qbuffer):
3999 * process.c (QCfamily, QCfilter):
4000 * widget.c (free_frame_faces):
4001 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4002 * xfont.c (x_clear_errors):
4003 * xterm.c (x_frame_parm_handlers):
4004 Remove now-redundant extern decls.
4005 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4006 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4007 Now static.
4008 * xfaces.c: Remove unnecessary static decls.
4009 * xterm.c (updating_frame): Remove decl of nonexistent object.
4010
4011 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4012 when building globals.h, as the objects that are not built on
4013 this host are not needed to compile C files on this host.
4014
4015 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4016
4017 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4018
4019 * frame.h: Add missing prototype for x_wm_set_size_hint.
4020
4021 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4024 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4025 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4026 (Fsubstitute_command_keys):
4027 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4028 (save_excursion_save, save_excursion_restore)
4029 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4030 (format_time_string, general_insert_function)
4031 (make_buffer_string, make_buffer_string_both)
4032 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4033 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4034 (copy_text, insert_1, insert_1_both, insert_from_string)
4035 (insert_from_string_before_markers, insert_from_string_1)
4036 (insert_from_buffer, insert_from_buffer_1, replace_range)
4037 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4038 (del_range_2, modify_region):
4039 * intervals.c (intervals_equal, balance_possible_root_interval)
4040 (adjust_intervals_for_insertion, merge_properties_sticky)
4041 (graft_intervals_into_buffer, lookup_char_property)
4042 (adjust_for_invis_intang, set_point_both)
4043 (get_property_and_range, compare_string_intervals)
4044 (set_intervals_multibyte_1, set_intervals_multibyte):
4045 * keyboard.c (decode_timer):
4046 Use bool for boolean.
4047 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4048 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4049
4050 2012-09-02 Chong Yidong <cyd@gnu.org>
4051
4052 * keymap.c (push_key_description): Print M-TAB as C-M-i
4053 (Bug#11758).
4054
4055 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4056
4057 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4058 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4059 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4060 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4061 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4062 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4063 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4064
4065 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4066
4067 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4068 more than one grapheme cluster passed to the shaper: compute the
4069 offset adjustment values separately for each cluster. (Bug#11860)
4070
4071 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4072 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4073 about implicit conversions from integer to pointer.
4074
4075 2012-09-01 Daniel Colascione <dancol@dancol.org>
4076
4077 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4078 system used too early.
4079
4080 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4081
4082 Better seed support for (random).
4083 * emacs.c (main): Call init_random.
4084 * fns.c (Frandom): Set the seed from a string argument, if given.
4085 Remove long-obsolete Gentzel cruft.
4086 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4087 (init_random): New function.
4088
4089 2012-09-01 Daniel Colascione <dancol@dancol.org>
4090
4091 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4092 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4093 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4094 x_wm_set_size_hint, x_query_colors, x_real_positions,
4095 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4096 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4097 all of which have been moved to common code.
4098
4099 * xfaces.c: Include TERM_HEADER instead of listing all possible
4100 window-system headers.
4101
4102 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4103 to match header.
4104
4105 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4106 directly accessing frame internals.
4107
4108 * w32font.h: Include font.h. Define syms_of_w32font and
4109 globals_of_w32font.
4110
4111 * process.c: Include TERM_HEADER instead of listing all possible
4112 window-system headers.
4113
4114 * nsterm.h: Remove declarations now in frame.h.
4115 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4116
4117 * menu.c: Include TERM_HEADER instead of listing all possible
4118 window-system headers.
4119
4120 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4121 window system.
4122
4123 * keyboard.c: Include TERM_HEADER instead of listing all possible
4124 window-system headers.
4125
4126 * image.c: Include TERM_HEADER instead of listing all possible
4127 window-system headers. Declare Vlibrary_cache when compiling for
4128 Windows.
4129
4130 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4131 window system declarations.
4132
4133 * frame.h: Move common functions here: set_frame_menubar,
4134 x_set_window_size, x_sync, x_get_focus_frame,
4135 x_set_mouse_position, x_set_mouse_pixel_position,
4136 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4137 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4138 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4139 x_activate_menubar, x_real_positions, x_bitmap_icon,
4140 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4141 and x_query_colors.
4142
4143 * frame.c: Include TERM_HEADER instead of listing all possible
4144 window-system headers.
4145
4146 * font.c: Include TERM_HEADER instead of listing all possible
4147 window-system headers.
4148
4149 * emacs.c: Include TERM_HEADER.
4150
4151 * dispnew.c: Include TERM_HEADER instead of listing all possible
4152 window-system headers.
4153
4154 * ccl.h: Include character.h.
4155
4156 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4157 the current window system; include in list of objects to link into
4158 Emacs.
4159
4160 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4161
4162 Remove mark_ttys function and fix tty_display_info initialization.
4163 * lisp.h (mark_ttys): Remove prototype.
4164 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4165 to mark_ttys because all possible values of 'top_frame' slot are
4166 the frames which are reachable from Vframe_list.
4167 * term.c (mark_ttys): Remove.
4168 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4169
4170 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4171
4172 Change struct frame bitfields from unsigned char to unsigned.
4173 * frame.h (struct frame): Change type of 'display_preempted',
4174 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4175 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4176 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4177 bitfields from unsigned char to unsigned.
4178
4179 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Remove unused member of struct x_output and struct w32_output.
4182 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4183 * w32term.h (struct w32_output): Likewise.
4184
4185 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4186
4187 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4188 does not become zero (Bug#12234).
4189
4190 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4193 for GCC 4.7.1 x86-64.
4194
4195 2012-08-30 Glenn Morris <rgm@gnu.org>
4196
4197 * lread.c (init_lread): For out-of-tree builds, only add the
4198 source directory's site-lisp dir to the load-path if it exists,
4199 consistent with in-tree builds. (Bug#12302)
4200
4201 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4202
4203 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4204 button_values to NULL. Call setStykeMask so dialogs get a close button.
4205 (windowShouldClose:): Set window_closed.
4206 (dealloc): New member, free button_values.
4207 (process_dialog:): Make member function. Remove window argument,
4208 replace window with self. Count buttons and allocate and store values
4209 in button_values.
4210 (addButton:value:row:): value is int with the name tag. Call setTag
4211 with tag. Remove return self, declare return value as void.
4212 (addString:row:): Remove return self, declare return value as void.
4213 (addSplit): Remove return self, declare return value as void.
4214 (clicked:): Remove return self, declare return value as void.
4215 Set dialog_return to button_values[seltag]. Code formatting change.
4216 (initFromContents:isQuestion:): Adjust call to process_dialog.
4217 Code formatting change.
4218 (timeout_handler:): Set timer_fired to YES.
4219 (runDialogAt:): Set timer_fired to NO.
4220 Handle click on close button as quit.
4221
4222 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4223 Add window_closed and button_values. Add void as return value for
4224 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4225 Add process_dialog as new member.
4226
4227 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4228
4229 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4230 is not one of the heaps we manage. (Bug#12242)
4231
4232 2012-08-28 Glenn Morris <rgm@gnu.org>
4233
4234 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4235
4236 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4237
4238 * window.c (Fset_window_configuration): Remove handling of
4239 auto-buffer-name window parameter. Install revision of reverted
4240 fix.
4241
4242 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4243
4244 Do not allow to set major mode for a dead buffer.
4245 * buffer.c (Fset_buffer_major_mode): Signal an error
4246 if the buffer is dead.
4247 (Fother_buffer, other_buffer_safely): Remove redundant
4248 nested declaration.
4249
4250 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Always use set_buffer_if_live to restore original buffer at unwind.
4253 * buffer.h (record_unwind_current_buffer): New function.
4254 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4255 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4256 * undo.c, window.c: Adjust users.
4257 * buffer.c (set_buffer_if_live): Fix comment.
4258
4259 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4260
4261 Fix usage of set_buffer_internal.
4262 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4263 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4264 * coding.c (decode_coding): Omit redundant test.
4265 * fileio.c (decide_coding_unwind): Likewise.
4266 * fns.c (secure_hash): Likewise.
4267 * insdel.c (modify_region): Likewise.
4268 * keyboard.c (command_loop_1): Likewise.
4269 * print.c (PRINTFINISH): Likewise.
4270 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4271
4272 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4273
4274 * dispnew.c: Use bool for boolean.
4275 (frame_garbaged, display_completed, delayed_size_change)
4276 (fonts_changed_p, add_window_display_history)
4277 (add_frame_display_history, verify_row_hash)
4278 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4279 (row_equal_p, realloc_glyph_pool)
4280 (allocate_matrices_for_frame_redisplay)
4281 (showing_window_margins_p)
4282 (adjust_frame_glyphs_for_frame_redisplay)
4283 (build_frame_matrix_from_leaf_window, make_current)
4284 (mirrored_line_dance, mirror_line_dance, update_frame)
4285 (update_window_tree, update_single_window)
4286 (check_current_matrix_flags, update_window, update_text_area)
4287 (update_window_line, set_window_update_flags, scrolling_window)
4288 (update_frame_1, scrolling, buffer_posn_from_coords)
4289 (do_pending_window_change, change_frame_size)
4290 (change_frame_size_1, sit_for):
4291 Use bool for boolean.
4292 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4293 and remove last int (actually boolean) argument, which was always 0.
4294 All callers changed.
4295 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4296 * dispextern.h (struct composition_it): Use bool for boolean.
4297 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4298 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4299 * dired.c (file_name_completion):
4300 Use bool for boolean. (This was missed in an earlier change.)
4301
4302 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4303
4304 * window.c (Fset_window_configuration): Revert first part of
4305 last change.
4306
4307 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4308
4309 * nsterm.h (NSPanel): New class variable dialog_return.
4310
4311 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4312 Initialize dialog_return.
4313 (windowShouldClose:): Use stop instead of stopModalWithCode.
4314 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4315 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4316 event.
4317 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4318 modal loop returns.
4319
4320 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4321
4322 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4323 * composite.c (find_composition, composition_gstring_p)
4324 (composition_reseat_it, find_automatic_composition):
4325 * data.c (let_shadows_buffer_binding_p)
4326 (let_shadows_global_binding_p, set_internal, make_blv)
4327 (Fmake_variable_buffer_local, Fmake_local_variable)
4328 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4329 (cons_to_signed, arith_driver):
4330 * dbusbind.c (xd_in_read_queued_messages):
4331 * dired.c (directory_files_internal, file_name_completion):
4332 Use bool for booleans.
4333 * dired.c (file_name_completion):
4334 * process.h (fd_callback):
4335 Omit int (actually boolean) argument. It wasn't being used.
4336 All uses changed.
4337 * composite.h, lisp.h: Reflect above API changes.
4338
4339 * cmds.c, coding.c: Use bool for booleans.
4340 * cmds.c (move_point, Fself_insert_command):
4341 * coding.h (struct composition status, struct coding_system):
4342 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4343 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4344 (emacs_mule_char, decode_coding_emacs_mule)
4345 (encode_coding_emacs_mule, detect_coding_iso_2022)
4346 (decode_coding_iso_2022, encode_invocation_designation)
4347 (encode_designation_at_bol, encode_coding_iso_2022)
4348 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4349 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4350 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4351 (encode_coding_raw_text, detect_coding_charset)
4352 (decode_coding_charset, encode_coding_charset, detect_eol)
4353 (detect_coding, get_translation_table, produce_chars)
4354 (consume_chars, reused_workbuf_in_use)
4355 (make_conversion_work_buffer, code_conversion_save)
4356 (decode_coding_object, encode_coding_object)
4357 (detect_coding_system, char_encodable_p)
4358 (Funencodable_char_position, code_convert_region)
4359 (code_convert_string, code_convert_string_norecord)
4360 (Fset_coding_system_priority):
4361 * fileio.c (Finsert_file_contents):
4362 Use bool for booleans.
4363 * coding.h, lisp.h: Reflect above API changes.
4364 * coding.c: Remove unnecessary static function decls.
4365 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4366 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4367 not a boolean 'int', since callers never look at the return value.
4368 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4369 * coding.h (decoding_buffer_size, encoding_buffer_size)
4370 (emacs_mule_string_char): Remove unused extern decls.
4371 (struct iso_2022_spec, struct coding_system):
4372 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4373 (struct emacs_mule_spec): Remove unused field 'full_support'.
4374 All initializations removed.
4375 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4376
4377 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 Fix spare memory change (Bug#12286).
4380 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4381 (valid_lisp_object_p): Likewise.
4382
4383 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4384
4385 * window.c (Fset_window_configuration): Record any window's old
4386 buffer if it's replaced (see Bug#8789). If the new current
4387 buffer doesn't appear in the selected window, go to its old
4388 point (Bug#12208).
4389
4390 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4391
4392 Special MEM_TYPE_SPARE to denote reserved memory.
4393 * alloc.c (enum mem_type): New memory type.
4394 (refill_memory_reserve): Use new type for spare memory.
4395 This prevents live_cons_p and live_string_p from incorrect
4396 detection of uninitialized objects from spare memory as live.
4397
4398 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4399
4400 Spelling fixes.
4401 * Makefile.in (.PHONY): versioclean -> versionclean.
4402
4403 Remove unused external symbols.
4404 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4405 * window.c (Qwindow_valid_p, decode_valid_window):
4406 Now static, not extern.
4407 * data.c (Qinterval): Remove; unused.
4408 (syms_of_data): Do not define 'interval'.
4409 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4410 * window.h (decode_valid_window):
4411 Remove decls.
4412
4413 * character.c, charset.c, chartab.c: Use bool for booleans.
4414 * character.c (lisp_string_width, string_count_byte8)
4415 (string_escape_byte8):
4416 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4417 (load_charset_map_from_file, map_charset_chars)
4418 (Fdefine_charset_internal, define_charset_internal)
4419 (Fdeclare_equiv_charset, find_charsets_in_text)
4420 (Ffind_charset_region, char_charset, Fiso_charset):
4421 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4422 (sub_char_table_set, sub_char_table_set_range)
4423 (char_table_set_range, optimize_sub_char_table)
4424 (map_sub_char_table):
4425 Use bool for boolean.
4426 * character.c (str_to_unibyte): Omit last boolean argument; it was
4427 always 0. All callers changed.
4428 * character.h, charset.h: Adjust to match previous changes.
4429 * character.h (char_printable_p): Remove decl of nonexistent function.
4430 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4431 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4432 are all boolean, so make them single-bit bitfields.
4433
4434 * lisp.h (ASET): Remove attempt to detect side effects.
4435 It was meant to be temporary and it often doesn't work,
4436 because when IDX has side effects the behavior of IDX==IDX
4437 is undefined. See Stefan Monnier in
4438 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4439
4440 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4441
4442 * lisp.h (functionp): New function (extracted from Ffunctionp).
4443 (FUNCTIONP): Use it.
4444 * eval.c (Ffunctionp): Use it.
4445
4446 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4447
4448 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4449 as that's faster and simpler than static storage. Don't bother
4450 with the g_main_context_query overhead if g_main_context_pending
4451 says no events are pending.
4452 (gfds, gfds_size): Remove these static vars.
4453 (xgselect_initialize): Remove; no longer needed.
4454 All uses and decls removed.
4455
4456 * emacs.c (fatal_error_signal_hook): Remove.
4457 All uses removed. This leftover from old code was always 0.
4458
4459 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4460 * casefiddle.c (casify_object, casify_region):
4461 * casetab.c (set_case_table):
4462 * category.c, category.h (word_boundary_p):
4463 * category.h (CHAR_HAS_CATEGORY):
4464 Use bool for booleans, instead of int.
4465
4466 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4467
4468 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4469
4470 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4471
4472 On assertion failure, print backtrace if available.
4473 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4474 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4475 * Makefile.in (LIB_EXECINFO): New macro.
4476 (LIBES): Use it.
4477
4478 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4479 * bytecode.c (exec_byte_code):
4480 * callint.c (check_mark, Fcall_interactively):
4481 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4482 (getenv_internal, sync_process_alive, call_process_exited):
4483 * lisp.h (USE_SAFE_ALLOCA):
4484 Use bool for booleans, instead of int.
4485 * lisp.h, process.h: Adjust prototypes to match above changes.
4486 * callint.c (Fcall_interactively): Don't assume the mark's
4487 offset fits in 'int'.
4488
4489 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4490
4491 * buffer.c, buffer.h: Use bool for boolean.
4492 * buffer.c (reset_buffer_local_variables)
4493 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4494 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4495 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4496 (overlay_touches_p, overlay_strings, Foverlay_put)
4497 (report_overlay_modification, call_overlay_mod_hooks):
4498 (mmap_enlarge, mmap_set_vars):
4499 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4500 Use bool for booleans, instead of int.
4501 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4502 since the 1-or-0 return value is always ignored anyway.
4503 (mmap_initialized_p):
4504 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4505 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4506
4507 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 * bidi.c: Use bool for boolean.
4510 This is a bit more readable, and makes the text segment of bidi.o
4511 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4512 Presumably it's faster too.
4513 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4514 Now bool.
4515 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4516 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4517 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4518 (bidi_explicit_dir_char, bidi_level_of_next_char)
4519 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4520 Use bool for booleans, instead of int.
4521 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4522 (bidi_unshelve_cache): Adjust decls to match code.
4523
4524 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4525
4526 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4527 argument.
4528
4529 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4532 * atimer.h: Include <stdbool.h>.
4533
4534 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4535
4536 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4537 compile time tests instead of run time tests on systems that do
4538 not use them.
4539 (FRAME_MAC_P): Remove leftover from deleted code.
4540 * frame.c (syms_of_frame): Remove leftover from deleted code.
4541
4542 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4543
4544 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4545
4546 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4547
4548 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4549 Otherwise, the compiler complains about (A?B:C) where B is void
4550 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4551 (fontset_add): Return void, for FONTSET_ADD.
4552
4553 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4554
4555 * alloc.c: Use bool for booleans.
4556 (gc_in_progress, abort_on_gc)
4557 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4558 (dont_register_blocks) [GC_MALLOC_CHECK]:
4559 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4560 (check_string_bytes, make_specified_string, memory_full)
4561 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4562 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4563 (mark_stack, valid_pointer_p, make_pure_string)
4564 (Fgarbage_collect, survives_gc_p, gc_sweep):
4565 Use bool for booleans, instead of int.
4566 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4567 Remove unused local.
4568 * alloc.c (PURE_POINTER_P):
4569 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4570 * editfns.c (Fformat):
4571 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4572 (Fdo_auto_save):
4573 * fns.c (sweep_weak_table):
4574 * lisp.h (suppress_checking, push_message, survives_gc_p)
4575 (make_pure_string, gc_in_progress, abort_on_gc):
4576 * lread.c (readchar, read1):
4577 * print.c (Fprin1_to_string):
4578 * xdisp.c (push_message):
4579 Use bool for booleans affected directly or indirectly by
4580 alloc.c's changes.
4581
4582 Make recently-introduced setters macros.
4583 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4584 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4585 (set_fontset_default, set_fontset_fallback): Rename from their
4586 upper-case counterparts, and make them functions rather than macros.
4587 This is more consistent with the other recently-introduced setters.
4588 These don't need to be inline, since they're local.
4589
4590 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4591
4592 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4593 the loop (Bug#12247).
4594
4595 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4596
4597 * lisp.h (vcopy): Use memcpy rather than our own loop.
4598 This fixes a performance regression introduced by the recent
4599 addition of vcopy. This means 'vcopy' will need to be modified
4600 for a copying collector, but that's OK. Also, tighten the
4601 checking in the assertion.
4602
4603 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4604
4605 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4606 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4607 non-base glyph for the width of the base character, according to
4608 what x_draw_composite_glyph_string_foreground expects.
4609 Generate WADJUST value according to composition_gstring_width's
4610 expectations, to produce correct width of the composed character.
4611 Reverse the sign of the DU offset produced by ScriptPlace.
4612
4613 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4616
4617 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4618
4619 Avoid direct writes to contents member of struct Lisp_Vector.
4620 * lisp.h (vcopy): New function to copy data into vector.
4621 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4622 * fns.c (Ffillarray): Use ASET.
4623 * keyboard.c (timer_check_2): Use AREF and ASET.
4624 (append_tool_bar_item, Frecent_keys): Use vcopy.
4625 * lread.c (read_vector): Use ASET.
4626 * msdos.c (Frecent_doskeys): Use vcopy.
4627 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4628 (Finternal_merge_in_global_face): Use ASET and vcopy.
4629 * xfont.c (xfont_list_pattern): Likewise.
4630
4631 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4632
4633 * window.c (Fwindow_point): For the selected window always return
4634 the position of its buffer's point.
4635 (Fset_window_point): For the selected window always go in its
4636 buffer to the specified position.
4637
4638 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4639
4640 Setter macros for fontsets.
4641 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4642 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4643 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4644 Adjust users.
4645
4646 2012-08-20 Glenn Morris <rgm@gnu.org>
4647
4648 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4649 Don't assume that `ln -f' works.
4650
4651 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4652
4653 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4654 and later about non-assignments with no effect. See discussion at
4655 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4656 details.
4657
4658 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4659
4660 Inline setter functions for Lisp_Objects slots of struct specbinding.
4661 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4662 Adjust users.
4663
4664 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4665
4666 * window.c (select_window): Always make selected window's buffer
4667 current.
4668
4669 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4670
4671 Use AREF and ASET for docstrings of category tables.
4672 * category.h (CATEGORY_DOCSTRING): Use AREF.
4673 (SET_CATEGORY_DOCSTRING): Use ASET.
4674 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4675
4676 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4677
4678 Inline setter functions for hash table members.
4679 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4680 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4681 (set_hash_key_and_value, set_hash_index, set_hash_next)
4682 (set_hash_hash): New functions.
4683 * charset.c, fns.c: Adjust users.
4684
4685 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4686
4687 Inline getter and setter functions for per-buffer values.
4688 * buffer.h (per_buffer_default, set_per_buffer_default)
4689 (per_buffer_value, set_per_buffer_value): New functions.
4690 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4691 * buffer.c, data.c: Adjust users.
4692
4693 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4694
4695 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4696
4697 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4698
4699 Rely on <config.h> + <unistd.h> to declare 'environ',
4700 as gnulib does this if the system doesn't.
4701 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4702 Remove declaration. MS-Windows declares it on stdlib.h which is
4703 included by conf_post.h.
4704 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4705 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4706 * vm-limit.c: Include <unistd.h>, for 'environ'.
4707
4708 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4709 (start_of_data): Remove decl; mem-limits.h provides it.
4710
4711 * xdisp.c (handle_invisible_prop): Make it a bit faster
4712 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4713
4714 2012-08-19 Chong Yidong <cyd@gnu.org>
4715
4716 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4717 ends (Bug#3874).
4718
4719 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4720
4721 * .gdbinit: Use call instead of set when calling a function in the
4722 inferior.
4723
4724 * data.c (set_internal): Don't use set_blv_found.
4725 (Fkill_local_variable): Likewise.
4726
4727 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4728
4729 * nsfont.m (ns_ascii_average_width): Ensure the string
4730 ascii_printable is initialized with a null-terminated character
4731 array. Otherwise, it can contain undesired extra characters.
4732
4733 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4734
4735 port new setting code to Sun C 5.8 2005/10/13
4736 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4737 Return void, not Lisp_Object. Otherwise, the compiler
4738 complains about (A?B:C) where B is void and C is Lisp_Object
4739 when compiling CHAR_TABLE_SET, due to the recent change to
4740 the API of sub_char_table_set_contents.
4741
4742 2012-08-18 Chong Yidong <cyd@gnu.org>
4743
4744 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4745 for the string case (Bug#3874).
4746
4747 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 * buffer.h (BSET): Remove (Bug#12215).
4750 Replace all uses with calls to new setter functions.
4751 (bset_bidi_paragraph_direction, bset_case_canon_table)
4752 (bset_case_eqv_table, bset_directory, bset_display_count)
4753 (bset_display_time, bset_downcase_table)
4754 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4755 (bset_last_selected_window, bset_local_var_alist)
4756 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4757 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4758 (bset_width_table):
4759 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4760 (bset_auto_fill_function, bset_auto_save_file_format)
4761 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4762 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4763 (bset_cache_long_line_scans, bset_case_fold_search)
4764 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4765 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4766 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4767 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4768 (bset_header_line_format, bset_indicate_buffer_boundaries)
4769 (bset_indicate_empty_lines, bset_invisibility_spec)
4770 (bset_left_fringe_width, bset_major_mode, bset_mark)
4771 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4772 (bset_name, bset_overwrite_mode, bset_pt_marker)
4773 (bset_right_fringe_width, bset_save_length)
4774 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4775 (bset_scroll_up_aggressively, bset_selective_display)
4776 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4777 (bset_word_wrap, bset_zv_marker):
4778 * category.c (bset_category_table):
4779 * syntax.c (bset_syntax_table):
4780 New setter functions.
4781
4782 * process.h (PSET): Remove (Bug#12215).
4783 Replace all uses with calls to new setter functions.
4784 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4785 (PROCESS_INLINE): New macro.
4786 (pset_childp): New setter function.
4787 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4788 * process.c (PROCESS_INLINE):
4789 Define to EXTERN_INLINE, so that the corresponding functions
4790 are compiled into code.
4791 (pset_buffer, pset_command, pset_decode_coding_system)
4792 (pset_decoding_buf, pset_encode_coding_system)
4793 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4794 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4795 (pset_type, pset_write_queue): New setter functions.
4796
4797 * window.h (WSET): Remove (Bug#12215).
4798 Replace all uses with calls to new setter functions.
4799 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4800 (WINDOW_INLINE): New macro.
4801 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4802 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4803 (wset_total_lines, wset_vertical_scroll_bar)
4804 (wset_window_end_pos, wset_window_end_valid)
4805 (wset_window_end_vpos): New setter functions.
4806 * window.c (WINDOW_INLINE):
4807 Define to EXTERN_INLINE, so that the corresponding functions
4808 are compiled into code.
4809 (wset_combination_limit, wset_dedicated, wset_display_table)
4810 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4811 (wset_new_normal, wset_new_total, wset_next_buffers)
4812 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4813 (wset_prev_buffers, wset_right_fringe_width)
4814 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4815 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4816 (wset_window_parameters):
4817 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4818 (wset_column_number_displayed, wset_region_showing):
4819 New setter functions.
4820
4821 * termhooks.h (TSET): Remove (Bug#12215).
4822 Replace all uses with calls to new setter functions.
4823 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4824 (TERMHOOKS_INLINE): New macro.
4825 (tset_charset_list, tset_selection_alist): New setter functions.
4826 * terminal.c (TERMHOOKS_INLINE):
4827 Define to EXTERN_INLINE, so that the corresponding functions
4828 are compiled into code.
4829 (tset_param_alist): New setter function.
4830
4831 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * keyboard.h (KSET): Remove (Bug#12215).
4834 Replace all uses with calls to new setter functions.
4835 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4836 (KEYBOARD_INLINE): New macro.
4837 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4838 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4839 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4840 New setter functions.
4841 * keyboard.c (KEYBOARD_INLINE):
4842 Define to EXTERN_INLINE, so that the corresponding functions
4843 are compiled into code.
4844 (kset_echo_string, kset_kbd_queue)
4845 (kset_keyboard_translate_table, kset_last_prefix_arg)
4846 (kset_last_repeatable_command, kset_local_function_key_map)
4847 (kset_overriding_terminal_local_map, kset_real_last_command)
4848 (kset_system_key_syms): New setter functions.
4849
4850 * frame.h (FSET): Remove (Bug#12215).
4851 Replace all uses with calls to new setter functions.
4852 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4853 (FRAME_INLINE): New macro.
4854 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4855 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4856 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4857 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4858 (fset_param_alist, fset_root_window, fset_scroll_bars)
4859 (fset_selected_window, fset_title, fset_tool_bar_items)
4860 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4861 * frame.c (FRAME_INLINE):
4862 Define to EXTERN_INLINE, so that the corresponding functions
4863 are compiled into code.
4864 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4865
4866 A few more naming-convention fixes for getters and setters.
4867 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4868 and rename from buffer_overlays_set_before.
4869 (set_buffer_overlays_after): Move here from buffer.h, and rename
4870 from buffer_overlays_set_after.
4871 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4872 All uses changed.
4873 (set_buffer_intervals): Rename from buffer_set_intervals.
4874 * intervals.c (set_interval_object): Move here from intervals.h,
4875 and rename from interval_set_object.
4876 (set_interval_left): Move here from intervals.h, and rename from
4877 interval_set_left.
4878 (set_interval_right): Move here from intervals.h, and rename from
4879 interval_set_right.
4880 (copy_interval_parent): Move here from intervals.h, and rename from
4881 interval_copy_parent.
4882 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4883 (set_interval_plist): Rename from interval_set_plist.
4884 Return void, not Lisp_Object, since no caller uses the result.
4885 * lisp.h (string_intervals): Rename from string_get_intervals.
4886 (set_string_intervals): Rename from string_set_intervals.
4887
4888 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4889 (set_char_table_contents): Rename from char_table_set_contents.
4890 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
4891 All uses changed. See the end of
4892 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4893
4894 * lisp.h (CSET): Remove (Bug#12215).
4895 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4896 (set_char_table_purpose): New functions,
4897 replacing CSET. All uses changed. For example, replace
4898 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
4899 "set_char_table_parent (char_table, parent);".
4900 The old version was confusing because it used the same name
4901 'parent' for two different things.
4902
4903 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4904
4905 Functions to get and set Lisp_Object fields of buffer-local variables.
4906 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4907 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4908 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4909 * data.c, eval.c, frame.c: Adjust users.
4910
4911 2012-08-17 Chong Yidong <cyd@gnu.org>
4912
4913 * xfaces.c (merge_face_vectors): If the target font specfies a
4914 font spec, make the font's attributes take precedence over
4915 directly-specified attributes.
4916 (merge_face_ref): Recognize :font.
4917
4918 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4919
4920 Do not use memcpy for copying intervals.
4921 * intervals.c (reproduce_interval): New function.
4922 (reproduce_tree, reproduce_tree_obj): Use it.
4923 (reproduce_tree_obj): Remove prototype.
4924
4925 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4926
4927 * lisp.h (duration_to_sec_usec): Remove unused decl.
4928
4929 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4930
4931 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4932 to an allocated instance of NSString, not to the class itself.
4933
4934 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4935
4936 * makefile.w32-in (C_CTYPE_H): New macro.
4937 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4938 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4939 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4940
4941 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4942
4943 Use ASCII tests for character types.
4944 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4945 * xfns.c, xterm.c:
4946 Don't include <ctype.h>; was not needed.
4947 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4948 * sysdep.c, xfaces.c:
4949 Include <c-ctype.h> instead of <ctype.h>.
4950 * nsterm.m: Include <c-ctype.h>.
4951 * charset.c (read_hex):
4952 * doc.c (Fsnarf_documentation):
4953 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4954 (DRIVE_LETTER) [DOS_NT]:
4955 (Ffile_name_directory, Fexpand_file_name)
4956 (Fsubstitute_in_file_name):
4957 * font.c (font_parse_xlfd, font_parse_fcname):
4958 * frame.c (x_set_font_backend):
4959 * gtkutil.c (xg_get_font):
4960 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4961 * nsimage.m (hexchar):
4962 * nsterm.m (ns_xlfd_to_fontname):
4963 * sysdep.c (system_process_attributes):
4964 * xfaces.c (hash_string_case_insensitive):
4965 Use C-locale tests instead of locale-specific tests for character
4966 types, since we want the ASCII interpretation here, not the
4967 interpretation suitable for whatever happens to be the current locale.
4968
4969 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4970
4971 Consistently check windows for validity/liveness
4972 (Bug#11984, Bug#12025, Bug#12026).
4973 * lisp.h (CHECK_VALID_WINDOW): New macro.
4974 * window.c (decode_window): Rename to decode_live_window.
4975 (decode_valid_window, Fwindow_valid_p): New functions.
4976 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4977 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4978 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4979 (Fwindow_prev_sibling, Fwindow_combination_limit)
4980 (Fset_window_combination_limit, Fwindow_use_time)
4981 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4982 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4983 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4984 (Fwindow_hscroll, Fset_window_hscroll)
4985 (Fwindow_redisplay_end_trigger)
4986 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4987 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4988 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4989 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4990 (Fwindow_end, Fset_window_point, Fset_window_start)
4991 (Fpos_visible_in_window_p, Fwindow_line_height)
4992 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4993 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4994 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4995 (Fset_window_parameter, Fwindow_display_table)
4996 (Fset_window_display_table, Fdelete_other_windows_internal)
4997 (Fset_window_buffer, Fset_window_new_total)
4998 (Fset_window_new_normal, Fdelete_window_internal)
4999 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5000 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5001 (Fwindow_scroll_bars): Check whether argument window is a valid or
5002 live window. Update doc-strings.
5003 (syms_of_window): New symbol Qwindow_valid_p.
5004 * keyboard.c (Fposn_at_x_y): Check whether argument
5005 frame_or_window denotes a valid window.
5006
5007 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5008
5009 Fix previous char table change.
5010 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5011 * chartab.c (optimize_sub_char_table): Likewise.
5012
5013 2012-08-16 Chong Yidong <cyd@gnu.org>
5014
5015 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5016
5017 * xfont.c (xfont_open):
5018 * xftfont.c (xftfont_open): Set the font's max_width field.
5019
5020 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5021 min_width to space_width and average_width to the average over
5022 printable ASCII characters.
5023 (ns_char_width): Code cleanup.
5024 (ns_ascii_average_width): New utility function.
5025
5026 * font.h (struct font): Update comments.
5027
5028 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5029
5030 Simple interface to set Lisp_Object fields of character tables.
5031 * lisp.h (CSET): New macro.
5032 (char_table_set_extras, char_table_set_contents)
5033 (sub_char_table_set_contents): New function.
5034 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5035 * syntax.c: Adjust users.
5036
5037 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5038
5039 * eval.c (eval_sub): Bind lexical-binding.
5040 * lread.c (Qlexical_binding): Make non-static.
5041
5042 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5043
5044 * nsmenu.m (popupSession): Remove.
5045 (pop_down_menu): Remove endModalSession.
5046 (timeout_handler:): New method.
5047 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5048 Call runModalForWindow. Check timer_fired when it returns.
5049 If not set, cancel timer and break out of loop.
5050 Otherwise loop again, with a new timeout.
5051
5052 * nsterm.m: Include fcntl.h if present.
5053 (fd_entry, t_readfds, inNsSelect): Remove.
5054 (select_writefds, select_valid, select_timeout, selfds)
5055 (select_mutex, apploopnr): Add.
5056 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5057 Otherwise call kbd_buffer_store_event.
5058 (ns_send_appdefined): Remove release of fd_entry.
5059 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5060 Increment and decrement apploopnr.
5061 (ns_select): If no file descriptors, just do a NSTimer.
5062 Otherwise copy read/write masks and start select thread (fd_handler).
5063 Start main loop and wait for application defined event.
5064 Inform select thread to stop selecting after main loop is exited.
5065 (ns_term_init): Create selfds pipe and set non-blocking.
5066 Initialize select_mutex. Start the select thread (fd_handler).
5067 (fd_handler:): Loop forever, wait for info from the main thread
5068 to either start or stop selecting. When select returns, send
5069 and appdefined event.
5070 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5071 If not call kbd_buffer_store_event.
5072
5073 * nsterm.h (EmacsApp): fd_handler takes id argument.
5074 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5075
5076 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5077
5078 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5079
5080 * region-cache.c (move_cache_gap): Update gap_len using the actual
5081 growth of the boundaries array. Do not change cache_len.
5082 (Bug#12196)
5083
5084 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 Generalize and cleanup font subsystem checks.
5087 * font.h (FONT_DEBUG, font_assert): Remove.
5088 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5089 Change font_assert to eassert. Use eassert where appropriate.
5090
5091 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5092
5093 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5094
5095 2012-08-15 Chong Yidong <cyd@gnu.org>
5096
5097 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5098 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5099 extract the font descriptor instead of just the font name.
5100 In that case, return a font spec instead of a string.
5101 (x_last_font_name): Move to this file from xfns.c.
5102
5103 * xfns.c (Fx_select_font): The return value can also be a font
5104 spec. Move x_last_font_name management to gtkutil.c.
5105
5106 * xfaces.c: Make font weight and style symbols non-static.
5107
5108 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5109
5110 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5111 (bug#12117).
5112
5113 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5114
5115 * alloc.c (Fgarbage_collect): Use plural form consistently.
5116
5117 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5118
5119 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5120 iteration through the command loop. Fixes a problem whereby mouse
5121 movements are ignored until the first mouse click.
5122
5123 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5124
5125 Use bool, not int, for Lisp booleans.
5126 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5127 makes Emacs a bit smaller and presumably a bit faster.
5128 * lisp.h: Include <stdbool.h>.
5129 (struct Lisp_Boolfwd, defvar_bool):
5130 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5131 * regex.c [!emacs]: Include <stdbool.h>.
5132 (false, true): Remove; <stdbool.h> does this for us now.
5133
5134 2012-08-14 Chong Yidong <cyd@gnu.org>
5135
5136 * character.c (Fcharacterp): Doc fix (Bug#12076).
5137
5138 * data.c (Findirect_variable): Doc fix (Bug#11040).
5139
5140 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5141
5142 * editfns.c (Fformat): Doc fix (Bug#12059).
5143 (Fsave_current_buffer): Doc fix (Bug#11542).
5144
5145 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5146
5147 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5148 (bug#12022).
5149
5150 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5151
5152 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5153 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5154 * minibuf.c (choose_minibuf_frame, read_minibuf):
5155 * w32fns.c (x_create_tip_frame):
5156 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5157 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5158
5159 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 * intervals.c (offset_intervals): Remove obsolete comment.
5162
5163 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5164
5165 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5166
5167 2012-08-14 Gergely Risko <gergely@risko.hu>
5168
5169 * coding.c (decode_coding): Record buffer modification before
5170 disabling undo_list (Bug#11773).
5171
5172 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5173
5174 Revert and cleanup some recent overlay changes.
5175 * buffer.h (enum overlay_type): Remove.
5176 (buffer_get_overlays, buffer_set_overlays): Likewise.
5177 (buffer_set_overlays_before, buffer_set_overlays_after):
5178 New function. Adjust users.
5179 (unchain_both): Add eassert.
5180
5181 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5184
5185 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5186
5187 * gtkutil.c (xg_mark_data): Don't assume C99.
5188
5189 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5190
5191 * gtkutil.c (xg_frame_tb_info): New struct.
5192 (TB_INFO_KEY): New define.
5193 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5194 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5195 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5196 if not present.
5197 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5198 is up to date. Otherwise store new data.
5199 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5200
5201 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5202
5203 Use KSET for write access to Lisp_Object members of struct kboard.
5204 * keyboard.h (KSET): New macro.
5205 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5206 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5207 * xterm.c: Adjust users.
5208
5209 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5210
5211 Use BSET for write access to Lisp_Object members of struct buffer.
5212 * buffer.h (BSET): New macro.
5213 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5214 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5215 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5216 * window.c, xdisp.c, xfns.c: Adjust users.
5217
5218 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5219
5220 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5221
5222 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5223
5224 * nsterm.m (not_in_argv): New function.
5225 (application:openFile, application:openTempFile:):
5226 (application:openFileWithoutUI:, application:openFiles:): Open file
5227 if not_in_argv returns non-zero (bug#12171).
5228
5229 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5230 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5231 Define for Gtk+ versions less than 3.2.
5232 (xg_get_font_name): Use those functions/macros here.
5233 Reported by Frans Oilinki <moilinki@gmail.com>.
5234
5235 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5236
5237 * unexmacosx.c (copy_data_segment): Copy initialized data in
5238 statically linked libraries from input file rather than memory.
5239
5240 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5241 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5242 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5243
5244 2012-08-10 Glenn Morris <rgm@gnu.org>
5245
5246 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5247 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5248
5249 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Fix last change to allow compilation with low optimization levels.
5252 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5253 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5254
5255 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5256
5257 Use common inline syntax in intervals.h.
5258 * intervals.h (INTERVALS_INLINE): New macro.
5259 Change all users from LISP_INLINE.
5260
5261 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5262
5263 Define Qnone once for all platforms.
5264 * frame.c (Qnone): Define here.
5265 (syms_of_frame): DEFSYM it.
5266 * lisp.h (Qnone): New declaration.
5267 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5268 * xfns.c: Remove duplication. Adjust users.
5269
5270 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5271
5272 Remove unused macros from intervals.h.
5273 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5274 * intervals.c: Adjust comment.
5275
5276 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5277
5278 * w32fns.c <w32_unicode_gui>: New static variable.
5279 (globals_of_w32fns): Initialize it according to os_subtype.
5280 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5281 testing os_subtype.
5282
5283 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5284 Eli Zaretskii <eliz@gnu.org>
5285
5286 Fix bug #10299 with Unicode characters sent by customized
5287 keyboards created by MSKLC.
5288 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5289 (w32_init_class): Use it to initialize the Emacs class with either
5290 ANSI or Unicode API calls.
5291 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5292 later.
5293 (w32_wnd_proc): If the character code sent by WM_CHAR or
5294 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5295 original message. Call DefWindowProcW on NT and later.
5296
5297 2012-08-10 Glenn Morris <rgm@gnu.org>
5298
5299 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5300
5301 * lisp.h (DIRECTORY_SEP): Let configure set it.
5302
5303 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5304
5305 Use TSET for write access to Lisp_Object slots of struct terminal.
5306 * termhooks.h (TSET): New macro.
5307 * coding.c, terminal.c, xselect.c: Adjust users.
5308
5309 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5310
5311 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5312 the failing expression, include them in the error message.
5313 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5314 * lisp.h (internal_condition_case_n): Update declaration.
5315
5316 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5317
5318 Inline functions to examine and change buffer overlays.
5319 * buffer.c (unchain_both): New function.
5320 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5321 (buffer_has_overlays): New function.
5322 (enum overlay_type): New enum.
5323 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5324 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5325
5326 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5327
5328 Inline functions to examine and change buffer intervals.
5329 * alloc.c (mark_interval_tree): Remove.
5330 (MARK_INTERVAL_TREE): Simplify.
5331 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5332 * intervals.c (buffer_balance_intervals): New function.
5333 (graft_intervals_into_buffer): Adjust indentation.
5334 (set_intervals_multibyte): Simplify.
5335 * buffer.h (BUF_INTERVALS): Remove.
5336 (buffer_get_intervals, buffer_set_intervals): New function.
5337 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5338 * intervals.c, textprop.c: Adjust users.
5339
5340 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5341
5342 Inline functions to examine and change string intervals.
5343 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5344 (string_get_intervals, string_set_intervals): New function.
5345 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5346 * lread.c, print.c, textprop.c: Adjust users.
5347
5348 2012-08-08 Glenn Morris <rgm@gnu.org>
5349
5350 * lisp.mk (lisp): Remove language/persian.elc.
5351
5352 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5353
5354 Cleanup intervals.
5355 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5356 (NULL_INTERVAL_P): Likewise. Adjust users.
5357 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5358 Adjust comment. Move under #if 0.
5359 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5360 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5361
5362 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5363
5364 Check total length of intervals with eassert.
5365 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5366 * intervals.c: Change all users to eassert.
5367
5368 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5369
5370 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5371 Rename fields to match removal of FGET and WGET and disuse of
5372 INTERNAL_FIELD in Lisp_Cons.
5373
5374 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5375
5376 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5377 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5378 name since all xname users are fixed long time ago. Do not
5379 use INTERNAL_FIELD.
5380 (set_symbol_name, set_symbol_function, set_symbol_plist):
5381 (set_symbol_next, set_overlay_plist): New function.
5382 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5383 (struct Lisp_Overlay): Likewise.
5384 (CVAR, MVAR, SVAR): Remove.
5385 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5386 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5387 * xterm.c: Adjust users.
5388 * .gdbinit: Change to use name field of struct Lisp_Symbol
5389 where appropriate.
5390
5391 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5392
5393 Basic functions to set Lisp_Object and pointer slots of intervals.
5394 * intervals.h (interval_set_parent, interval_set_object):
5395 (interval_set_left, interval_set_right, interval_set_plist):
5396 (interval_copy_parent): New function.
5397 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5398 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5399 Adjust indentation.
5400 (INTERVAL_SIZE): Remove. Adjust users.
5401 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5402
5403 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5406 * process.h (PGET): Remove.
5407 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5408 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5409
5410 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5411
5412 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5413 * window.h (WGET): Remove.
5414 (struct window): Do not use INTERNAL_FIELD.
5415 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5416 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5417 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5418 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5419 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5420 Adjust users.
5421
5422 2012-08-07 Chong Yidong <cyd@gnu.org>
5423
5424 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5425 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5426 (Fdelete_window_internal): Signal an error if the window is not on
5427 a live frame (Bug#12025).
5428
5429 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5430
5431 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5432 * frame.h (FGET): Remove.
5433 (struct frame): Do not use INTERNAL_FIELD.
5434 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5435 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5436 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5437 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5438
5439 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5440
5441 * w32.c: Silence compiler warnings.
5442 (map_w32_filename): Remove unused variable `is_fat'.
5443 (chase_symlinks): Add parentheses around expression.
5444
5445 2012-08-06 Glenn Morris <rgm@gnu.org>
5446
5447 * sysdep.c: Respect BROKEN_GETWD.
5448
5449 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5450 Let configure handle it.
5451 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5452
5453 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 Use GCALIGNMENT where appropriate.
5456 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5457 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5458 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5459
5460 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5461
5462 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5463 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5464
5465 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5466
5467 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5468 that should be sufficient for everyone.
5469
5470 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5471
5472 * keyboard.c (timer_check_2): Add break so timer_check returns next
5473 timeout.
5474
5475 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 Fix Windows build errors introduced after converting to WGET and WSET.
5478 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5479 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5480
5481 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5482
5483 * nsterm.m (ns_frame_rehighlight): Use FSET.
5484
5485 * nsmenu.m (ns_update_menubar): Use FSET.
5486
5487 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Separate read and write access to Lisp_Object slots of Lisp_Process.
5490 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5491 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5492
5493 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5494
5495 Separate read and write access to Lisp_Object slots of struct window.
5496 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5497 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5498 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5499 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5500 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5501 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5502 Adjust users.
5503
5504 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5505
5506 Fix Windows build errors introduced after converting to FGET and FSET.
5507 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5508 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5509 (w32_judge_scroll_bars): Change to use FSET.
5510 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5511
5512 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5513
5514 Fix replacement typo.
5515 * window.c (replace_window): Set root_window instead of
5516 selected_window. This fixes a total window subsystem
5517 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5518
5519 2012-08-06 Glenn Morris <rgm@gnu.org>
5520
5521 * lisp.mk (lisp): Add language/persian.elc.
5522
5523 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5524
5525 Separate read and write access to Lisp_Object slots of struct frame.
5526 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5527 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5528 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5529 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5530 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5531
5532 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5533
5534 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5535
5536 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 Generalize common compile-time constants.
5539 * lisp.h (header_size, bool_header_size, word_size): Now here.
5540 (struct Lisp_Vector): Add comment.
5541 (struct Lisp_Bool_Vector): Move up to define handy constants.
5542 (VECSIZE, PSEUDOVECSIZE): Simplify.
5543 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5544 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5545 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5546 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5547 * xfont.c, xmenu.c: Use word_size where appropriate.
5548
5549 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5550
5551 * search.c (Freplace_match): Treat \? in the replacement text
5552 literally (Bug#8161).
5553
5554 2012-08-05 Chong Yidong <cyd@gnu.org>
5555
5556 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5557 * frame.c (Vdelete_frame_functions):
5558 * emacs.c (Vkill_emacs_hook): Doc fix.
5559
5560 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5561
5562 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5563 --with-x-toolkit=no builds.
5564 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5565
5566 2012-08-04 Chong Yidong <cyd@gnu.org>
5567
5568 * syntax.c (Fmodify_syntax_entry): Doc fix.
5569
5570 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5571
5572 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5573 * w32.c (init_environment): Change the default values of many
5574 environment variables in dflt_envvars[] to NULL, to avoid pushing
5575 them into environment when they were not already defined.
5576 Remove the code that deletes site-lisp subdirectories from the default
5577 value of EMACSLOADPATH, as it is no longer needed.
5578 (check_windows_init_file): Now external, not static.
5579 Use Vload_path as is, without adding anything, as this function is now
5580 called when Vload_path is already set up.
5581
5582 * w32.h (check_windows_init_file): Add prototype.
5583
5584 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5585 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5586 compatibility with Posix platforms.
5587 (main): Move the call to check_windows_init_file to here from
5588 w32.c.
5589 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5590 any, in the DEFALT argument into the root of the Emacs build or
5591 installation tree, as appropriate.
5592
5593 * callproc.c (init_callproc_1): Call decode_env_path instead of
5594 doing its equivalent by hand.
5595 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5596 the code that sets Vexec_path run on MS-Windows.
5597
5598 * lread.c (init_lread): Add comments to #ifdef's.
5599
5600 * msdos.c (dos_set_window_size, IT_update_begin)
5601 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5602 instead of direct references.
5603
5604 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5605
5606 Export DEFAULT_REHASH_* to GDB.
5607 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5608 Now constants, not macros.
5609
5610 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5611
5612 Remove unnecessary casts involving pointers.
5613 These casts are no longer needed now that we assume C89 or later,
5614 since they involve casting to or from void *.
5615 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5616 (make_pure_float, make_pure_vector):
5617 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5618 * macros.c (Fstart_kbd_macro):
5619 * menu.c (find_and_return_menu_selection):
5620 * minibuf.c (read_minibuf_noninteractive):
5621 * sysdep.c (closedir):
5622 * xdisp.c (x_produce_glyphs):
5623 * xfaces.c (compare_fonts_by_sort_order):
5624 * xfns.c (x_real_positions, select_visual):
5625 * xselect.c (x_stop_queuing_selection_requests)
5626 (x_get_window_property, x_get_window_property_as_lisp_data):
5627 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5628 Remove unnecessary pointer casts.
5629 * alloc.c (record_xmalloc): New function.
5630 * lisp.h (record_xmalloc): New decl.
5631 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5632 more like a function. This is because the pointer cast is not
5633 needed. All uses changed.
5634 * print.c (print_string, print_error_message): Avoid length recalc.
5635
5636 Improve fix for macroexp crash with debugging (Bug#12118).
5637 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5638 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5639 not supposed to be invoked from the garbage collector.
5640 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5641 (gc_aset): New function, which is like ASET but can be
5642 used in the garbage collector.
5643 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5644 (set_hash_index): Use it instead of ASET.
5645
5646 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5647
5648 Support symlinks on latest versions of MS-Windows.
5649 * w32.c: Include winioctl.h and aclapi.h.
5650 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5651 (revert_to_self): Forward declarations of static functions.
5652 <static BOOL g_b_init_get_security_info>:
5653 <g_b_init_create_symbolic_link>: New static flags.
5654 (globals_of_w32): Initialize them to zero.
5655 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5656 (map_w32_filename): Improve commentary. Simplify switch.
5657 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5658 headers (most versions of MinGW w32api don't).
5659 (get_security_info, create_symbolic_link)
5660 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5661 New functions.
5662 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5663 in the argument file name.
5664 (sys_access): Call unc_volume_file_attributes only if
5665 GetFileAttributes fails with network-related error codes.
5666 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5667 have the required privileges.
5668 (get_file_security_desc_by_name): Rename from
5669 get_file_security_desc.
5670 (stat_worker): New function, with most of the guts of 'stat', and
5671 with addition of handling of symlinks and support for 'lstat'.
5672 If possible, get file's attributes and security information by
5673 handle, not by name. Produce S_IFLNK bit for symlinks, when
5674 called from 'lstat'.
5675 (stat, lstat): New functions, call 'stat_worker'.
5676 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5677 symlinks when the underlying filesystem supports them.
5678
5679 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 Fix macroexp crash on Windows with debugging (Bug#12118).
5682 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5683 checking subscripts; problem introduced with the recent
5684 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5685 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5686 since it's used in non-static inline functions now.
5687
5688 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5689 Don't assume buffer size fits in 'int'. Remove unused local.
5690
5691 Use C99-style 'extern inline' if available.
5692 * buffer.h (BUFFER_INLINE):
5693 * category.h (CATEGORY_INLINE):
5694 * character.h (CHARACTER_INLINE):
5695 * charset.h (CHARSET_INLINE):
5696 * composite.h (COMPOSITE_INLINE):
5697 * dispextern.h (DISPEXTERN_INLINE):
5698 * lisp.h (LISP_INLINE):
5699 * systime.h (SYSTIME_INLINE):
5700 New macro, replacing 'static inline' in this header.
5701 * buffer.h, category.h, character.h, charset.h, composite.h:
5702 * dispextern.h, lisp.h, systime.h:
5703 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5704 * alloc.c (LISP_INLINE):
5705 * buffer.c (BUFFER_INLINE):
5706 * category.c (CATEGORY_INLINE):
5707 * character.c (CHARACTER_INLINE):
5708 * charset.c (CHARSET_INLINE):
5709 * composite.c (COMPOSITE_INLINE):
5710 * dispnew.c (DISPEXTERN_INLINE):
5711 * sysdep.c (SYSTIME_INLINE):
5712 Define to EXTERN_INLINE, so that the corresponding functions
5713 are compiled into code.
5714 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5715 (INLINE_HEADER_END): New macros.
5716 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5717 since it's used in non-static inline functions now.
5718 (VALMASK) [!USE_LSB_TAG]: Likewise.
5719
5720 2012-08-02 Glenn Morris <rgm@gnu.org>
5721
5722 * s/: Remove empty directory.
5723
5724 * s/ms-w32.h: Move to ../nt/inc.
5725 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5726 Update for new ms-w32.h location.
5727
5728 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 Port to Solaris 8.
5731 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5732
5733 2012-08-02 Glenn Morris <rgm@gnu.org>
5734
5735 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5736 hard-coding the path separator.
5737
5738 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5741 This how ASET and AREF are supposed to work, and makes
5742 it easier to think about future improvements. See
5743 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5744 * charset.h (set_charset_attr): New function.
5745 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5746 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5747 (aref_addr): New function. All uses of &AREF(...) changed.
5748 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5749 (set_hash_index): New functions. All lvalue-style uses of
5750 HASH_KEY etc. changed.
5751 * keyboard.c (set_prop): New function. All lvalue-style uses
5752 of PROP changed.
5753
5754 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5755
5756 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5757 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5758 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5759 * nsfns.m (ns_set_name_as_filename): Likewise.
5760 * nsmenu.m (ns_update_menubar): Likewise.
5761 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5762
5763 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5764
5765 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5766 Adapt to latest changes in field names of the corresponding Lisp
5767 objects.
5768
5769 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5770
5771 2012-08-01 Glenn Morris <rgm@gnu.org>
5772
5773 * s/msdos.h: Remove file.
5774 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5775 * Makefile.in (S_FILE): Remove.
5776 (config_h): Remove S_FILE.
5777
5778 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5779
5780 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5781 Remove; moved to nt/config.nt.
5782
5783 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5784
5785 Use INTERNAL_FIELD for conses and overlays.
5786 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5787 Remove obsolete comment.
5788 (MVAR): New macro.
5789 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5790 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5791
5792 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5793
5794 Use INTERNAL_FIELD for symbols.
5795 * lisp.h (SVAR): New macro. Adjust users.
5796 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5797 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5798
5799 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5800
5801 Use INTERNAL_FIELD for processes.
5802 * process.h (PVAR): New macro. Adjust style.
5803 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5804 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5805
5806 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5807
5808 Use INTERNAL_FIELD for windows.
5809 * window.h (WVAR): New macro.
5810 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5811 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5812 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5813 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5814 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5815 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5816
5817 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5818
5819 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5820
5821 2012-08-01 Glenn Morris <rgm@gnu.org>
5822
5823 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5824 Move to configure.ac.
5825
5826 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5827
5828 * makefile.w32-in (CONFIG_H): Update dependencies.
5829 (CONF_POST_H): New macro.
5830
5831 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5832
5833 2012-07-31 Glenn Morris <rgm@gnu.org>
5834
5835 * Makefile.in (S_FILE): No longer set by configure.
5836
5837 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5838 is available.
5839 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5840
5841 * process.h (NULL_DEVICE):
5842 * emacs.c (SEPCHAR):
5843 * editfns.c (USER_FULL_NAME): Let configure set them.
5844
5845 * s/README, s/template.h: Remove files.
5846
5847 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5848
5849 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5850 Move to configure.ac.
5851
5852 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5853
5854 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5855 resulting renaming of 'struct frame' members.
5856
5857 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5858
5859 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5860 after introduction of FVAR.
5861
5862 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5863
5864 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5865
5866 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5867 instead of compositeToPoint.
5868 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5869
5870 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5871
5872 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5873
5874 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5875 * lisp.h (INTERNAL_FIELD): New macro.
5876 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
5877 (BVAR): Change to use INTERNAL_FIELD.
5878 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5879 (KVAR): Change to use INTERNAL_FIELD.
5880 * frame.h (FVAR): New macro.
5881 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
5882 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5883 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5884 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5885 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5886
5887 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5888
5889 Miscellaneous fixes for non-default X toolkits.
5890 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5891 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5892 Move under #ifdef USE_LUCID.
5893 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5894 definition and usage to avoid warnings.
5895
5896 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5897
5898 * nsterm.m (openFiles): Fix previous checkin.
5899
5900 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5901
5902 * indent.c (compute_motion): Remove unused local.
5903
5904 2012-07-31 Glenn Morris <rgm@gnu.org>
5905
5906 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5907
5908 * conf_post.h [USG5_4]:
5909 Move remaining contents of s/usg5-4-common.h here.
5910 * s/usg5-4-common.h: Remove file.
5911
5912 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5913 * s/irix6-5.h: Remove file.
5914
5915 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5916 * s/darwin.h: Remove file.
5917
5918 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5919 * s/hpux10-20.h: Remove file, which is now empty.
5920
5921 2012-07-30 Glenn Morris <rgm@gnu.org>
5922
5923 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5924 * Makefile.in (config_h): Add conf_post.h.
5925 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5926
5927 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5928
5929 * nsterm.m (ns_do_open_file): New variable.
5930 (ns_term_init): Set ns_do_open_file to YES after run returns.
5931 (openFile, openTempFile, openFileWithoutUI, openFiles):
5932 Open files only if ns_do_open_file.
5933
5934 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5937 This no-op macro hasn't been needed for many years.
5938 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5939
5940 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5941 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5942 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5943 gdb_make_enums_visible.
5944 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5945 (DIRECTORY_SEP): Now a constant, not a macro.
5946
5947 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5948
5949 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5950 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5951
5952 * w32term.c <w32_keyboard_codepage>: Renamed from
5953 keyboard_codepage and now external. All users changed.
5954
5955 * w32term.h: Add declaration of w32_keyboard_codepage.
5956
5957 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5958 the codepage to translate keys to Unicode. If this argument is
5959 -1, use the value returned by GetConsoleCP. All callers changed.
5960
5961 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5962
5963 Update .PHONY listings in makefiles.
5964 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5965 bootstrap-clean, distclean, maintainer-clean, versioclean,
5966 extraclean, frc.
5967
5968 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5969 This is a bit clearer. Fix some commentary typos.
5970
5971 2012-07-30 Glenn Morris <rgm@gnu.org>
5972
5973 * s/netbsd.h: Let configure include signal.h if needed.
5974 Remove file, which is now empty.
5975
5976 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5977 Let configure set them.
5978 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5979 No more need to undefine.
5980
5981 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5982
5983 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5984 non-single-byte char when adding meta modifier. (Bug#12090)
5985
5986 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5987
5988 Convert safe_call to use variable number of arguments.
5989 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5990 (safe_call2): Fix comment.
5991 * lisp.h (safe_call): Adjust prototype.
5992 * coding.c (encode_coding_object): Change to use safe_call2.
5993 * xfaces.c (merge_face_heights): Change to use safe_call1.
5994
5995 2012-07-30 Glenn Morris <rgm@gnu.org>
5996
5997 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5998 does that unconditionally. Remove file, which is now empty.
5999
6000 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6001 Remove empty files.
6002
6003 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 Export to GDB most of lisp.h's remaining object-like macros.
6006 * lisp.h (min, max): Move earlier, because they're used earlier now.
6007 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6008 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6009 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6010 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6011 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6012 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6013 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6014 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6015 Now constants, for GDB. They need not be macros.
6016 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6017 Now constants, for GDB, as well as macros, for static initializers.
6018 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6019 Move to after the definition of struct Lisp_Char_Table,
6020 since the former now needs that type defined.
6021 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6022 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6023 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6024 New enums, for gdb_make_enums_visible.
6025 (GLYPH_MODE_LINE_FACE): Remove; unused.
6026 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6027 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6028 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6029 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6030 enum maxargs, enum MAX_ALLOCA.
6031 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6032 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6033 no longer needed, now that they are done in lisp.h.
6034
6035 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6036
6037 Cleanup string bytes checking.
6038 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6039 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6040 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6041 (check_sblock, compact_small_strings): Simplify.
6042
6043 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6044
6045 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6046 These macros are confusing and no longer need to be defined, as
6047 the enum values now suffice. All uses replaced with definiens.
6048 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6049
6050 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6051
6052 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6053 ($(BLD)/w32console.$(O)): Update dependencies.
6054
6055 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6056
6057 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6058 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6059 time. Adjust users.
6060 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6061
6062 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6063
6064 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6065 setting sitelisp (Bug#12010).
6066
6067 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6068
6069 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6070
6071 * w32heap.c (cache_system_info):
6072 * w32.c (sys_rename):
6073 * w32proc.c (find_child_console, sys_kill): All users changed.
6074
6075 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6076
6077 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6078
6079 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6080
6081 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6082
6083 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6084
6085 Cleanup statistics calculation in Fgarbage_collect.
6086 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6087 Fix zombies percentage calculation. Simplify elapsed time calculation.
6088
6089 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6090
6091 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6092 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6093 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6094 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6095 (replace_range, replace_range_2, del_range_2): Change to eassert.
6096 * marker.c (byte_char_debug_check): Adjust style.
6097
6098 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6099
6100 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6101 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6102 long-ago-commented-out code that talks about "WIN32".
6103 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6104 All uses changed.
6105
6106 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6107
6108 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6109 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6110 Simplify by using alignof.
6111 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6112 * lisp.h: Include <stdalign.h>.
6113 (GCALIGNMENT): New macro and constant.
6114 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6115 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6116 (stdalign): New macro, if not already defined.
6117
6118 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6119
6120 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6121 * w32inevt.c: Include w32inevt.h.
6122 (w32_read_console_input): New inline function, calls either
6123 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6124 w32_console_unicode_input.
6125 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6126 (w32_kbd_patch_key, key_event): Use the codepage returned by
6127 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6128 (key_event): use uChar.UnicodeChar only if
6129 w32_console_unicode_input is non-zero.
6130
6131 * w32console.c: Include w32heap.h.
6132 <w32_console_unicode_input>: New global variable.
6133 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6134 family of Windows, zero otherwise.
6135
6136 * w32inevt.h: Declare w32_console_unicode_input.
6137
6138 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6139 --without-x. (Bug#11742)
6140
6141 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 Adjust GDB to reflect pvec_type changes (Bug#12036).
6144 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6145 2012-07-04 changes to pseudovector representation.
6146 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6147
6148 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6149
6150 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6151 bus address.
6152 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6153
6154 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6155
6156 * alloc.c (listn): Fix the order the arguments are consed onto the
6157 list.
6158
6159 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6160 enumeration constants, as PURE and HEAP are too general, and clash
6161 with other headers and sources, such as gmalloc.c and the
6162 MS-Windows system headers. All users changed.
6163
6164 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6165
6166 Revert last save_excursion_save and save_excursion_restore changes.
6167 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6168 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6169
6170 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6171
6172 Fix recently-introduced typos in Windows port.
6173 Reported by Martin Rudalics <rudalics@gmx.at>.
6174 * w32.c (init_environment): Replace comma with semicolon.
6175 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6176
6177 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 Improve GDB symbol export (Bug#12036).
6180 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6181 arms of an 'if', not using conditional expressions; otherwise GDB
6182 complains about the types in the unevaluated arm when the argument
6183 is an integer literal.
6184 (xgetint): Simplify expression.
6185 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6186 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6187 Zaretskii in <http://bugs.gnu.org/12036#13>.
6188 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6189 needed now that we have gdb_make_enums_visible.
6190 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6191 (enum enum_USE_LSB_TAG):
6192 New enum types, packaging up enums that need to be exported to GDB.
6193
6194 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6195
6196 Utility function to make a list from specified amount of objects.
6197 * lisp.h (enum constype): New datatype.
6198 (listn): New prototype.
6199 * alloc.c (listn): New function.
6200 (Fmemory_use_count, syms_of_alloc): Use it.
6201 * buffer.c (syms_of_buffer): Likewise.
6202 * callint.c (syms_of_callint): Likewise.
6203 * charset.c (define_charset_internal): Likewise.
6204 * coding.c (syms_of_coding): Likewise.
6205 * keymap.c (syms_of_keymap): Likewise.
6206 * search.c (syms_of_search): Likewise.
6207 * syntax.c (syms_of_syntax): Likewise.
6208 * w32.c (init_environment): Likewise.
6209 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6210 * xdisp.c (syms_of_xdisp): Likewise.
6211 * xfns.c (syms_of_xfns): Likewise.
6212
6213 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 Fast save_excursion_save and save_excursion_restore.
6216 * lisp.h (struct Lisp_Excursion): New data type.
6217 (PVEC_EXCURSION): New pseudovector type.
6218 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6219 to deal with it. Adjust comments.
6220 (init_marker, attach_marker): New prototype.
6221 (unchain_marker): Adjust prototype.
6222 * marker.c (attach_marker): Change to global.
6223 (init_marker): New function.
6224 * alloc.c (Fmake_marker, build_marker): Use it.
6225 (build_marker): More easserts.
6226 (mark_object): Handle struct Lisp_Excursion.
6227 * editfns.c (save_excursion_save, save_excursion_restore):
6228 Reimplement to use struct Lisp_Excursion. Add comments.
6229
6230 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6231
6232 Fix export of symbols to GDB (Bug#12036).
6233 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6234 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6235 emacs.c, as this is a more-suitable home. Had this been done earlier
6236 the fix for 12036 would have avoided some of the problems noted in
6237 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6238 would have been more obvious.
6239 * emacs.c: Do not include <verify.h>; no longer needed.
6240 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6241 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6242 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6243 Remove; now done in lisp.h.
6244 * lisp.h (PUBLISH_TO_GDB): New macro.
6245 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6246 (DATA_SEG_BITS): Use it.
6247 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6248 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6249 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6250 not be usable in #if. This simplifies things.
6251
6252 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6253
6254 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6255
6256 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6257
6258 Simplify export of symbols to GDB (Bug#12036).
6259 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6260 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6261 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6262 Adjust to changes in lisp.h and emacs.c, by using
6263 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6264 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6265 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6266 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6267 instead of gdb_valbits.
6268 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6269 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6270 instead of gdb_array_mark_flag.
6271 (xboolvector): Get size from $->size, not $->header.size.
6272 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6273 (xreload, hook-run, hookpost-run): Remove.
6274 * emacs.c: Include <verify.h>.
6275 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6276 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6277 Remove.
6278 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6279 (gdb_USE_LSB_TAG): New enum constants.
6280 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6281 Also define these as enum constants, so they're visible to GDB.
6282 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6283 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6284 as constants, so they're visible to GDB.
6285 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6286 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6287 Now enum constants, not macros, so they're visible to GDB.
6288 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6289 more convenient now. All uses changed.
6290 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6291 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6292
6293 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6294
6295 Explicitly free restriction data that are not needed anymore.
6296 * editfns.c (save_restriction_restore): Free restriction data.
6297
6298 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6299
6300 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6301 add argument, tune behavior, and adjust all callers.
6302
6303 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6304
6305 Use typedef for EMACS_INT, EMACS_UINT.
6306 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6307 than macros. This simplifies debugging in the usual case, since
6308 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6309 and it allows expressions involving EMACS_INT casts.
6310 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6311
6312 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6313
6314 * nsterm.m (ns_read_socket): Return early if there is a modal
6315 window (Bug#12043).
6316
6317 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6318
6319 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6320 that FOCUS-FRAME can be omitted.
6321
6322 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6323
6324 Adjust buffer text indirection counters at the end of Fkill_buffer.
6325 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6326 buffer is definitely dead. This should really fix an issue reported
6327 by Christoph Scholtes again. (Bug#12007).
6328 (init_buffer_once): Initialize indirection counters of
6329 buffer_defaults and buffer_local_symbols (for sanity and safety).
6330
6331 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6332
6333 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6334 and continuation glyphs on tooltip frames, leave them at zero.
6335 Avoids continued lines in tooltips. (Bug#11832)
6336
6337 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6338
6339 Simplify copy_overlay.
6340 * buffer.c (copy_overlay): Simplify. Use build_marker.
6341 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6342
6343 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6344
6345 * print.c (print_object): Don't crash when a frame's name is nil
6346 or invalid. (Bug#12025)
6347
6348 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6349 it signals an error when a tooltip frame is being created.
6350
6351 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6352
6353 Cleanup miscellaneous objects allocation and initialization.
6354 * alloc.c (allocate_misc): Change to static. Add argument to
6355 specify the subtype. Adjust comment and users.
6356 (build_overlay): New function.
6357 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6358 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6359 (allocate_misc): Remove prototype.
6360 (build_overlay): Add prototype.
6361
6362 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6363
6364 Swap buffer text indirection counters in Fbuffer_swap_text.
6365 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6366 This avoids crash reported by Christoph Scholtes at
6367 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6368
6369 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6370
6371 * nsmenu.m (Popdown_data): New struct.
6372 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6373 free Popdown_data.
6374 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6375 (initWithContentRect): Make imgView and contentView non-static
6376 and autorelease them. Also autorelease img and matrix (Bug#12005).
6377 (dealloc): Remove (Bug#12005).
6378
6379 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6380
6381 Adjust consing_since_gc when objects are explicitly freed.
6382 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6383 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6384 (free_cons, free_misc): Subtract object size from consing_since_gc.
6385
6386 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6387
6388 Simplify and cleanup markers positioning code.
6389 * marker.c (attach_marker): More useful eassert.
6390 (live_buffer, set_marker_internal): New function.
6391 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6392 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6393
6394 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6395
6396 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6397 as it's limited by the amount of memory, not by INT_MAX.
6398
6399 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6400
6401 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6402 in special-event-map. See the discussion at
6403 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6404 for the reasons.
6405
6406 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6407 info.dwItemData. Fixes crashes on 64-bit Windows.
6408 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6409
6410 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6411
6412 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6413 (conversationIdentifier): Return value is NSInteger.
6414 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6415
6416 2012-07-21 Chong Yidong <cyd@gnu.org>
6417
6418 * window.c (decode_any_window): Signal an error if the window is
6419 on a dead frame (Bug#11984).
6420
6421 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6422
6423 Add indirection counting to speed up Fkill_buffer.
6424 * buffer.h (struct buffer): New member.
6425 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6426 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6427 base buffer indirection counter.
6428 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6429 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6430 through buffer list if indirection counter is 0.
6431
6432 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6433
6434 Extend the value returned by Fgarbage_collect with heap statistics.
6435 * alloc.c (Qheap): New symbol.
6436 (syms_of_alloc): DEFSYM it.
6437 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6438 (Fmemory_free): Remove.
6439 (syms_of_alloc): Don't defsubr it.
6440 * buffer.c (Fcompact_buffer): Remove.
6441 (syms_of_buffer): Don't defsubr it.
6442
6443 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6444
6445 Make maybe_gc inline.
6446 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6447 * lisp.h (consing_since_gc, gc_relative_threshold)
6448 (memory_full_cons_threshold): Revert declaration.
6449 (maybe_gc): Remove prototype, define as inline.
6450 * alloc.c: Remove old commented-out code.
6451 (consing_since_gc, gc_relative_threshold)
6452 (memory_full_cons_threshold): Revert to global.
6453 (maybe_gc): Remove.
6454
6455 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6458 * lisp.h (build_unibyte_string): New function.
6459 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6460 * sysdep.c, w32fns.c, xfns.c: Use it.
6461 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6462 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6463 Adjust users accordingly.
6464 * font.h (font_open_by_name): Adjust prototype.
6465
6466 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6467
6468 Cleanup calls to Fgarbage_collect.
6469 * lisp.h (maybe_gc): New prototype.
6470 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6471 Remove declarations.
6472 * alloc.c (maybe_gc): New function.
6473 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6474 Make them static.
6475 * bytecode.c (MAYBE_GC): Use maybe_gc.
6476 * eval.c (eval_sub, Ffuncall): Likewise.
6477 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6478 to avoid dependency from auto-save feature.
6479
6480 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6481
6482 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6483 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6484 'for_each_per_buffer_object_at'.
6485 All uses changed. It's better to use upper-case for macros that
6486 cannot be implemented as functions, to give the reader a clue
6487 that they're special.
6488
6489 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6490
6491 * alloc.c (Fgarbage_collect): Tweak docstring.
6492
6493 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6494
6495 Tweak the value returned from Fgarbage_collect again.
6496 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6497 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6498 Adjust documentation.
6499 (total_vector_bytes): Rename to total_vector_slots, adjust
6500 accounting.
6501 (total_free_vector_bytes): Rename to total_free_vector_slots,
6502 adjust accounting.
6503 (Qstring_bytes, Qvector_slots): New symbols.
6504 (syms_of_alloc): DEFSYM them.
6505
6506 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6507
6508 Buffer compaction primitive which may be used from Lisp.
6509 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6510 (syms_of_buffer): Register Fcompact_buffer.
6511 * alloc.c (Fgarbage_collect): Use compact_buffer.
6512 * buffer.h (compact_buffer): New prototype.
6513 (struct buffer_text): New member.
6514
6515 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6516
6517 New macro to iterate over all buffers, miscellaneous cleanups.
6518 * lisp.h (all_buffers): Remove declaration.
6519 * buffer.h (all_buffers): Add declaration, with comment.
6520 (for_each_buffer): New macro.
6521 * alloc.c (Fgarbage_collect, mark_object): Use it.
6522 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6523 (init_buffer): Likewise.
6524 * data.c (Fset_default): Likewise.
6525 * coding.c (code_conversion_restore): Remove redundant check
6526 for dead buffer.
6527 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6528
6529 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6530
6531 Fix bug that created negative-length intervals.
6532 * intervals.c (merge_interval_right, merge_interval_left):
6533 Do not zero out this interval if it is absorbed by its children,
6534 as this interval's total length doesn't change in that case. See
6535 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6536
6537 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6540 when invoking (make-bool-vector N t) and N is a positive
6541 multiple of 8 -- the last 8 bits were mistakenly cleared.
6542
6543 Remove some struct layout assumptions in bool vectors.
6544 * alloc.c (bool_header_size): New constant.
6545 (header_size, word_size): Move earlier, as they're now used earlier.
6546 Use 'word_size' in a few more places, where it's appropriate.
6547 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6548 padding before the data member of a bool vector.
6549 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6550 than doing the check by hand with an abort ().
6551
6552 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6553
6554 * eval.c (Fdefvar): Don't check constants since we only set the var if
6555 it's not yet defined anyway (bug#11904).
6556
6557 * lisp.h (last_undo_boundary): Declare new var.
6558 * keyboard.c (command_loop_1): Set it.
6559 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6560 were auto-added by the command loop (bug#11774).
6561
6562 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6563
6564 * w32font.c (Qsymbol): Remove local definition.
6565 (syms_of_w32font): Don't DEFSYM it.
6566
6567 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6568
6569 Fix sweep_vectors to handle large bool vectors correctly.
6570 * alloc.c (sweep_vectors): Account total_vector_bytes for
6571 bool vectors larger than VBLOCK_BYTES_MAX.
6572
6573 2012-07-18 Chong Yidong <cyd@gnu.org>
6574
6575 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6576 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6577
6578 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6579
6580 Return more descriptive data from Fgarbage_collect.
6581 Suggested by Stefan Monnier in
6582 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6583 * alloc.c (bounded_number): New function.
6584 (total_buffers, total_vectors): New variable.
6585 (total_string_size): Rename to total_string_bytes, adjust users.
6586 (total_vector_size): Rename to total_vector_bytes, adjust users.
6587 (sweep_vectors): Account total_vectors and total_vector_bytes.
6588 (Fgarbage_collect): New return value. Adjust documentation.
6589 (gc_sweep): Account total_buffers.
6590 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6591 (VECTOR_SIZE): Remove.
6592 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6593 (Qinterval, Qmisc): New symbols.
6594 (syms_of_data): Initialize them.
6595 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6596 (Qcons, Qbuffer): New declarations.
6597
6598 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6601 Round up, not down. Improve doc.
6602
6603 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6604
6605 Restore old code in allocate_string_data to avoid Faset breakage.
6606 Reported by Julien Danjou <julien@danjou.info> in
6607 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6608 * alloc.c (allocate_string_data): Restore old code with minor
6609 adjustments, fix comment to explain this subtle issue.
6610
6611 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6612
6613 Remove FILE_SYSTEM_CASE.
6614 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6615
6616 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6617 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6618 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6619 call-process-region passes it through expand-file-name.
6620
6621 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6622
6623 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6624
6625 Fix crash when creating indirect buffer (Bug#11917)
6626 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6627 Don't handle unbound variables specially if non-zero.
6628 (Fbuffer_local_variables): Pass zero.
6629 (clone_per_buffer_values): Pass non-zero.
6630
6631 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6632
6633 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6634 to make the loop interruptible.
6635
6636 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6637
6638 * gnutls.c (emacs_gnutls_handshake): Only retry if
6639 GNUTLS_E_INTERRUPTED.
6640
6641 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6642
6643 Cleanup and convert miscellaneous checks to eassert.
6644 * alloc.c (mark_interval): Fix comment, partially rephrase
6645 old comment from intervals.h (see below).
6646 * intervals.c (find_interval, adjust_intervals_for_insertion)
6647 (delete_interval, adjust_intervals_for_deletion)
6648 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6649 Convert to eassert.
6650 (adjust_intervals_for_insertion, make_new_interval):
6651 Remove obsolete and unused code.
6652 * intervals.h (struct interval): Remove obsolete comment.
6653 * textprotp.c (erase_properties): Remove unused code.
6654 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6655 (Fremove_list_of_text_properties): Convert to eassert.
6656
6657 2012-07-17 Chong Yidong <cyd@gnu.org>
6658
6659 * editfns.c (Finsert_char): Doc fix.
6660
6661 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6662
6663 Fix previous change to make Fmemory_free always accurate.
6664 * alloc.c (make_interval): Update total_free_intervals.
6665 (make_float): Likewise for total_free_floats.
6666 (free_cons, Fcons): Likewise for total_free_conses.
6667 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6668 Likewise for total_free_vector_bytes.
6669 (Fmake_symbol): Likewise for total_free_symbols.
6670 (bytes_free): Remove.
6671
6672 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6673
6674 Simple free memory accounting feature.
6675 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6676 (sweep_vectors): Accumulate size of free vectors.
6677 (Fgarbage_collect): Setup bytes_free.
6678 (Fmemory_free): New function.
6679 (syms_of_alloc): Register it.
6680
6681 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6682
6683 Cleanup overlays checking.
6684 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6685 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6686 eassert and OVERLAYP.
6687 (sort_overlays): Change to use OVERLAYP.
6688
6689 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6690
6691 * editfns.c (Finsert_char): Make it interactive, and make the
6692 second arg optional. Copy interactive spec and docstring from
6693 ucs-insert.
6694
6695 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6696
6697 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6698 Unlike the other wrapped functions, fabs has an unspecified
6699 effect on errno.
6700
6701 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6702
6703 * nsterm.m (keyDown): Interpret flags without left/right bits
6704 as the left key (Bug#11670).
6705
6706 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6707
6708 Remove empty and useless init functions.
6709 * lisp.h (init_character_once, init_fns, init_image)
6710 (init_filelock, init_sound): Remove prototype.
6711 * character.c (init_character_once): Remove.
6712 * filelock.c (init_filelock): Likewise.
6713 * fns.c (init_fns): Likewise.
6714 * image.c (init_image): Likewise.
6715 * sound.c (init_sound): Likewise.
6716 * emacs.c (main): Adjust accordingly.
6717
6718 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6719
6720 * gtkutil.h: Tiny cleanups.
6721 (use_old_gtk_file_dialog): Remove useless declaration.
6722 (xg_uses_old_file_dialog): Add suggested const attribute.
6723
6724 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6725
6726 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6727 (bidi_paragraph_init): Use it to limit search forward for a strong
6728 directional character in abnormally large paragraphs full of
6729 neutral or weak characters. (Bug#11943)
6730
6731 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6732
6733 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6734 the toolbar (Bug#9451).
6735 (xg_make_tool_item): Give the widget event box a transparent
6736 background.
6737
6738 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6739
6740 Cleanup basic allocation variables and functions.
6741 * alloc.c (ignore_warnings, init_intervals, init_float)
6742 (init_cons, init_symbol, init_marker): Remove.
6743 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6744 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6745 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6746 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6747 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6748 (staticidx, init_alloc_once, init_strings, free_ablock):
6749 Remove redundant initialization.
6750 * fns.c (init_weak_hash_tables): Remove.
6751 * lisp.h (init_weak_hash_tables): Remove prototype.
6752
6753 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6754
6755 Use zero_vector where appropriate.
6756 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6757 accordingly.
6758 * lisp.h (zero_vector): New declaration.
6759 * font.c (null_vector): Remove.
6760 (syms_of_font): Remove initialization and staticpro.
6761 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6762 * keymap.c (Faccessible_keymaps): Likewise.
6763
6764 2012-07-15 Leo Liu <sdl.web@gmail.com>
6765
6766 * fringe.c: Fix typo in comments.
6767
6768 2012-07-14 Leo Liu <sdl.web@gmail.com>
6769
6770 * fringe.c: Add a new bitmap exclamation-mark.
6771
6772 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6773
6774 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6775
6776 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6777 (HAVE_MENUS): Don't define, defined by editing config.in with
6778 msdos/sed2v2.inp.
6779 (GMALLOC_INHIBIT_VALLOC): Don't define.
6780 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6781
6782 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6783
6784 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6785
6786 2012-07-14 Glenn Morris <rgm@gnu.org>
6787
6788 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6789 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6790 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6791
6792 2012-07-13 Glenn Morris <rgm@gnu.org>
6793
6794 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6795
6796 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6797 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6798
6799 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6800
6801 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6802 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6803 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6804 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6805 where appropriate.
6806 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6807 as boolean expression.
6808 (x_set_window_size): Remove unused variable toolbar.
6809 (ns_get_color_default, ns_mod_to_lisp): Remove.
6810 (ns_mouse_position): Remove unused variables xchar and ychar.
6811 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6812 (ns_set_vertical_scroll_bar): Remove unused variable count.
6813 (ns_delete_terminal): Remove unused variable i.
6814 (ns_term_init): Remove unused variables r, g and b.
6815 (mouseDown): Remove unused variable window.
6816 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6817 (initFrameFromEmacs): Remove unused variable vbextra.
6818 (mouseEntered): Remove unused variables p and dpyinfo.
6819 (mouseExited): Remove unused variables p and r.
6820 (ns_define_frame_cursor, ns_clear_frame_area)
6821 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6822 (menuDown): Assign [sender tag] to variable and cast the variable.
6823
6824 * nsterm.h (menuDown): Add id as type to argument sender.
6825 (ns_display_info_for_name): Add Lisp_Object argument.
6826 (ns_term_init): Add Lisp_Object argument.
6827 (ns_map_event_to_object): Add void argument.
6828 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6829 prototype with arguments and only declare if __OBJC__.
6830 (nxatoms_of_nsselect): Add void argument.
6831 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6832 (ns_alloc_autorelease_pool): Add void argument.
6833 (ns_release_autorelease_pool): Add void* argument.
6834 (ns_get_defaults_value): Add const char* argument.
6835
6836 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6837 (initFromContents): Use SSDATA where appropriate.
6838 (ns_update_menubar): Add braces to ambigous if-else.
6839 (initWithTitle): Put () around assignment in if statement.
6840 (ns_menu_show): Remove unused variables window and keymap.
6841 (update_frame_tool_bar): Remove unused variable selected_p.
6842 (initWithContentRect): Remove unused variable this_cmd_name.
6843
6844 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6845 appropriate.
6846 (setXBMColor): Remove unused variable len.
6847 (setPixmapData): Put () around assignment in loop statement.
6848
6849 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6850 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6851 where appropriate.
6852 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6853 around assignment in loop statement.
6854 (nsfont_open): Remove unused variable i.
6855 (nsfont_open): Remove unused variable len.
6856 (nsfont_draw): Remove unused variable cs.
6857
6858 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6859 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6860 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6861 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6862 (Fns_font_name, Fns_perform_service)
6863 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6864 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6865 (ns_set_name): Remove unused variable view.
6866 (x_set_menu_bar_lines): Remove unused variable olines.
6867 (x_set_tool_bar_lines): Remove unused variable root_window.
6868 (Fns_list_colors): Put () around assignment in while statement.
6869 (Fns_perform_service): Remove unused variable len.
6870 (Fns_display_usable_bounds): Remove unused variable top.
6871 (syms_of_nsfns): Remove unused variable i.
6872
6873 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6874 memcpy (Bug#11907).
6875
6876 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
6877
6878 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6879 and free it with DestroyExceptionInfo (Bug#11558).
6880
6881 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
6882
6883 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6884 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6885 Set here, not in nt/config.nt.
6886
6887 2012-07-13 Eli Zaretskii <eliz@gnu.org>
6888
6889 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6890 cursor overflow into the last glyph on display line when the right
6891 fringe is off. (Bug#11832)
6892
6893 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6894
6895 * xdisp.c (produce_special_glyphs): Now static.
6896 * dispextern.h (produce_special_glyphs): Remove decl.
6897
6898 2012-07-13 Glenn Morris <rgm@gnu.org>
6899
6900 * s/bsd-common.h, s/cygwin.h: Remove empty files.
6901 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6902
6903 * s/usg5-4-common.h (USG, USG5):
6904 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6905 * s/sol2-6.h (SOLARIS2):
6906 * s/irix6-5.h (IRIX6_5):
6907 * s/hpux10-20.h (USG, USG5, HPUX):
6908 * s/gnu-linux.h (USG, GNU_LINUX):
6909 * s/freebsd.h (BSD_SYSTEM):
6910 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6911 * s/cygwin.h (CYGWIN):
6912 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6913 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6914
6915 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6916
6917 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6918
6919 2012-07-13 Glenn Morris <rgm@gnu.org>
6920
6921 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6922
6923 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6924
6925 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6926 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6927
6928 2012-07-12 Glenn Morris <rgm@gnu.org>
6929
6930 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6931
6932 * process.c (init_process_emacs): Rename from init_process.
6933 The old name is also the name of a Mach system call.
6934 * lisp.h, emacs.c: Update for this name change.
6935 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6936 longer needed.
6937
6938 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6939
6940 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6941 memmove call that removes glyphs covered by the left truncation
6942 glyph. Improve commentary.
6943 (display_line): Fix display of continuation glyphs on GUI frames
6944 when the right fringe is turned off and variable-size fonts are
6945 used in the window. Move the code that appends a stretch glyph to
6946 produce_special_glyphs, so that it could be used for truncation
6947 and continuation glyphs alike.
6948 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6949 glyph of a suitably computed width, to align the special glyphs at
6950 the window margin. Code moved from display_line. (Bug#11832)
6951
6952 2012-07-12 Glenn Morris <rgm@gnu.org>
6953
6954 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6955
6956 * s/gnu-linux.h, s/hpux10-20.h:
6957 Do not unconditionally define HAVE_XRMSETDATABASE.
6958
6959 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6960
6961 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6962
6963 Fix typos that broke OS X build.
6964 Reported by Randal L. Schwartz in
6965 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6966 * nsterm.m (ns_timeout): Add missing local decl.
6967 (ns_get_color): snprintf -> sprintf, to fix typo.
6968
6969 2012-07-12 Glenn Morris <rgm@gnu.org>
6970
6971 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6972 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6973 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6974 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6975
6976 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6977 Move PTY_OPEN to configure.
6978
6979 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6980 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6981 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6982
6983 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6984
6985 Use empty_unibyte_string where applicable.
6986 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6987 * lread.c (read1): Likewise.
6988 * xsettings.c (syms_of_xsettings): Likewise.
6989
6990 2012-07-12 Glenn Morris <rgm@gnu.org>
6991
6992 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6993 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6994 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6995 * s/hpux10-20.h (RUN_TIME_REMAP):
6996 * s/bsd-common.h (TABDLY): Move to configure.
6997
6998 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6999
7000 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7001
7002 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7003 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7004
7005 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7006
7007 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7008 * s/template.h: Move NARROWPROTO to configure.
7009
7010 2012-07-11 Glenn Morris <rgm@gnu.org>
7011
7012 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7013 unused since 2011-01-17 change to systty.h.
7014
7015 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7016 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7017 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7018
7019 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7020
7021 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7022
7023 2012-07-11 Glenn Morris <rgm@gnu.org>
7024
7025 * s/darwin.h, s/gnu-linux.h, s/template.h:
7026 Move INTERRUPT_INPUT to configure.
7027
7028 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7029
7030 Minor adjustments to interning code.
7031 * lisp.h (intern, intern_c_string): Redefine as static inline
7032 wrappers for intern_1 and intern_c_string_1, respectively.
7033 (intern_1, intern_c_string_1): Rename prototypes.
7034 * lread.c (intern_1, intern_c_string_1, oblookup):
7035 Simplify Vobarray checking.
7036 * font.c (font_intern_prop): Likewise. Adjust comment.
7037 * w32font.c (intern_font_name): Likewise.
7038
7039 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7040
7041 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7042
7043 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7044 of Fcar/Fcdr if possible.
7045 * font.c (check_otf_features): Likewise.
7046 * fontset.c (Fnew_fontset): Likewise.
7047 * gnutls.c (Fgnutls_boot): Likewise.
7048 * minibuf.c (read_minibuf): Likewise.
7049 * msdos.c (IT_set_frame_parameters): Likewise.
7050 * xmenu.c (Fx_popup_dialog): Likewise.
7051 * w32menu.c (Fx_popup_dialog): Likewise.
7052
7053 2012-07-11 Glenn Morris <rgm@gnu.org>
7054
7055 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7056 since nothing has defined it on these platforms.
7057
7058 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7059 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7060
7061 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7062 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7063 Move CLASH_DETECTION to configure.
7064
7065 * s/gnu.h: Remove file, which is now empty.
7066
7067 * s/gnu.h, s/gnu-linux.h:
7068 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7069
7070 2012-07-11 John Wiegley <johnw@newartisans.com>
7071
7072 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7073 function attribute, so we only use it if it exists in the
7074 compiler.
7075
7076 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7077
7078 Avoid call to strlen in fast_c_string_match_ignore_case.
7079 * search.c (fast_c_string_match_ignore_case): Change to use
7080 length argument. Adjust users accordingly.
7081 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7082
7083 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7084
7085 Assume mkdir, rmdir.
7086 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7087 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7088
7089 Assume rename.
7090 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7091
7092 Assume perror.
7093 * s/hpux10-20.h (HAVE_PERROR): Remove.
7094 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7095 Remove dummy definition, as this problem was obsolete long ago.
7096
7097 Assume strerror.
7098 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7099
7100 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7101
7102 Avoid calls to strlen in font processing functions.
7103 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7104 (font_open_by_name): Change to use length argument.
7105 Adjust users accordingly.
7106 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7107 Adjust prototypes.
7108 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7109 Change to return ptrdiff_t.
7110 (xfont_list_pattern, xfont_match): Use length returned by
7111 xfont_decode_coding_xlfd.
7112 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7113
7114 2012-07-11 Glenn Morris <rgm@gnu.org>
7115
7116 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7117 Move DONT_REOPEN_PTY to configure.
7118
7119 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7120 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7121
7122 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7123
7124 Remove "#define unix" that is no longer needed (Bug#11905).
7125 * s/aix4-2.h (unix): Remove; no longer needed.
7126
7127 EMACS_TIME simplification (Bug#11875).
7128 This replaces macros (which typically do not work in GDB)
7129 with functions, typedefs and enums, making the code easier to debug.
7130 The functional style also makes code easier to read and maintain.
7131 * systime.h: Include <sys/time.h> on all hosts, not just if
7132 WINDOWSNT, since 'struct timeval' is needed in general.
7133 (EMACS_TIME): Now a typedef, not a macro.
7134 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7135 not macros.
7136 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7137 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7138 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7139 (EMACS_TIME_LE): Now functions, not macros.
7140 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7141 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7142 which are not functions. All uses rewritten to use:
7143 (make_emacs_time): New function.
7144 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7145 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7146 not functions. All uses rewritten to use the following, respectively:
7147 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7148 (add_emacs_time, sub_emacs_time): New functions.
7149 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7150 * fileio.c (Fcopy_file):
7151 * xterm.c (XTflash): Get the current time closer to when it's used.
7152 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7153
7154 * bytecode.c (targets): Suppress -Woverride-init warnings.
7155
7156 Simplify by avoiding confusing use of strncpy etc.
7157 * doc.c (Fsnarf_documentation):
7158 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7159 * frame.c (Fmake_terminal_frame):
7160 * gtkutil.c (get_utf8_string):
7161 * lread.c (openp):
7162 * nsmenu.m (ns_update_menubar):
7163 * regex.c (regerror):
7164 Prefer memcpy to strncpy and strncat when either will do.
7165 * fileio.c (Fsubstitute_in_file_name):
7166 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7167 (menu_separator_name_p):
7168 * nsmenu.m (ns_update_menubar):
7169 Prefer memcmp to strncmp when either will do.
7170 * nsterm.m: Include <ftoastr.h>.
7171 (ns_get_color):
7172 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7173 Prefer snprintf to strncpy.
7174 * nsterm.m (ns_term_init):
7175 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7176 * nsterm.m (ns_term_init):
7177 Avoid the need for strncpy, by using build_string or
7178 make_unibyte_string directly. Use dtoastr, not snprintf.
7179 * process.c (Fmake_network_process): Diagnose service names that
7180 are too long, rather than silently truncating them or creating
7181 non-null-terminated names.
7182 (Fnetwork_interface_info): Likewise, for interface names.
7183 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7184 Prefer sprintf to strncat.
7185 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7186 Prefer vsnprintf to vsprintf + strncpy.
7187
7188 2012-07-10 Glenn Morris <rgm@gnu.org>
7189
7190 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7191 Clarify fallback case.
7192
7193 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7194
7195 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7196 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7197 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7198 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7199 where argument type is known to be a Lisp_Cons.
7200
7201 2012-07-10 Tom Tromey <tromey@redhat.com>
7202
7203 * bytecode.c (BYTE_CODE_THREADED): New macro.
7204 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7205 (enum byte_code_op): New type.
7206 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7207 (exec_byte_code): Use them. Use token threading when applicable.
7208
7209 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7210
7211 Optimize pure C strings initialization.
7212 * lisp.h (make_pure_string): Fix prototype.
7213 (build_pure_c_string): New function, defined as static inline. This
7214 provides a better opportunity to optimize away calls to strlen when
7215 the function is called with compile-time constant argument.
7216 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7217 argument, adjust users accordingly. Use build_pure_c_string where
7218 appropriate.
7219 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7220 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7221 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7222
7223 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7224
7225 Avoid calls to strlen in miscellaneous functions.
7226 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7227 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7228 * lread.c (openp): Likewise.
7229
7230 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7231
7232 Avoid calls to strlen in path processing functions.
7233 * fileio.c (file_name_as_directory): Add comment. Change to add
7234 srclen argument and return the length of result. Adjust users
7235 accordingly.
7236 (directory_file_name): Fix comment. Change to add srclen argument,
7237 swap 1st and 2nd arguments to obey the common convention.
7238 Adjust users accordingly.
7239 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7240
7241 2012-07-10 Glenn Morris <rgm@gnu.org>
7242
7243 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7244 Move PENDING_OUTPUT_COUNT definition to configure.
7245
7246 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7247 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7248 * s/gnu.h (DATA_START): Move definitions to configure.
7249
7250 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7251 We include usg5-4-common.h, which defines them both.
7252
7253 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7254 O_RDONLY already includes it).
7255
7256 Stop ns builds setting the EMACSLOADPATH environment variable.
7257 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7258 Now it does not set EMACSLOADPATH, just returns the load-path string.
7259 * nsterm.h: Update accordingly.
7260 * lread.c [HAVE_NS]: Include nsterm.h.
7261 (init_lread) [HAVE_NS]: Use ns_load_path.
7262 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7263
7264 2012-07-09 Glenn Morris <rgm@gnu.org>
7265
7266 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7267 since the included bsd-common.h does so.
7268
7269 Stop ns builds setting the EMACSPATH environment variable.
7270 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7271 (ns_init_paths): Do not set EMACSPATH.
7272 * nsterm.h (ns_exec_path): Add it.
7273 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7274 Use ns_exec_path.
7275
7276 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7277
7278 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7279
7280 * process.c (wait_reading_process_output): 'waitchannels' was unset
7281 when read_kbd || !NILP (wait_for_cell); fix this.
7282
7283 Add GCC-style 'const' attribute to functions that can use it.
7284 * character.h (char_resolve_modifier_mask):
7285 * keyboard.h (make_ctrl_char):
7286 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7287 (init_character_once, next_almost_prime, init_fns, init_image)
7288 (flush_pending_output, init_sound):
7289 * mem-limits.h (start_of_data):
7290 * menu.h (finish_menu_items):
7291 Add ATTRIBUTE_CONST.
7292 * emacs.c (DEFINE_DUMMY_FUNCTION):
7293 Declare the dummy function with ATTRIBUTE_CONST.
7294 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7295 Add decls with ATTRIBUTE_CONST.
7296
7297 Minor improvements to make_formatted_string.
7298 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7299 where int is good enough, as vsprintf returns an int.
7300 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7301
7302 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7303
7304 Use make_formatted_string to avoid double length calculation.
7305 * lisp.h (make_formatted_string): New prototype.
7306 * alloc.c (make_formatted_string): New function.
7307 * buffer.c (Fgenerate_new_buffer_name): Use it.
7308 * dbusbind.c (syms_of_dbusbind): Likewise.
7309 * editfns.c (Fcurrent_time_zone): Likewise.
7310 * filelock.c (get_boot_time): Likewise.
7311 * frame.c (make_terminal_frame, set_term_frame_name)
7312 (x_report_frame_params): Likewise.
7313 * image.c (gs_load): Likewise.
7314 * minibuf.c (get_minibuffer): Likewise.
7315 * msdos.c (dos_set_window_size): Likewise.
7316 * process.c (make_process): Likewise.
7317 * xdisp.c (ensure_echo_area_buffers): Likewise.
7318 * xsettings.c (apply_xft_settings): Likewise.
7319
7320 2012-07-09 Glenn Morris <rgm@gnu.org>
7321
7322 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7323 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7324 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7325 * nsterm.h (ns_etc_directory): Add it.
7326 * callproc.c [HAVE_NS]: Include nsterm.h.
7327 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7328
7329 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7330
7331 Move marker debugging code under MARKER_DEBUG.
7332 * marker.c (MARKER_DEBUG): Move marker debugging code under
7333 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7334 for bootstrap with --enable-checking (~3x slowdown reported
7335 by Juanma Barranquero <lekktu@gmail.com>).
7336 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7337
7338 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7339
7340 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7341 See <http://bugs.gnu.org/11825#29>.
7342
7343 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7344
7345 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7346 has no font, use the frame's font. (Bug#11813)
7347 (display_line): Add commentary about displaying truncation glyphs
7348 on GUI frames.
7349 (produce_special_glyphs): Move here from term.c.
7350
7351 * term.c (produce_special_glyphs): Move to xdisp.c.
7352
7353 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7354 section.
7355
7356 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7357
7358 * xdisp.c (display_line): Avoid warning about implicit declaration
7359 of FRAME_FONT.
7360
7361 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7362
7363 * lisp.h: Remove empty conditional.
7364
7365 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7366
7367 * lread.c (load_path_check): Now static.
7368
7369 Fix some minor --with-ns problems found by static checking.
7370 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7371 (x_set_font) [!HAVE_X_WINDOWS]:
7372 * image.c (xpm_load_image) [HAVE_NS]:
7373 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7374 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7375 Remove unused local.
7376 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7377 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7378 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7379 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7380 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7381 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7382 Fix pointer signedness problem.
7383 * xfaces.c (FRAME_X_FONT_TABLE):
7384 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7385
7386 2012-07-07 Glenn Morris <rgm@gnu.org>
7387
7388 * lread.c (load_path_check): New function, split from init_lread.
7389 (init_lread): Reorganize. Motivation:
7390 If EMACSLOADPATH is set, check/warn about that rather than the
7391 defaults, which we are not going to use. Hence we can remove
7392 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7393 Don't warn if site-lisp directories are missing.
7394 If not installed, start from a blank load-path, since
7395 PATH_LOADSEARCH refers to the eventual installation directories.
7396
7397 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7398
7399 Support truncation and continuation glyphs on GUI frames, when
7400 fringes are disabled. (Bug#11832)
7401 * xdisp.c (init_iterator): Get dimensions of truncation and
7402 continuation glyphs even if on GUI frames.
7403 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7404 or both, are absent.
7405 (start_display, move_it_in_display_line_to): Handle the case of a
7406 GUI frame without a fringe to display continuation or truncation
7407 glyphs.
7408 (insert_left_trunc_glyphs): Support GUI frames: make sure
7409 truncation glyphs overwrite enough glyphs from the current line to
7410 have sufficient space in pixels.
7411 (display_line): Support truncation and continuation glyphs on GUI
7412 frames. If some spare pixels are left on the line after inserting
7413 the truncation glyphs, fill that space with a stretch glyph of a
7414 suitably computed width.
7415
7416 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7417 produce_glyphs, to support GUI sessions.
7418
7419 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7420
7421 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7422
7423 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7424
7425 Do not require float-time's arg to fit in time_t (Bug#11825).
7426 This works better on hosts where time_t is unsigned, and where
7427 float-time is applied to the (negative) difference between two times.
7428 * editfns.c (decode_time_components): Last arg is now double *,
7429 not int *, and means to store all the result as a double, without
7430 worrying about whether the seconds part fits in time_t.
7431 All callers changed.
7432 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7433 All callers changed.
7434 (Ffloat_time): Do not fail merely because the specified time falls
7435 outside of time_t range.
7436
7437 2012-07-07 Glenn Morris <rgm@gnu.org>
7438
7439 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7440 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7441 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7442
7443 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7444
7445 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7446 Update dependencies.
7447
7448 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7449
7450 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7451
7452 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7453 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7454 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7455 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7456 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7457 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7458
7459 * xfont.c (compare_font_names): Redo to omit the need for casts.
7460
7461 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7462
7463 * xfns.c (Fx_change_window_property): Doc fix.
7464 * w32fns.c (Fx_change_window_property): Doc fix.
7465
7466 * w32fns.c (Fx_window_property): Accept the same arguments as the
7467 X Windows version. Doc fix.
7468 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7469
7470 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7471 Eli Zaretskii <eliz@gnu.org>
7472
7473 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7474 Windows-specific code from nt/config.nt moved here.
7475 Obsolete settings removed.
7476
7477 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 * process.c: Avoid unnecessary calls to gettime.
7480 (wait_reading_process_output): Don't get the time of day
7481 when gobbling data immediately and not waiting, as there's no need
7482 for it in that case. This removes a FIXME.
7483
7484 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7485
7486 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7487 is defined (Bug#11768).
7488
7489 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7490
7491 Fix marker debugging code.
7492 * marker.c (byte_char_debug_check): Do not perform the check
7493 if buffer is not multibyte.
7494 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7495 Call byte_char_debug_check with correct arguments.
7496
7497 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7498
7499 Compile marker debugging code only if ENABLE_CHECKING is defined.
7500 * marker.c (byte_char_debug_check, count_markers):
7501 Use only if ENABLE_CHECKING is defined.
7502 (byte_debug_flag): Remove.
7503 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7504 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7505
7506 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7507
7508 Avoid code repetition in marker-related functions.
7509 * marker.c (attach_marker): New function.
7510 (Fset_marker, set_marker_restricted, set_marker_both)
7511 (set_marker_restricted_both): Use it.
7512 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7513 Consistently rename charno to charpos.
7514 (marker_position): Add eassert.
7515 (marker_byte_position): Convert to eassert.
7516
7517 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7518
7519 Simplify list operations in unchain_overlay and unchain_marker.
7520 * buffer.c (unchain_overlay): Simplify. Add comment.
7521 * marker.c (unchain_marker): Simplify. Fix comments.
7522
7523 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 Introduce fast path for the widely used marker operation.
7526 * alloc.c (build_marker): New function.
7527 * lisp.h (build_marker): New prototype.
7528 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7529 * composite.c (autocmp_chars): Likewise.
7530 * editfns.c (buildmark): Remove.
7531 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7532 (save_restriction_save): Use build_marker.
7533 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7534 * window.c (save_window_save): Likewise.
7535
7536 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7537
7538 Do not use Fdelete_overlay in delete_all_overlays
7539 to avoid redundant calls to unchain_overlay.
7540 * buffer.c (drop_overlay): New function.
7541 (delete_all_overlays, Fdelete_overlay): Use it.
7542 * minibuf.c (get_minibuffer): Fix comment.
7543
7544 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7545
7546 Port to OpenBSD 5.1 amd64.
7547 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7548 This is needed for OpenBSD, and should be harmless on all BSD systems.
7549 Also, include <sys/sysctl.h>, as it should be available on all
7550 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7551 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7552 use p_pid member, not kp_proc.pid.
7553
7554 2012-07-06 Glenn Morris <rgm@gnu.org>
7555
7556 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7557
7558 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7559
7560 More xmalloc and related cleanup.
7561 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7562 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7563 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7564 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7565 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7566 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7567 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7568 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7569 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7570 * xterm.c:
7571 Omit needless casts involving void * pointers and allocation.
7572 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7573 as the former is more robust if P's type is changed.
7574 Prefer xzalloc to xmalloc + memset 0.
7575 Simplify malloc-or-realloc to realloc.
7576 Don't worry about xmalloc returning a null pointer.
7577 Prefer xstrdup to xmalloc + strcpy.
7578 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7579 growing it.
7580 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7581 alloca of a constant.
7582
7583 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7584
7585 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7586 hscroll is larger than the line width. Fixes long and futile
7587 looping inside extend_face_to_end_of_line (on a TTY) producing
7588 glyphs that are not needed and thrown away.
7589
7590 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 * marker.c (set_marker_restricted_both): Simplify by using
7593 clip_to_bounds.
7594
7595 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7596
7597 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7598
7599 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7600
7601 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7602 not defined (Bug#11768).
7603 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7604 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7605 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7606 followed by gtk_box_set_homogeneous (Bug#11768).
7607 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7608 (update_theme_scrollbar_width, xg_create_scroll_bar):
7609 Use gtk_scrollbar_new (Bug#11768).
7610 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7611 (is_box_type): New function (Bug#11768).
7612 (xg_tool_item_stale_p): Call is_box_type.
7613 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7614 with default display (Bug#11768).
7615
7616 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7617
7618 * xdisp.c (window_hscroll_limited): New function.
7619 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7620 coordinates when window's hscroll is set to insanely large
7621 values. (Bug#11857)
7622
7623 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7624
7625 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7626 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7627
7628 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7629
7630 Cleanup xmalloc.
7631 * lisp.h (xzalloc): New prototype. Omit needless casts.
7632 * alloc.c (xzalloc): New function. Omit needless casts.
7633 * charset.c: Omit needless casts. Convert all calls to
7634 xmalloc with following memset to xzalloc.
7635 * dispnew.c: Likewise.
7636 * fringe.c: Likewise.
7637 * image.c: Likewise.
7638 * sound.c: Likewise.
7639 * term.c: Likewise.
7640 * w32fns.c: Likewise.
7641 * w32font.c: Likewise.
7642 * w32term.c: Likewise.
7643 * xfaces.c: Likewise.
7644 * xfns.c: Likewise.
7645 * xterm.c: Likewise.
7646 * atimer.c: Omit needless casts.
7647 * buffer.c: Likewise.
7648 * callproc.c: Likewise.
7649 * ccl.c: Likewise.
7650 * coding.c: Likewise.
7651 * composite.c: Likewise.
7652 * doc.c: Likewise.
7653 * doprnt.c: Likewise.
7654 * editfns.c: Likewise.
7655 * emacs.c: Likewise.
7656 * eval.c: Likewise.
7657 * filelock.c: Likewise.
7658 * fns.c: Likewise.
7659 * gtkutil.c: Likewise.
7660 * keyboard.c: Likewise.
7661 * lisp.h: Likewise.
7662 * lread.c: Likewise.
7663 * minibuf.c: Likewise.
7664 * msdos.c: Likewise.
7665 * print.c: Likewise.
7666 * process.c: Likewise.
7667 * region-cache.c: Likewise.
7668 * search.c: Likewise.
7669 * sysdep.c: Likewise.
7670 * termcap.c: Likewise.
7671 * terminal.c: Likewise.
7672 * tparam.c: Likewise.
7673 * w16select.c: Likewise.
7674 * w32.c: Likewise.
7675 * w32reg.c: Likewise.
7676 * w32select.c: Likewise.
7677 * w32uniscribe.c: Likewise.
7678 * widget.c: Likewise.
7679 * xdisp.c: Likewise.
7680 * xmenu.c: Likewise.
7681 * xrdb.c: Likewise.
7682 * xselect.c: Likewise.
7683
7684 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7685
7686 * fileio.c (time_error_value): Check the right error number.
7687 Problem reported by Troels Nielsen in
7688 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7689
7690 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7691
7692 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7693 This should be fixed in a better way; see Eli Zaretskii in
7694 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7695 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7696
7697 * fileio.c (time_error_value): Rename from special_mtime.
7698 The old name's problems were noted by Eli Zaretskii in
7699 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7700
7701 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7702 This variable's comment says Emacs needs at least one GDB-visible
7703 symbol of type enum pvec_type, to work around GDB problems.
7704 The symbol's value doesn't matter.
7705
7706 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7707 that causes compilation to fail on pre-C99 compilers.
7708
7709 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7710
7711 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7712 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7713
7714 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7715
7716 * buffer.c (init_buffer_once): Fix initialization of
7717 headers for buffer_defaults and buffer_local_symbols.
7718 Reported by Juanma Barranquero <lekktu@gmail.com>.
7719
7720 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7721
7722 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7723 * lisp.h (enum pvec_type): Use fewer bits.
7724 (PSEUDOVECTOR_SIZE_BITS): New constant.
7725 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7726 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7727 change in pvec_type.
7728 (PSEUDOVECTOR_TYPEP): New macro.
7729 (TYPED_PSEUDOVECTORP): Use it.
7730 * fns.c (internal_equal): Adapt code to extract pvectype.
7731 * emacs.c (gdb_pvec_type): Update type.
7732 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7733 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7734 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7735 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7736 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7737 abusing vector->header.next.nbytes.
7738 (live_vector_p): Use PVEC_TYPE.
7739 (mark_object): Adapt code to extract pvectype. Use switch.
7740
7741 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7742
7743 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7744 Tighten new eassert a bit.
7745
7746 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7747
7748 Fix compilation with --enable-gcc-warnings and -O1
7749 optimization level.
7750 * doprnt.c (doprnt): Change type of tem to int, initialize
7751 to avoid compiler warning. Add eassert.
7752 * search.c (simple_search): Initialize match_byte to avoid
7753 compiler warning. Add eassert.
7754
7755 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7756
7757 Avoid weird behavior with large horizontal scrolls.
7758 Without this change, for example, large hscroll values would
7759 mess up Emacs's display on Fedora 15 x86, presumably due to
7760 overflows in int calculations in the display code.
7761 Also, if buffers had long lines, Emacs would freeze.
7762 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7763 (set_window_hscroll): New function, containing the old guts of
7764 Fset_window_hscroll. Return the clipped value.
7765 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7766 This avoids the need to check against PTRDIFF_MAX.
7767
7768 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7769
7770 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7771
7772 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7773
7774 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7777 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7778 since GCC 4.4.6 issues a bogus warning for them.
7779
7780 Fix bugs in file timestamp newness comparisons.
7781 * fileio.c (Ffile_newer_than_file_p):
7782 * lread.c (Fload): Use full timestamp resolution of files,
7783 not just the 1-second resolution, so that files that are only
7784 slightly newer still count as newer.
7785 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7786 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7787
7788 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * fileio.c: Improve handling of file time marker. (Bug#11852)
7791 (special_mtime): New function.
7792 (Finsert_file_contents, Fverify_visited_file_modtime):
7793 Use it to set special mtime values consistently.
7794
7795 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7796
7797 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7798 marker for non-existing file. (Bug#11852)
7799
7800 2012-07-03 Glenn Morris <rgm@gnu.org>
7801
7802 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7803 and did not make it into globals.h).
7804
7805 2012-07-03 Tom Tromey <tromey@redhat.com>
7806
7807 * window.c (Fset_window_margins, Fset_window_fringes)
7808 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7809 * textprop.c (Fprevious_property_change): No longer static.
7810 * syntax.c (Fsyntax_table_p): No longer static.
7811 * process.c (Fget_process, Fprocess_datagram_address): No longer
7812 static.
7813 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7814 * keyboard.c (Fcommand_execute): No longer static.
7815 Remove EXFUN.
7816 * insdel.c (Fcombine_after_change_execute): No longer static.
7817 * image.c (Finit_image_library): No longer static.
7818 * fileio.c (Fmake_symbolic_link): No longer static.
7819 * eval.c (Ffetch_bytecode): No longer static.
7820 * editfns.c (Fuser_full_name): No longer static.
7821 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7822 No longer static.
7823 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7824 static.
7825 * dired.c (Ffile_attributes): No longer static.
7826 * composite.c (Fcomposition_get_gstring): No longer static.
7827 * callproc.c (Fgetenv_internal): No longer static.
7828
7829 * ccl.h: Remove EXFUNs.
7830 * buffer.h: Remove EXFUNs.
7831 * dispextern.h: Remove EXFUNs.
7832 * intervals.h: Remove EXFUNs.
7833 * fontset.h: Remove EXFUN.
7834 * font.h: Remove EXFUNs.
7835 * dosfns.c (system_process_attributes): Remove EXFUN.
7836 * keymap.h: Remove EXFUNs.
7837 * lisp.h: Remove EXFUNs.
7838 * w32term.h: Remove EXFUNs.
7839 * window.h: Remove EXFUNs.
7840 * xsettings.h: Remove EXFUN.
7841 * xterm.h: Remove EXFUN.
7842
7843 2012-07-03 Glenn Morris <rgm@gnu.org>
7844
7845 * lisp.h (Frandom): Make it visible to C.
7846 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7847 buffer for invisible buffers. (Bug#1229)
7848
7849 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7850
7851 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7852 values which aren't power of 2.
7853 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7854 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7855 accordingly.
7856
7857 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7858
7859 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7860
7861 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7862
7863 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7864
7865 * alloc.c (allocate_vector_block): Remove redundant
7866 calls to mallopt if DOUG_LEA_MALLOC is defined.
7867 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7868 avoid calls to mallopt if zero_vector is returned.
7869
7870 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7871
7872 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7873 is enabled, avoid dereferencing NULL current_sblock if
7874 running undumped.
7875
7876 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7877
7878 Cleanup basic buffer management.
7879 * buffer.h (struct buffer): Change layout to use generic vector
7880 marking code. Fix some comments. Change type of 'clip_changed'
7881 to bitfield. Remove unused #ifndef old.
7882 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7883 (GET_OVERLAYS_AT): Fix indentation.
7884 (for_each_per_buffer_object_at): New macro.
7885 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7886 (Fbuffer_local_variables): Use it.
7887 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7888 * alloc.c (allocate_buffer): Adjust to match new layout of
7889 struct buffer. Fix comment.
7890 (mark_overlay): New function.
7891 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7892 Lisp area of struct buffer.
7893 (mark_object): Use it. Adjust marking of misc objects
7894 and related comments.
7895
7896 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7899 wrapper that is not needed because the wrapped code is a no-op (zero
7900 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7901 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7902
7903 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7904
7905 * alloc.c (mark_buffer): Simplify. Remove prototype.
7906 (mark_object): Add comment. Reorganize marking of vector-like
7907 objects. Use CHECK_LIVE for all vector-like objects except buffers
7908 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7909 Avoid redundant calls to mark_vectorlike for bool vectors.
7910
7911 2012-06-30 Glenn Morris <rgm@gnu.org>
7912
7913 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7914
7915 * epaths.in (PATH_SITELOADSEARCH): New.
7916 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7917 This is rather than relying on --enable-locallisppath elements
7918 having "site-lisp" in their names. (Bug#10208#25, 11658)
7919
7920 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7921
7922 * w32proc.c (sys_select): Accept and ignore one more argument.
7923
7924 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7925
7926 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7927 (pselect) [!MS_DOS]: Redirect to sys_select.
7928
7929 * sysdep.c: Don't include dos.h and dosfns.h.
7930
7931 * process.c (sys_select):
7932 * msdos.c (sys_select): Accept one more argument and ignore it.
7933
7934 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7935 adapt data types and code to that.
7936
7937 * dosfns.c:
7938 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7939 which clashes with the gnulib function of the same name.
7940
7941 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7942
7943 * font.c (font_style_to_value, font_style_symbolic)
7944 (font_prop_validate_style): Add type checks for values in
7945 font_style_table.
7946
7947 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7948 argument.
7949 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7950 uses.
7951
7952 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7953
7954 * xdisp.c (try_window_id): Undo last change.
7955
7956 * w32.c (getwd): Adjust commentary about startup_dir.
7957 (init_environment): Always call sys_access, even in non-MSVC
7958 builds. Don't chdir to the directory of the Emacs executable.
7959 This undoes code from 1997 which was justified by the need to
7960 "avoid conflicts when removing and renaming directories". But its
7961 downside was that every relative file name was being interpreted
7962 relative to the directory of the Emacs executable, which can never
7963 be TRT. In particular, it broke sys_access when called with
7964 relative file names.
7965 (sys_access): Map GetLastError to errno.
7966
7967 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7968
7969 * window.h (struct window): Change type of 'fringes_outside_margins'
7970 to bitfield. Fix comment. Adjust users accordingly.
7971 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7972 Adjust comment.
7973 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7974 to ptrdiff_t.
7975
7976 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7977
7978 * gnutls.c (emacs_gnutls_handshake):
7979 Add QUIT to make the loop interruptible.
7980
7981 2012-06-29 Glenn Morris <rgm@gnu.org>
7982
7983 * charset.c (init_charset): Make lack of etc/charsets fatal.
7984
7985 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7986
7987 * editfns.c (region_limit): Fix type mismatch.
7988
7989 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7990
7991 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7992 undefined. Convert from xassert to eassert.
7993 * nsmenu.m: Convert from xassert to eassert.
7994 * nsterm.m: Likewise.
7995
7996 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7997
7998 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7999
8000 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8001
8002 Avoid integer overflow on scroll-left and scroll-right.
8003 * window.c (HSCROLL_MAX): New macro.
8004 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8005 overflow when requested scroll falls outside ptrdiff_t range.
8006
8007 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8008
8009 * window.h (struct window): Change type of 'hscroll',
8010 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8011 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8012 Adjust users accordingly.
8013 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8014 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8015 from EMACS_INT to ptrdiff_t.
8016 (make_window): Omit redundant initialization.
8017
8018 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8019
8020 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8021
8022 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8023
8024 * window.h (struct window): Change type of 'use_time' and
8025 'sequence_number' from Lisp_Object to int.
8026 * frame.c (make_frame): Adjust users accordingly.
8027 * print.c (print_object): Likewise.
8028 * window.c (select_window, Fwindow_use_time, make_parent_window)
8029 (make_window): Likewise.
8030
8031 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8032
8033 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8034 enabled with --enable-checking=[all,glyphs] configure option.
8035 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8036 adjust comments accordingly.
8037 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8038 undefined, adjust comments accordingly.
8039 * image.c: Likewise.
8040 * scroll.c: Likewise.
8041 * w32fns.c: Likewise.
8042 * w32term.c: Likewise.
8043 * xdisp.c: Likewise.
8044 * xfaces.c: Likewise.
8045 * xfns.c: Likewise.
8046 * xterm.c: Likewise.
8047
8048 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8049
8050 Generalize run-time debugging checks.
8051 * dispextern.h (XASSERTS): Remove.
8052 * fontset.c (xassert): Remove.
8053 Convert from xassert to eassert.
8054 * alloc.c: Convert from xassert to eassert.
8055 * bidi.c: Likewise.
8056 * dispnew.c: Likewise.
8057 * fns.c: Likewise.
8058 * fringe.c: Likewise.
8059 * ftfont.c: Likewise.
8060 * gtkutil.c: Likewise.
8061 * image.c: Likewise.
8062 * keyboard.c: Likewise.
8063 * menu.c: Likewise.
8064 * process.c: Likewise.
8065 * scroll.c: Likewise.
8066 * sound.c: Likewise.
8067 * term.c: Likewise.
8068 * w32console.c: Likewise.
8069 * w32fns.c: Likewise.
8070 * w32term.c: Likewise.
8071 * window.c: Likewise.
8072 * xdisp.c: Likewise.
8073 * xfaces.c: Likewise.
8074 * xfns.c: Likewise.
8075 * xselect.c: Likewise.
8076 * xterm.c: Likewise.
8077
8078 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8079
8080 * fns.c (maybe_resize_hash_table): Output message when growing the
8081 purify-hashtable.
8082
8083 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8084
8085 * alloc.c (allocate_string_data): Remove dead code.
8086 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8087 avoid GCC warning about unused macro.
8088
8089 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8090
8091 * alloc.c (allocate_string): Omit intervals initialization.
8092 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8093 as in make_pure_string and make_pure_c_string.
8094
8095 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8096
8097 * alloc.c (allocate_string): Fix last change.
8098
8099 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8100
8101 * alloc.c (allocate_string): Remove two redundant calls
8102 to memset, add explicit initialization where appropriate.
8103
8104 2012-06-27 Glenn Morris <rgm@gnu.org>
8105
8106 * lisp.mk (lisp): Remove paths.elc.
8107
8108 2012-06-27 Chong Yidong <cyd@gnu.org>
8109
8110 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8111
8112 2012-06-26 John Wiegley <johnw@newartisans.com>
8113
8114 * unexmacosx.c (copy_data_segment): Add two section names used
8115 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8116
8117 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8118 when building with Clang.
8119
8120 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8121
8122 * eval.c (Fapply): Allow calling it with a single argument.
8123
8124 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8125
8126 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8127 _stricmp and _strnicmp.
8128 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8129
8130 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8131
8132 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8133 allocated window.
8134 (allocate_process): Likewise for new process.
8135 (allocate_terminal): Change to use offsetof.
8136 (allocate_frame): Likewise.
8137 * frame.c (make_frame): Omit redundant initialization.
8138 * window.c (make_parent_window): Use memset.
8139 (make_window): Omit redundant initialization.
8140 * process.c (make_process): Omit redundant initialization.
8141 * terminal.c (create_terminal): Likewise.
8142
8143 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8144
8145 * term.c (delete_tty): Remove redundant call to memset.
8146
8147 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8148
8149 * alloc.c: Remove build_string.
8150 * lisp.h: Define build_string as static inline. This provides
8151 a better opportunity to optimize away calls to strlen when the
8152 function is called with compile-time constant argument.
8153 * image.c (imagemagick_error): Convert to build_string.
8154 * w32proc.c (sys_spawnve): Likewise.
8155 * xterm.c (x_term_init): Likewise.
8156
8157 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8158
8159 Use sprintf return value instead of invoking strlen on result.
8160 In the old days this wasn't portable, since some sprintf
8161 implementations returned char *. But they died out years ago and
8162 Emacs already assumes sprintf returns int.
8163 Similarly for float_to_string.
8164 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8165 * ccl.c (ccl_driver):
8166 * character.c (string_escape_byte8):
8167 * data.c (Fnumber_to_string):
8168 * doprnt.c (doprnt):
8169 * print.c (print_object):
8170 * xdisp.c (message_dolog):
8171 * xfns.c (syms_of_xfns):
8172 Use sprintf or float_to_string result to avoid need to call strlen.
8173 * data.c (Fnumber_to_string):
8174 Use make_unibyte_string, since the string must be ASCII.
8175 * lisp.h, print.c (float_to_string): Now returns int length.
8176 * term.c (produce_glyphless_glyph):
8177 Use sprintf result rather than recomputing it.
8178
8179 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8180 * Makefile.in (ALL_CFLAGS):
8181 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8182 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8183
8184 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8185
8186 * dispextern.h (xstrcasecmp): Define to library function
8187 strcasecmp if available.
8188 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8189
8190 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8191
8192 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8193 Avoid comma operator.
8194 * menu.c (push_submenu_start, push_submenu_end)
8195 (push_left_right_boundary, push_menu_pane): Likewise.
8196 * msdos.c (dos_rawgetc): Likewise.
8197
8198 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8199
8200 * xfns.c (xic_create_fontsetname): Remove redundant calls
8201 to memset.
8202
8203 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8204
8205 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8206 sprintf already null-terminates its output.
8207
8208 * xfns.c (x_window): Remove redundant cast.
8209
8210 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8211
8212 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8213 `const char *' to `char *' to avoid compiler warning.
8214
8215 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8218 instead of truncating it to 63 (admittedly a generous limit).
8219
8220 * process.c: Fix spelling and caps in comments.
8221
8222 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8223
8224 * emacs.c (setpgrp): Remove definition, unused.
8225 * sysdep.c (setpgrp): Remove definition, not used in this file.
8226
8227 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8228
8229 * makefile.w32-in: Update dependencies.
8230
8231 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8232
8233 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8234 (SYSTIME_H): Add nt/inc/sys/time.h.
8235
8236 * systime.h [WINDOWSNT]: Include sys/time.h.
8237
8238 * s/ms-w32.h (struct timespec): Definition moved from
8239 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8240
8241 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8242
8243 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8244 * buffer.h (buffer_slot_type_mismatch):
8245 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8246 * eval.c (unwind_to_catch):
8247 * image.c (my_png_error, my_error_exit):
8248 * keyboard.c (quit_throw_to_read_char, user_error)
8249 (Fexit_recursive_edit, Fabort_recursive_edit):
8250 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8251 (wrong_type_argument, buffer_overflow, __executable_start)
8252 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8253 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8254 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8255 (fatal):
8256 (child_setup) [!DOS_NT]:
8257 * lread.c (end_of_file_error, invalid_syntax):
8258 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8259 * puresize.h (pure_write_error):
8260 * search.c (matcher_overflow):
8261 * sound.c (sound_perror, alsa_sound_perror):
8262 * sysdep.c, syssignal.h (croak):
8263 * term.c (maybe_fatal, vfatal):
8264 * textprop.c (text_read_only):
8265 * undo.c (user_error):
8266 * unexmacosx.c (unexec_error):
8267 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8268 Use _Noreturn rather than NO_RETURN.
8269 No need for separate decl merely because of _Noreturn.
8270 * sound.c (sound_warning, parse_sound):
8271 Remove unnecessary forward decls.
8272
8273 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8274
8275 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8276 * lisp.h (WAIT_READING_MAX): New macro.
8277 * dispnew.c (Fsleep_for, sit_for):
8278 * keyboard.c (kbd_buffer_get_event):
8279 * process.c (Faccept_process_output):
8280 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8281 This improves on the previous patch, which introduced a bug
8282 when time_t is unsigned and as wide as intmax_t.
8283 See <http://bugs.gnu.org/9000#51>.
8284
8285 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8286
8287 * dispnew.c (sit_for, Fsleep_for):
8288 * keyboard.c (kbd_buffer_get_event):
8289 * process.c (Faccept_process_output): Avoid compiler warnings when
8290 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8291
8292 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8293
8294 * makefile.w32-in: Update dependencies.
8295
8296 * w32.c (ltime): Add return type and declare static.
8297 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8298
8299 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8302 Privately reported by Herbert J. Skuhra.
8303 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8304 All uses changed.
8305 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8306 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8307
8308 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8309
8310 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8311 last argument of make_unibyte_string.
8312
8313 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8314 language ID in the event parameters.
8315
8316 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8317 event.code, not the obscure "character set ID".
8318
8319 2012-06-23 Chong Yidong <cyd@gnu.org>
8320
8321 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8322
8323 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8324
8325 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8326 * w32.c (fdutimens): New function.
8327
8328 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8329
8330 * s/ms-w32.h (pselect): Redirect to sys_select.
8331
8332 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8333
8334 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8335 in the logic of incrementing and decrementing the value of
8336 use_relocatable_buffers.
8337
8338 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8339
8340 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8341 Privately reported by Herbert J. Skuhra.
8342 [__FreeBSD__]: Remove "*/" typo after "#include".
8343 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8344 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8345 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8346 Don't assume EMACS_TIME and struct timeval are the same type.
8347
8348 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 Support higher-resolution time stamps (Bug#9000).
8351 The time stamps are only nanosecond-resolution at the C level,
8352 since that's the best that any real-world system supports now.
8353 But they are picosecond-resolution at the Lisp level, as that's
8354 easy, and leaves room for future OS improvements.
8355
8356 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8357 (LIBES): Use it.
8358
8359 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8360 Don't get current time unless it's needed.
8361
8362 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8363 now provides it if it's absent.
8364 (start_atimer): Port to higher-res time stamps.
8365 Check for time stamp overflow. Don't get current time more
8366 often than is needed.
8367
8368 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8369 Include systime.h, not time.h.
8370 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8371
8372 * dired.c: Include stat-time.h.
8373 (Ffile-attributes): File times now have higher resolution.
8374
8375 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8376 (struct image): Timestamp now has higher resolution.
8377
8378 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8379 has at least microseconds now. All uses removed.
8380 (update_frame, update_single_window, update_window, update_frame_1)
8381 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8382 (duration_to_sec_usec): Remove; no longer needed.
8383
8384 * editfns.c (time_overflow): Now extern.
8385 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8386 (float-time, Fformat_time_string, Fcurrent_time_string)
8387 (Fcurrent_time_zone): Accept and generate higher-resolution
8388 time stamps.
8389 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8390 (decode_time_components, lisp_seconds_argument): New functions.
8391 (make_time): Now static.
8392 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8393 Report an error if the time is invalid, rather than having the caller
8394 do that.
8395
8396 * fileio.c: Include <stat-time.h>
8397 (Fcopy_file): Copy higher-resolution time stamps.
8398 Prefer to set the time stamp via a file descriptor if that works.
8399 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8400 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8401 (Fvisited_file_modtime, Fset_visited_file_modtime):
8402 Support higher-resolution time stamps.
8403
8404 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8405
8406 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8407
8408 * image.c (prepare_image_for_display, clear_image_cache)
8409 (lookup_image): Port to higer-resolution time stamps.
8410
8411 * keyboard.c (start_polling, bind_polling_period):
8412 Check for time stamp overflow.
8413 (read_char, kbd_buffer_get_event, timer_start_idle)
8414 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8415 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8416 Port to higher-resolution time stamps. Do not assume time_t is signed.
8417 (decode_timer): New function. Timers are now vectors of length 9,
8418 not 8, to accommodate the picosecond component.
8419 (timer_check_2): Use it.
8420
8421 * nsterm.m (select_timeout, timeval_subtract): Remove.
8422 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8423 as they're a bit more accurate and handle overflow better.
8424 (ns_select): Change prototype to be compatible with pselect.
8425 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8426 * nsterm.h (ns_select): Adjust prototype.
8427
8428 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8429 us-resolution time stamps.
8430 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8431
8432 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8433
8434 * lisp.h (time_overflow): New decl.
8435 (wait_reading_process_output): First arg is now intmax_t, not int,
8436 to accommodate larger waits.
8437
8438 * process.h (struct Lisp_Process.read_output_delay):
8439 Now counts nanoseconds, not microseconds.
8440 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8441 EMACS_HAS_USECS.
8442 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8443 (wait_reading_process_output):
8444 Port to ns-resolution time stamps.
8445 (Faccept_process_output, wait_reading_process_output):
8446 Check for time stamp overflow. Do not assume time_t is signed.
8447 (select_wrapper): Remove; we now use pselect.
8448 (Fprocess_attributes): Now generates ns-resolution time stamps.
8449
8450 * sysdep.c: Include utimens.h. Don't include utime.h
8451 or worry about struct utimbuf; gnulib does that for us now.
8452 (gettimeofday): Remove; gnulib provides a substitute.
8453 (make_timeval): New function.
8454 (set_file_times): Now sets ns-resolution time stamps.
8455 New arg FD; all uses changed.
8456 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8457 (system_process_attributes):
8458 Now returns ns-resolution time stamp. All uses changed.
8459 Check for time stamp overflow.
8460
8461 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8462 provides a substitute now.
8463
8464 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8465 since it guarantees struct timespec.
8466 (EMACS_TIME): Now struct timespec, so that we can support
8467 ns-resolution time stamps.
8468 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8469 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8470 (EMACS_USECS): Remove.
8471 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8472 so multiply the arg by 1000 before storing it.
8473 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8474 New macros.
8475 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8476 Port to ns-resolution time stamps.
8477 (EMACS_TIME_NEG_P): Remove; replaced by....
8478 (EMACS_TIME_SIGN): New macro.
8479 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8480 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8481 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8482 (make_timeval, make_lisp_time, decode_time_components): New decls.
8483 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8484 that it mishandled time_t overflow. You can't compare by subtracting!
8485 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8486 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8487
8488 * term.c: Include <sys/time.h>.
8489 (timeval_to_Time): New function, for proper overflow wraparound.
8490 (term_mouse_position, term_mouse_click): Use it.
8491
8492 * undo.c (record_first_change): Support higher-resolution time stamps
8493 in the undo buffer.
8494 (Fprimitive_undo): Use them when restoring time stamps.
8495
8496 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8497 (w32_get_internal_run_time):
8498 Port to higher-resolution Emacs time stamps.
8499 (ltime): Now accepts single 64-bit integer, as that's more convenient
8500 for callers.
8501
8502 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8503
8504 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8505 for compatibility with pselect. Support ns-resolution time stamps.
8506
8507 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8508
8509 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8510 Check for time stamp overflow, and support ns-resolution time stamps.
8511
8512 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8513 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8514 (timeval_subtract): Remove; no longer needed.
8515 (XTflash, XTring_bell, x_wait_for_event):
8516 Port to ns-resolution time stamps. Don't assume time_t is signed.
8517
8518 2012-06-22 Chong Yidong <cyd@gnu.org>
8519
8520 * xdisp.c (x_consider_frame_title): Revert last change.
8521
8522 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8523
8524 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8525 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8526 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8527 staticidx goes up to 1597 out of 1600 = 0x640.)
8528
8529 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8530
8531 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8532 Otherwise, the umask might be mistakenly 0 while handling input signals.
8533
8534 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8535
8536 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8537
8538 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8539
8540 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8541 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8542 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8543 access to `contents' member of Lisp_Vector objects with AREF and ASET
8544 where appropriate.
8545
8546 2012-06-19 Chong Yidong <cyd@gnu.org>
8547
8548 * frame.c (delete_frame): When selecting a frame on a different
8549 text terminal, do not alter the terminal's top-frame.
8550
8551 * xdisp.c (format_mode_line_unwind_data): Record the target
8552 frame's selected window and its terminal's top-frame.
8553 (unwind_format_mode_line): Restore them.
8554 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8555 Callers changed.
8556 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8557 since tty frames can be explicitly named.
8558 (prepare_menu_bars): Likewise.
8559
8560 * term.c (Ftty_top_frame): New function.
8561
8562 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 Port byte-code-meter to modern targets.
8565 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8566 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8567 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8568 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8569 (METER_1, METER_2): Simplify.
8570
8571 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8572
8573 * data.c (Fdefalias): Return `symbol' (bug#11686).
8574
8575 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8576
8577 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8578 gets killed during executing of this function (Bug#11665).
8579 Try to always return Qt when the buffer has been actually killed.
8580 (Vkill_buffer_query_functions): In doc-string say that functions
8581 run by this hook should not change the current buffer.
8582
8583 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8584
8585 Fix recently-introduced process.c problems found by static checking.
8586 * process.c (write_queue_push, write_queue_pop, send_process):
8587 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8588 (write_queue_pop): Fix pointer signedness problem.
8589 (send_process): Remove unused local.
8590
8591 2012-06-17 Chong Yidong <cyd@gnu.org>
8592
8593 * xdisp.c (redisplay_internal): No need to redisplay terminal
8594 frames that are not on top.
8595
8596 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8597
8598 * process.c (make_process): Initialize write_queue.
8599 (write_queue_push, write_queue_pop): New functions.
8600 (send_process): Use them to maintain correct ordering of process
8601 writes (Bug#10815).
8602
8603 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 * lisp.h (eassert): Assume C89 or later.
8606 This removes the need for CHECK.
8607 (CHECK): Remove. Its comments about always evaluating its
8608 argument were confusing, as 'eassert' typically does not evaluate
8609 its argument.
8610
8611 * coding.c (produce_chars): Use ptrdiff_t, not int.
8612
8613 * xterm.c (x_draw_underwave): Check for integer overflow.
8614 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8615
8616 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8617
8618 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8619 referenced (Bug#11583).
8620
8621 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8622
8623 Implement wave-style variant of underlining.
8624 * dispextern.h (face_underline_type): New enum.
8625 (face): Add field for underline type.
8626 * nsterm.m (ns_draw_underwave): New function.
8627 (ns_draw_text_decoration): Use it.
8628 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8629 New functions.
8630 (x_draw_glyph_string): Use them.
8631 * xfaces.c (Qline, Qwave): New Lisp objects.
8632 (check_lface_attrs, merge_face_ref)
8633 (Finternal_set_lisp_face_attribute, realize_x_face):
8634 Handle wave-style underline face attributes.
8635 * xterm.c (x_draw_underwave): New function.
8636 (x_draw_glyph_string): Use it.
8637
8638 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8639
8640 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8641 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8642 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8643 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8644 ($(BLD)/w32select.$(O)): Update dependencies.
8645
8646 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8647
8648 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8649 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8650 * character.c (_fetch_multibyte_char_p): Remove.
8651 * alloc.c: Include "character.h" before "buffer.h".
8652 * bidi.c: Likewise.
8653 * buffer.c: Likewise.
8654 * bytecode.c: Likewise.
8655 * callint.c: Likewise.
8656 * callproc.c: Likewise.
8657 * casefiddle.c: Likewise.
8658 * casetab.c: Likewise.
8659 * category.c: Likewise.
8660 * cmds.c: Likewise.
8661 * coding.c: Likewise.
8662 * composite.c: Likewise.
8663 * dired.c: Likewise.
8664 * dispnew.c: Likewise.
8665 * doc.c: Likewise.
8666 * dosfns.c: Likewise.
8667 * editfns.c: Likewise.
8668 * emacs.c: Likewise.
8669 * fileio.c: Likewise.
8670 * filelock.c: Likewise.
8671 * font.c: Likewise.
8672 * fontset.c: Likewise.
8673 * fringe.c: Likewise.
8674 * indent.c: Likewise.
8675 * insdel.c: Likewise.
8676 * intervals.c: Likewise.
8677 * keyboard.c: Likewise.
8678 * keymap.c: Likewise.
8679 * lread.c: Likewise.
8680 * macros.c: Likewise.
8681 * marker.c: Likewise.
8682 * minibuf.c: Likewise.
8683 * nsfns.m: Likewise.
8684 * nsmenu.m: Likewise.
8685 * print.c: Likewise.
8686 * process.c: Likewise.
8687 * regex.c: Likewise.
8688 * region-cache.c: Likewise.
8689 * search.c: Likewise.
8690 * syntax.c: Likewise.
8691 * term.c: Likewise.
8692 * textprop.c: Likewise.
8693 * undo.c: Likewise.
8694 * unexsol.c: Likewise.
8695 * w16select.c: Likewise.
8696 * w32fns.c: Likewise.
8697 * w32menu.c: Likewise.
8698 * window.c: Likewise.
8699 * xdisp.c: Likewise.
8700 * xfns.c: Likewise.
8701 * xmenu.c: Likewise.
8702 * xml.c: Likewise.
8703 * xselect.c: Likewise.
8704
8705 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8706
8707 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8708 If all the glyphs of the glyph row came from strings, and we have no
8709 cursor positioning clues, put the cursor on the first glyph of the
8710 row.
8711 (handle_face_prop): Use chunk-relative overlay string index when
8712 indexing into it->string_overlays array. (Bug#11653)
8713 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8714 the rightmost. (Bug#11720)
8715
8716 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8717
8718 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8719 (CATEGORY_MEMBER): Enforce 1/0 value.
8720 * category.c (_temp_category_set): Remove.
8721
8722 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8723
8724 * window.c (Fdelete_other_windows_internal)
8725 (Fdelete_window_internal): Don't access frame's mouse highlight
8726 info of the initial frame. (Bug#11677)
8727
8728 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8729
8730 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8731 Assume USE_2_TAGS_FOR_INTS.
8732 (xreload): Adjust $tagmask width to match recent lisp.h change.
8733
8734 Simplify lisp.h in minor ways that should not affect code.
8735 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8736 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8737 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8738 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8739 (INTTYPEBITS): New macro, for clarity.
8740 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8741 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8742 Simplify now that USE_LSB_TAG is always defined.
8743 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8744 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8745
8746 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8747
8748 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8749
8750 2012-06-13 Glenn Morris <rgm@gnu.org>
8751
8752 * s/bsd-common.h (BSD4_3):
8753 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8754
8755 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8756
8757 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8758 instead of union.
8759 (XLI, XIL): Define.
8760 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8761 Use them.
8762 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8763 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8764 * alloc.c (widen_to_Lisp_Object): Remove.
8765 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8766 * frame.c (delete_frame): Remove outdated comment.
8767 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8768 USE_LISP_UNION_TYPE.
8769 (Fw32_unregister_hot_key): Likewise.
8770 (Fw32_toggle_lock_key): Likewise.
8771 * w32menu.c (add_menu_item): Likewise.
8772 (w32_menu_display_help): Use XIL instead of checking
8773 USE_LISP_UNION_TYPE.
8774 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8775 (init_heap): Likewise.
8776 * w32term.c (w32_read_socket): Update comment.
8777
8778 2012-06-13 Glenn Morris <rgm@gnu.org>
8779
8780 * s/usg5-4-common.h, src/s/unixware.h:
8781 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8782
8783 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8784
8785 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8786
8787 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8788 * alloc.c (make_number) [!defined make_number]:
8789 Remove, as lisp.h always defines this now.
8790 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8791 (roundup_size): Verify that it is a power of 2.
8792 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8793 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8794 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8795 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8796 USE_LSB_TAG now is always defined to be either 0 or 1.
8797 All uses changed.
8798 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8799 code works fine either way, and efficiency is not a concern here,
8800 as the union type is for debugging, not for production.
8801 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8802 Use an inline function on all platforms when using the union type,
8803 since this is simpler and 'static inline' can be used portably
8804 within Emacs now.
8805 (LISP_INITIALLY_ZERO): New macro.
8806 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8807 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8808
8809 2012-06-12 Glenn Morris <rgm@gnu.org>
8810
8811 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8812
8813 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8814
8815 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8816 Move BROKEN_SIGIO to configure.
8817
8818 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8819 Move NO_TERMIO to configure.
8820
8821 2012-06-12 Chong Yidong <cyd@gnu.org>
8822
8823 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8824 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8825 MagickExportImagePixels is undefined.
8826
8827 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 * image.c (imagemagick_load_image): Remove unused label.
8830
8831 2012-06-11 Glenn Morris <rgm@gnu.org>
8832
8833 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8834 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8835 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8836 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8837
8838 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8839
8840 * alloc.c (make_byte_code): New function.
8841 (Fmake_byte_code): Use it. Don't purify here.
8842 * lread.c (read1): Use it as well to avoid extra allocation.
8843
8844 2012-06-11 Chong Yidong <cyd@gnu.org>
8845
8846 * image.c (imagemagick_load_image): Implement transparency.
8847
8848 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8849
8850 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8851 account for preceding backslashes. (Bug#11663)
8852
8853 2012-06-09 Chong Yidong <cyd@gnu.org>
8854
8855 * term.c: Support italics in capable terminals (Bug#9652).
8856 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8857 (turn_on_face): Output using TS_enter_italic_mode if available.
8858 Don't handle unused blinking and alt-charset cases.
8859 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8860 and tty_alt_charset_p cases.
8861 (tty_capable_p, init_tty): Support italics.
8862
8863 * termchar.h (struct tty_display_info): Add field for italics.
8864 Remove unused blink field.
8865
8866 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8867 Handle slant.
8868
8869 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8870 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8871 tty_alt_charset_p. Add tty_italic_p.
8872
8873 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
8874
8875 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8876 dbus_type_is_basic if available.
8877 (xd_extract_signed, xd_extract_unsigned): Rename from
8878 extract_signed and extract_unsigned, respectively. Adapt callers.
8879
8880 2012-06-09 Chong Yidong <cyd@gnu.org>
8881
8882 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8883
8884 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8885 case (Bug#9752).
8886
8887 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8888
8889 * xdisp.c (vmessage): Treat frame message as multibyte.
8890 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8891 would generate the diagnostic "Making \302\247 buffer-local while
8892 let-bound!".
8893
8894 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8895
8896 * dispnew.c (showing_window_margins_p): Undo last change, which
8897 was done due to an inadvertent commit.
8898 (adjust_frame_glyphs_for_frame_redisplay): Do call
8899 showing_window_margins_p.
8900
8901 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8902
8903 * eval.c (Fmake_var_non_special): New primitive.
8904 (syms_of_eval): Defsubr it.
8905 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8906
8907 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
8908
8909 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8910 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8911
8912 2012-06-08 Eli Zaretskii <eliz@gnu.org>
8913
8914 * alloc.c (allocate_vectorlike): Fix last change.
8915
8916 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8917
8918 Block-based vector allocation of small vectors.
8919 * lisp.h (struct vectorlike_header): New field `nbytes',
8920 adjust comment accordingly.
8921 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8922 to denote vector blocks. Adjust users (live_vector_p,
8923 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8924 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8925 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8926 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8927 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8928 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8929 (roundup_size): New constant.
8930 (struct vector_block): New data type.
8931 (vector_blocks, vector_free_lists, zero_vector): New variables.
8932 (all_vectors): Rename to `large_vectors'.
8933 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8934 (sweep_vectors): New functions.
8935 (allocate_vectorlike): Return `zero_vector' as the only vector of
8936 0 items. Allocate new vector from block if vector size is less than
8937 or equal to VBLOCK_BYTES_MAX.
8938 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8939 (init_alloc_once): Add call to init_vectors.
8940
8941 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8942
8943 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8944
8945 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8946
8947 * doprnt.c (doprnt): Truncate multibyte char correctly.
8948 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8949 would mishandle a string argument "Xc" if X was a multibyte
8950 character of length 2: it would truncate after X's first byte
8951 rather than including all of X.
8952
8953 2012-06-06 Chong Yidong <cyd@gnu.org>
8954
8955 * buffer.c (word_wrap): Doc fix.
8956
8957 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8958
8959 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8960
8961 2012-06-03 Glenn Morris <rgm@gnu.org>
8962
8963 * xdisp.c (tool-bar-style): Doc fix.
8964
8965 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8966
8967 * Makefile.in (PAXCTL): Define.
8968 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8969 binary via PaX flags if the paxctl utility is available.
8970 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8971 Restore PaX flags to their default. (Bug#11398)
8972
8973 2012-06-03 Chong Yidong <cyd@gnu.org>
8974
8975 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8976 buffer (Bug#11226).
8977
8978 2012-06-03 Chong Yidong <cyd@gnu.org>
8979
8980 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8981 (note_mode_line_or_margin_highlight): If there is no help echo,
8982 use mode-line-default-help-echo. Handle the case where the mouse
8983 position is past the end of the mode line string.
8984
8985 * buffer.c (buffer_local_value_1): New function, split from
8986 Fbuffer_local_value; can return Qunbound.
8987 (Fbuffer_local_value): Use it.
8988 (Vmode_line_format): Docstring tweaks.
8989
8990 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * sysdep.c (system_process_attributes): Improve comment.
8993
8994 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8995
8996 * keyboard.c: Export real-this-command to Elisp.
8997 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8998 and DEFVAR it. Update all users.
8999
9000 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9003
9004 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9005 Convert pctcpu and pctmem to Lisp float properly.
9006 Let the compiler fold better, as 100.0/0x8000 is exact.
9007
9008 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9009
9010 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9011 cons_block.
9012
9013 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9014
9015 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9016
9017 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9018
9019 For a 'struct window', replace some Lisp_Object fields to
9020 bitfields where appropriate, remove unused fields.
9021 * window.h (struct window): Remove unused 'last_mark_x' and
9022 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9023 change its type from Lisp_Object to bitfield.
9024 Change type of 'force_start', 'optional_new_start',
9025 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9026 fields from Lisp_Object to bitfield. Adjust users accordingly.
9027
9028 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9029
9030 Pacify gcc -Wdouble-precision when using Xaw.
9031 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9032 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9033 Use 'float' consistently, rather than 'float' in most places
9034 and 'double' in a couple of places.
9035
9036 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9037
9038 * xdisp.c (handle_stop): Detect whether we have overlay strings
9039 loaded by testing it->current.overlay_string_index to be
9040 non-negative, instead of checking whether n_overlay_strings is
9041 positive. (Bug#11587)
9042
9043 2012-05-31 Chong Yidong <cyd@gnu.org>
9044
9045 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9046
9047 * doc.c (Fsubstitute_command_keys): Doc fix.
9048
9049 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9050
9051 * search.c (search_buffer): Remove calls to
9052 r_alloc_inhibit_buffer_relocation, as it is now called by
9053 maybe_unify_char, which was the cause of relocation of buffer text
9054 in bug#11519.
9055
9056 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9057
9058 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9059 for the duration of call to load_charset, to avoid problems with
9060 callers of maybe_unify_char that access buffer text through C
9061 pointers.
9062
9063 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9064 decrement the inhibition flag, instead of just setting or
9065 resetting it.
9066
9067 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 Remove obsolete '#define static' cruft.
9070 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9071 This #undef was "temporary" in 2000; it is no longer needed
9072 now that '#define static' has gone away.
9073 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9074 (gray_bitmap_bits): Remove; no longer needed.
9075 All uses replaced with definiens.
9076 * xterm.c: Include "bitmaps/gray.xbm".
9077
9078 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 Clean up __executable_start, monstartup when --enable-profiling.
9081 The following changes affect the code only when profiling.
9082 * dispnew.c (__executable_start): Rename from safe_bcopy.
9083 Define only on platforms that need it.
9084 * emacs.c: Include <sys/gmon.h> when profiling.
9085 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9086 (__executable_start): Remove decl, since lisp.h does it now.
9087 (safe_bcopy): Remove decl; no longer has that name.
9088 (main): Coalesce #if into single bit of code, for simplicity.
9089 Cast pointers to uintptr_t, since standard libraries want integers
9090 and not pointers.
9091 * lisp.h (__executable_start): New decl.
9092
9093 2012-05-31 Glenn Morris <rgm@gnu.org>
9094
9095 * image.c (Fimagemagick_types): Doc fix.
9096
9097 2012-05-30 Jim Meyering <meyering@redhat.com>
9098
9099 * callproc.c (Fcall_process_region): Include directory component
9100 in mkstemp error message (Bug#11586).
9101
9102 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9103
9104 * alloc.c, lisp.h (make_pure_vector): Now static.
9105
9106 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9107
9108 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9109 Move to byte-run.el.
9110 (Fautoload): Do the hash-doc more carefully.
9111 * data.c (Fdefalias): Purify definition, except for keymaps.
9112 (Qdefun): Move from eval.c.
9113 * lisp.h (Qdefun): Remove.
9114 * lread.c (read1): Tiny simplification.
9115
9116 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9117
9118 Do not create empty overlays with the evaporate property (Bug#9642).
9119 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9120 Bug#9642, but explicitly check that the buffer the overlay would
9121 be moved to is live and rearrange lines to make sure that errors
9122 will not put the overlay in an inconsistent state.
9123 (Fdelete_overlay): Cosmetics.
9124
9125 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9126
9127 * w32term.c (my_bring_window_to_top): New function.
9128 (x_raise_frame): Use handle returned by DeferWindowPos, which
9129 could be different from the original one.
9130 Call my_bring_window_to_top instead of my_set_foreground_window.
9131 (Bug#11513)
9132
9133 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9134 by calling BringWindowToTop.
9135
9136 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9137 (WM_EMACS_END): Increase by one.
9138
9139 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9140
9141 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9142 This avoids undefined behavior that might cause the eassert
9143 to not catch an out-of-range value.
9144
9145 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9146
9147 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9148 Update dependencies.
9149
9150 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9151
9152 * bidi.c (bidi_mirror_char): Fix last change.
9153
9154 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9155
9156 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9157 when referring to sectname field in printf format.
9158
9159 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9160
9161 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9162 Only r_alloc_inhibit_buffer_relocation needed to be added;
9163 the others were already declared.
9164
9165 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9166 before checking whether it's out of range. Put the check inside
9167 eassert. See
9168 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9169
9170 2012-05-27 Ken Brown <kbrown@cornell.edu>
9171
9172 * callproc.c (Fcall_process): Restore a line that was accidentally
9173 commented out in the 2011-02-13 change (bug#11547).
9174
9175 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9176
9177 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9178 defined on ralloc.c.
9179
9180 * buffer.c [REL_ALLOC]: Remove prototypes of
9181 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9182 they are now on lisp.h.
9183
9184 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9185
9186 * search.c (search_buffer): Use it to inhibit relocation of buffer
9187 text while re_search_2 is doing its job, because re_search_2 is
9188 passed C pointers to buffer text. (Bug#11519)
9189
9190 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9191 Update value to 24.
9192
9193 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9194 state after an additional call to move_it_in_display_line_to, keep
9195 the values of it->max_ascent and it->max_descent found for the
9196 entire line.
9197 (pos_visible_p): Revert the comparison against bottom_y to what it
9198 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9199 (Bug#11464)
9200
9201 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9202
9203 Fix coding-related core dumps with gcc -ftrapv.
9204 The code was computing A - B, where A and B are pointers, and B is
9205 random garbage. This can lead to core dumps on platforms that
9206 have special pointer registers, and it also leads to core dumps on
9207 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9208 A - B only when B is initialized properly.
9209 * coding.c (coding_set_source, coding_set_destination): Return void.
9210 (coding_change_source, coding_change_destinations): New functions,
9211 with the old behaviors of coding_set_source and coding_set_destination.
9212 All callers that need an offset changed to use these new functions.
9213
9214 2012-05-26 Glenn Morris <rgm@gnu.org>
9215
9216 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9217
9218 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9219
9220 Extend mouse support on W32 text-mode console.
9221 * xdisp.c (draw_row_with_mouse_face):
9222 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9223
9224 * w32console.c: Include window.h.
9225 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9226 New functions.
9227 (initialize_w32_display): Initialize mouse-highlight data.
9228
9229 * w32inevt.c: Include termchar.h and window.h.
9230 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9231 moves, call note_mouse_highlight. If help_echo changed, call
9232 gen_help_event to produce help-echo message in the echo area.
9233 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9234 highlight info.
9235
9236 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9237
9238 * lread.c (read1): Simplify slightly to avoid an overflow warning
9239 with GCC 4.7.0 on x86-64.
9240
9241 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9242
9243 * bidi.c (bidi_mirror_char): Revert last change: an int is
9244 definitely wide enough here.
9245
9246 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 Fix integer width and related bugs (Bug#9874).
9249 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9250 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9251 (string_bytes, check_sblock, allocate_string_data):
9252 (compact_small_strings, Fmake_bool_vector, make_string)
9253 (make_unibyte_string, make_multibyte_string)
9254 (make_string_from_bytes, make_specified_string)
9255 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9256 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9257 (mark_vectorlike):
9258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9259 (allocate_pseudovector):
9260 Use int, not EMACS_INT, where int is wide enough.
9261 (inhibit_garbage_collection, Fgarbage_collect):
9262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9263 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9264 int might not be wide enough.
9265 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9266 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9267 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9268 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9269 (bidi_level_of_next_char, bidi_move_to_visually_next):
9270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9271 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9272 (Fkill_buffer, Fset_buffer_major_mode)
9273 (advance_to_char_boundary, Fbuffer_swap_text)
9274 (Fset_buffer_multibyte, overlays_at, overlays_in)
9275 (overlay_touches_p, struct sortvec, record_overlay_string)
9276 (overlay_strings, recenter_overlay_lists)
9277 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9278 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9279 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9280 (Foverlay_recenter, last_overlay_modification_hooks_used)
9281 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9283 (validate_region): Omit unnecessary test for b <= e,
9284 since that's guaranteed by the previous test.
9285 (adjust_overlays_for_delete): Avoid pos + length overflow.
9286 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9287 (report_overlay_modification):
9288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9289 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9290 Omit pointer cast, which isn't needed anyway, and doesn't work
9291 after the EMACS_INT -> ptrdiff_t change.
9292 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9293 * buffer.h: Adjust decls to match defn changes elsewhere.
9294 (struct buffer_text, struct buffer):
9295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9296 Use EMACS_INT, not int, where int might not be wide enough.
9297 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9298 not int, to avoid needless 32-bit limit on 64-bit hosts.
9299 (exec_byte_code): Use tighter memory-full test, one that checks
9300 for alloca overflow. Don't compute the address of the object just
9301 before an array, as that's not portable. Use EMACS_INT, not
9302 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9303 * callint.c (Fcall_interactively):
9304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9305 * callproc.c (call_process_kill, Fcall_process):
9306 Don't assume pid_t fits into an Emacs fixnum.
9307 (call_process_cleanup, Fcall_process, child_setup):
9308 Don't assume pid_t fits into int.
9309 (call_process_cleanup, Fcall_process, delete_temp_file)
9310 (Fcall_process_region):
9311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9312 (Fcall_process): Simplify handling of volatile integers.
9313 Use int, not EMACS_INT, where int will do.
9314 * casefiddle.c (casify_object, casify_region, operate_on_word)
9315 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9317 (casify_object): Avoid integer overflow when overallocating buffer.
9318 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9319 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9320 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9321 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9322 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9323 integers are now checked earlier. All uses replaced with XINT.
9324 (ccl_driver):
9325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9326 For CCL_MapSingle, check that content and value are in int range.
9327 (ccl_driver, Fregister_code_conversion_map):
9328 Check that Vcode_version_map_vector is a vector.
9329 (resolve_symbol_ccl_program): Check that vector header is in range.
9330 Always copy the vector, so that we can check its contents reliably
9331 now rather than having to recheck each instruction as it's being
9332 executed. Check that vector words fit in 'int'.
9333 (ccl_get_compiled_code, Fregister_ccl_program)
9334 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9335 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9336 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9337 contents are in range.
9338 (Fccl_execute_on_string): Check that status is in range.
9339 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9340 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9341 Accept and return EMACS_INT, not int, because callers can pass values
9342 out of 'int' range.
9343 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9344 (multibyte_chars_in_text, parse_str_as_multibyte)
9345 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9346 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9347 (string_escape_byte8, Fget_byte):
9348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9349 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9350 avoid mishandling large integers.
9351 * character.h: Adjust decls to match defn changes elsewhere.
9352 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9353 (Ffind_charset_region):
9354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9355 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9356 (load_charset_map_from_vector, Fdefine_charset_internal):
9357 Don't assume fixnum fits in int.
9358 (load_charset_map_from_vector, Fmap_charset_chars):
9359 Remove now-unnecessary CHECK_NATNUMs.
9360 (Fdefine_charset_internal): Check ranges here, more carefully.
9361 Don't rely on undefined behavior with signed left shift overflow.
9362 Don't assume unsigned int fits into fixnum, or that fixnum fits
9363 into unsigned int. Don't require max_code to be a valid fixnum;
9364 that's not true for gb10830 4-byte on a 32-bit host. Allow
9365 invalid_code to be a cons, for the same reason. Require code_offset
9366 to be a character. Avoid int overflow if max_char is close
9367 to INT_MAX.
9368 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9369 this is intended anyway and avoids some undefined behavior.
9370 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9371 INDEX_TO_CODE_POINT, as that's what it expects.
9372 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9373 * charset.h (DECODE_CHAR): Return int, not unsigned;
9374 this is what was intended anyway, and it avoids undefined behavior.
9375 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9376 integer-overflow issues.
9377 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9378 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9379 where the argument is EMACS_INT, and this behavior is not intended.
9380 * chartab.c (Fmake_char_table, Fset_char_table_range)
9381 (uniprop_get_decoder, uniprop_get_encoder):
9382 Don't assume fixnum fits in int.
9383 * cmds.c (move_point): New function, that does the gist of
9384 Fforward_char and Fbackward_char, but does so while checking
9385 for integer overflow more accurately.
9386 (Fforward_char, Fbackward_char): Use it.
9387 (Fforward_line, Fend_of_line, internal_self_insert)
9388 (internal_self_insert):
9389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9390 Fix a FIXME, by checking for integer overflow when calculating
9391 target_clm and actual_clm.
9392 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9393 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9394 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9395 (coding_alloc_by_making_gap, alloc_destination)
9396 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9397 (encode_coding_utf_16, detect_coding_emacs_mule)
9398 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9399 (detect_coding_iso_2022, decode_coding_iso_2022)
9400 (encode_invocation_designation, encode_designation_at_bol)
9401 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9402 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9403 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9404 (encode_coding_ccl, encode_coding_raw_text)
9405 (detect_coding_charset, decode_coding_charset)
9406 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9407 (produce_composition, produce_charset, produce_annotation)
9408 (decode_coding, handle_composition_annotation)
9409 (handle_charset_annotation, consume_chars, decode_coding_gap)
9410 (decode_coding_object, encode_coding_object, detect_coding_system)
9411 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9412 (code_convert_region, code_convert_string)
9413 (Fdefine_coding_system_internal)
9414 (coding_set_source, coding_set_destination):
9415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9416 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9417 (Fdefine_coding_system_internal):
9418 Don't assume fixnums fit in int.
9419 (decode_coding_gap, decode_coding_object, encode_coding_object)
9420 (Fread_coding_system, Fdetect_coding_region)
9421 (Funencodable_char_position, Fcheck_coding_systems_region)
9422 (get_translation, handle_composition_annotation, consume_chars):
9423 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9424 (consume_chars): Rewrite to not calculate an address outside buffer.
9425 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9426 Don't access memory outside of the args array.
9427 (Fdefine_coding_system_internal): Check for charset-id overflow.
9428 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9429 result of ENCODE_CHAR.
9430 * coding.h: Adjust decls to match defn changes elsewhere.
9431 (struct coding_system):
9432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9433 * composite.c (get_composition_id, find_composition)
9434 (run_composition_function, update_compositions)
9435 (compose_text, composition_gstring_put_cache)
9436 (composition_gstring_p, composition_gstring_width)
9437 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9438 (composition_compute_stop_pos, composition_reseat_it)
9439 (composition_update_it, struct position_record)
9440 (find_automatic_composition, composition_adjust_point)
9441 (Fcomposition_get_gstring, Ffind_composition_internal):
9442 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9443 (update_compositions):
9444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9445 * composite.h: Adjust decls to match defn changes elsewhere.
9446 (struct composition):
9447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9448 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9449 Do not attempt to compute the address of the object just before a
9450 buffer; this is not portable.
9451 (Faref, Faset):
9452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9453 (Faset): Use int, not EMACS_INT, where int is wide enough.
9454 (Fstring_to_number): Don't assume fixnums fit in int.
9455 (Frem): Don't assume arg is nonnegative.
9456 * dbusbind.c (xd_append_arg): Check for integers out of range.
9457 (Fdbus_call_method): Don't overflow the timeout int.
9458 (extract_signed, extract_unsigned): New functions.
9459 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9460 (xd_get_connection_references): Return ptrdiff_t, not int.
9461 All uses changed.
9462 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9463 (xd_read_message_1):
9464 Use int, not unsigned, where the dbus API uses int.
9465 (Fdbus_message_internal): Don't overflow mtype.
9466 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9467 * dired.c (directory_files_internal, file_name_completion, scmp)
9468 (file_name_completion_stat):
9469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9470 (file_name_completion): Don't overflow matchcount.
9471 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9472 * dispextern.h: Adjust decls to match defn changes elsewhere.
9473 (struct text_pos, struct glyph, struct bidi_saved_info)
9474 (struct bidi_string_data, struct bidi_it, struct composition_it)
9475 (struct it):
9476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9477 (struct display_pos, struct composition_it, struct it):
9478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9479 * dispnew.c (increment_matrix_positions)
9480 (increment_row_positions, mode_line_string)
9481 (marginal_area_string):
9482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9483 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9484 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9485 (duration_to_sec_usec): New function, to check for overflow better.
9486 (Fsleep_for, sit_for): Use it.
9487 * doc.c (get_doc_string, store_function_docstring):
9488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9489 (get_doc_string, Fsnarf_documentation):
9490 Use int, not EMACS_INT, where int is wide enough.
9491 (get_doc_string):
9492 Use SAFE_ALLOCA, not alloca.
9493 Check for overflow when converting EMACS_INT to off_t.
9494 * doprnt.c (doprnt):
9495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9496 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9497 Don't assume uid_t fits into fixnum.
9498 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9499 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9500 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9501 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9502 (general_insert_function)
9503 (Finsert_char, make_buffer_string, make_buffer_string_both)
9504 (update_buffer_properties, Fbuffer_substring)
9505 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9506 (Fsubst_char_in_region, check_translation)
9507 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9508 (transpose_markers, Ftranspose_regions):
9509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9510 (clip_to_bounds): Move to lisp.h as an inline function).
9511 (Fconstrain_to_field): Don't assume integers are nonnegative.
9512 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9513 (Fsubst_char_in_region, Fsave_restriction):
9514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9515 (Femacs_pid): Don't assume pid_t fits into fixnum.
9516 (lo_time): Use int, not EMACS_INT, when int suffices.
9517 (lisp_time_argument): Check for usec out of range.
9518 (Fencode_time): Don't assume fixnum fits in int.
9519 (Fuser_login_name, Fuser_full_name): Signal an error
9520 if a uid argument is out of range, rather than relying on
9521 undefined behavior.
9522 (Fformat_time_string): Remove now-unnecessary check.
9523 lisp_time_argument checks for out-of-range usec now.
9524 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9525 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9526 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9527 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9528 (init_cmdargs, Fdump_emacs):
9529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9530 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9531 the bottom (typically) 32 bits of the fixnum.
9532 * eval.c (specpdl_size, call_debugger):
9533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9534 (when_entered_debugger, Fbacktrace_debug):
9535 Don't assume fixnum can fit in int.
9536 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9537 the object just before a buffer; this is not portable.
9538 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9539 (grow_specpdl, unbind_to):
9540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9541 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9542 (grow_specpdl): Simplify allocation by using xpalloc.
9543 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9544 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9545 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9547 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9548 (a_write, e_write):
9549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9550 (Fcopy_file, non_regular_nbytes, read_non_regular)
9551 (Finsert_file_contents):
9552 Use int, not EMACS_INT, where int is wide enough.
9553 (READ_BUF_SIZE): Verify that it fits in int.
9554 (Finsert_file_contents): Check that counts are in proper range,
9555 rather than assuming fixnums fit into ptrdiff_t etc.
9556 Don't assume fixnums fit into int.
9557 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9558 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9559 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9560 (string_char_to_byte, string_byte_to_char)
9561 (string_make_multibyte, string_to_multibyte)
9562 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9563 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9564 (substring_both, Fdelete, internal_equal, Ffillarray)
9565 (Fclear_string, mapcar1)
9566 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9567 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9568 (larger_vector, make_hash_table, maybe_resize_hash_table)
9569 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9570 (Fmaphash, secure_hash):
9571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9572 (concat): Check for string index and length overflow.
9573 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9574 (Frequire):
9575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9576 (larger_vector): New API (vec, incr_min, size_max) replaces old
9577 one (vec, new_size, init). This catches size overflow.
9578 INIT was removed because it was always Qnil.
9579 All callers changed.
9580 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9581 the upper bound on a hash table index size.
9582 (make_hash_table, maybe_resize_hash_table): Use it.
9583 (secure_hash): Computer start_byte and end_byte only after
9584 they're known to be in ptrdiff_t range.
9585 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9586 (Ffont_get_glyphs, Ffont_at):
9587 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9588 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9589 (Flist_fonts, Fopen_font):
9590 Don't assume fixnum can fit in int.
9591 (check_gstring): Don't assume index can fit in int.
9592 (font_match_p): Check that fixnum is a character, not a nonnegative
9593 fixnum, since the later code needs to stuff it into an int.
9594 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9595 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9596 conversion overflow issues.
9597 (Fopen_font): Check for integer out of range.
9598 (Ffont_get_glyphs): Don't assume index can fit in int.
9599 * font.h: Adjust decls to match defn changes elsewhere.
9600 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9601 integer overflow.
9602 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9603 printmax_t, where ptrdiff_t is wide enough.
9604 (Finternal_char_font):
9605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9606 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9607 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9608 (Fset_frame_position, x_set_frame_parameters)
9609 (x_set_line_spacing, x_set_border_width)
9610 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9611 Check that fixnums are in proper range for system types.
9612 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9614 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9615 Use SAFE_ALLOCA_LISP, not alloca.
9616 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9617 intptr_t is wide enough.
9618 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9619 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9620 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9621 Check for fixnum out of range.
9622 * ftfont.c (ftfont_list): Don't assume index fits in int.
9623 Check that fixnums are in proper range for system types.
9624 (ftfont_shape_by_flt):
9625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9626 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9628 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9629 Check that fixnums are in proper range for system types.
9630 * gnutls.h: Adjust decls to match defn changes elsewhere.
9631 * gtkutil.c (xg_dialog_run):
9632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9633 (update_frame_tool_bar):
9634 Check that fixnums are in proper range for system types.
9635 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9636 (lookup_image): Check that fixnums are in range for system types.
9637 * indent.c (last_known_column, last_known_column_point):
9638 (current_column_bol_cache):
9639 (skip_invisible, current_column, check_display_width):
9640 (check_display_width, scan_for_column, current_column_1)
9641 (Findent_to, Fcurrent_indentation, position_indentation)
9642 (indented_beyond_p, Fmove_to_column, compute_motion):
9643 (Fcompute_motion, Fvertical_motion):
9644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9645 (last_known_column_modified): Use EMACS_INT, not int.
9646 (check_display_width):
9647 (Fcompute_motion):
9648 Check that fixnums and floats are in proper range for system types.
9649 (compute_motion): Don't assume index or fixnum fits in int.
9650 (compute_motion, Fcompute_motion):
9651 Use int, not EMACS_INT, when it is wide enough.
9652 (vmotion): Omit local var start_hpos that is always 0; that way
9653 we don't need to worry about overflow in expressions involving it.
9654 * indent.h: Adjust decls to match defn changes elsewhere.
9655 (struct position):
9656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9657 Use int, not EMACS_INT, where int is wide enough.
9658 Remove unused members ovstring_chars_done and tab_offset;
9659 all uses removed.
9660 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9661 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9662 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9663 (make_gap, copy_text, insert, insert_and_inherit)
9664 (insert_before_markers, insert_before_markers_and_inherit)
9665 (insert_1, count_combining_before, count_combining_after)
9666 (insert_1_both, insert_from_string)
9667 (insert_from_string_before_markers, insert_from_string_1)
9668 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9669 (adjust_after_replace, adjust_after_insert, replace_range)
9670 (replace_range_2, del_range, del_range_1, del_range_byte)
9671 (del_range_both, del_range_2, modify_region)
9672 (prepare_to_modify_buffer, signal_before_change)
9673 (signal_after_change, Fcombine_after_change_execute):
9674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9675 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9676 (balance_an_interval, split_interval_right, split_interval_left)
9677 (find_interval, next_interval, update_interval)
9678 (adjust_intervals_for_insertion, delete_node, delete_interval)
9679 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9680 (static_offset_intervals, offset_intervals)
9681 (merge_interval_right, merge_interval_left, make_new_interval)
9682 (graft_intervals_into_buffer, temp_set_point_both)
9683 (temp_set_point, set_point, adjust_for_invis_intang)
9684 (set_point_both, move_if_not_intangible, get_property_and_range)
9685 (get_local_map, copy_intervals, copy_intervals_to_string)
9686 (compare_string_intervals, set_intervals_multibyte_1):
9687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9688 * intervals.h: Adjust decls to match defn changes elsewhere.
9689 (struct interval):
9690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9691 * keyboard.c (this_command_key_count, this_single_command_key_start)
9692 (before_command_key_count, before_command_echo_length, echo_now)
9693 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9694 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9695 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9696 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9698 (last_non_minibuf_size, last_point_position, echo_truncate)
9699 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9700 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9701 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9702 (stuff_buffered_input):
9703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9704 (last_auto_save, command_loop_1, read_char):
9705 Use EMACS_INT, not int, to avoid integer overflow.
9706 (record_char): Avoid overflow in total_keys computation.
9707 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9708 * keyboard.h: Adjust decls to match defn changes elsewhere.
9709 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9710 (Fkey_description, Fdescribe_vector, Flookup_key):
9711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9712 (click_position): New function, to check that positions are in range.
9713 (Fcurrent_active_maps):
9714 (describe_command):
9715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9716 (Faccessible_keymaps, Fkey_description):
9717 (preferred_sequence_p):
9718 Don't assume fixnum can fit into int.
9719 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9720 Check for integer overflow in size calculations.
9721 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9722 avoid mishandling large integers.
9723 * lisp.h: Adjust decls to match defn changes elsewhere.
9724 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9725 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9726 (struct Lisp_Marker):
9727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9728 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9729 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9730 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9731 All callers changed.
9732 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9733 Assume the arg has valid form, since it always does.
9734 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9735 unsigned integer system type.
9736 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9737 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9739 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9740 (duration_to_sec_usec): New decl.
9741 * lread.c (read_from_string_index, read_from_string_index_byte)
9742 (read_from_string_limit, readchar, unreadchar, openp)
9743 (read_internal_start, read1, oblookup):
9744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9745 (Fload, readevalloop, Feval_buffer, Feval_region):
9746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9747 (openp): Check for out-of-range argument to 'access'.
9748 (read1): Use int, not EMACS_INT, where int is wide enough.
9749 Don't assume fixnum fits into int.
9750 Fix off-by-one error that can read outside a buffer.
9751 (read_filtered_event): Use duration_to_sec_usec
9752 to do proper overflow checking on durations.
9753 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9754 in size calculation.
9755 (Fexecute_kbd_macro):
9756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9757 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9758 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9759 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9760 (set_marker_both, set_marker_restricted_both, marker_position)
9761 (marker_byte_position, Fbuffer_has_markers_at):
9762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9763 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9764 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9765 It now merely ensures that the menu is large enough, without
9766 necessarily growing it, as this avoids some integer overflow issues.
9767 All callers changed.
9768 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9770 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9771 Use SAFE_ALLOCA_LISP, not alloca.
9772 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9773 to EMACS_INT. Check that fixnums are in proper range for system types.
9774 * minibuf.c (minibuf_prompt_width, string_to_object)
9775 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9776 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9778 (get_minibuffer, read_minibuf_unwind):
9779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9780 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9781 this simplifies overflow checking. All callers changed.
9782 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9783 (Ftest_completion):
9784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9785 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9786 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9787 Check that fixnums are in proper range for system types.
9788 (Fx_create_frame, Fx_show_tip):
9789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9790 * nsfont.m (ns_findfonts, nsfont_list_family):
9791 Don't assume fixnum fits in long.
9792 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9794 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9795 wide enough.
9796 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9798 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9799 (PRINTDECLARE, PRINTPREPARE):
9800 (strout, print_string):
9801 (print, print_preprocess, print_check_string_charset_prop)
9802 (print_object):
9803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9804 (PRINTDECLARE):
9805 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9807 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9808 (printchar, strout): Use xpalloc to catch size calculation overflow.
9809 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9810 (print_error_message): Use SAFE_ALLOCA, not alloca.
9811 (print_object): Use int, not EMACS_INT, where int is wide enough.
9812 (print_depth, new_backquote_output, print_number_index):
9813 Use ptrdiff_t, not int, where int might not be wide enough.
9814 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9815 (Fset_process_window_size, Fformat_network_address)
9816 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9817 (sigchld_handler):
9818 Check that fixnums are in proper range for system types.
9819 (Fsignal_process): Simplify by avoiding a goto.
9820 Check for process-ids out of pid_t range rather than relying on
9821 undefined behavior.
9822 (process_tick, update_tick): Use EMACS_INT, not int.
9823 (Fformat_network_address, read_process_output, send_process)
9824 (Fprocess_send_region, status_notify):
9825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9826 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9827 (wait_reading_process_output, read_process_output, exec_sentinel):
9828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9829 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9830 (Faccept_process_output): Use duration_to_sec_usec to do proper
9831 overflow checking on durations.
9832 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9833 Don't assume pid_t fits in int.
9834 * process.h (struct Lisp_Process): Members tick and update_tick
9835 are now of type EMACS_INT, not int.
9836 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9837 configured --with-wide-int.
9838 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9839 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9840 * search.c (looking_at_1, string_match_1):
9841 (fast_string_match, fast_c_string_match_ignore_case)
9842 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9843 (scan_newline, find_before_next_newline, search_command)
9844 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9845 (set_search_regs, wordify):
9846 (Freplace_match):
9847 (Fmatch_data):
9848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9849 (string_match_1, search_buffer, set_search_regs):
9850 (Fmatch_data):
9851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9852 (wordify): Check for overflow in size calculation.
9853 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9854 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9855 Check that fixnums are in proper range for system types.
9856 * sound.c (struct sound_device)
9857 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9859 (Fplay_sound_internal):
9860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9861 * syntax.c (struct lisp_parse_state, find_start_modiff)
9862 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9863 (Fparse_partial_sexp):
9864 Don't assume fixnums can fit in int.
9865 (struct lisp_parse_state, find_start_pos, find_start_value)
9866 (find_start_value_byte, find_start_begv)
9867 (update_syntax_table, char_quoted, dec_bytepos)
9868 (find_defun_start, prev_char_comend_first, back_comment):
9869 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9870 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9872 (Finternal_describe_syntax_value): Check that match_lisp is a
9873 character, not an integer, since the code stuffs it into int.
9874 (scan_words, scan_sexps_forward):
9875 Check that fixnums are in proper range for system types.
9876 (Fforward_word):
9877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9878 (scan_sexps_forward):
9879 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9880 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9881 * syntax.h: Adjust decls to match defn changes elsewhere.
9882 (struct gl_state_s):
9883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9884 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9885 MOST_POSITIVE_FIXNUM.
9886 * sysdep.c (wait_for_termination_1, wait_for_termination)
9887 (interruptible_wait_for_termination, mkdir):
9888 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9889 (emacs_read, emacs_write):
9890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9891 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9892 and double all fit in int.
9893 * term.c (set_tty_color_mode):
9894 Check that fixnums are in proper range for system types.
9895 * termhooks.h (struct input_event):
9896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9897 * textprop.c (validate_interval_range, interval_of)
9898 (Fadd_text_properties, set_text_properties_1)
9899 (Fremove_text_properties, Fremove_list_of_text_properties)
9900 (Ftext_property_any, Ftext_property_not_all)
9901 (copy_text_properties, text_property_list, extend_property_ranges)
9902 (verify_interval_modification):
9903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9904 (Fnext_single_char_property_change)
9905 (Fprevious_single_char_property_change):
9906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9907 (copy_text_properties):
9908 Check for integer overflow in index calculation.
9909 * undo.c (last_boundary_position, record_point, record_insert)
9910 (record_delete, record_marker_adjustment, record_change)
9911 (record_property_change):
9912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9913 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9915 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9916 (Fx_hide_tip, Fx_file_dialog):
9917 * w32menu.c (set_frame_menubar):
9918 Use ptrdiff_t, not int, for consistency with rest of code.
9919 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9920 (select_window, Fdelete_other_windows_internal)
9921 (window_scroll_pixel_based, window_scroll_line_based)
9922 (Frecenter, Fset_window_configuration):
9923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9924 (Fset_window_hscroll, run_window_configuration_change_hook)
9925 (set_window_buffer, temp_output_buffer_show, scroll_command)
9926 (Fscroll_other_window, Frecenter):
9927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9928 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9929 Don't assume fixnum fits in int.
9930 (Fset_window_scroll_bars):
9931 Check that fixnums are in proper range for system types.
9932 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9933 (string_pos, c_string_pos, number_of_chars, init_iterator)
9934 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9935 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9936 (compute_display_string_end, handle_face_prop)
9937 (face_before_or_after_it_pos, handle_invisible_prop)
9938 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9939 (display_prop_intangible_p, string_buffer_position_lim)
9940 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9941 (get_overlay_strings_1, get_overlay_strings)
9942 (iterate_out_of_display_property, forward_to_next_line_start)
9943 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9944 (get_next_display_element, set_iterator_to_next)
9945 (get_visually_first_element, compute_stop_pos_backwards)
9946 (handle_stop_backwards, next_element_from_buffer)
9947 (move_it_in_display_line_to, move_it_in_display_line)
9948 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9949 (add_to_log, message_dolog, message_log_check_duplicate)
9950 (message2, message2_nolog, message3, message3_nolog
9951 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9952 (current_message_1, truncate_echo_area, truncate_message_1)
9953 (set_message, set_message_1, store_mode_line_noprop)
9954 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9955 (text_outside_line_unchanged_p, check_point_in_composition)
9956 (reconsider_clip_changes)
9957 (redisplay_internal, set_cursor_from_row, try_scrolling)
9958 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9959 (redisplay_window, find_last_unchanged_at_beg_row)
9960 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9961 (trailing_whitespace_p, find_row_edges, display_line)
9962 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9963 (display_mode_element, store_mode_line_string)
9964 (pint2str, pint2hrstr, decode_mode_spec)
9965 (display_count_lines, display_string, draw_glyphs)
9966 (x_produce_glyphs, x_insert_glyphs)
9967 (rows_from_pos_range, mouse_face_from_buffer_pos)
9968 (fast_find_string_pos, mouse_face_from_string_pos)
9969 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9971 (safe_call, init_from_display_pos, handle_fontified_prop)
9972 (handle_single_display_spec, load_overlay_strings)
9973 (with_echo_area_buffer, setup_echo_area_for_printing)
9974 (display_echo_area, echo_area_display)
9975 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9976 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9977 (redisplay_window, dump_glyph_row, display_mode_line)
9978 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9979 (handle_display_spec, display_prop_string_p):
9980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9981 (handle_single_display_spec, build_desired_tool_bar_string)
9982 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9983 (get_specified_cursor_type):
9984 Check that fixnums are in proper range for system types.
9985 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9986 (Flookup_image_map):
9987 Don't assume fixnums fit in int.
9988 (compare_overlay_entries):
9989 Avoid mishandling comparisons due to subtraction overflow.
9990 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9991 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9992 (handle_tool_bar_click):
9993 Use int, not unsigned, since we prefer signed and the signedness
9994 doesn't matter here.
9995 (get_next_display_element, next_element_from_display_vector):
9996 Use int, not EMACS_INT, when int is wide enough.
9997 (start_hourglass): Use duration_to_sec_usec to do proper
9998 overflow checking on durations.
9999 * xfaces.c (Fbitmap_spec_p):
10000 Check that fixnums are in proper range for system types.
10001 (compare_fonts_by_sort_order):
10002 Avoid mishandling comparisons due to subtraction overflow.
10003 (Fx_family_fonts, realize_basic_faces):
10004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10005 (Fx_family_fonts):
10006 Don't assume fixnum fits in int.
10007 Use SAFE_ALLOCA_LISP, not alloca.
10008 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10009 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10010 (face_at_buffer_position, face_for_overlay_string)
10011 (face_at_string_position):
10012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10013 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10014 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10015 (Fx_show_tip):
10016 Check that fixnums are in proper range for system types.
10017 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10018 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10019 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10020 (Fx_change_window_property): Don't assume fixnums fit in int.
10021 * xfont.c (xfont_chars_supported):
10022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10023 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10024 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10026 * xml.c (parse_region):
10027 * xrdb.c (magic_file_p):
10028 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10029 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10030 (x_get_local_selection, x_reply_selection_request)
10031 (x_handle_selection_request, wait_for_property_change):
10032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10033 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10034 short is wide enough.
10035 (x_send_client_event): Don't assume fixnum fits in int.
10036 * xterm.c (x_x_to_emacs_modifiers):
10037 Don't assume EMACS_INT overflows nicely into int.
10038 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10039 may come from Lisp.
10040 (handle_one_xevent): NATNUMP can eval its arg twice.
10041 (x_connection_closed):
10042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10043 * xterm.h: Adjust decls to match defn changes elsewhere.
10044 (struct scroll_bar): Use struct vectorlike_header
10045 rather than rolling our own approximation.
10046 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10047
10048 2012-05-25 Glenn Morris <rgm@gnu.org>
10049
10050 * lisp.mk (lisp): Update for more files being compiled now.
10051
10052 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10053
10054 * lread.c: Remove `read_pure' which makes no difference.
10055 (read_pure): Remove var.
10056 (unreadpure): Remove function.
10057 (readevalloop): Don't call read_list with -1 flag.
10058 (read1, read_vector): Don't test read_pure any more.
10059 (read_list): Simplify.
10060
10061 * fileio.c, character.h: Minor style tweaks.
10062
10063 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10064
10065 * window.h (clip_changed): Remove useless declaration.
10066
10067 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10068
10069 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10070 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10071
10072 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10073
10074 Remove src/m/*.
10075 This directory predates autoconf and is no longer needed nowadays.
10076 Move its few remaining bits of functionality to where they're needed.
10077 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10078 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10079 * m/template.h: Remove.
10080 * Makefile.in (M_FILE): Remove. All uses removed.
10081 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10082 * lisp.h (USE_LSB_TAG):
10083 * mem-limits.h (EXCEEDS_LISP_PTR):
10084 Use VAL_MAX, not VALBITS, in #if.
10085 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10086 (EMACS_UINT): Define unconditionally now.
10087 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10088 (BITS_PER_EMACS_INT): New constants, replacing
10089 what used to be in config.h, but not useful in #if.
10090 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10091 define them any more.
10092 (VAL_MAX): New macro.
10093 (VALMASK): Use it.
10094 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10095 BITS_PER_EMACS_INT, in #if.
10096 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10097 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10098 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10099 * s/ms-w32.h (DATA_START):
10100 Move here from removed file m/intel386.h.
10101 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10102 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10103
10104 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10105
10106 Assume C89 or later.
10107 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10108 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10109 (xrealloc):
10110 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10111 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10112 * textprop.c, tparam.c (NULL): Remove.
10113 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10114 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10115 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10116 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10117 * xterm.c (input_signal_count): Assume volatile works.
10118
10119 2012-05-21 Ken Brown <kbrown@cornell.edu>
10120
10121 * xgselect.c (xg_select): Fix first argument in call to 'select'
10122 (bug#11508).
10123
10124 2012-05-20 Ken Brown <kbrown@cornell.edu>
10125
10126 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10127 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10128
10129 2012-05-19 Ken Brown <kbrown@cornell.edu>
10130
10131 * xfns.c (x_in_use): Remove `static' qualifier.
10132 * xterm.h (x_in_use): Declare.
10133 * xgselect.c: Include xterm.h.
10134 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10135 and `display_arg' (bug#9754).
10136
10137 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10138
10139 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10140
10141 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10142 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10143
10144 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10145
10146 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10147
10148 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10149 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10150
10151 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10152 reference to image_cache->refcount.
10153 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10154
10155 2012-05-17 Juri Linkov <juri@jurta.org>
10156
10157 * search.c (Fword_search_regexp, Fword_search_backward)
10158 (Fword_search_forward, Fword_search_backward_lax)
10159 (Fword_search_forward_lax): Move functions to isearch.el
10160 (bug#10145, bug#11381).
10161
10162 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10163
10164 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10165
10166 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10167
10168 * lread.c (init_obarray): Declare Qt and Qnil as special.
10169
10170 2012-05-14 Glenn Morris <rgm@gnu.org>
10171
10172 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10173 Put "libexec" before "bin", for the sake of init_callproc_1.
10174
10175 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10176
10177 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10178
10179 * unexaix.c: Port to more-recent AIX compilers.
10180 (report_error, report_error_1, make_hdr, copy_sym)
10181 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10182 Make arguments const char *, not char *, to avoid violations of C
10183 standard and to fix some AIX warnings reported by Gilles Pion.
10184
10185 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10186
10187 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10188 already have overlays loaded.
10189 (handle_single_display_spec): Before returning without displaying
10190 fringe bitmap, synchronize the bidi iterator with the main display
10191 iterator, by calling iterate_out_of_display_property.
10192 (iterate_out_of_display_property): Detect buffer iteration by
10193 testing that it->string is a Lisp string.
10194 (get_next_display_element): When the current object is exhausted,
10195 and there's something on it->stack, call set_iterator_to_next to
10196 proceed with what's on the stack, instead of returning zero.
10197 (set_iterator_to_next): If called at the end of a Lisp string,
10198 proceed to consider_string_end without incrementing string
10199 position. Don't increment display vector index past the end of
10200 the display vector. (Bug#11417)
10201 (pos_visible_p): Don't report a position visible when move_it_to
10202 stopped at the last line of window, which happens to be scanned
10203 backwards by the bidi iteration. (Bug#11464)
10204
10205 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10206
10207 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10208 and right-margin display specs even if the spec is invalid or we
10209 are on a TTY, and thus unable to display on the fringes.
10210 That's because the text with the property will not be displayed anyway,
10211 so we need to signal to the caller that this is a "replacing"
10212 display spec. This fixes display when the spec is invalid or we
10213 are on a TTY.
10214
10215 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10216
10217 * unexaix.c (make_hdr): Fix typo in prototype.
10218 This bug broke the build on AIX. Problem reported by Gilles Pion.
10219
10220 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10221
10222 * keyboard.c (kbd_buffer_get_event): Read special events also in
10223 batch mode. (Bug#11415)
10224
10225 2012-05-12 Glenn Morris <rgm@gnu.org>
10226
10227 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10228
10229 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10230
10231 * lisp.mk (lisp): Add newcomment.elc.
10232
10233 2012-05-12 Glenn Morris <rgm@gnu.org>
10234
10235 * Makefile.in (MKDIR_P): New, set by configure.
10236 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10237
10238 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10239
10240 Remove unused function hourglass_started.
10241 * dispextern.h (hourglass_started):
10242 * w32fns.c (hourglass_started):
10243 * xdisp.c (hourglass_started): Remove.
10244
10245 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10246
10247 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10248 Update dependencies.
10249
10250 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10251
10252 * xgselect.c (xg_select): Put maxfds+1 into a var.
10253 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10254
10255 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10256
10257 2012-05-10 Dave Abrahams <dave@boostpro.com>
10258
10259 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10260 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10261
10262 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10263
10264 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10265 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10266 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10267 Initialize xd_registered_buses.
10268
10269 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 Untag more efficiently if USE_LSB_TAG.
10272 This is based on a proposal by YAMAMOTO Mitsuharu in
10273 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10274 For an admittedly artificial (nth 8000 longlist) benchmark on
10275 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10276 Emacs's overall text size by 1%.
10277 * lisp.h (XUNTAG): New macro.
10278 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10279 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10280 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10281 * eval.c (Fautoload):
10282 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10283 * frame.h (XFRAME): Use XUNTAG.
10284
10285 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10286 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10287 Remove unportable assumptions about print widths of types like
10288 dbus_uint32_t.
10289 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10290 intptr_t when converting between pointer and integer, to avoid GCC
10291 warnings about wrong width.
10292
10293 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10294
10295 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10296 stack for each reader_thread, instead of defaulting to 8MB
10297 determined by the linker. This avoids failures in creating
10298 subprocesses on Windows 7, see the discussion in this thread:
10299 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10300
10301 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10302
10303 Fix up display of the *Minibuf-0* buffer in the mini window.
10304 * keyboard.c (read_char): Don't clear the echo area if there's no
10305 message to clear.
10306 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10307 contents of *Minibuf-0*) if there's no message displayed in its stead.
10308
10309 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10310
10311 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10312 batch mode.
10313
10314 2012-05-06 Chong Yidong <cyd@gnu.org>
10315
10316 * lisp.mk (lisp): Update.
10317
10318 2012-05-05 Jim Meyering <meyering@redhat.com>
10319
10320 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10321
10322 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10323
10324 * data.c (PUT_ERROR): New macro.
10325 (syms_of_data): Use it. Add new error type `user-error'.
10326 * undo.c (user_error): New function.
10327 (Fprimitive_undo): Use it.
10328 * print.c (print_error_message): Adjust print style for `user-error'.
10329 * keyboard.c (user_error): New function.
10330 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10331
10332 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10333
10334 Do not limit current-time-string to years 1000..9999.
10335 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10336 (Fcurrent_time_string): Support any year that is supported by the
10337 underlying localtime representation. Don't use asctime, as it
10338 has undefined behavior for years outside the range -999..9999.
10339
10340 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10341
10342 Fix race conditions involving setenv, gmtime, localtime, asctime.
10343 Without this fix, interrupts could mess up code that uses these
10344 nonreentrant functions, since setting TZ invalidates existing
10345 tm_zone or tzname values, and since most of these functions return
10346 pointers to static storage.
10347 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10348 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10349 Grow the critical sections to include not just invoking
10350 localtime/gmtime, but also accessing these functions' results
10351 including their tm_zone values if any, and any related TZ setting.
10352 (format_time_string): Last arg is now struct tm *, not struct tm **,
10353 so that the struct tm is saved in the critical section.
10354 All callers changed. Simplify allocation of initial buffer, partly
10355 motivated by the fact that memory allocation needs to be outside
10356 the critical section.
10357
10358 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10359
10360 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10361 with RESET_INTERVAL.
10362
10363 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10364 Remove duplicated buffer name initialization.
10365
10366 2012-05-02 Jim Meyering <jim@meyering.net>
10367
10368 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10369
10370 * xfns.c (x_window): Use xstrdup (Bug#11375).
10371
10372 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10373
10374 * xdisp.c (pos_visible_p): If already at a newline from the
10375 display string before the 'while' loop, don't walk back the glyphs
10376 from it3.glyph_row. Solves assertion violation when the display
10377 string begins with a newline (egg.el). (Bug#11367)
10378
10379 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10380
10381 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10382 Move to simple.el.
10383
10384 2012-05-01 Glenn Morris <rgm@gnu.org>
10385
10386 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10387 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10388 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10389 All were removed before 23.1.
10390
10391 * dispnew.c: Remove HAVE_LIBNCURSES test;
10392 it is always true on relevant platforms.
10393
10394 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10395 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10396
10397 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10398
10399 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10400
10401 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10402 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10403 Remove.
10404
10405 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10406
10407 Do not avoid creating empty evaporating overlays (Bug#9642).
10408 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10409 That is, do not delete an evaporating overlay if it becomes
10410 empty after its bounds are adjusted to fit within its buffer.
10411 This fix caused other problems, and I'm reverting it until we get
10412 to the bottom of them.
10413
10414 2012-04-27 Chong Yidong <cyd@gnu.org>
10415
10416 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10417
10418 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10419
10420 * xdisp.c (pos_visible_p): If the window start position is beyond
10421 ZV, start the display from buffer beginning. Prevents assertion
10422 violation in init_iterator when the minibuffer window is scrolled
10423 via the scroll bar.
10424
10425 * window.c (window_scroll_pixel_based): Likewise.
10426
10427 2012-04-27 Chong Yidong <cyd@gnu.org>
10428
10429 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10430
10431 2012-04-27 Glenn Morris <rgm@gnu.org>
10432
10433 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10434 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10435
10436 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10437
10438 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10439 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10440
10441 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10442
10443 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10444 display element, check also the underlying string or buffer
10445 character. (Bug#11341)
10446
10447 * w32menu.c: Include w32heap.h.
10448 (add_menu_item): If the call to AppendMenuW (via
10449 unicode_append_menu) fails, disable Unicode menus only if we are
10450 running on Windows 9X/Me.
10451
10452 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10453
10454 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10455 (xgetint): Add missing shift for LSB tags.
10456
10457 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10458
10459 * keyboard.c (read_char): Don't wipe echo area for select window
10460 events: These might get delayed via `mouse-autoselect-window'
10461 (Bug#11304).
10462
10463 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10464
10465 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10466 manipulation of :loaded-from data.
10467
10468 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10469
10470 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10471 now a cons (bug#11311).
10472
10473 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10474
10475 Do not create empty overlays with the evaporate property (Bug#9642).
10476 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10477 if it becomes empty after its bounds are adjusted to fit within
10478 its buffer. Without this fix, in a nonempty buffer (let ((o
10479 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10480 yields an empty overlay that has the evaporate property, which is
10481 not supposed to happen.
10482
10483 Fix minor GTK3 problems found by static checking.
10484 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10485 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10486 (struct _EmacsFixedClass, emacs_fixed_get_type):
10487 Move decls here from emacsgtkfixed.h, since they needn't be public.
10488 (emacs_fixed_get_type): Now static.
10489 (emacs_fixed_class_init): Omit unused local.
10490 (emacs_fixed_child_type): Remove; unused.
10491 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10492 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10493 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10494 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10495 (EMACS_FIXED_GET_CLASS): Remove; unused.
10496 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10497
10498 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10499 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10500
10501 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10502
10503 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10504 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10505 (__malloc_size_t, __malloc_ptrdiff_t):
10506 Remove. All uses removed, replaced by the definiens if needed,
10507 since we can assume C89 or better now.
10508 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10509 (protect_malloc_state, align, get_contiguous_space)
10510 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10511 (malloc_atfork_handler_child, malloc_enable_thread)
10512 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10513 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10514 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10515 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10516 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10517 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10518 Define using prototypes, not old style.
10519 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10520 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10521 (align): Don't assume that signed integer overflow wraps around.
10522 Omit unused local var.
10523 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10524 (_free_internal_nolock, memalign, mallochook, reallochook):
10525 Omit no-longer-needed casts.
10526 (valloc): Use getpagesize, not __getpagesize.
10527 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10528 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10529
10530 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10531
10532 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10533
10534 Move functions from C to Lisp. Make non-blocking method calls
10535 the default. Implement further D-Bus standard interfaces.
10536
10537 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10538 (QCdbus_request_name_allow_replacement)
10539 (QCdbus_request_name_replace_existing)
10540 (QCdbus_request_name_do_not_queue)
10541 (QCdbus_request_name_reply_primary_owner)
10542 (QCdbus_request_name_reply_in_queue)
10543 (QCdbus_request_name_reply_exists)
10544 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10545 (QCdbus_registered_serial, QCdbus_registered_method)
10546 (QCdbus_registered_signal): New Lisp objects.
10547 (XD_DEBUG_MESSAGE): Use sizeof.
10548 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10549 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10550 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10551 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10552 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10553 (xd_signature, xd_append_arg): Allow float for integer types.
10554 (xd_get_connection_references): New function.
10555 (xd_get_connection_address): Rename from xd_initialize.
10556 Return cached address.
10557 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10558 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10559 level.
10560 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10561 Return number of refcounts.
10562 (Fdbus_get_unique_name): Make stronger parameter check.
10563 (Fdbus_message_internal): New defun.
10564 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10565 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10566 (Fdbus_send_signal, Fdbus_register_service)
10567 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10568 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10569 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10570 (Vdbus_compiled_version, Vdbus_runtime_version)
10571 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10572 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10573 (Vdbus_message_type_signal): New defvars.
10574 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10575 Adapt docstring.
10576
10577 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10578
10579 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10580 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10581 Do not assume ptrdiff_t is the same width as 'int'.
10582
10583 * alloc.c: Handle unusual debugging option combinations.
10584 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10585 since the two debugging options are incompatible.
10586 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10587 is defined.
10588 (mem_init, mem_insert, mem_insert_fixup):
10589 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10590 (NEED_MEM_INSERT): Remove; no longer needed.
10591
10592 2012-04-22 Leo Liu <sdl.web@gmail.com>
10593
10594 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10595
10596 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10597
10598 * sysdep.c [__FreeBSD__]: Minor cleanups.
10599 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10600 Use Emacs indenting style more consistently. Avoid some casts.
10601 Use 'double' consistently rather than mixing 'float' and 'double'.
10602
10603 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10604
10605 * sysdep.c (list_system_processes, system_process_attributes):
10606 Add implementation for FreeBSD (Bug#5243).
10607
10608 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10609
10610 * lisp.mk (lisp): Update.
10611
10612 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10615 It is never used otherwise.
10616
10617 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10618
10619 * print.c (print_preprocess): Only check print_depth if print-circle
10620 is nil.
10621 (print_object): Check for cycles even when print-circle is nil and
10622 print-gensym is t, but only check print_depth if print-circle is nil.
10623
10624 2012-04-20 Chong Yidong <cyd@gnu.org>
10625
10626 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10627 set the status to "failed" and ensure that sentinel is run.
10628
10629 2012-04-20 Glenn Morris <rgm@gnu.org>
10630
10631 * process.c (Fset_process_inherit_coding_system_flag)
10632 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10633 (Fmake_network_process, Fmake_serial_process): Doc fix.
10634
10635 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10636
10637 * xdisp.c (string_buffer_position_lim): Limit starting position to
10638 BEGV.
10639 (set_cursor_from_row): If called for a mode-line or header-line
10640 row, return zero immediately.
10641 (try_cursor_movement): If inside continuation line, don't back up
10642 farther than the first row after the header line, if any.
10643 Don't consider the header-line row as "partially visible", even if
10644 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10645
10646 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10647
10648 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10649 (bug#11238).
10650
10651 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10652 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 configure: new option --enable-gcc-warnings (Bug#11207)
10655 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10656 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10657 (ALL_CFLAGS): Use new macros rather than old.
10658 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10659 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10660 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10661 -Wunused-result, -Wunused-variable. This should go away once
10662 the Emacs and Gnulib regex code is merged.
10663 (xmalloc, xrealloc): Now static.
10664
10665 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10666
10667 * dired.c (Fsystem_groups): Remove unused local.
10668
10669 2012-04-17 Glenn Morris <rgm@gnu.org>
10670
10671 * dired.c (Fsystem_users): Doc fix.
10672
10673 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10674
10675 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10676 (syms_of_dired): Add them.
10677
10678 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 Fix minor alloc.c problems found by static checking.
10681 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10682 New extern decls, to avoid calling undeclared functions.
10683 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10684 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10685 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10686 (NEED_MEM_INSERT): New macro.
10687 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10688 Remove one incorrect comment and fix another.
10689
10690 Fix minor ralloc.c problems found by static checking.
10691 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10692 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10693 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10694 (r_alloc_sbrk): Now static.
10695
10696 Improve ralloc.c interface checking.
10697 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10698 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10699 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10700 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10701 [REL_ALLOC]: ... to here, to check interface.
10702 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10703 Remove decls. This fixes an "It stinks!".
10704
10705 * alloc.c (which_symbols): Fix alignment issue / type clash.
10706
10707 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10708
10709 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10710 (struct Lisp_Misc_Any): Likewise.
10711 (struct Lisp_Free): Likewise.
10712 * alloc.c (union aligned_Lisp_Symbol): Define.
10713 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10714 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10715 (union aligned_Lisp_Misc): Define.
10716 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10717 aligned_Lisp_Misc instead of union Lisp_Misc.
10718 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10719
10720 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10721
10722 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10723 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10724 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10725 * s/netbsd.h, s/sol2-6.h:
10726 Remove definition of GC_MARK_STACK, since the default now works.
10727 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10728 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10729 no longer the default.
10730 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10731
10732 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10733
10734 * lread.c (lisp_file_lexically_bound_p):
10735 Fix hang at ";-*-\n" (bug#11238).
10736
10737 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10738
10739 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10740 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10741
10742 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10743
10744 * nsterm.m (constrainFrameRect): Always constrain when there is only
10745 one screen (Bug#10962).
10746
10747 2012-04-13 Ken Brown <kbrown@cornell.edu>
10748
10749 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10750
10751 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10752
10753 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10754
10755 2012-04-11 Daniel Colascione <dancol@dancol.org>
10756
10757 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10758 against is gone. It's better to use vfork now so that when Cygwin
10759 gains a new, working vfork, we use it automatically (bug#10398).
10760
10761 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10762
10763 * window.c (save_window_save): Obey window-point-insertion-type.
10764
10765 2012-04-11 Glenn Morris <rgm@gnu.org>
10766
10767 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10768
10769 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10770
10771 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10772
10773 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10774
10775 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10776 (force_quit_count): New var.
10777 (handle_interrupt): Use it.
10778
10779 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10780
10781 * w32.c (w32_delayed_load): Record the full path of the library
10782 being loaded (bug#10424).
10783
10784 2012-04-09 Glenn Morris <rgm@gnu.org>
10785
10786 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10787 not just in the obarray, before snarfing them. (Bug#11036)
10788
10789 * Makefile.in ($(leimdir)/leim-list.el):
10790 Pass EMACS rather than BUILT_EMACS.
10791
10792 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10793
10794 * process.c (make_process):
10795 * process.h: Add integer `gnutls_handshakes_tried' member to
10796 process struct.
10797
10798 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10799 Add convenience `GNUTLS_LOG2i' macro.
10800
10801 * gnutls.c (gnutls_log_function2i): Convenience log function.
10802 (emacs_gnutls_read): Use new log functions,
10803 `gnutls_handshakes_tried' process member, and
10804 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10805 attempts per process (connection).
10806
10807 2012-04-09 Chong Yidong <cyd@gnu.org>
10808
10809 * eval.c (Fuser_variable_p, user_variable_p_eh)
10810 (lisp_indirect_variable): Functions deleted.
10811 (Fdefvar): Caller changed.
10812
10813 * callint.c (Finteractive, Fcall_interactively):
10814 * minibuf.c (Fread_variable): Callers changed.
10815
10816 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10817
10818 * xdisp.c (set_cursor_from_row): If the display string appears in
10819 the buffer at position that is closer to point than the position
10820 after the display string, display the cursor on the first glyph of
10821 the display string. Fixes cursor display when a 'display' text
10822 property immediately follows invisible text. (Bug#11094)
10823
10824 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10825
10826 composite.c: use 'double' consistently
10827 * composite.c (get_composition_id): Use 'double' consistently
10828 instead of converting 'float' to 'double' and vice versa; this is
10829 easier to understand and avoids a GCC warning.
10830
10831 2012-04-09 Glenn Morris <rgm@gnu.org>
10832
10833 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10834 preparation for dumping it with emacs. (Bug#4789)
10835 (leimdir): New variable.
10836 ($(leimdir)/leim-list.el): New rule.
10837 (emacs$(EXEEXT)): Depend on leim-list.el.
10838
10839 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10840 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10841 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10842
10843 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10844
10845 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10846 proper alignment.
10847
10848 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10849
10850 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10851 Remove unused local variable.
10852
10853 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10854
10855 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10856 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10857 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10858 objects, as mark_maybe_pointer will catch them otherwise.
10859 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10860 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10861
10862 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10863
10864 Fix typo that broke non-Windows builds.
10865 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10866
10867 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10868
10869 Support building on MS-Windows with libxml2.
10870
10871 * makefile.w32-in (OBJ2): Add xml.$(O).
10872 (GLOBAL_SOURCES): Add xml.c.
10873 ($(BLD)/xml.$(O)): New dependency list.
10874
10875 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10876 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10877 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10878 [!WINDOWSNT]: New macros.
10879 (init_libxml2_functions, libxml2_loaded_p): New functions.
10880 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10881 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10882 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10883 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10884 linked in).
10885 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10886 Call init_libxml2_functions before calling libxml2 functions.
10887 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10888
10889 * emacs.c: Don't include libxml/parser.h.
10890 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10891 xmlCleanupParser directly.
10892
10893 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10894
10895 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10896
10897 * indent.c (Fvertical_motion): If there is a display string at
10898 point, use it.vpos to compute how many lines to backtrack after
10899 move_it_to point. (Bug#11133)
10900
10901 2012-04-06 Eli Zaretskii <eliz@gnu.org>
10902
10903 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10904 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10905 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10906 macros related to unification of CJK characters. For the details,
10907 see the discussion following the message here:
10908 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10909
10910 2012-04-04 Chong Yidong <cyd@gnu.org>
10911
10912 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10913
10914 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10915
10916 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10917 instead of alloca. (Bug#11138)
10918
10919 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10920
10921 * w32menu.c (is_simple_dialog): Properly check lisp types.
10922 (Bug#11141)
10923
10924 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10925
10926 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10927 position we get to after a call to move_it_to fails the
10928 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10929 only if we wind up in a string from display property. (Bug#11063)
10930
10931 * window.c (Fdelete_other_windows_internal): Invalidate the row
10932 and column information about mouse highlight, so that redisplay
10933 restores it after reallocating the glyph matrices. (Bug#7464)
10934
10935 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10936 string comes from a `display' text property, use the buffer
10937 position of that property as if we actually saw that position in
10938 the row's glyphs.
10939 (move_it_by_lines): Remove the assertion that
10940 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10941 violated when there's a before-string at the beginning of a line.
10942 (Bug#11063)
10943
10944 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10945
10946 * xdisp.c (append_space_for_newline): If the default face was
10947 remapped, use the remapped face for the appended newline.
10948 (extend_face_to_end_of_line): Use the remapped default face for
10949 extending the face to the end of the line.
10950 (display_line): Call extend_face_to_end_of_line when the default
10951 face was remapped. (Bug#11068)
10952
10953 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10954
10955 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10956
10957 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10958
10959 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10960
10961 2012-03-27 Glenn Morris <rgm@gnu.org>
10962
10963 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10964 Doc fixes.
10965
10966 2012-03-26 Kenichi Handa <handa@m17n.org>
10967
10968 * dispextern.h (struct glyph): Fix previous change. Change the
10969 bit length of glyphless.ch to 25 (Bug#11082).
10970
10971 2012-03-26 Chong Yidong <cyd@gnu.org>
10972
10973 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10974 (command_loop_1): Use it; inhibit selection update for
10975 handle-select-window too (Bug#8996).
10976
10977 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10978
10979 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10980
10981 2012-03-25 Kenichi Handa <handa@m17n.org>
10982
10983 * dispextern.h (struct glyph): Change the bit length of
10984 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10985
10986 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10987
10988 * s/ms-w32.h (tzname): Include time.h before redirecting to
10989 _tzname. Fixes the MSVC build. (Bug#9960)
10990
10991 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10992
10993 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10994 characters.
10995
10996 * xterm.c (XTread_socket): Only modify handling_signal if
10997 !SYNC_INPUT. (Bug#11080)
10998
10999 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11000
11001 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11002 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11003 when fetching a multibyte character consumes more bytes than
11004 CHAR_BYTES returns, due to unification of CJK characters in
11005 string_char. (Bug#11073)
11006
11007 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11008
11009 * process.c (wait_reading_process_output): Handle pty disconnect
11010 by refraining from sending oneself a SIGCHLD (bug#10933).
11011
11012 2012-03-22 Chong Yidong <cyd@gnu.org>
11013
11014 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11015
11016 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11017 Mark string as coming from a prefix property.
11018 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11019 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11020
11021 2012-03-21 Chong Yidong <cyd@gnu.org>
11022
11023 * xfaces.c (Vface_remapping_alist): Doc fix.
11024
11025 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11026
11027 * w32proc.c (Fw32_set_console_codepage)
11028 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11029 Doc fixes.
11030
11031 2012-03-20 Chong Yidong <cyd@gnu.org>
11032
11033 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11034 to reflect default non-nil value of redisplay-dont-pause.
11035
11036 2012-03-19 Kenichi Handa <handa@m17n.org>
11037
11038 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11039 it fit in a valid range (Bug#11003).
11040
11041 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11042
11043 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11044 that is not from display property, accept the row as a "cursor
11045 row" if one of the string's character has a non-nil `cursor'
11046 property. Fixes cursor positioning when there are newlines in
11047 overlay strings, e.g. in icomplete.el. (Bug#11035)
11048
11049 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11050
11051 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11052
11053 2012-03-12 Chong Yidong <cyd@gnu.org>
11054
11055 * eval.c (inhibit_lisp_code): Rename from
11056 inhibit_window_configuration_change_hook; move from window.c.
11057
11058 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11059 * window.c (run_window_configuration_change_hook)
11060 (syms_of_window): Callers changed.
11061
11062 2012-03-11 Chong Yidong <cyd@gnu.org>
11063
11064 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11065
11066 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11067
11068 2012-03-10 Chong Yidong <cyd@gnu.org>
11069
11070 * frame.c (other_visible_frames): Don't assume the selected frame
11071 is visible (Bug#10955).
11072
11073 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11074
11075 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11076
11077 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11078
11079 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11080 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11081 zero (Bug#10954).
11082
11083 2012-03-03 Glenn Morris <rgm@gnu.org>
11084
11085 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11086
11087 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11088
11089 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11090 position past the first glyph_row that ends at ZV. (Bug#10902)
11091 (redisplay_window, next_element_from_string): Fix typos in
11092 comments.
11093 (redisplay_window): Pass to move_it_vertically the margin in
11094 pixels, not in screen lines.
11095
11096 2012-03-02 Glenn Morris <rgm@gnu.org>
11097
11098 * buffer.c (buffer-list-update-hook): Doc fix.
11099
11100 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11101
11102 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11103 push_it before setting up the iterator for the first overlay
11104 string, even if we have an empty string loaded.
11105 (next_overlay_string): If there's an empty string on the iterator
11106 stack, pop the stack. (Bug#10903)
11107
11108 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11109
11110 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11111 Suggested by Stefan Monnier in
11112 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11113 * alloc.c (widen_to_Lisp_Object): New static function.
11114 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11115 and widening them to Lisp_Objects. This would work even if
11116 USE_LSB_TAG is defined and wide integers are used, which might
11117 happen in a future version of Emacs.
11118
11119 2012-02-25 Chong Yidong <cyd@gnu.org>
11120
11121 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11122 Doc fix.
11123
11124 * xselect.c (Fx_selection_exists_p): Doc fix.
11125 (x_clipboard_manager_save_all): Print an informative message
11126 before saving to clipboard manager.
11127
11128 2012-02-24 Chong Yidong <cyd@gnu.org>
11129
11130 * keyboard.c (process_special_events): Handle all X selection
11131 requests in kbd_buffer, not just the next one (Bug#8869).
11132
11133 2012-02-23 Chong Yidong <cyd@gnu.org>
11134
11135 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11136 call when setting menu-bar-lines and tool-bar-lines parameters.
11137 (unwind_create_frame_1): New helper function.
11138
11139 * window.c (inhibit_window_configuration_change_hook): New var.
11140 (run_window_configuration_change_hook): Obey it.
11141 (syms_of_window): Initialize it.
11142
11143 2012-02-22 Chong Yidong <cyd@gnu.org>
11144
11145 * xterm.c (x_draw_image_relief): Add missing type check for
11146 Vtool_bar_button_margin (Bug#10743).
11147
11148 2012-02-21 Chong Yidong <cyd@gnu.org>
11149
11150 * fileio.c (Vfile_name_handler_alist): Doc fix.
11151
11152 * buffer.c (Fget_file_buffer): Protect against invalid file
11153 handler return value.
11154
11155 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11156
11157 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11158 when computing $valmask.
11159
11160 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11161 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11162 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11163 It's useless in that case, and it can cause problems on hosts
11164 that allocate halves of EMACS_INT values separately.
11165 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11166 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11167 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11168 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11169 it avoids undefined behavior on hosts where shifting right by more
11170 than the word width has undefined behavior.
11171
11172 2012-02-19 Chong Yidong <cyd@gnu.org>
11173
11174 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11175 (Funhandled_file_name_directory, Ffile_name_as_directory)
11176 (Fdirectory_file_name, Fexpand_file_name)
11177 (Fsubstitute_in_file_name): Protect against invalid file handler
11178 return values (Bug#10845).
11179
11180 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11181
11182 * .gdbinit (pitx): Fix incorrect references to fields of the
11183 iterator stack.
11184
11185 2012-02-17 Chong Yidong <cyd@gnu.org>
11186
11187 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11188
11189 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11190
11191 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11192 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11193
11194 2012-02-15 Chong Yidong <cyd@gnu.org>
11195
11196 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11197 marked as special. Also, starting docstrings with * is obsolete.
11198
11199 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11200
11201 * gnutls.c (emacs_gnutls_write): Fix last change.
11202
11203 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11204
11205 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11206 send_process.
11207
11208 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11209
11210 * keymap.c (Fsingle_key_description): Handle char ranges.
11211
11212 2012-02-12 Chong Yidong <cyd@gnu.org>
11213
11214 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11215 as that creates a dangerous corner case.
11216
11217 * window.c (Fdelete_window_internal): Invalidate the mouse
11218 highlight (Bug#9904).
11219
11220 2012-02-12 Glenn Morris <rgm@gnu.org>
11221
11222 * xselect.c (Fx_own_selection_internal)
11223 (Fx_get_selection_internal, Fx_disown_selection_internal)
11224 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11225 * nsselect.m (Fx_own_selection_internal)
11226 (Fx_disown_selection_internal, Fx_selection_exists_p)
11227 (Fx_selection_owner_p, Fx_get_selection_internal):
11228 Sync docs and argument specs with the xselect.c versions.
11229
11230 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11231
11232 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11233
11234 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11235
11236 * w32select.c (Fx_selection_exists_p): Sync doc string and
11237 argument list with xselect.c. (Bug#10783)
11238
11239 * w16select.c (Fx_selection_exists_p): Sync doc string and
11240 argument list with xselect.c. (Bug#10783)
11241
11242 2012-02-10 Glenn Morris <rgm@gnu.org>
11243
11244 * fns.c (Fsecure_hash): Doc fix.
11245
11246 2012-02-09 Kenichi Handa <handa@m17n.org>
11247
11248 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11249
11250 2012-02-07 Chong Yidong <cyd@gnu.org>
11251
11252 * buffer.c (Fbuffer_local_variables)
11253 (buffer_lisp_local_variables): Handle unbound vars correctly;
11254 don't let Qunbound leak into Lisp.
11255
11256 2012-02-07 Glenn Morris <rgm@gnu.org>
11257
11258 * image.c (Fimagemagick_types): Doc fix.
11259
11260 * image.c (imagemagick-render-type): Change it from a lisp object
11261 to an integer. Move the doc here from the lisp manual.
11262 Treat all values not equal to 0 the same.
11263
11264 2012-02-06 Chong Yidong <cyd@gnu.org>
11265
11266 * doc.c (store_function_docstring): Avoid applying docstring of
11267 alias to base function (Bug#2603).
11268
11269 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11270
11271 * .gdbinit (pp1, pv1): Remove redundant defines.
11272 (pr): Use pp.
11273
11274 2012-02-04 Chong Yidong <cyd@gnu.org>
11275
11276 * nsterm.m: Declare a global (Bug#10694).
11277
11278 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11279
11280 * w32.c (get_emacs_configuration_options):
11281 Include --enable-checking, if specified, in the return value.
11282
11283 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11284
11285 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11286 after rounding frame sizes. (Bug#9723)
11287
11288 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11289
11290 * keyboard.c (adjust_point_for_property): Don't position point
11291 before BEGV. (Bug#10696)
11292
11293 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11294
11295 Handle overflow when computing char display width (Bug#9496).
11296 * character.c (char_width): Return EMACS_INT, not int.
11297 (char_width, c_string_width): Check for overflow when
11298 computing the width; this is possible now that individual
11299 characters can have unbounded width. Problem introduced
11300 by merge from Emacs 23 on 2012-01-19.
11301
11302 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11303
11304 * dbusbind.c (Fdbus_register_method): Mention the return value
11305 :ignore in the docstring.
11306
11307 2012-02-02 Glenn Morris <rgm@gnu.org>
11308
11309 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11310
11311 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11312 Unconditionally set to t. (Bug#10673)
11313 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11314 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11315 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11316
11317 2012-02-02 Kenichi Handa <handa@m17n.org>
11318
11319 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11320 0, do not call append_composite_glyph.
11321
11322 2012-02-02 Kenichi Handa <handa@m17n.org>
11323
11324 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11325 NULL (Bug#6988).
11326 (x_produce_glyphs): If the component of a composition is a null
11327 string, set it->pixel_width to 1 to avoid zero-width glyph.
11328
11329 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11330
11331 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11332 first 2 arguments are identical. This makes inserting large
11333 output from a subprocess an order of magnitude faster on
11334 MS-Windows, where all sbrk'ed memory is always contiguous.
11335
11336 2012-01-31 Glenn Morris <rgm@gnu.org>
11337
11338 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11339 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11340 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11341
11342 2012-01-29 Glenn Morris <rgm@gnu.org>
11343
11344 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11345
11346 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11347
11348 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11349
11350 2012-01-28 Chong Yidong <cyd@gnu.org>
11351
11352 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11353
11354 2012-01-26 Chong Yidong <cyd@gnu.org>
11355
11356 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11357
11358 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11359 repeat counts (Bug#10507).
11360
11361 2012-01-26 Glenn Morris <rgm@gnu.org>
11362
11363 * lread.c (syms_of_lread): Doc fix.
11364
11365 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11366
11367 * coding.c (encode_designation_at_bol): Change return value to
11368 EMACS_INT.
11369
11370 2012-01-25 Chong Yidong <cyd@gnu.org>
11371
11372 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11373
11374 2012-01-21 Chong Yidong <cyd@gnu.org>
11375
11376 * floatfns.c (Fcopysign): Make the second argument non-optional,
11377 since nil is not allowed anyway.
11378
11379 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11380
11381 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11382 (send_process): Likewise.
11383
11384 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11385
11386 * window.c (save_window_save, Fcurrent_window_configuration)
11387 (Vwindow_persistent_parameters): Do not use Qstate.
11388 Rewrite doc-strings.
11389
11390 2012-01-19 Kenichi Handa <handa@m17n.org>
11391
11392 * character.c (char_width): New function.
11393 (Fchar_width, c_string_width, lisp_string_width):
11394 Use char_width (Bug#9496).
11395
11396 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11397
11398 * window.c (Vwindow_persistent_parameters): New variable.
11399 (Fset_window_configuration, save_window_save): Handle persistent
11400 window parameters.
11401
11402 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11403
11404 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11405 thrashing the stack of the thread. (Bug#9087)
11406
11407 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11408
11409 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11410
11411 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11412
11413 * xdisp.c (rows_from_pos_range): Handle the case where the
11414 highlight ends on a newline. (Bug#10464)
11415 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11416 he end column for display of highlight that ends on a newline
11417 before a R2L line.
11418
11419 2012-01-11 Glenn Morris <rgm@gnu.org>
11420
11421 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11422 from load-path also when installation-directory is nil. (Bug#10208)
11423
11424 2012-01-10 Glenn Morris <rgm@gnu.org>
11425
11426 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11427
11428 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11429 Update template values to be closer to their typical values these days.
11430
11431 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11432
11433 * xdisp.c (rows_from_pos_range): Accept additional argument
11434 DISP_STRING, and accept any glyph in a row whose object is that
11435 string as eligible for mouse highlight. Fixes mouse highlight of
11436 display strings from overlays. (Bug#10464)
11437
11438 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 emacs: fix an auto-save permissions race condition (Bug#10400)
11441 * fileio.c (auto_saving_dir_umask): New static var.
11442 (Fmake_directory_internal): Use it.
11443 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11444 creating the directory. The old code temporarily assigns
11445 too-generous permissions to the directory.
11446 (do_auto_save_eh): Clear it.
11447 (Fdo_auto_save): Catch all errors, not just file errors, so
11448 that the var is always cleared.
11449
11450 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11451
11452 * search.c (scan_buffer): Pass character positions to
11453 know_region_cache, not byte positions. (Bug#6540)
11454
11455 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11456
11457 * w32.c (sys_rename): Report EXDEV when rename of a directory
11458 fails because the target is on another logical disk. (Bug#10284)
11459
11460 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11461
11462 * xterm.c (x_embed_request_focus): New function.
11463
11464 * xterm.h: Add prototype.
11465
11466 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11467
11468 2012-01-05 Glenn Morris <rgm@gnu.org>
11469
11470 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11471
11472 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11473
11474 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11475 Load gnutls_transport_set_lowat only if GnuTLS version is below
11476 2.11.1.
11477 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11478 GnuTLS versions below 2.11.1.
11479
11480 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11481
11482 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11483 to the doc string advising against its use for altering the way
11484 windows are scrolled.
11485
11486 2011-12-28 Kenichi Handa <handa@m17n.org>
11487
11488 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11489 coding-system ASCII compatible only when it does not produce BOM
11490 on encoding (Bug#10383).
11491
11492 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11493
11494 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11495 can scroll.
11496 (create_and_show_popup_menu): Always use menu_position_func for
11497 Gtk3 (Bug#10361).
11498
11499 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11500
11501 * callint.c (Fcall_interactively): Don't truncate prompt string.
11502
11503 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11504
11505 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11506 property that ends at ZV, so that the bidi iteration could be
11507 resumed from there (after widening). (Bug#10360)
11508
11509 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11510
11511 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11512
11513 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11514
11515 * nsterm.m (x_free_frame_resources):
11516 Release f->output_data.ns->miniimage.
11517 (ns_index_color): Fix indentation. Do not retain
11518 color_table->colors[i].
11519
11520 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11521 before returning.
11522
11523 * nsfns.m (x_set_background_color): Assign return value from
11524 ns_index_color to face-background instead of NSColor*.
11525 (ns_implicitly_set_icon_type): Fix indentation.
11526 Change assignment in for loop to comparison.
11527
11528 * emacs.c (ns_pool): New variable.
11529 (main): Assign ns_pool.
11530 (Fkill_emacs): Call ns_release_autorelease_pool.
11531
11532 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11533 autorelease fdesc, release fdAttrs and tdict.
11534 (ns_get_covering_families): Release charset.
11535 (ns_findfonts): Release NSFontDescriptor created with new.
11536 (ns_uni_to_glyphs): Fix indentation.
11537 (setString): Release attrStr before assigning new value.
11538
11539 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11540
11541 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11542 and NS_IMPL_COCOA.
11543 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11544 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11545
11546 2011-12-18 David Reitter <reitter@cmu.edu>
11547
11548 * nsterm.m (ns_term_init): Subscribe for notifications
11549 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11550 to method trackingNotification in EmacsMenu.
11551
11552 * nsmenu.m (trackingMenu): New variable.
11553 (trackingNotification): New method (from Aquamacs).
11554 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11555 from Aquamacs (Bug#7030).
11556
11557 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11558
11559 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11560 (symbol_to_nsstring): Fix indentation.
11561 (ns_symbol_to_pb): New function.
11562 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11563 (Fns_rotate_cut_buffers_internal): Remove.
11564 (Fns_store_selection_internal): Rename from
11565 Fns_store_cut_buffer_internal.
11566 (ns_get_foreign_selection, Fx_own_selection_internal)
11567 (Fx_disown_selection_internal, Fx_selection_exists_p)
11568 (Fns_get_selection_internal, Fns_store_selection_internal):
11569 Use ns_symbol_to_pb and check if return value is nil.
11570 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11571 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11572 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11573 renamed to Sns_store_selection_internal.
11574 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11575 and remove this function.
11576 (ns_handle_selection_clear): Remove, never used.
11577 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11578 here.
11579
11580 2011-12-17 Ken Brown <kbrown@cornell.edu>
11581
11582 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11583 GID is unknown (Bug#10257).
11584
11585 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11586
11587 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11588 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11589 which caused a build failure on GNU/Linux IA-64. This problem was
11590 introduced by my 2011-10-07 patch.
11591
11592 2011-12-15 Juri Linkov <juri@jurta.org>
11593
11594 * image.c (imagemagick_error): New function. (Bug#10112)
11595 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11596 Use `imagemagick_error' where ImageMagick functions return
11597 `MagickFalse'.
11598 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11599 proper order.
11600
11601 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11602
11603 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11604 fill background (Bug#8992).
11605
11606 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11607
11608 * window.c (Vwindow_combination_resize)
11609 (Vwindow_combination_limit): Use t instead of non-nil in
11610 doc-strings.
11611 (Vrecenter_redisplay): Add first sentence of doc-string on
11612 separate line.
11613 (Frecenter): Fix doc-string typo.
11614
11615 2011-12-11 Kenichi Handa <handa@m17n.org>
11616
11617 * coding.c (Funencodable_char_position): Pay attention to the
11618 buffer text relocation (Bug#9389).
11619
11620 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11621
11622 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11623 gtk_init (Bug#10100).
11624
11625 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11626
11627 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11628 IT->string is nil. (Bug#10263)
11629
11630 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11631
11632 * nsterm.h (x_free_frame_resources): Declare.
11633
11634 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11635 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11636
11637 * nsterm.h (ns_get_defaults_value): Declare.
11638
11639 * nsterm.m (ns_default): Call ns_get_defaults_value.
11640
11641 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11642
11643 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11644 (Bug#10170)
11645
11646 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11647
11648 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11649 that where the value of an _OBJC_* symbol points to is in the .bss
11650 section (Bug#10240).
11651
11652 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11653
11654 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11655 after the loop to call ccl_driver at least once (Bug#8619).
11656
11657 2011-12-08 Kenichi Handa <handa@m17n.org>
11658
11659 * ftfont.c (get_adstyle_property): Fix previous change
11660 (Bug#10233).
11661
11662 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11663
11664 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11665 dirs from the default value of EMACSLOADPATH (bug#10208).
11666
11667 2011-12-07 Glenn Morris <rgm@gnu.org>
11668
11669 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11670 installation and source directories as well. (Bug#10208)
11671
11672 2011-12-06 Chong Yidong <cyd@gnu.org>
11673
11674 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11675
11676 2011-12-06 Glenn Morris <rgm@gnu.org>
11677
11678 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11679 as an error, not just -1. (Bug#10217)
11680
11681 2011-12-05 Chong Yidong <cyd@gnu.org>
11682
11683 * keyboard.c (process_special_events): New function.
11684 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11685
11686 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 * coding.c (encode_designation_at_bol): Don't use uninitialized
11689 local variable (Bug#9318).
11690
11691 2011-12-05 Kenichi Handa <handa@m17n.org>
11692
11693 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11694 return Qnil (Bug#8046, Bug#10193).
11695
11696 2011-12-05 Kenichi Handa <handa@m17n.org>
11697
11698 * coding.c (encode_designation_at_bol): New args charbuf_end and
11699 dst. Return the number of produced bytes. Callers changed.
11700 (coding_set_source): Return how many bytes coding->source was
11701 relocated.
11702 (coding_set_destination): Return how many bytes
11703 coding->destination was relocated.
11704 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11705 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11706
11707 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11708
11709 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11710 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11711 macro (Bug#9318).
11712
11713 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11714
11715 The following changes are to fix Bug#9318.
11716
11717 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11718 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11719 (encode_coding_iso_2022, encode_coding_sjis)
11720 (encode_coding_big5, encode_coding_charset): Use the above macros.
11721
11722 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11723
11724 * lisp.h (process_quit_flag): Fix external declaration.
11725
11726 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11727
11728 Don't macro-inline non-performance-critical code.
11729 * eval.c (process_quit_flag): New function.
11730 * lisp.h (QUIT): Use it.
11731
11732 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11733
11734 * nsfns.m (get_geometry_from_preferences): New function.
11735 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11736
11737 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11738
11739 * emacs.c (Qkill_emacs): Define.
11740 (syms_of_emacs): Initialize it.
11741 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11742 Qquit_flag to `kill-emacs' instead.
11743 (quit_throw_to_read_char): Add parameter `from_signal'.
11744 All callers changed. Call Fkill_emacs if requested and safe.
11745 * lisp.h (QUIT): Call Fkill_emacs if requested.
11746
11747 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11748
11749 * widget.c (update_wm_hints): Return if wmshell is null.
11750 (widget_update_wm_size_hints): New function.
11751
11752 * widget.h (widget_update_wm_size_hints): Declare.
11753
11754 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11755 widget_update_wm_size_hints (Bug#10104).
11756
11757 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11758
11759 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11760 before a newline, prepare the bidi iterator for consuming the
11761 newline, and keep the current paragraph direction. (Bug#10183)
11762 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11763
11764 2011-12-02 Juri Linkov <juri@jurta.org>
11765
11766 * search.c (Fword_search_regexp): New Lisp function created from
11767 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11768 (Fword_search_backward, Fword_search_forward)
11769 (Fword_search_backward_lax, Fword_search_forward_lax):
11770 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11771 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11772
11773 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11774
11775 * fileio.c (Finsert_file_contents): Move after-change-function call
11776 to before the "handled:" label, since all "goto handled" appear in
11777 cases where the *-change-functions have already been properly called
11778 (bug#10117).
11779
11780 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11781
11782 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11783 waiting for input. (Bug#10169)
11784
11785 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11786
11787 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11788 verifies glyph row's hash code--we have just reallocated the
11789 glyphs, so their contents can be complete garbage. (Bug#10164)
11790
11791 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11792
11793 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11794
11795 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11796
11797 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11798 attributes are tested _before_ calling verify_row_hash, to protect
11799 against GCC re-ordering of the tests. (Bug#10164)
11800
11801 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11802
11803 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11804
11805 * xterm.c (handle_one_xevent): Only set async_visible and friends
11806 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11807 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11808 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11809
11810 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11811
11812 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11813 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11814 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11815 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11816 All uses changed to use GCPRO1 etc.
11817 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11818 Revert to old implementation (i.e., before 2011-03-11).
11819
11820 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11821
11822 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11823 of scroll runs so as to avoid assigning disabled bogus rows and
11824 unnecessary graphics copy operations.
11825
11826 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11827
11828 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11829 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11830 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11831 (malloc, free, realloc, calloc): Redirect to e_* only when
11832 compiling Emacs.
11833
11834 * lisp.h (GCTYPEBITS): Move before first use.
11835 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11836 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11837 this macro definition.
11838
11839 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11840 _MSC_VER.
11841
11842 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11843
11844 * gtkutil.c (xg_create_frame_widgets):
11845 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11846 present with Gtk+ 2.0.
11847
11848 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11849
11850 * fileio.c (Finsert_file_contents): Undo previous change; see
11851 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11852
11853 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11854
11855 Rename locals to avoid shadowing.
11856 * fileio.c (Finsert_file_contents):
11857 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11858 * process.c (wait_reading_process_output):
11859 Rename inner 'proc' to 'p' to avoid shadowing.
11860 Indent for consistency with usual Emacs style.
11861
11862 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11863
11864 * xdisp.c (redisplay_window): If cursor row is not fully visible
11865 after recentering, and scroll-conservatively is set to a large
11866 number, scroll window by a few more lines to make the cursor fully
11867 visible and out of scroll-margin. (Bug#10105)
11868 (start_display): Don't move to the next line if the display should
11869 start at a newline that is part of a display vector or an overlay
11870 string. (Bug#10119)
11871
11872 2011-11-24 Juri Linkov <juri@jurta.org>
11873
11874 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11875 after the `MagickPingImage' call. (Bug#10112)
11876
11877 2011-11-23 Chong Yidong <cyd@gnu.org>
11878
11879 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11880
11881 2011-11-23 Martin Rudalics <rudalics@gmx.at>
11882
11883 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11884 making another buffer current. (Bug#10114)
11885
11886 2011-11-23 Glenn Morris <rgm@gnu.org>
11887
11888 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11889
11890 2011-11-23 Chong Yidong <cyd@gnu.org>
11891
11892 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11893 using it (Bug#5984).
11894
11895 2011-11-22 Eli Zaretskii <eliz@gnu.org>
11896
11897 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11898 and header-lines, as they don't have one computed for them.
11899 (Bug#10098)
11900
11901 * .gdbinit (prow): Make displayed values more self-explaining.
11902 Add row's hash code.
11903
11904 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11905
11906 * process.c (wait_reading_process_output): Fix asynchrounous
11907 GnuTLS socket handling on some versions of the GnuTLS library.
11908 (wait_reading_process_output): Add comment and URL.
11909
11910 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11911
11912 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11913
11914 2011-11-21 Chong Yidong <cyd@gnu.org>
11915
11916 * window.c (Fnext_window, Fprevious_window): Doc fix.
11917
11918 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11919
11920 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11921
11922 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11923
11924 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11925
11926 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11927
11928 * window.c (Fset_window_combination_limit): Rename argument
11929 STATUS to LIMIT.
11930 (Vwindow_combination_limit): Remove "status" from doc-string.
11931
11932 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11933
11934 * m/ibms390.h: Remove.
11935 * m/ibms390x.h: Don't include "ibms390.h".
11936
11937 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11938
11939 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11940 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11941
11942 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11943
11944 * casetab.c (Fset_case_table):
11945 * charset.c (Fcharset_after): Fix typos.
11946
11947 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11950 Otherwise, valgrind does not work on some platforms.
11951 Problem reported by Andreas Schwab in
11952 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11953 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11954 is set, removing the need for VIRT_ADDRESS_VARIES.
11955 (PURE_P): Use a more-efficient implementation that needs just one
11956 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11957 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11958 to 4 (xorl, subq, cmpq, setbe).
11959 * alloc.c (pure): Always extern now, since that's the
11960 VIRT_ADDR_VARIES behavior.
11961 (PURE_POINTER_P): Use a single comparison, not two, for
11962 consistency with the new puresize.h.
11963 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11964 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11965 Remove VIRT_ADDR_VARIES no longer needed.
11966
11967 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11968
11969 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11970 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11971 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11972 behave as if the cursor position were at the window margin.
11973
11974 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11975 and the cursor position is out of bounds, behave as if the cursor
11976 position were at the window margin. (Bug#10075)
11977
11978 2011-11-18 Chong Yidong <cyd@gnu.org>
11979
11980 * window.c (Fwindow_combination_limit): Make first argument
11981 non-optional, since it is meaningless for live windows like the
11982 selected window.
11983
11984 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11985
11986 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11987
11988 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11989
11990 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11991 (graft_intervals_into_buffer): Simplify.
11992
11993 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11994
11995 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11996 hash values of the two rows.
11997 (copy_row_except_pointers): Preserve the used[] arrays and the
11998 hash values of the two rows. (Bug#10035)
11999 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12000
12001 * xdisp.c (row_hash): New function, body extracted from
12002 compute_line_metrics.
12003 (compute_line_metrics): Call row_hash, instead of computing the
12004 hash code inline.
12005
12006 * dispnew.c (verify_row_hash): Call row_hash for computing the
12007 hash code of a row, instead of duplicating code from xdisp.c.
12008
12009 * dispextern.h (row_hash): Add prototype.
12010
12011 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12012
12013 * frame.c (delete_frame): Don't delete the terminal when the last
12014 X frame is closed if emacs is built with GTK toolkit.
12015
12016 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12017
12018 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12019
12020 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12021
12022 * window.c (Vwindow_splits): Rename to
12023 Vwindow_combination_resize. Suggested by Juri Linkov.
12024 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12025 of Vwindow_splits.
12026
12027 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12028
12029 * nsfns.m (Fns_font_name):
12030 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12031
12032 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12033
12034 * window.h (window): Rename slot "nest" to "combination_limit".
12035 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12036 (Fset_window_nest): Rename to Fset_window_combination_limit.
12037 (Vwindow_nest): Rename to Vwindow_combination_limit.
12038 (recombine_windows, make_parent_window, make_window)
12039 (Fsplit_window_internal, saved_window)
12040 (Fset_window_configuration, save_window_save): Rename all
12041 occurrences of window_nest to window_combination_limit.
12042
12043 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12044
12045 * image.c (imagemagick_load_image): Fix typo.
12046
12047 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12048
12049 * xdisp.c (display_line): Move the call to
12050 highlight_trailing_whitespace before the call to
12051 compute_line_metrics, since the latter needs to see the final
12052 faces of all the glyphs to compute ROW's hash value.
12053 Fixes assertion violations in row_equal_p. (Bug#10035)
12054
12055 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12056
12057 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12058 just return (bug#10044).
12059
12060 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12061
12062 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12063 with user-defined heap size. Bump the default size of the temacs
12064 heap to 27MB, to avoid memory warning when running temacs.
12065 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12066
12067 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12068 current_matrix and desired_matrix. (Bug#9990)
12069 (verify_row_hash) [XASSERTS]: New function.
12070 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12071 that the hash value of glyph rows is correct.
12072
12073 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12074
12075 * window.h (window): Remove splits slot.
12076 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12077 (Fdelete_other_windows_internal, make_parent_window)
12078 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12079 (Fset_window_configuration, save_window_save): Don't deal with
12080 split status of windows.
12081 (saved_window): Remove splits slot.
12082 (Vwindow_splits): Rewrite doc-string.
12083
12084 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12085
12086 * xfns.c (unwind_create_frame):
12087 * nsfns.m (unwind_create_frame):
12088 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12089 Vframe_list (Bug#9999).
12090
12091 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12092
12093 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12094
12095 2011-11-11 Kenichi Handa <handa@m17n.org>
12096
12097 * callproc.c (Fcall_process): Set the member dst_multibyte of
12098 process_coding.
12099
12100 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12101
12102 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12103 avoid a crash (bug#9496).
12104
12105 2011-11-09 Chong Yidong <cyd@gnu.org>
12106
12107 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12108 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12109
12110 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12111
12112 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12113
12114 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12115
12116 Avoid some portability problems by eschewing 'extern inline' functions.
12117 The trivial performance wins aren't worth the portability hassles; see
12118 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12119 et seq.
12120 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12121 (window_box_width, window_box_left, window_box_left_offset)
12122 (window_box_right, window_box_right_offset): Undo previous change,
12123 by removing the "extern"s.
12124 * intervals.c (adjust_intervals_for_insertion)
12125 (adjust_intervals_for_deletion): Undo previous change,
12126 making these static again.
12127 (offset_intervals, temp_set_point_both, temp_set_point)
12128 (copy_intervals_to_string): No longer inline.
12129 * xdisp.c (window_text_bottom_y, window_box_width)
12130 (window_box_height, window_box_left_offset)
12131 (window_box_right_offset, window_box_left, window_box_right)
12132 (window_box): No longer inline.
12133
12134 2011-11-08 Chong Yidong <cyd@gnu.org>
12135
12136 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12137 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12138 Signal an error if not a live window.
12139 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12140 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12141
12142 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12143
12144 * lisp.h (syms_of_abbrev): Remove declaration.
12145 Reported by CHENG Gao <chenggao@royau.me>.
12146
12147 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12148
12149 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12150 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12151 of temacs in GUI mode.
12152
12153 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12154
12155 * window.h: Declare delete_all_child_windows instead of
12156 delete_all_subwindows.
12157 * window.c (Fwindow_nest, Fset_window_nest)
12158 (Fset_window_new_total, Fset_window_new_normal)
12159 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12160 (delete_all_subwindows): Rename to delete_all_child_windows.
12161 (Fdelete_other_windows_internal, Fset_window_configuration):
12162 Call delete_all_child_windows instead of delete_all_subwindows.
12163 * frame.c (delete_frame): Call delete_all_child_windows instead
12164 of delete_all_subwindows.
12165
12166 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12167
12168 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12169 This is also needed for porting to any host where GC_MARK_STACK is
12170 not GC_MAKE_GCPROS_NOOPS.
12171 (which_symbols): Use it.
12172
12173 2011-11-07 Kenichi Handa <handa@m17n.org>
12174
12175 * coding.c (coding_set_destination): Check coding->src_pos only
12176 when coding->src_object is a buffer (bug#9910).
12177
12178 * process.c (send_process): Set the member src_multibyte of coding
12179 to 0 (bug#9911) when sending a unibyte text.
12180
12181 * callproc.c (Fcall_process): Set the member src_multibyte of
12182 process_coding to 0 (bug#9912).
12183
12184 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12185
12186 * xmenu.c (cleanup_widget_value_tree): New function.
12187 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12188 calling free_menubar_widget_value_tree directly (Bug#9830).
12189
12190 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12191
12192 Fix some portability problems with 'inline'.
12193 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12194 (window_box_width, window_box_left, window_box_left_offset)
12195 (window_box_right, window_box_right_offset): Declare extern.
12196 Otherwise, these inline functions do not conform to C99 and
12197 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12198 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12199 * intervals.c (adjust_intervals_for_insertion)
12200 (adjust_intervals_for_deletion): Now extern, because otherwise the
12201 extern inline functions 'offset_intervals' couldn't refer to it.
12202 (static_offset_intervals): Remove.
12203 (offset_intervals): Rewrite using the old contents of
12204 static_offset_intervals. The old version didn't conform to C99
12205 because an extern inline function contained a reference to an
12206 identifier with static linkage.
12207
12208 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12209
12210 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12211 GC.
12212
12213 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12214
12215 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12216 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12217 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12218 return Qleft_to_right.
12219
12220 2011-11-06 Chong Yidong <cyd@gnu.org>
12221
12222 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12223 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12224 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12225 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12226 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12227 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12228 (Fwindow_vscroll): Doc fix.
12229 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12230 argument, since it makes no sense to pass a live window and for
12231 consistency with window-child.
12232
12233 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12234
12235 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12236 support MSVC.
12237
12238 2011-11-05 Jason Rumney <jasonr@gnu.org>
12239
12240 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12241 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12242 fonts (Bug#6029).
12243 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12244 bitwise arithmetic preventing use of unicode-sip and non-truetype
12245 opentype fonts.
12246
12247 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12248
12249 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12250 "emacs"-only part.
12251
12252 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12253 initialization code to keep similarity to xfns.c after changes
12254 from 2011-11-05.
12255
12256 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12257
12258 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12259 (unwind_create_frame): New function (Bug#9943).
12260 (Fx_create_frame): Restructure code to be more similar to the one in
12261 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12262 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12263 Move terminal->reference_count++ just before making the frame official
12264 (Bug#9943).
12265
12266 * nsterm.m (x_free_frame_resources): New function.
12267 (x_destroy_window): Move code to x_free_frame_resources.
12268
12269 * xfns.c (unwind_create_frame): Fix comment.
12270 (Fx_create_frame, x_create_tip_frame):
12271 Move terminal->reference_count++ just before making the frame
12272 official. Move initialization of image_cache_refcount and
12273 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12274
12275 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12276
12277 Support MSVC build with newer versions of Visual Studio.
12278 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12279 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12280 nt/gmake.defs.
12281
12282 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12283 which are not supported by MSVC.
12284 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12285 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12286 bitfields.
12287 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12288 types in bitfields.
12289 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12290
12291 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12292
12293 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12294
12295 Support MSVC build with newer versions of Visual Studio.
12296 * w32.c: Don't include w32api.h for MSVC.
12297 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12298
12299 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12300 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12301 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12302 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12303 e_* cousins.
12304 (alloca) [_MSC_VER]: Define to _alloca.
12305
12306 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12307
12308 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12309
12310 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12311
12312 * xdisp.c (note_mouse_highlight): If either of
12313 previous/next-single-property-change returns nil, treat that as
12314 the beginning or the end of the buffer. (Bug#9955)
12315
12316 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12317
12318 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12319 label is not null (Bug#9951).
12320 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12321 may be NULL.
12322
12323 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12324
12325 * window.c (Fwindow_body_size): Mention in the doc string that the
12326 return value is in frame's canonical units. (Bug#9949)
12327
12328 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12329
12330 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12331
12332 * w32fns.c (unwind_create_frame): If needed, free the glyph
12333 matrices of the partially constructed frame. (Bug#9943)
12334 * xfns.c (unwind_create_frame): Likewise.
12335
12336 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12337
12338 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12339 Don't stop backward scan on the continuation glyph, even though
12340 its CHARPOS is positive.
12341 (mouse_face_from_buffer_pos, note_mouse_highlight):
12342 Rename cover_string to disp_string.
12343
12344 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12345
12346 * window.c (temp_output_buffer_show): Don't use
12347 Vtemp_buffer_show_specifiers.
12348 (Vtemp_buffer_show_specifiers): Remove unused variable.
12349
12350 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12351
12352 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12353 past the beginning of the current glyph matrix.
12354
12355 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12356
12357 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12358 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12359 HAVE_GTK3 (Bug#9869).
12360
12361 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12362 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12363
12364 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12365
12366 * xterm.c: Declare x_handle_net_wm_state to return int.
12367 (handle_one_xevent): Check if we are iconified but don't have
12368 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12369 (get_current_wm_state): Return non-zero if not hidden,
12370 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12371 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12372 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12373 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12374
12375 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12376
12377 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12378 so that this new function doesn't get optimized away by a
12379 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12380
12381 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12382
12383 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12384
12385 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12386
12387 Fix the `xbytecode' command.
12388 * .gdbinit (xprintbytestr): New command.
12389 (xwhichsymbols): Rename from `which'; all callers changed.
12390 (xbytecode): Print the byte-code string as well.
12391
12392 2011-10-29 Kim Storm <storm@cua.dk>
12393
12394 * alloc.c (which_symbols): New function.
12395
12396 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12397
12398 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12399 line. (Bug#9903)
12400
12401 2011-10-29 Glenn Morris <rgm@gnu.org>
12402
12403 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12404 Not clear what it was for, and it causes various bugs. (Bug#9839)
12405
12406 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12407
12408 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12409 possible random value that matches one of those tested as
12410 condition to clear the mouse face.
12411
12412 2011-10-28 Chong Yidong <cyd@gnu.org>
12413
12414 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12415
12416 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12417
12418 * window.c (make_window): Initialize phys_cursor_on_p.
12419
12420 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12421
12422 * lisp.h (struct Lisp_Symbol): Update comments.
12423
12424 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12425
12426 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12427
12428 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12429
12430 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12431 <oslsachem@gmail.com> for helping to debug this.
12432
12433 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12434 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12435 (g_b_init_get_glyph_outline_w): New static variables.
12436 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12437 (GetGlyphOutlineW_Proc): New typedefs.
12438 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12439 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12440 New functions.
12441 (w32font_open_internal, compute_metrics):
12442 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12443 instead of calling the "wide" APIs directly.
12444
12445 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12446
12447 * w32.h (syms_of_w32font): Add prototype.
12448
12449 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12450
12451 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12452 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12453 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12454 (Fmove_to_window_line): Doc fix.
12455
12456 2011-10-27 Chong Yidong <cyd@gnu.org>
12457
12458 * process.c (make_process): Set gnutls_state to NULL.
12459
12460 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12461 non-NULL, regardless of GNUTLS_INITSTAGE.
12462 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12463 an error. Set process slots as soon as we allocate them.
12464
12465 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12466
12467 2011-10-27 Chong Yidong <cyd@gnu.org>
12468
12469 * gnutls.c (emacs_gnutls_deinit): New function.
12470 Deallocate credentials structures as well as calling gnutls_deinit.
12471 (Fgnutls_deinit, Fgnutls_boot): Use it.
12472
12473 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12474 (deactivate_process): Call emacs_gnutls_deinit.
12475
12476 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12477
12478 * image.c (x_create_x_image_and_pixmap):
12479 * w32.c (sys_rename, w32_delayed_load):
12480 * w32font.c (fill_in_logfont):
12481 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12482
12483 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12484
12485 * w32fns.c (w32_default_color_map): New function,
12486 extracted from Fw32_default_color_map.
12487 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12488
12489 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12490
12491 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12492
12493 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12494
12495 * keyboard.c (test_undefined): New function (bug#9751).
12496 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12497
12498 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12499
12500 * sysdep.c (init_sys_modes): Fix the check for the controlling
12501 terminal (Bug#6649).
12502
12503 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12504
12505 * dispextern.h (struct bidi_it): New member next_en_type.
12506
12507 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12508 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12509 current character, check also for next_en_type being WEAK_EN.
12510 (bidi_resolve_weak): Don't enter the expensive loop if the current
12511 position is before next_en_pos. Record the bidi type of the first
12512 non-ET, non-BN character we find, in addition to its position.
12513 (bidi_level_of_next_char): Invalidate next_en_type when
12514 next_en_pos is over-stepped.
12515
12516 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12517
12518 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12519 * editfns.c: Rewrite current-time-zone so that it invokes
12520 the equivalent of (format-time-string "%Z") to get the time zone name.
12521 This fixes a bug when the time zone name contains characters that
12522 need converting from the system time locale to Emacs internal format.
12523 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12524 that patch fixed format-time-string to do the conversion, but
12525 I forgot to fix current-time-zone.
12526 (format_time_string): New function, containing most of
12527 what Fformat_time_string used to contain.
12528 (Fformat_time_string): Rewrite in terms of format_time_string.
12529 This doesn't change this function's behavior.
12530 (current-time-zone): Rewrite to use format_time_string.
12531 This fixes the bug reported by Michael Schierl in
12532 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12533 Jason Rumney's 2007-06-07 change worked around this bug, but
12534 didn't fix it.
12535 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12536
12537 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12538
12539 * xdisp.c (start_display): If the character at POS is displayed
12540 via a display vector, reset IT->current.dpvec_index to zero.
12541 (try_window_reusing_current_matrix): If a line ends in a display
12542 vector or the next line starts in a display vector, continue
12543 redrawing the window even though the character position of
12544 start_row was reached.
12545 (Bug#9771, part 2)
12546
12547 2011-10-18 Chong Yidong <cyd@gnu.org>
12548
12549 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12550 with nobreak-char-display too.
12551
12552 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12553
12554 Fix part 3 of bug#9771.
12555 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12556 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12557 non-neutral characters if the current character is a paragraph
12558 separator (a.k.a. Newline). This avoids running the same
12559 expensive loop twice, once when we consume the preceding newline
12560 and the other time when the line actually needs to be displayed.
12561 Avoid the loop when we see neutrals on the base embedding level
12562 following a character whose directionality is the same as the
12563 paragraph's. This avoids running the expensive loop when a line
12564 ends in a long sequence of neutrals, like control characters.
12565 Add assertion against STRONG_AL type. Slightly rearrange code
12566 that determines the type of a neutral given the first non-neutral
12567 that follows it.
12568 (bidi_level_of_next_char): Set next_en_pos to zero when
12569 invalidating its info.
12570
12571 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12572
12573 * xdisp.c (push_display_prop): Determine whether to record string
12574 or buffer position by IT->string, not by IT->method. Allow
12575 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12576 (move_it_vertically_backward): Don't look for character position
12577 immediately after the newline when in a continuation line.
12578 (Bug#9771, part 1)
12579
12580 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12581
12582 * window.c (coordinates_in_window): Rewrite and delabelize
12583 vertical border check. (Bug#5357) (Bug#9618)
12584
12585 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12586
12587 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12588 errors in XSetWindowBorder (bug#9310).
12589
12590 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12591
12592 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12593 avoid crash when xmalloc overrun checking is enabled.
12594
12595 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12596
12597 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12598 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12599 cursor motion with <left> and <right> arrow keys.
12600
12601 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12602 some callers set that themselves.
12603
12604 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12605
12606 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12607 display string and the previous row comes from the same string and
12608 is empty. (Bug#9739) (Bug#9738)
12609
12610 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12611
12612 * doc.c (get_doc_string): Encode file name (bug#9735).
12613
12614 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12615
12616 * bidi.c (bidi_level_of_next_char):
12617 * xdisp.c (get_visually_first_element): Remove old incorrect
12618 comments regarding the Unicode Line Separator character.
12619
12620 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12621
12622 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12623
12624 * alloc.c (Fgc_status): Do not access beyond zombies array
12625 boundary if nzombies > MAX_ZOMBIES.
12626 * alloc.c (dump_zombies): Add missing format specifier.
12627
12628 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12629
12630 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12631 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12632
12633 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12634 Some packages use them to denote characters with modifiers.
12635
12636 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12637
12638 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12639 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12640 matching a pp-number. Rename parameter var to var1.
12641
12642 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12643
12644 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12645
12646 2011-10-08 Glenn Morris <rgm@gnu.org>
12647
12648 * callint.c (Fcall_interactively): Give a more explicit error for the
12649 'c' case with a non-character input. (Bug#8479)
12650
12651 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12652
12653 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12654 lines.
12655 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12656 lines that are hscrolled on the left.
12657
12658 * dispnew.c (buffer_posn_from_coords): Account for a possible
12659 presence of header-line. (Bug#4426)
12660
12661 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12662
12663 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12664 Don't advertise functionality which we discourage or doesn't work.
12665
12666 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12667
12668 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12669 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12670 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12671 this makes Emacs dump core during garbage collection on rare
12672 occasions. sizeof is obviously inferior to offsetof here, so
12673 stick with offsetof.
12674 (GC_POINTER_ALIGNMENT): New macro.
12675 (mark_memory): Omit 3rd (offset) arg; caller changed.
12676 Don't assume EMACS_INT alignment is the same as pointer alignment.
12677
12678 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12679
12680 * keyboard.c (read_key_sequence_remapped): New var.
12681 (read_key_sequence): Compute remapping in the right buffer.
12682 (command_loop_1): Use read_key_sequence's remapping directly.
12683
12684 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12685
12686 * dired.c (file_name_completion): Don't expand file name.
12687 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12688 before checking file name handler.
12689
12690 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12691 they've been requested explicitly (bug#9591).
12692
12693 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12694
12695 * keymap.c (Fsingle_key_description): Use make_specified_string
12696 instead of build_string to build string from push_key_description.
12697 (Bug#5193)
12698
12699 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12700
12701 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12702 This fixes a Y2038 bug on 64-bit hosts.
12703 * buffer.c (reset_buffer):
12704 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12705 (Fclear_buffer_auto_save_failure):
12706 Use 0, not -1, to represent an unset failure time, since time_t
12707 might not be signed.
12708
12709 Remove dependency on glibc malloc internals.
12710 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12711 Move back here from lisp.h, but with their new implementations.
12712 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12713 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12714 * charset.c (charset_table_init): New static var.
12715 (syms_of_charset): Use it instead of xmalloc. This removes a
12716 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12717 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12718 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12719 Move back to alloc.c.
12720 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12721 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12722
12723 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12724
12725 * nsterm.m (windowDidResize): Call x_set_window_size only when
12726 ns_in_resize is true. Otherwise set pixelwidth/height and
12727 call change_frame_size (Bug#9628).
12728
12729 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12730
12731 Port --enable-checking=all to Fedora 14 x86-64.
12732 * charset.c (syms_of_charset): Also account for glibc malloc's
12733 internal overhead when calculating the initial malloc maximum.
12734
12735 Port --enable-checking=all to Fedora 14 x86.
12736 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12737 Move to lisp.h.
12738 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12739 (overrun_check_realloc, overrun_check_free):
12740 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12741 That way, xmalloc returns a properly-aligned pointer even if
12742 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12743 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12744 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12745 into account when calculating the initial malloc maximum.
12746 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12747 Move here from alloc.c, so that charset.c can use it too.
12748 Properly align; the old code wasn't right for common 32-bit hosts
12749 when configured with --enable-checking=all.
12750 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12751 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12752
12753 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12754
12755 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12756 use EDOM.
12757
12758 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12759
12760 * xdisp.c (compute_display_string_end): If there's no display
12761 string at CHARPOS, return -1.
12762
12763 * bidi.c (bidi_fetch_char): When compute_display_string_end
12764 returns a negative value, treat the character as a normal
12765 character not covered by a display string. (Bug#9624)
12766
12767 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12768
12769 * lread.c (Fread_from_string): Fix typo in docstring.
12770
12771 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12772
12773 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12774 newline, reseat the iterator instead of bidi-iterating there one
12775 character at a time. (Bug#9610)
12776 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12777 TO_CHARPOS if the bidi iterator is at base embedding level.
12778
12779 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12780
12781 * lread.c (readevalloop): Use correct code for NBSP.
12782 (read1): Likewise. (Bug#9608)
12783
12784 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12785
12786 * dbusbind.c (Fdbus_register_signal): When service is not
12787 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12788
12789 2011-09-25 Glenn Morris <rgm@gnu.org>
12790
12791 * buffer.c (truncate-lines): Doc fix.
12792
12793 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12794
12795 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12796 (Fset_window_next_buffers): Doc fix.
12797
12798 2011-09-24 Glenn Morris <rgm@gnu.org>
12799
12800 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12801
12802 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12803
12804 Fix minor problems found by static checking.
12805 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12806 * indent.c (Fvertical_motion): Fix == vs = typo.
12807
12808 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12809
12810 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12811 Default value is now t. Doc fix.
12812
12813 * indent.c (Fvertical_motion): Compute and apply the overshoot
12814 logic when moving up, not only when moving down. Fix the
12815 confusing name and values of the it_overshoot_expected variable;
12816 logic changes accordingly. (Bug#9254) (Bug#9549)
12817
12818 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12819 CHARPOS is covered by a display string which includes newlines.
12820 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12821 is covered by a display string with embedded newlines.
12822
12823 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12824
12825 * dbusbind.c (Fdbus_register_signal): Add match rule to
12826 Vdbus_registered_objects_table. (Bug#9581)
12827 (Fdbus_register_method, Vdbus_registered_objects_table):
12828 Fix docstring.
12829
12830 2011-09-24 Jim Meyering <meyering@redhat.com>
12831
12832 do not ignore write error for any output size
12833 The previous change was incomplete.
12834 While it makes emacs --batch detect the vast majority of stdout
12835 write failures, errors were still ignored whenever the output size is
12836 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12837 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12838 && echo FAIL: ignored write error
12839 FAIL: ignored write error
12840 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12841 && echo FAIL: ignored write error
12842 FAIL: ignored write error
12843 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12844
12845 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12846
12847 * emacs.c (Fkill_emacs): In noninteractive mode exit
12848 non-successfully if a write error occurred on stdout. (Bug#9574)
12849
12850 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12851
12852 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12853 the xassert test.
12854
12855 * dispextern.h (struct it): Update the comment documenting what
12856 can it->OBJECT be.
12857
12858 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12859
12860 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12861 a display string, extend search for cursor position to end of row.
12862 (find_row_edges): If the row ends in a newline from a display
12863 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12864 Handle the case of a display string with multiple newlines.
12865 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12866 non-empty line. Fixes confusing cursor motion with arrow keys at
12867 the beginning of a line that starts with whitespace.
12868
12869 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12870
12871 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12872 (bug#9493).
12873
12874 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
12875
12876 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12877 boolean (Bug#9154).
12878
12879 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12880
12881 * xdisp.c (display_line): Record maximum and minimum buffer
12882 positions even if no glyphs were produced (e.g., by a zero-width
12883 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12884 buffer positions that will be removed from the glyph row because
12885 they don't fit.
12886 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12887 column is beyond frame width: don't subtract 1 "pixel" when
12888 computing width of the stretch.
12889 (reseat_at_next_visible_line_start): Undo the change made on
12890 2011-09-17 that saved paragraph information and restored it after
12891 the call to `reseat'. (Bug#9545)
12892
12893 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12894
12895 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12896 and turn window cursor on if cleared (Bug#9415).
12897
12898 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
12899
12900 * search.c (boyer_moore): Take unibyte characters from pattern
12901 literally. (Bug#9458)
12902
12903 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12904
12905 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12906
12907 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12908
12909 Fix minor problem found by static checking.
12910 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12911 initialized, to pacify gcc -Wuninitialized.
12912
12913 * fileio.c: Report proper errno when syscall falls.
12914 (Finsert_file_contents): Save and restore errno,
12915 so that report_file_error outputs the correct diagnostic.
12916 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12917
12918 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12919
12920 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12921
12922 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12923
12924 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12925 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12926
12927 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12928
12929 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12930 about the current paragraph and restore it after the call to reseat.
12931
12932 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12933 (bidi_find_paragraph_start): Search back for paragraph beginning
12934 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12935 (bidi_move_to_visually_next): Only trigger paragraph-related
12936 computations when the last character is a newline or at EOB, not
12937 just any NEUTRAL_B. (Bug#9470)
12938
12939 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12940 truncated lines if point is covered by a display string. (Bug#9524)
12941
12942 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12943
12944 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12945 (cons_to_x_long): New function.
12946 (lisp_data_to_selection_data): Use it. Correct the test for
12947 short-versus-long data; it was negated. Break out of vector
12948 loop, for efficiency, when a long datum is discovered.
12949
12950 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12951
12952 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12953
12954 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12955
12956 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12957 GCC PR/17406) by declaring this function with external scope.
12958
12959 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12960
12961 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12962 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12963
12964 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12965
12966 * editfns.c (Fformat): Correctly handle text properties on "%%".
12967
12968 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12969
12970 * xterm.c (x_draw_composite_glyph_string_foreground):
12971 * w32term.c (x_draw_composite_glyph_string_foreground):
12972 * term.c (encode_terminal_code):
12973 * composite.c (composition_update_it, get_composition_id):
12974 * xdisp.c (get_next_display_element)
12975 (fill_composite_glyph_string): Add comments about special meaning
12976 of TAB characters in a composition.
12977
12978 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12979
12980 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12981 This occurs when processing a multibyte format.
12982 Problem reported by Wolfgang Jenker.
12983
12984 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12985
12986 * xdisp.c (try_cursor_movement): Only check for exact match if
12987 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12988
12989 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12990
12991 Remove unused external symbols.
12992 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12993 * xdisp.c (calc_pixel_width_or_height): Now static.
12994 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12995 * indent.c (check_display_width):
12996 * w32term.c: Fix comment to match code.
12997 * xterm.c, xterm.h (x_catching_errors): Remove.
12998
12999 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13000
13001 * xselect.c: Use signed conversions more consistently (Bug#9498).
13002 (selection_data_to_lisp_data): Assume incoming selection data are
13003 signed integers, not unsigned. This is to be consistent with
13004 outgoing selection data, which was modified to use signed integers
13005 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13006 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13007 expects long, not unsigned long.
13008
13009 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13010
13011 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13012 computation of loop end. Reported by Johan Bockgård
13013 <bojohan@gnu.org>.
13014
13015 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13016
13017 * frame.c (Fother_visible_frames_p): Function deleted.
13018
13019 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13020
13021 * indent.c (compute_motion): Process display vector front to back
13022 rather than the other way around. (Bug#2496)
13023
13024 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13025
13026 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13027
13028 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13029
13030 * minibuf.c (Fread_from_minibuffer): Doc fix.
13031
13032 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13033
13034 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13035 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13036
13037 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13038
13039 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13040 value for non-existent files.
13041
13042 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13043
13044 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13045 set its "size" to -1. This will set the modtime_size field of
13046 the corresponding buffer to -1, which is what
13047 verify-visited-file-modtime expects for files that do not exist.
13048 (Bug#9139)
13049
13050 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13051
13052 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13053 here ...
13054 * lisp.h: ... from here. push_key_description is no longer
13055 defined in keyboard.c, so its declaration should not be in
13056 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13057 logically belongs with push_key_description.
13058
13059 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13060
13061 * buffer.h: Include <sys/types.h> instead of <time.h>.
13062 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13063 Problem reported by Herbert J. Skuhra.
13064
13065 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13066
13067 * xml.c (parse_region): Make the parsing work for
13068 non-comment-starting XML files again (bug#9144).
13069
13070 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13071
13072 * image.c (gif_load): Fix calculation of bottom and right corner.
13073 (Bug#9468)
13074
13075 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13076
13077 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13078 redisplay in small windows.
13079
13080 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13081
13082 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13083
13084 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13085
13086 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13087 Operate on live windows only.
13088
13089 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13090
13091 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13092
13093 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13094
13095 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13096 only under bidi iteration.
13097
13098 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13099
13100 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13101
13102 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13103
13104 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13105 Without this fix, the command to link temacs failed due to an
13106 undefined symbol __builtin_isnan. This is because
13107 /usr/include/iso/math_c99.h #defines isnan(x) to
13108 __builtin_isnan(x), but the bundled gcc, which identifies itself
13109 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13110 a __builtin_isnan.
13111 * floatfns.c (isnan): #undef, and then #define to a clone of
13112 what's in data.c.
13113 (Fisnan): Always define, since it's always available now.
13114 (syms_of_floatfns): Always define isnan at the Lisp level.
13115
13116 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13117
13118 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13119
13120 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13121
13122 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13123 The previous code assumed that file offsets (off_t values) fit in
13124 EMACS_INT variables, which is not true on typical 32-bit hosts.
13125 The code messed up by falsely reporting buffer overflow in cases
13126 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13127 when "big" contains more than 2**29 bytes, even though this
13128 inserts just one byte and does not overflow the buffer.
13129 (Finsert_file_contents): Store file offsets as off_t
13130 values, not as EMACS_INT values. Check for overflow when
13131 converting between EMACS_INT and off_t. When checking for
13132 buffer overflow or for overlap, take the offsets into account.
13133 Don't use EMACS_INT for small values where int suffices.
13134 When checking for overlap, fix a typo: ZV was used where
13135 ZV_BYTE was intended.
13136 (Fwrite_region): Don't assume off_t fits into 'long'.
13137 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13138
13139 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13140
13141 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13142
13143 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13144
13145 sprintf-related integer and memory overflow issues (Bug#9412).
13146
13147 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13148 (esprintf, exprintf, evxprintf): New functions.
13149 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13150 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13151 (modify_event_symbol): Do not assume that the length of
13152 name_alist_or_stem is safe to alloca and fits in int.
13153 (Fexecute_extended_command): Likewise for function name and binding.
13154 (Frecursion_depth): Wrap around reliably on integer overflow.
13155 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13156 since some callers pass EMACS_INT values.
13157 (Fsingle_key_description): Don't crash if symbol name contains more
13158 than MAX_ALLOCA bytes.
13159 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13160 (get_minibuffer): Arg is now EMACS_INT, not int.
13161 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13162 (esprintf, exprintf, evxprintf): New decls.
13163 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13164
13165 * dbusbind.c (signature_cat): New function.
13166 (xd_signature, Fdbus_register_signal):
13167 Do not overrun buffer; instead, report string overflow.
13168
13169 * dispnew.c (add_window_display_history): Don't overrun buffer.
13170 Truncate instead; this is OK since it's just a log.
13171
13172 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13173 even if the time zone offset is outlandishly large.
13174 Don't mishandle offset == INT_MIN.
13175
13176 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13177 when creating daemon; the previous buffer-overflow check was incorrect.
13178
13179 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13180 which has the guts of the old verror function.
13181
13182 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13183 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13184
13185 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13186 (font_unparse_xlfd): Don't blindly alloca long strings.
13187 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13188 fits in int, when using sprintf. Use single snprintf to count
13189 length of string rather than counting it via multiple sprintfs;
13190 that's simpler and more reliable.
13191 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13192 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13193 sprintf, in case result does not fit in int.
13194
13195 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13196 (fontset_from_font): Print it.
13197
13198 * frame.c (tty_frame_count): Now printmax_t, not int.
13199 (make_terminal_frame, set_term_frame_name): Print it.
13200 (x_report_frame_params): In X, window IDs are unsigned long,
13201 not signed long, so print them as unsigned.
13202 (validate_x_resource_name): Check for implausibly long names,
13203 and don't assume name length fits in 'int'.
13204 (x_get_resource_string): Don't blindly alloca invocation name;
13205 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13206 not fit in int.
13207
13208 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13209 (xg_check_special_colors, xg_set_geometry):
13210 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13211
13212 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13213 Use esprintf, not sprintf, in case result does not fit in int.
13214
13215 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13216 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13217 it as a large positive number.
13218 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13219 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13220
13221 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13222 in case result does not fit in int.
13223
13224 * print.c (float_to_string): Detect width overflow more reliably.
13225 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13226 buffer overrun. Don't assume list length fits in 'int'. Treat
13227 print length of 0 as 0, not as infinity; to be consistent with other
13228 uses of print length in this function. Don't overflow print length
13229 index. Don't assume hash table size fits in 'long', or that
13230 vectorlike size fits in 'unsigned long'.
13231
13232 * process.c (make_process): Use printmax_t, not int, to format
13233 process-name gensyms.
13234
13235 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13236
13237 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13238 to avoid potential buffer overrun.
13239
13240 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13241 if X resource line is longer than 512 bytes.
13242
13243 * xfns.c (x_window): Make sprintf buffer a bit bigger
13244 to avoid potential buffer overrun.
13245
13246 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13247
13248 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13249
13250 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13251
13252 Integer overflow fixes for scrolling, etc.
13253 Without these, Emacs silently mishandles large integers sometimes.
13254 For example, "C-u 4294967297 M-x recenter" was treated as if
13255 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13256
13257 * xdisp.c (try_window_id): Check Emacs fixnum range before
13258 converting to 'int'.
13259
13260 * window.c (window_scroll_line_based, Frecenter):
13261 Check that an Emacs fixnum is in range before assigning it to 'int'.
13262 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13263 values converted from Emacs fixnums.
13264 (Frecenter): Don't wrap around a line count if it is out of 'int'
13265 range; instead, treat it as an extreme value.
13266 (Fset_window_configuration, compare_window_configurations):
13267 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13268
13269 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13270 that can exceed INT_MAX. Check that EMACS_INT value is in range
13271 before assigning it to the (possibly-narrower) index.
13272 (match_limit): Don't assume that a fixnum can fit in 'int'.
13273
13274 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13275 exceed INT_MAX.
13276
13277 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13278 (Fvertical_motion): Don't wrap around LINES values that don't fit
13279 in 'int'. Instead, treat them as extreme values. This is good
13280 enough for windows, which can't have more than INT_MAX lines anyway.
13281
13282 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13283
13284 * Require libxml/parser.h to avoid compilation warning.
13285
13286 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13287
13288 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13289 since this reportedly can destroy thread storage.
13290
13291 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13292
13293 * syntax.c (find_defun_start): Update all cache variables if
13294 exiting early (Bug#9401).
13295
13296 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13297
13298 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13299
13300 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13301 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13302 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13303
13304 * term.c (tty_append_glyph): New function.
13305 (produce_stretch_glyph): Static function and its prototype deleted.
13306
13307 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13308 Add prototypes.
13309
13310 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13311
13312 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13313 when checking :margin (Bug#9390).
13314 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13315 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13316 so that the name doesn't mislead. All uses changed.
13317
13318 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13319
13320 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13321 set_tty_hooks.
13322
13323 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13324
13325 * xdisp.c (move_it_to): Don't bail out early when reaching
13326 position beyond to_charpos, if we are scanning backwards.
13327 (move_it_vertically_backward): When DY == 0, make sure we get to
13328 the first character in the line after the newline.
13329
13330 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13331
13332 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13333 (ccl_driver): Do not generate an out-of-range pointer.
13334 (Fccl_execute_on_string): Remove unnecessary check for
13335 integer overflow, noted by Stefan Monnier in
13336 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13337 Remove a FIXME that didn't need fixing.
13338 Simplify the newly-introduced buffer reallocation code.
13339
13340 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13341
13342 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13343
13344 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13345
13346 Integer and memory overflow issues (Bug#9196).
13347
13348 * doc.c (get_doc_string): Rework so that
13349 get_doc_string_buffer_size is the actual buffer size, rather than
13350 being 1 less than the actual buffer size; this makes xpalloc more
13351 convenient.
13352
13353 * image.c (x_allocate_bitmap_record, cache_image):
13354 * xselect.c (Fx_register_dnd_atom):
13355 Simplify previous changes by using xpalloc.
13356
13357 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13358 since either will do and ptrdiff_t is convenient with xpalloc.
13359
13360 * charset.c (charset_table_size)
13361 (struct charset_sort_data.priority): Now ptrdiff_t.
13362 (charset_compare): Don't overflow if priorities differ greatly.
13363 (Fsort_charsets): Don't assume list length fits in int.
13364 Check for size-calculation overflow when allocating sort data.
13365 (syms_of_charset): Allocate an initial charset table that is
13366 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13367
13368 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13369
13370 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13371 The actual value is always <= INT_MAX, and leaving it unsigned made
13372 overflow checking harder.
13373
13374 * dispextern.h (struct glyph_matrix.rows_allocated)
13375 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13376 with xpalloc. The values are still always <= INT_MAX.
13377
13378 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13379
13380 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13381 (SAFE_NALLOCA): New macro.
13382
13383 * region-cache.c (struct boundary.pos, find_cache_boundary)
13384 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13385 (set_cache_region, invalidate_region_cache)
13386 (revalidate_region_cache, know_region_cache, region_cache_forward)
13387 (region_cache_backward, pp_cache):
13388 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13389 so that ptrdiff_t * can be passed to xpalloc.
13390 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13391 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13392 (pp_cache): Don't assume cache_len fits in int.
13393 * region-cache.h: Adjust extern decls to match.
13394
13395 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13396 EMACS_INT, since either will do, for xpalloc.
13397
13398 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13399 (xnmalloc, xnrealloc, xpalloc): New functions.
13400
13401 * bidi.c (bidi_shelve_header_size): New constant.
13402 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13403 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13404
13405 * bidi.c (bidi_cache_shrink):
13406 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13407 (overlay_strings):
13408 Don't update size of array until after memory allocation succeeds,
13409 because xmalloc/xrealloc may not return.
13410 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13411 now that we have proper integer overflow checking.
13412 (record_overlay_string, overlay_strings): Catch overflows when
13413 calculating size of overlay_str_buf.
13414
13415 * callproc.c (Fcall_process): Check for size overflow when
13416 calculating size of args2.
13417 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13418 Normally we prefer signed values, but sticking with ptrdiff_t would
13419 require adding more-complicated checks.
13420
13421 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13422 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13423 Redo buffer-overflow calculations to avoid integer overflow.
13424 Add a FIXME comment where memory seems to be over-allocated.
13425
13426 * character.c (Fstring): Check for size-calculation overflow.
13427
13428 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13429 unnecessary integer overflow. Check for size overflow.
13430 (encode_coding_object): Don't update size until xmalloc succeeds.
13431
13432 * composite.c (get_composition_id): Check for overflow in glyph
13433 length calculations.
13434
13435 Integer and memory overflow fixes for display code.
13436 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13437 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13438 (scrolling_window): Check for overflow in size calculations.
13439 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13440 Don't assume glyph table len fits in int.
13441 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13442 (row_table_size): Now ptrdiff_t, not int.
13443 (scrolling_window): Avoid overflow in size calculations.
13444 Don't update size until allocation succeeds.
13445 * fns.c (concat): Check for overflow in size calculations.
13446 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13447 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13448 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13449
13450 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13451 (get_doc_string): Check for size calculation overflow.
13452 Don't update size until allocation succeeds.
13453 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13454 EMACS_INT, where ptrdiff_t will do.
13455 (Fsubstitute_command_keys): Check for string overflow.
13456
13457 * editfns.c (set_time_zone_rule): Don't assume environment length
13458 fits in int.
13459 (message_length): Now ptrdiff_t, not int.
13460 (Fmessage_box): Don't update size until allocation succeeds.
13461 Don't assume message length fits in int.
13462 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13463
13464 * emacs.c (main): Do not reallocate argv, since there is a null at
13465 the end that can be overwritten, and this way there's no need to
13466 worry about size-calculation overflow.
13467 (sort_args): Check for size-calculation overflow.
13468
13469 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13470 alloc succeeds.
13471 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13472
13473 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13474 (x_set_scroll_bar_width, x_figure_window_size):
13475 Check for integer overflow.
13476 (x_set_alpha): Do not assume XINT fits in int.
13477
13478 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13479 This is for the members text_lines, text_cols, total_lines, total_cols,
13480 where the system imposes an 'int' limit.
13481
13482 * fringe.c (Fdefine_fringe_bitmap):
13483 Don't update size until alloc works.
13484
13485 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13486 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13487
13488 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13489 Check for size-calculation overflow.
13490 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13491 do, as we prefer signed integers.
13492 (id_to_widget.max_size, id_to_widget.used)
13493 (xg_store_widget_in_map, xg_remove_widget_from_map)
13494 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13495 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13496 Use and return ptrdiff_t, not int.
13497 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13498 * gtkutil.h: Change prototypes to match the above.
13499
13500 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13501 are duplicate now that they've been promoted to lisp.h.
13502 (x_allocate_bitmap_record, x_alloc_image_color)
13503 (make_image_cache, cache_image, xpm_load):
13504 Don't update size until alloc is done.
13505 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13506 (x_detect_edges):
13507 Check for size calculation overflow.
13508 (ct_colors_allocated_max): New constant.
13509 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13510 overflow.
13511
13512 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13513 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13514 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13515 Use ptrdiff_t, not int, to count maps.
13516 (read_char_minibuf_menu_prompt): Check for overflow in size
13517 calculations. Don't update size until allocation succeeds.
13518 Redo calculations to avoid overflow.
13519 * keyboard.h: Change prototypes to match the above.
13520
13521 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13522 to count maps.
13523 (current_minor_maps): Check for size calculation overflow.
13524 * keymap.h: Change prototypes to match the above.
13525
13526 * lread.c (read1, init_obarray): Don't update size until alloc done.
13527
13528 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13529 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13530
13531 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13532 Now ptrdiff_t, not int.
13533 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13534 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13535
13536 * process.c (Fnetwork_interface_list): Check for overflow
13537 in size calculation.
13538
13539 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13540
13541 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13542 overflow. Don't bother calling xmalloc when xrealloc will do.
13543
13544 * search.c (Freplace_match): Check for size calculation overflow.
13545 (Fset_match_data): Don't assume list lengths fit in 'int'.
13546
13547 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13548 for command line length. Do not attempt to address one before the
13549 beginning of an array, as that's not portable.
13550
13551 * term.c (max_frame_lines): Remove; unused.
13552 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13553 not int.
13554 (encode_terminal_code, calculate_costs): Check for size
13555 calculation overflow.
13556 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13557 table lengths and related sizes. Don't update size until alloc
13558 done. Redo calculations to avoid overflow.
13559 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13560
13561 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13562 subtracting pointers.
13563 (gobble_line): Check for overflow more carefully. Don't update size
13564 until alloc done.
13565
13566 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13567 Don't update size until alloc done.
13568 Redo size calculations to avoid overflow.
13569 Check for size calculation overflow.
13570 (main) [DEBUG]: Fix typo in invoking tparam1.
13571
13572 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13573 Use ptrdiff_t, not int, for sizes.
13574 (store_mode_line_noprop_char): Don't update size until alloc done.
13575
13576 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13577 Use ptrdiff_t, not int, for sizes.
13578 (Finternal_make_lisp_face, cache_face):
13579 Check for size calculation overflow.
13580 (cache_face): Treat size calculation overflows as if they were
13581 memory exhaustion (the usual treatment), rather than aborting.
13582
13583 * xfns.c (x_encode_text, x_set_name_internal)
13584 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13585 sizes, since they can exceed INT_MAX in size. Check for size
13586 calculation overflow.
13587
13588 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13589 (xg_select): Check for size calculation overflow.
13590 Don't update size until alloc done.
13591
13592 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13593 as sprintf is limited to int lengths.
13594
13595 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13596 (X_LONG_MIN): New macros.
13597 Use them to make the following changes clearer.
13598 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13599 This change doesn't affect the value now, but it may help remind
13600 future maintainers not to raise the value too much later.
13601 (SELECTION_QUANTUM): Remove, replacing with ...
13602 (selection_quantum): ... new function, which avoids overflow.
13603 All uses changed.
13604 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13605 assumption that selection length fits in 'int'.
13606 (x_reply_selection_request, x_handle_selection_request)
13607 (x_get_window_property, receive_incremental_selection)
13608 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13609 (lisp_data_to_selection_data, clean_local_selection_data):
13610 Use ptrdiff_t, not int, to record length of selection.
13611 (x_reply_selection_request, x_get_window_property)
13612 (receive_incremental_selection, x_property_data_to_lisp):
13613 Redo calculations to avoid overflow.
13614 (x_reply_selection_request): When sending hint, ceiling it at
13615 X_LONG_MAX rather than relying on wraparound overflow to send
13616 something.
13617 (x_get_window_property, receive_incremental_selection)
13618 (lisp_data_to_selection_data, x_property_data_to_lisp):
13619 Check for size-calculation overflow.
13620 (x_get_window_property, receive_incremental_selection)
13621 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13622 Don't store size until memory allocation succeeds.
13623 (x_get_window_property): Plug memory leak on memory exhaustion.
13624 Don't double-block input; malloc is safe here. Don't assume 2**34
13625 - 4 fits in unsigned long. Add an xassert to check
13626 XGetWindowProperty overflow. Be more careful about overflow
13627 calculations, and distinguish size from memory overflow better.
13628 (receive_incremental_selection): When tracing, don't assume
13629 unsigned int is less than INT_MAX.
13630 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13631 harmful) conversions of unsigned short to int.
13632 (lisp_data_to_selection_data): Don't assume that integers
13633 in the range -65535 through -1 fit in an X unsigned short.
13634 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13635 result parameters unless successful. Rely on cons_to_unsigned
13636 to report problems with elements; the old code wasn't right anyway.
13637 (x_check_property_data): Check for int overflow; we cannot use
13638 a wider type due to X limits.
13639 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13640
13641 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13642
13643 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13644 (x_term_init): Check for size calculation overflow.
13645 (x_color_cells): Don't store size until memory allocation succeeds.
13646 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13647 Don't assume alloca size is less than MAX_ALLOCA.
13648 (x_term_init): Don't assume length fits in int (sprintf is limited
13649 to int size).
13650
13651 Use ptrdiff_t for composition IDs.
13652 * character.c (lisp_string_width):
13653 * composite.c (composition_table_size, n_compositions)
13654 (get_composition_id, composition_gstring_from_id):
13655 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13656 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13657 * window.c (Frecenter):
13658 Use ptrdiff_t, not int, for composition IDs.
13659 * composite.c (get_composition_id): Check for integer overflow.
13660 * composite.h: Adjust prototypes to match the above changes.
13661
13662 Use ptrdiff_t for hash table indexes.
13663 * category.c (hash_get_category_set):
13664 * ccl.c (ccl_driver):
13665 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13666 * coding.c (coding_system_charset_list, detect_coding_system):
13667 * coding.h (struct coding_system.id):
13668 * composite.c (get_composition_id, gstring_lookup_cache):
13669 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13670 * image.c (xpm_get_color_table_h):
13671 * lisp.h (hash_lookup, hash_put):
13672 * minibuf.c (Ftest_completion):
13673 Use ptrdiff_t for hash table indexes, not int (which is too
13674 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13675 32-bit --with-wide-int hosts).
13676
13677 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13678 Add a FIXME comment about memory leaks.
13679 (syms_of_charset): Don't assume xmalloc returns.
13680
13681 Don't assume that stated character widths fit in int.
13682 * character.c (Fchar_width, c_string_width, lisp_string_width):
13683 * character.h (CHAR_WIDTH):
13684 * indent.c (MULTIBYTE_BYTES_WIDTH):
13685 Use sanitize_char_width to avoid undefined and/or bad behavior
13686 with outlandish widths.
13687 * character.h (sanitize_tab_width): Rename from sanitize_width,
13688 now that we have two such functions. All uses changed.
13689 (sanitize_char_width): New inline function.
13690
13691 Don't assume that tab-width fits in int.
13692 * character.h (sanitize_width): New inline function.
13693 (SANE_TAB_WIDTH): New macro.
13694 (ASCII_CHAR_WIDTH): Use it.
13695 * indent.c (sane_tab_width): Remove. All uses replaced by
13696 SANE_TAB_WIDTH (current_buffer).
13697 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13698
13699 * fileio.c: Integer overflow issues with file modes.
13700 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13701
13702 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13703 Remove unreachable code.
13704 (read_hex, load_charset_map_from_file): Check for integer overflow.
13705
13706 * xterm.c: Don't go over XClientMessageEvent limit.
13707 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13708 (x_send_scroll_bar_event): Likewise. Check that the size does not
13709 exceed limits imposed by XClientMessageEvent, as well as the usual
13710 ptrdiff_t and size_t limits.
13711
13712 * keyboard.c: Overflow, signedness and related fixes.
13713 (make_lispy_movement): Use same integer type in forward decl
13714 that is used in the definition.
13715 (read_key_sequence, keyremap_step):
13716 Change bufsize argument back to int, undoing my 2011-03-30 change.
13717 We prefer signed types, and int is wide enough here.
13718 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13719 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13720 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13721 length, not size_t. Use ptrdiff_t for index, not int.
13722 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13723 possibility of integer overflow.
13724
13725 Overflow, signedness and related fixes for images.
13726
13727 * dispextern.h (struct it.stack[0].u.image.image_id)
13728 (struct_it.image_id, struct image.id, struct image_cache.size)
13729 (struct image_cache.used, struct image_cache.ref_count):
13730 * gtkutil.c (update_frame_tool_bar):
13731 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13732 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13733 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13734 * nsmenu.m (update_frame_tool_bar):
13735 * xdisp.c (calc_pixel_width_or_height):
13736 * xfns.c (image_cache_refcount):
13737 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13738 on typical 64-bit hosts.
13739
13740 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13741 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13742 Omit unnecessary casts to int.
13743 (parse_image_spec): Check that integers fall into 'int' range
13744 when the callers expect that.
13745 (image_ascent): Redo ascent calculation to avoid int overflow.
13746 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13747 (lookup_image): Remove unnecessary tests.
13748 (xbm_image_p): Locals are now of int, not EMACS_INT,
13749 since parse_image_check makes sure they fit into int.
13750 (png_load, gif_load, svg_load_image):
13751 Prefer int to unsigned where either will do.
13752 (tiff_handler): New function, combining the cores of the
13753 old tiff_error_handler and tiff_warning_handler.
13754 This function is rewritten to use vsnprintf and thereby avoid
13755 stack buffer overflows. It uses only the features of vsnprintf
13756 that are common to both POSIX and native Microsoft.
13757 (tiff_error_handler, tiff_warning_handler): Use it.
13758 (tiff_load, gif_load, imagemagick_load_image):
13759 Don't assume :index value fits in 'int'.
13760 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13761 (imagemagick_load_image): Check that crop parameters fit into
13762 the integer types that MagickCropImage accepts. Don't assume
13763 Vimagemagick_render_type has a nonnegative value. Don't assume
13764 size_t fits in 'long'.
13765 (gs_load): Use printmax_t to print the widest integers possible.
13766 Check for integer overflow when computing image height and width.
13767
13768 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13769
13770 * xdisp.c (redisplay_window): Don't force window start if point
13771 will be invisible in the resulting window. (Bug#9324)
13772
13773 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13774
13775 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13776 the display spec is of the form `(space ...)'.
13777 (handle_display_spec): Return the value returned by
13778 handle_single_display_spec, not just 1 or zero.
13779 (handle_single_display_spec): If the display spec is of the form
13780 `(space ...)', and specifies display in the text area, return 2
13781 rather than 1.
13782 (try_cursor_movement): Check for the need to scroll more
13783 accurately, and prefer exact match for point under bidi.
13784 Don't advance `row' beyond the last row of the window.
13785
13786 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13787 into disp_prop; all users changed.
13788
13789 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13790 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13791 for the text covered by the display property.
13792
13793 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13794
13795 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13796 Change return value to nil.
13797 (Frecord_buffer): Delete unused function.
13798
13799 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13800
13801 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13802 buffers, return left-to-right.
13803 (set_cursor_from_row): Consider candidate row a win if its glyph
13804 represents a newline and point is on that newline. Fixes cursor
13805 positioning on the newline at EOL of R2L text within L2R
13806 paragraph, and vice versa.
13807 (try_cursor_movement): Check continued rows, in addition to
13808 continuation rows. Fixes unwarranted scroll when point enters a
13809 continued line of R2L text within an L2R paragraph, or vice versa.
13810 (cursor_row_p): Consider the case of point being equal to
13811 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13812 from the end of a short line to the beginning of a continued line
13813 of R2L text within L2R paragraph.
13814 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13815 composed characters.
13816
13817 * bidi.c (bidi_check_type): Use xassert.
13818 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13819 members.
13820
13821 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13822
13823 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13824 a character.
13825
13826 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13827
13828 * nsfont.m (ns_otf_to_script): Fix typo.
13829
13830 2011-08-22 Kenichi Handa <handa@m17n.org>
13831
13832 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13833 extra slot even if the purpose is char-code-property-table.
13834
13835 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13836
13837 * xdisp.c (redisplay_window): When computing centering_position,
13838 account for the height of the header line. (Bug#8874)
13839
13840 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13841 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13842 candidate is selected by the mouse, and that candidate has a
13843 composed character under the mouse.
13844
13845 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13846 coordinates reported by pos-visible-in-window-p for a composed
13847 character in column zero.
13848
13849 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13850
13851 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13852
13853 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13854
13855 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13856 consider it a hit if to_charpos is anywhere in the range of the
13857 composed buffer positions.
13858
13859 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13860
13861 * image.c (gif_load): Don't assume that each subimage has the same
13862 dimensions as the base image. Handle disposal method that is
13863 "undefined" by the gif spec (Bug#9335).
13864
13865 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13866
13867 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13868 (Fcondition_case): Document `debug' symbol in error handler.
13869
13870 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13871
13872 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13873 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13874 from an Org mode buffer to a Speedbar frame.
13875
13876 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13877 a composition, take its buffer position from IT->cmp_it.charpos.
13878 Fixes cursor positioning at the beginning of a line that begins
13879 with a composed character.
13880
13881 2011-08-18 Eli Zaretskii <eliz@gnu.org>
13882
13883 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13884 character bidirectional type, use STRONG_L instead. Fixes crashes
13885 in a buffer produced by `describe-categories'.
13886
13887 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13888 members before the level stack, so they would be saved and
13889 restored when copying iterator state. Fixes incorrect reordering
13890 around TABs covered by display properties.
13891
13892 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13893
13894 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
13895
13896 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
13897
13898 * eval.c (internal_condition_case, internal_condition_case_1)
13899 (internal_condition_case_2, internal_condition_case_n):
13900 Remove unnecessary aborts (Bug#9081).
13901
13902 2011-08-17 Eli Zaretskii <eliz@gnu.org>
13903
13904 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13905 has no `load' handler, try opening the file locally. (Bug#9311)
13906
13907 2011-08-16 Ken Brown <kbrown@cornell.edu>
13908
13909 * gmalloc.c: Expand comment.
13910
13911 2011-08-16 Eli Zaretskii <eliz@gnu.org>
13912
13913 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13914 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13915
13916 2011-08-16 Ken Brown <kbrown@cornell.edu>
13917
13918 Fix memory allocation problems in Cygwin build (Bug#9273).
13919
13920 * unexcw.c ( __malloc_initialized): Declare external variable.
13921 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13922
13923 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13924 New variables.
13925 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13926 dumped emacs.
13927 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13928 in the static heap.
13929 [CYGWIN] (special_realloc): New function.
13930 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13931 requests to realloc storage in the static heap.
13932
13933 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13934
13935 * bidi.c (bidi_initialize): Remove unused local.
13936
13937 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13938
13939 * bidimirror.h:
13940 * biditype.h: Remove file.
13941 * makefile.w32-in ($(BLD)/bidi.$(O)):
13942 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13943
13944 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13945
13946 * chartab.c: Improve commentary for the uniprop_table API.
13947
13948 * bidi.c (bidi_paragraph_init): Support zero value of
13949 bidi_ignore_explicit_marks_for_paragraph_level.
13950 (bidi_initialize): Use uniprop_table instead of including
13951 biditype.h and bidimirror.h.
13952
13953 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13954 coordinates of the iterator when restoring from ppos_it.
13955 (Bug#9296)
13956
13957 2011-08-14 Kenichi Handa <handa@m17n.org>
13958
13959 * process.c (create_process): Call setup_process_coding_systems
13960 after the pid of the process is set to -1 (Bug#8162).
13961
13962 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13963
13964 * xdisp.c (move_it_in_display_line_to): Don't invoke
13965 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13966 ppos_it. Fixes vertical cursor motion when line beginning is
13967 covered by an image. (Bug#9296)
13968
13969 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13970
13971 * nsterm.h (ns_run_ascript): Declare.
13972 (NSAPP_DATA2_RUNASSCRIPT): Define.
13973
13974 * nsfns.m (as_script, as_result, as_status): New static variables.
13975 (ns_run_ascript): New function.
13976 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13977 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13978 the event loop. Get status from as_status (Bug#7276).
13979
13980 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13981 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13982 the event loop (Bug#7276).
13983
13984 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13985
13986 * gnutls.c (QCgnutls_bootprop_priority)
13987 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13988 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13989 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13990 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13991 (QCgnutls_bootprop_verify_hostname_error)
13992 (QCgnutls_bootprop_callbacks_verify): Rename from
13993 Qgnutls_bootprop_..., all uses changed.
13994
13995 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13996 uses changed.
13997
13998 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13999
14000 * xfaces.c (Qframe_set_background_mode): Now static.
14001 * dispextern.h (Qframe_set_background_mode): Remove decl.
14002
14003 * process.c (Fnetwork_interface_info): Declare local only if needed.
14004
14005 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14006
14007 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14008 (Fnetwork_interface_list): Allocate in increments of bytes instead
14009 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14010 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14011 sockaddr.
14012 (struct ifflag_def): notrailers is smart on OSX.
14013 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14014 Get hardware address with getifaddrs if available.
14015
14016 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14017
14018 * xdisp.c (iterate_out_of_display_property): xassert that
14019 IT->position is set to within IT->object's boundaries. Break from
14020 the loop as soon as EOB is reached; avoids infloops in redisplay
14021 when IT->position is set up wrongly due to some bug.
14022 Set IT->current to match the bidi iterator unconditionally.
14023 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14024 entry. Force push_it to save on the stack the current
14025 buffer/string position, to be restored by pop_it. Fix flags in
14026 the iterator structure wrt the object coming from a display
14027 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14028 properties. (Bug#9284)
14029
14030 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14031
14032 * fontset.c (fontset_get_font_group): Add proper type checks.
14033 (Bug#9172)
14034
14035 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14036
14037 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14038 and LC_VERSION_MIN_MACOSX.
14039 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14040 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14041
14042 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14043
14044 * xdisp.c (forward_to_next_line_start): Allow to use the
14045 no-display-properties-and-no-overlays under bidi display.
14046 Set disp_pos in the bidi iterator to avoid searches for display
14047 properties and overlays.
14048
14049 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14050
14051 * editfns.c (Fset_time_zone_rule): Document relationship with the
14052 setenv function.
14053
14054 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14055 the font entity extracted from the cache (Bug#8109).
14056
14057 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14058
14059 * composite.c (autocmp_chars): Don't reset point. That is done by
14060 restore_point_unwind (Bug#5984).
14061
14062 2011-08-07 Juri Linkov <juri@jurta.org>
14063
14064 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14065 to show the arg `TIME' instead of `TIMEVAL'.
14066
14067 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14068
14069 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14070 display property strides EOL and includes a newline, as in
14071 longlines-mode. (Bug#9254)
14072 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14073 word-wrap under bidirectional display. (Bug#9224)
14074
14075 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14076 is non-zero, even if the data buffer is NULL. Fixes a crash in
14077 vertical-motion with longlines-mode. (Bug#9254)
14078
14079 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14080
14081 * bidi.c <bidi_cache_total_alloc>: Now static.
14082 (bidi_initialize): Initialize bidi_cache_total_alloc.
14083
14084 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14085 cache. (Bug#9221)
14086
14087 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14088 amount allocated this far in `bidi_cache_total_alloc'.
14089 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14090 non-zero, only free the data buffer without restoring the cache
14091 contents. All callers changed.
14092
14093 * dispextern.h (bidi_unshelve_cache): Update prototype.
14094
14095 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14096 (move_it_in_display_line, move_it_to)
14097 (move_it_vertically_backward, move_it_by_lines): Replace the call
14098 to xfree to an equivalent call to bidi_unshelve_cache.
14099 (move_it_in_display_line_to): Fix logic of returning
14100 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14101
14102 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14103
14104 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14105 came from a string character with a `cursor' property. (Bug#9229)
14106
14107 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14108
14109 * Makefile.in (LIB_PTHREAD): New variable.
14110 (LIBES): Add LIB_PTHREAD (Bug#9216).
14111
14112 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14113 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14114
14115 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14116
14117 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14118
14119 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14120
14121 * xterm.c (x_find_topmost_parent): New function.
14122 (x_set_frame_alpha): Find topmost parent window with
14123 x_find_topmost_parent and set the property there also (bug#9181).
14124 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14125
14126 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 * callproc.c (Fcall_process): Avoid vfork clobbering
14129 the local vars buffer, coding_systems, current_dir.
14130
14131 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14132
14133 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14134
14135 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14136
14137 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14138 so that it is not optimized away.
14139
14140 * xdisp.c (compute_display_string_pos): Remove unused local.
14141
14142 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14143
14144 Fix slow cursor motion and scrolling in large buffers with
14145 selective display, like Org Mode buffers. (Bug#9218)
14146
14147 * dispextern.h (struct bidi_it): New member disp_prop_p.
14148
14149 * xdisp.c: Remove one-slot cache of display string positions.
14150 (compute_display_string_pos): Accept an additional argument
14151 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14152 for a display string or property. If found, set DISP_PROP_P
14153 non-zero.
14154
14155 * bidi.c (bidi_fetch_char): Accept an additional argument
14156 DISP_PROP_P, and pass it to compute_display_string_pos.
14157 Only handle text covered by a display string if DISP_PROP_P is returned
14158 non-zero. All callers of bidi_fetch_char changed.
14159
14160 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14161
14162 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14163
14164 2010-12-03 Don March <don@ohspite.net>
14165
14166 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14167 last character M-[char] is translated to ESC [char] (bug#7541).
14168
14169 2011-08-02 Kenichi Handa <handa@m17n.org>
14170
14171 * lisp.h (uniprop_table): Extern it.
14172
14173 * chartab.c (uniprop_table): Make it non-static.
14174
14175 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14176
14177 * xdisp.c (forward_to_next_line_start): Accept additional argument
14178 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14179 on the newline.
14180 (reseat_at_next_visible_line_start): Use the bidi iterator state
14181 returned by forward_to_next_line_start to restore the state of
14182 it->bidi_it after backing up to previous newline. (Bug#9212)
14183
14184 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14185
14186 * regex.c (re_comp): Protoize.
14187 (re_exec): Fix return type.
14188 (regexec): Fix type of `ret'. (Bug#9203)
14189
14190 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14191
14192 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14193 This is needed if max-image-size is a floating-point number.
14194
14195 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14196
14197 * print.c (print_object): Print empty symbol as ##.
14198
14199 * lread.c (read1): Read ## as empty symbol.
14200
14201 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14202
14203 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14204 setting frame foreground color (Bug#9175).
14205 (x_set_background_color): Likewise.
14206
14207 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14208 contents (Bug#9176).
14209 (EmacsTooltip -init): Remove bezels and add shadows to
14210 tooltip windows.
14211
14212 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14213 or scroll bar (Bug#8470).
14214
14215 * nsfont.m (nsfont_open): Remove assignment to voffset and
14216 unnecessary vars hshink, expand, hd, full_height, min_height.
14217 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14218
14219 * nsterm.h (nsfont_info): Remove voffset field.
14220
14221 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14222
14223 Implement strike-through and overline on NextStep (Bug#8863).
14224
14225 * nsfont.m (nsfont_open): Use underline position provided by font,
14226 instead of hard-coded value of 2.
14227 (nsfont_draw): Call ns_draw_text_decoration instead.
14228
14229 * nsterm.h: Add declaration for ns_draw_text_decoration.
14230
14231 * nsterm.m (ns_draw_text_decoration): New function for drawing
14232 underline, overline, and strike-through.
14233 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14234 ns_draw_text_decoration. Change treatment of cursor drawing to
14235 accommodate underlining, etc.
14236
14237 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14238
14239 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14240 default.
14241
14242 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14243
14244 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14245 Without this fix, if a signal arrives just after memory fills up,
14246 'malloc' might be invoked reentrantly.
14247
14248 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14249 In other words, assume that every image size is allowed, on non-X
14250 hosts. This assumption is probably wrong, but it lets Emacs compile.
14251
14252 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14253
14254 * regex.c (re_iswctype): Convert return values to boolean.
14255
14256 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14257
14258 * xdisp.c (compute_display_string_pos): Don't use cached display
14259 string position if the buffer had its restriction changed.
14260 (Bug#9184)
14261
14262 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14263
14264 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14265
14266 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14267
14268 Integer signedness and overflow and related fixes. (Bug#9079)
14269
14270 * bidi.c: Integer size and overflow fixes.
14271 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14272 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14273 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14274 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14275 (bidi_find_other_level_edge):
14276 Use ptrdiff_t instead of EMACS_INT where either will do.
14277 This works better on 32-bit hosts configured --with-wide-int.
14278 (bidi_cache_ensure_space): Check for size-calculation overflow.
14279 Use % rather than repeated addition, for better worst-case speed.
14280 Don't set bidi_cache_size until after xrealloc returns, because it
14281 might not return.
14282 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14283 (bidi_cache_ensure_space): Also check that the bidi cache size
14284 does not exceed that of the largest Lisp string or buffer. See Eli
14285 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14286
14287 * alloc.c (__malloc_size_t): Remove.
14288 All uses replaced by size_t. See Andreas Schwab's note
14289 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14290
14291 * image.c: Improve checking for integer overflow.
14292 (check_image_size): Assume that f is nonnull, since
14293 it is always nonnull in practice. This is one less thing to
14294 worry about when checking for integer overflow later.
14295 (x_check_image_size): New function, which checks for integer
14296 overflow issues inside X.
14297 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14298 This removes the need for a memory_full check.
14299 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14300 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14301 (xbm_read_bitmap_data): Change locals back to 'int', since
14302 their values must fit in 'int'.
14303 (xpm_load_image, png_load, tiff_load):
14304 Invoke x_create_x_image_and_pixmap earlier,
14305 to avoid much needless work if the image is too large.
14306 (tiff_load): Treat overly large images as if
14307 x_create_x_image_and_pixmap failed, not as malloc failures.
14308 (gs_load): Use x_check_image_size.
14309
14310 * gtkutil.c: Omit integer casts.
14311 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14312 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14313
14314 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14315
14316 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14317 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14318 would wrongly return t on a 64-bit host.
14319
14320 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14321 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14322 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14323 and therefore cause GCC to emit a bogus diagnostic in some cases.
14324
14325 * image.c: Integer signedness and overflow and related fixes.
14326 This is not an exhaustive set of fixes, but it's time to
14327 record what I've got.
14328 (lookup_pixel_color, check_image_size): Remove redundant decls.
14329 (check_image_size): Don't assume that arbitrary EMACS_INT values
14330 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14331 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14332 (tiff_load, imagemagick_load_image):
14333 Check for overflow in size calculations.
14334 (x_create_x_image_and_pixmap): Remove unnecessary test for
14335 xmalloc returning NULL; that can't happen.
14336 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14337 (xpm_color_bucket): Use better integer hashing function.
14338 (xpm_cache_color): Don't possibly over-allocate memory.
14339 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14340 (gif_memory_source):
14341 Use ptrdiff_t, not int or size_t, to record sizes.
14342 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14343 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14344 either works, as we prefer signed integers.
14345 (tiff_read_from_memory, tiff_write_from_memory):
14346 Return tsize_t, not size_t, since that's what the TIFF API wants.
14347 (tiff_read_from_memory): Don't fail simply because the read would
14348 go past EOF; instead, return a short read.
14349 (tiff_load): Omit no-longer-needed casts.
14350 (Fimagemagick_types): Don't assume size fits into 'int'.
14351
14352 Improve hashing quality when configured --with-wide-int.
14353 * fns.c (hash_string): New function, taken from sxhash_string.
14354 Do not discard information about ASCII character case; this
14355 discarding is no longer needed.
14356 (sxhash-string): Use it. Change sig to match it. Caller changed.
14357 * lisp.h: Declare it.
14358 * lread.c (hash_string): Remove, since we now use fns.c's version.
14359 The fns.c version returns a wider integer if --with-wide-int is
14360 specified, so this should help the quality of the hashing a bit.
14361
14362 * emacs.c: Integer overflow minor fix.
14363 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14364 Define only if GNU_LINUX.
14365 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14366
14367 * dispnew.c: Integer signedness and overflow fixes.
14368 Remove unnecessary forward decls, that were a maintenance hassle.
14369 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14370 All uses changed.
14371 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14372 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14373 (prepare_desired_row, line_draw_cost):
14374 Use int, not unsigned, where either works.
14375 (save_current_matrix, restore_current_matrix):
14376 Use ptrdiff_t, not size_t, where either works.
14377 (init_display): Check for overflow more accurately, and without
14378 relying on undefined behavior.
14379
14380 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14381 Remove, replacing with the new symbols in lisp.h. All uses changed.
14382 * fileio.c (make_temp_name):
14383 * filelock.c (lock_file_1, lock_file):
14384 * xdisp.c (message_dolog):
14385 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14386 Use pMd etc. instead.
14387 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14388 replacing the pWIDE etc. symbols removed from editfns.c.
14389
14390 * keyboard.h (num_input_events): Now uintmax_t.
14391 This is (very slightly) less likely to mess up due to wraparound.
14392 All uses changed.
14393
14394 * buffer.c: Integer signedness fixes.
14395 (alloc_buffer_text, enlarge_buffer_text):
14396 Use ptrdiff_t rather than size_t when either will do, as we prefer
14397 signed integers.
14398
14399 * alloc.c: Integer signedness and overflow fixes.
14400 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14401 (__malloc_size_t): Default to size_t, not to int.
14402 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14403 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14404 Prefer ptrdiff_t to size_t when either would do, as we prefer
14405 signed integers.
14406 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14407 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14408 Now const. Initialize with values that are in range even if char
14409 is signed.
14410 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14411 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14412 These functions do the right thing with sizes > 2**32.
14413 (check_depth): Now ptrdiff_t, not int.
14414 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14415 Adjust to new way of storing sizes. Check for size overflow bugs
14416 in rest of code.
14417 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14418 slightly wrong anyway, as it missed one instance of
14419 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14420 (refill_memory_reserve): Omit needless cast to size_t.
14421 (mark_object_loop_halt): Mark as externally visible.
14422
14423 * xselect.c: Integer signedness and overflow fixes.
14424 (Fx_register_dnd_atom, x_handle_dnd_message):
14425 Use ptrdiff_t, not size_t, since we prefer signed.
14426 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14427 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14428 x_dnd_atoms_size and x_dnd_atoms_length.
14429
14430 * doprnt.c: Prefer signed to unsigned when either works.
14431 * eval.c (verror):
14432 * doprnt.c (doprnt):
14433 * lisp.h (doprnt):
14434 * xdisp.c (vmessage):
14435 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14436 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14437 prefer signed arithmetic to avoid comparison confusion.
14438 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14439 but is a bit tricky.
14440
14441 Assume freestanding C89 headers, string.h, stdlib.h.
14442 * data.c, doprnt.c, floatfns.c, print.c:
14443 Include float.h unconditionally.
14444 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14445 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14446 * regex.c: Likewise for stddef.h, string.h.
14447 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14448 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14449 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14450 (STDC_HEADERS): Remove obsolete defines.
14451 * sysdep.c: Include limits.h unconditionally.
14452
14453 Assume support for memcmp, memcpy, memmove, memset.
14454 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14455 * regex.c (memcmp, memcpy):
14456 Remove; we assume C89 now.
14457
14458 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14459 (__malloc_safe_bcopy): Remove; no longer needed.
14460
14461 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14462 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14463 well either way, and we prefer signed to unsigned.
14464
14465 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14466
14467 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14468 closes the connection while we're reading (bug#9182).
14469
14470 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14471
14472 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14473 are specified (Bug#9168).
14474
14475 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14476
14477 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14478 Found by GCC static checking and --with-wide-int on a 32-bit host.
14479
14480 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14481
14482 * xdisp.c (compute_display_string_pos): Fix logic of caching
14483 previous display string position. Initialize cached_prev_pos to
14484 -1. Fixes slow-down at the beginning of a buffer.
14485
14486 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14487
14488 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14489 for attrs[LFACE_FONTSET_INDEX].
14490
14491 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14492
14493 * xml.c (parse_region): Remove unused local
14494 that was recently introduced.
14495
14496 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14497
14498 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14499 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14500
14501 * xdisp.c (move_it_in_display_line_to): Record the best matching
14502 position for TO_CHARPOS while scanning the line, and restore it on
14503 exit if none of the characters scanned was an exact match.
14504 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14505 when exact match is impossible due to invisible text, and the
14506 lines are truncated.
14507
14508 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14509
14510 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14511 for OSX >= 10.7.
14512
14513 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14514
14515 Fix a significant slow-down of cursor motion with C-n, C-p,
14516 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14517 auto-repeat under bidi redisplay in fontified buffers.
14518 * xdisp.c (compute_stop_pos_backwards): New function.
14519 (next_element_from_buffer): Call compute_stop_pos_backwards to
14520 find a suitable prev_stop when we find ourselves before
14521 base_level_stop.
14522 (reseat): Don't look for prev_stop, as that could mean a very long
14523 run.
14524 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14525 <cached_disp_overlay_modiff>: Cache for last found display string
14526 position.
14527 (compute_display_string_pos): Return the cached position if asked
14528 about the same buffer in the same area of character positions, and
14529 the buffer wasn't changed since the time the display string
14530 position was cached.
14531
14532 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14533
14534 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14535 is an integer, which is important for empty lines. (Bug#9149)
14536
14537 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14538
14539 * frame.c (Fmodify_frame_parameters): In tty case, update the
14540 default face if necessary (Bug#4238).
14541
14542 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14543
14544 * editfns.c (Fstring_to_char): No need to explain what a character
14545 is in the docstring (Bug#6576).
14546
14547 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14548
14549 * xml.c (parse_region): Make sure we always return a tree.
14550
14551 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14552
14553 * xml.c (parse_region): If a document contains only comments,
14554 return that, too.
14555
14556 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14557
14558 * xml.c (make_dom): Return comments, too.
14559
14560 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14561
14562 Port to OpenBSD.
14563 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14564 and the surrounding thread.
14565 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14566 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14567 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14568 timer goes off.
14569 * s/openbsd.h (BROKEN_SIGIO): Define.
14570 * unexelf.c (unexec) [__OpenBSD__]:
14571 Don't update the .mdebug section of the Alpha COFF symbol table.
14572
14573 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14574
14575 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14576 (bug#8460).
14577
14578 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14579
14580 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14581 This fixes some race conditions on the permissions of any newly
14582 created file.
14583
14584 * alloc.c (valid_pointer_p): Use pipe, not open.
14585 This fixes some permissions issues when debugging.
14586
14587 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14588 If fchown fails to set both uid and gid, try to set just gid,
14589 as that is sometimes allowed. Adjust the file's mode to eliminate
14590 setuid or setgid bits that are inappropriate if fchown fails.
14591
14592 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14593
14594 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14595 to compare Lisp_Objects.
14596 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14597 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14598 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14599
14600 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14601
14602 * lread.c (read_integer): Unread even EOF character.
14603 (read1): Likewise. Properly record start position of symbol.
14604
14605 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14606 symbol character follows.
14607
14608 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14609
14610 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14611 This works around a problem with the previous change to Fcopy_file.
14612 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14613 and without this change, GCC might complain about discarding
14614 fchown's return value.
14615
14616 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14617
14618 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14619
14620 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14621
14622 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14623
14624 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14625
14626 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14627 it's used from the C level.
14628
14629 * process.c: Use the same condition for POLL_FOR_INPUT in both
14630 keyboard.c and process.c (bug#1858).
14631
14632 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14633
14634 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14635 (Fgnutls_boot): Use it.
14636
14637 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14638
14639 * doc.c (Fsubstitute_command_keys): Revert last change.
14640
14641 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14642
14643 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14644 quotes the next character, and doesn't affect other longer
14645 sequences (bug#8935).
14646
14647 * lread.c (syms_of_lread): Clarify that is isn't only
14648 `eval-buffer' and `eval-defun' that's affected by
14649 `lexical-binding' (bug#8460).
14650
14651 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14652
14653 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14654 bidi redisplay when a line includes both an image and is truncated.
14655
14656 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14657
14658 Fix minor problems found by static checking.
14659 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14660 (elsz): Now a signed constant, not a size_t var. We prefer signed
14661 types to unsigned, to avoid integer comparison confusion. Without
14662 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14663 "cannot optimize loop, the loop counter may overflow", a symptom
14664 of the confusion.
14665 * indent.c (Fvertical_motion): Mark locals as initialized.
14666 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14667
14668 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14669
14670 * search.c (Fre_search_backward): Mention `case-fold-search' in
14671 all the re_search_* functions (bug#8138).
14672
14673 * keyboard.c (Fopen_dribble_file): Document when the file is
14674 closed (bug#8056).
14675
14676 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14677
14678 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14679 bidi_cache_idx.
14680
14681 Support bidi reordering of display and overlay strings.
14682 * xdisp.c (compute_display_string_pos)
14683 (compute_display_string_end): Accept additional argument STRING.
14684 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14685 (reseat_to_string): Initialize bidi_it->string.s and
14686 bidi_it->string.schars.
14687 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14688 NULL (avoids a crash in bidi_paragraph_init).
14689 Initialize itb.string.lstring.
14690 (init_iterator): Call bidi_init_it only of a valid
14691 buffer position was specified. Initialize paragraph_embedding to
14692 L2R.
14693 (reseat_to_string): Initialize the bidi iterator.
14694 (display_string): If we need to ignore text properties of
14695 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14696 original value of -1 will not work with bidi.)
14697 (compute_display_string_pos): First arg is now struct
14698 `text_pos *'; all callers changed. Support display properties on
14699 Lisp strings.
14700 (compute_display_string_end): Support display properties on Lisp
14701 strings.
14702 (init_iterator, reseat_1, reseat_to_string): Initialize the
14703 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14704 when iterating on a string not from display properties).
14705 (compute_display_string_pos, compute_display_string_end):
14706 Fix calculation of the object to scan. Fixes an error when using
14707 arrow keys.
14708 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14709 base_level_stop; instead, set base_level_stop to BEGV.
14710 Fixes crashes in vertical-motion.
14711 (next_element_from_buffer): Improve commentary for when
14712 the iterator is before prev_stop.
14713 (init_iterator): Initialize bidi_p from the default value of
14714 bidi-display-reordering, not from buffer-local value. Use the
14715 buffer-local value only if initializing for buffer iteration.
14716 (handle_invisible_prop): Support invisible properties on strings
14717 that are being bidi-reordered.
14718 (set_iterator_to_next): Support bidi reordering of C strings and
14719 Lisp strings.
14720 (next_element_from_string): Support bidi reordering of Lisp
14721 strings.
14722 (handle_stop_backwards): Support Lisp strings as well.
14723 (display_string): Support display of R2L glyph rows.
14724 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14725 (init_iterator): Don't initialize it->bidi_p for strings
14726 here.
14727 (reseat_to_string): Initialize it->bidi_p for strings here.
14728 (next_element_from_string, next_element_from_c_string)
14729 (next_element_from_buffer): Add xassert's for correspondence
14730 between IT's object being iterated and it->bidi_it.string
14731 structure.
14732 (face_before_or_after_it_pos): Support bidi iteration.
14733 (next_element_from_c_string): Handle the case of the first string
14734 character that is not the first one in the visual order.
14735 (get_visually_first_element): New function, refactored from common
14736 parts of next_element_from_buffer, next_element_from_string, and
14737 next_element_from_c_string.
14738 (tool_bar_lines_needed, redisplay_tool_bar)
14739 (display_menu_bar): Force left-to-right direction. Add a FIXME
14740 comment for making that be controlled by a user option.
14741 (push_it, pop_it): Save and restore the state of the
14742 bidi iterator. Save and restore the bidi_p flag.
14743 (pop_it): Iterate out of display property for string iteration as
14744 well.
14745 (iterate_out_of_display_property): Support iteration over strings.
14746 (handle_single_display_spec): Set up it->bidi_it for iteration
14747 over a display string, and call bidi_init_it.
14748 (handle_single_display_spec, next_overlay_string)
14749 (get_overlay_strings_1, push_display_prop): Set up the bidi
14750 iterator for displaying display or overlay strings.
14751 (forward_to_next_line_start): Don't use the shortcut if
14752 bidi-iterating.
14753 (back_to_previous_visible_line_start): If handle_display_prop
14754 pushed the iterator stack, restore the internal state of the bidi
14755 iterator by calling bidi_pop_it same number of times.
14756 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14757 and we are bidi-iterating, don't decrement the iterator position;
14758 instead, set the first_elt flag in the bidi iterator, to produce
14759 the same effect.
14760 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14761 (push_display_prop): xassert that we are iterating a buffer.
14762 (push_it, pop_it): Save and restore paragraph_embedding member.
14763 (handle_single_display_spec, next_overlay_string)
14764 (get_overlay_strings_1, reseat_1, reseat_to_string)
14765 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14766 correctly. Don't assume unibyte strings are not bidi-reordered.
14767 (compute_display_string_pos)
14768 (compute_display_string_end): Fix handling the case of C string.
14769 (push_it, pop_it): Save and restore from_disp_prop_p.
14770 (handle_single_display_spec, push_display_prop): Set the
14771 from_disp_prop_p flag.
14772 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14773 (pop_it): Call iterate_out_of_display_property only if we are
14774 popping after iteration over a string that came from a display
14775 property. Fix a typo in popping stretch info. Add an assertion
14776 for verifying that the iterator position is in sync with the bidi
14777 iterator.
14778 (handle_single_display_spec, get_overlay_strings_1)
14779 (push_display_prop): Fix initialization of paragraph direction for
14780 string when that of the parent object is not yet determined.
14781 (reseat_1): Call bidi_init_it to resync the bidi
14782 iterator with IT's position. (Bug#7616)
14783 (find_row_edges): If ROW->start.pos gives position
14784 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14785 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14786 Reset the from_disp_prop_p flag.
14787 (SAVE_IT, RESTORE_IT): New macros.
14788 (pos_visible_p, face_before_or_after_it_pos)
14789 (back_to_previous_visible_line_start)
14790 (move_it_in_display_line_to, move_it_in_display_line)
14791 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14792 (try_scrolling, redisplay_window, display_line): Use them when
14793 saving a temporary copy of the iterator and restoring it back.
14794 (back_to_previous_visible_line_start, reseat_1)
14795 (init_iterator): Empty the bidi cache "stack".
14796 (move_it_in_display_line_to): If iterator ended up at
14797 EOL, but we never saw any buffer positions smaller than
14798 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14799 motion in bidi-reordered lines.
14800 (move_it_in_display_line_to): Record prev_method and prev_pos
14801 immediately before the call to set_iterator_to_next. Fixes cursor
14802 motion in bidi-reordered lines with stretch glyphs and strings
14803 displayed in margins. (Bug#8133) (Bug#8867)
14804 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14805 TO_CHARPOS.
14806 (pos_visible_p): Support positions in bidi-reordered lines.
14807 Save and restore bidi cache.
14808
14809 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14810 (bidi_paragraph_info): Delete unused struct.
14811 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14812 (bidi_cache_start): New variable.
14813 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14814 to zero.
14815 (bidi_cache_fetch_state, bidi_cache_search)
14816 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14817 (bidi_cache_find, bidi_peek_at_next_level)
14818 (bidi_level_of_next_char, bidi_find_other_level_edge)
14819 (bidi_move_to_visually_next): Compare cache index with
14820 bidi_cache_start rather than with zero.
14821 (bidi_fetch_char): Accept new argument STRING; all callers
14822 changed. Support iteration over a string. Support strings with
14823 display properties. Support unibyte strings. Fix the type of
14824 `len' according to what STRING_CHAR_AND_LENGTH expects.
14825 (bidi_paragraph_init, bidi_resolve_explicit_1)
14826 (bidi_resolve_explicit, bidi_resolve_weak)
14827 (bidi_level_of_next_char, bidi_move_to_visually_next):
14828 Support iteration over a string.
14829 (bidi_set_sor_type, bidi_resolve_explicit_1)
14830 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14831 can now be zero (for strings); special values 0 and -1 were
14832 changed to -1 and -2, respectively.
14833 (bidi_char_at_pos): New function.
14834 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14835 Call it instead of FETCH_MULTIBYTE_CHAR.
14836 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14837 initialized to valid values.
14838 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14839 values.
14840 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14841 the test for valid cached positions. Fix the logic for looking up
14842 the sentinel state in the cache. GCPRO the Lisp string we are
14843 iterating.
14844 (bidi_push_it, bidi_pop_it): New functions.
14845 (bidi_initialize): Initialize the bidi cache start stack pointer.
14846 (bidi_cache_ensure_space): New function, refactored from part of
14847 bidi_cache_iterator_state. Don't assume the required size is just
14848 one BIDI_CACHE_CHUNK away.
14849 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14850 (bidi_count_bytes, bidi_char_at_pos): New functions.
14851 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14852 always valid if bidi_cache_idx is valid.
14853 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14854 is valid if it's going to be used.
14855 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14856 (bidi_cache_fetch_state, bidi_cache_search)
14857 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14858 (bidi_cache_iterator_state, bidi_cache_find)
14859 (bidi_find_other_level_edge, bidi_cache_start_stack):
14860 All variables related to cache indices are now EMACS_INT.
14861
14862 * dispextern.h (struct bidi_string_data): New structure.
14863 (struct bidi_it): New member `string'. Make flag members be 1-bit
14864 fields, and put them last in the struct.
14865 (compute_display_string_pos, compute_display_string_end):
14866 Update prototypes.
14867 (bidi_push_it, bidi_pop_it): Add prototypes.
14868 (struct iterator_stack_entry): New members bidi_p,
14869 paragraph_embedding, and from_disp_prop_p.
14870 (struct it): Member bidi_p is now a bit field 1 bit wide.
14871 (bidi_shelve_cache, bidi_unshelve_cache):
14872 Declare prototypes.
14873
14874 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14875 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14876 and vector-like objects.
14877
14878 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14879 cache around display iteration.
14880
14881 * window.c (Fwindow_end, window_scroll_pixel_based)
14882 (displayed_window_lines, Frecenter): Save and restore the bidi
14883 cache around display iteration.
14884
14885 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14886
14887 * editfns.c (Fdelete_region): Clarify the use of the named
14888 parameters (bug#6788).
14889
14890 2011-07-14 Martin Rudalics <rudalics@gmx.at>
14891
14892 * indent.c (Fvertical_motion): Set and restore w->pointm when
14893 saving and restoring the window's buffer (Bug#9006).
14894
14895 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14896
14897 * editfns.c (Fstring_to_char): Clarify just what is returned
14898 (bug#6576). Text by Eli Zaretskii.
14899
14900 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
14901
14902 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14903
14904 2011-07-13 Eli Zaretskii <eliz@gnu.org>
14905
14906 * buffer.c (mmap_find): Fix a typo.
14907
14908 2011-07-13 Johan Bockgård <bojohan@gnu.org>
14909
14910 Fix execution of x selection hooks.
14911 * xselect.c (Qx_lost_selection_functions)
14912 (Qx_sent_selection_functions): New vars.
14913 (syms_of_xselect): DEFSYM them.
14914 (x_handle_selection_request): Pass Qx_sent_selection_functions
14915 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14916 (x_handle_selection_clear,x_clear_frame_selections):
14917 Pass Qx_lost_selection_functions rather than
14918 Vx_lost_selection_functions to Frun_hook_with_args.
14919
14920 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14921
14922 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14923 The old code sometimes used this field without initializing it.
14924
14925 * alloc.c (gc_sweep): Don't read past end of array.
14926 In theory, the old code could also have corrupted Emacs internals,
14927 though it'd be very unlikely.
14928
14929 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14930
14931 * character.c (Fcharacterp): Don't advertise optional ignored
14932 argument. (Bug#4026)
14933
14934 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14935
14936 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14937 key" (bug#4257).
14938
14939 * window.c (Fset_window_start): Doc fix (bug#4199).
14940 (Fset_window_hscroll): Ditto.
14941
14942 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14943
14944 Fix minor new problems caught by GCC 4.6.1.
14945 * term.c (init_tty): Remove unused local.
14946 * xsettings.c (store_monospaced_changed): Define this function only
14947 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14948 not used otherwise.
14949
14950 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14951
14952 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14953
14954 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14955
14956 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14957 are the mini-buffer and the echo area (bug#3320).
14958
14959 * term.c (init_tty): Remove support for supdup, c10 and perq
14960 terminals, which are no longer supported (bug#1482).
14961
14962 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14963
14964 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14965
14966 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14967
14968 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14969 for non-popups (Bug#3642).
14970
14971 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14972
14973 * alloc.c (reset_malloc_hooks): Protoize.
14974 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14975 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14976 * cm.c (losecursor): Likewise.
14977 * data.c (fmod): Likewise.
14978 * dispnew.c (swap_glyphs_in_rows): Likewise.
14979 * emacs.c (memory_warning_signal): Likewise.
14980 * floatfns.c (float_error): Likewise.
14981 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14982 (otf_open, font_otf_capability, generate_otf_features)
14983 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14984 Likewise.
14985 * image.c (pbm_read_file): Likewise.
14986 * indent.c (string_display_width): Likewise.
14987 * intervals.c (check_for_interval, search_for_interval)
14988 (inc_interval_count, count_intervals, root_interval)
14989 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14990 * lread.c (defalias): Likewise.
14991 * ralloc.c (r_alloc_check): Likewise.
14992 * regex.c (set_image_of_range_1, set_image_of_range)
14993 (regex_grow_registers): Likewise.
14994 * sysdep.c (strerror): Likewise.
14995 * termcap.c (valid_filename_p, tprint, main): Likewise.
14996 * tparam.c (main): Likewise.
14997 * unexhp9k800.c (run_time_remap, save_data_space)
14998 (update_file_ptrs, read_header, write_header, calculate_checksum)
14999 (copy_file, copy_rest, display_header): Likewise.
15000 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15001 Likewise.
15002 * xdisp.c (check_it): Likewise.
15003 * xfaces.c (register_color, unregister_color, unregister_colors):
15004 Likewise.
15005 * xfns.c (print_fontset_result): Likewise.
15006 * xrdb.c (member, fatal, main): Likewise.
15007
15008 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15009
15010 Fix minor problems found by static checking (Bug#9031).
15011 * chartab.c (char_table_set_range, map_sub_char_table):
15012 Remove unused locals.
15013 (uniprop_table): Now static.
15014 * composite.c (_work_char): Remove unused static var.
15015
15016 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15017
15018 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15019
15020 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15021
15022 * gtkutil.c (qttip_cb): Remove code without function.
15023
15024 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15025
15026 * w32.c (pthread_sigmask): New stub.
15027
15028 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15029
15030 Use pthread_sigmask, not sigprocmask (Bug#9010).
15031 sigprocmask is portable only for single-threaded applications, and
15032 Emacs can be multi-threaded when it uses GTK.
15033 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15034 (LIBES): Use it.
15035 * callproc.c (Fcall_process):
15036 * process.c (create_process):
15037 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15038 Use pthread_sigmask, not sigprocmask.
15039
15040 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15041
15042 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15043 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15044 wrong (Bug#8591).
15045
15046 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15047
15048 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15049 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15050 (xg_hide_tooltip): Fix comment.
15051
15052 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15053 in registerServicesMenuSendTypes.
15054 (validRequestorForSendType): Don't check ns_return_types.
15055
15056 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15057 ns_return_type.
15058
15059 2011-07-08 Jason Rumney <jasonr@gnu.org>
15060
15061 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15062 SH_SHOW for hidden windows (Bug#5482).
15063
15064 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15065 frame struct members of non-existent frames (Bug#6284).
15066
15067 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15068
15069 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15070 variable firstTime not needed on OSX >= 10.6.
15071 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15072 >= 10.5. Use setKnobProportion, setDoubleValue.
15073
15074 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15075 (MAC_OS_X_VERSION_10_5): Define if not defined.
15076 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15077 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15078 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15079
15080 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15081 cString and lossyCString on OSX >= 10.4.
15082
15083 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15084 sizeToFit on OSX >= 10.2.
15085
15086 * nsimage.m (allocInitFromFile): Don't use deprecated method
15087 bestRepresentationForDevice on OSX >= 10.6.
15088
15089 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15090 to avoid warning.
15091
15092 * emacs.c: Declare unexec_init_emacs_zone.
15093
15094 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15095
15096 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15097
15098 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15099 on svcsMenu (Bug#8842).
15100
15101 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15102 ns_return_types.
15103 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15104
15105 * nsterm.m (QUTF8_STRING): Declare.
15106 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15107 (validRequestorForSendType): Return type is (id).
15108 Change indexOfObjectIdenticalTo to indexOfObject.
15109 Check if we have local selection before returning self (Bug#8842).
15110 (writeSelectionToPasteboard): Put local selection into paste board
15111 if we have a local selection (Bug#8842).
15112 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15113
15114 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15115 (ns_get_local_selection): Declare.
15116
15117 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15118
15119 * keymap.c (describe_map_tree): Don't insert a double newline at
15120 the end of the buffer (bug#1169) and return whether we inserted
15121 something.
15122
15123 * callint.c (Fcall_interactively): Change "reading args" to
15124 "providing args" to try to clarify what it does (bug#1010).
15125
15126 2011-07-07 Kenichi Handa <handa@m17n.org>
15127
15128 * composite.c (composition_compute_stop_pos): Ignore a static
15129 composition starting before CHARPOS (Bug#8915).
15130
15131 * xdisp.c (handle_composition_prop): Likewise.
15132
15133 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15134
15135 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15136 (Bug#9015)
15137
15138 2011-07-07 Kenichi Handa <handa@m17n.org>
15139
15140 * character.h (unicode_category_t): New enum type.
15141
15142 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15143 (Qchar_code_property_table): New variable.
15144 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15145 (UNIPROP_COMPRESSED_FORM_P): New macros.
15146 (char_table_ascii): Uncompress the compressed values.
15147 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15148 Uncompress the compressed values.
15149 (sub_char_table_ref_and_range): Likewise.
15150 (char_table_ref_and_range): Uncompress the compressed values.
15151 (sub_char_table_set): New arg is_uniprop. Callers changed.
15152 Uncompress the compressed values.
15153 (sub_char_table_set_range): Args changed. Callers changed.
15154 (char_table_set_range): Adjuted for the above change.
15155 (map_sub_char_table): Delete args default_val and parent. Add arg
15156 top. Give decoded values to a Lisp function.
15157 (map_char_table): Adjust for the above change. Give decoded
15158 values to a Lisp function. Gcpro more variables.
15159 (uniprop_table_uncompress)
15160 (uniprop_decode_value_run_length): New functions.
15161 (uniprop_decoder, uniprop_decoder_count): New variables.
15162 (uniprop_get_decoder, uniprop_encode_value_character)
15163 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15164 New functions.
15165 (uniprop_encoder, uniprop_encoder_count): New variables.
15166 (uniprop_get_encoder, uniprop_table)
15167 (Funicode_property_table_internal, Fget_unicode_property_internal)
15168 (Fput_unicode_property_internal): New functions.
15169 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15170 Sunicode_property_table_internal, Sget_unicode_property_internal,
15171 and Sput_unicode_property_internal. Defvar_lisp
15172 char-code-property-alist.
15173
15174 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15175 Vunicode_category_table.
15176
15177 * font.c (font_range): Adjust for the change of
15178 Vunicode_category_table.
15179
15180 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15181
15182 * m/iris4d.h: Remove file, move contents ...
15183 * s/irix6-5.h: ... here.
15184
15185 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15186
15187 Remove unportable assumption about struct layout (Bug#8884).
15188 * alloc.c (mark_buffer):
15189 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15190 (clone_per_buffer_values): Don't assume that
15191 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15192 This isn't true in general, and it's particularly not true
15193 if Emacs is configured with --with-wide-int.
15194 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15195 New macros, used in the buffer.c change.
15196
15197 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15198
15199 * xsettings.c: Use both GConf and GSettings if both are available.
15200 (store_config_changed_event): Add comment.
15201 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15202 (store_tool_bar_style_changed): New functions.
15203 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15204 (struct xsettings): Move font inside HAVE_XFT.
15205 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15206 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15207 Move inside HAVE_XFT.
15208 (something_changed_gsettingsCB): Rename from something_changedCB.
15209 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15210 also.
15211 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15212 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15213 (something_changed_gconfCB): Rename from something_changedCB.
15214 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15215 (parse_settings): Move check for font inside HAVE_XFT.
15216 (read_settings, apply_xft_settings): Add comment.
15217 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15218 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15219 call store_font_name_changed.
15220 (xft_settings_event): Add comment.
15221 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15222 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15223 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15224 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15225 (xsettings_initialize): Call init_gsettings last.
15226 (xsettings_get_system_font, xsettings_get_system_normal_font):
15227 Add comment.
15228
15229 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15230
15231 Random fixes. E.g., (random) never returned negative values.
15232 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15233 subseconds part to the entropy, as that's a bit more random.
15234 Prefer signed to unsigned, since the signedness doesn't matter and
15235 in general we prefer signed. When given a limit, use a
15236 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15237 latter isn't right if USE_2_TAGS_FOR_INTS.
15238 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15239 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15240
15241 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15242
15243 * textprop.c (text_property_stickiness):
15244 Obey Vtext_property_default_nonsticky.
15245 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15246 * w32fns.c (syms_of_w32fns):
15247 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15248
15249 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15250
15251 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15252 This is more efficient than Ffile_directory_p and avoids a minor race.
15253
15254 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15255
15256 * buffer.c (Foverlay_put): Say what the return value is
15257 (bug#7835).
15258
15259 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15260 is a directory before asking whether to use the file name
15261 (bug#7564).
15262 (barf_or_query_if_file_exists): Make the "File is a directory"
15263 error be more correct.
15264
15265 * fns.c (Frequire): Remove the mention of the .gz files, since
15266 that's installation-specific, but keep the mention of
15267 `get-load-suffixes'.
15268
15269 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15270
15271 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15272 Report string overflow if the output is too long.
15273
15274 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15275
15276 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15277 (syms_of_gnutls): Remove duplicate DEFSYM for
15278 Qgnutls_bootprop_verify_hostname_error, an error for
15279 Qgnutls_bootprop_verify_error (which is no longer used).
15280
15281 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15282 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15283 Also (re)move comments that are misplaced or no longer relevant.
15284
15285 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15286
15287 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15288
15289 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15290
15291 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15292 and background color parameters if they have been changed.
15293
15294 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15295
15296 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15297
15298 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15299
15300 * xsettings.c (SYSTEM_FONT): Define only when used.
15301 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15302
15303 * keymap.c (access_keymap_1): Now static.
15304
15305 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15306
15307 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15308 leave any prefix arg for the up event (Bug#1586).
15309
15310 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15311
15312 * lread.c (syms_of_lread): Mention single symbols defined by
15313 `defvar' or `defconst' (bug#7154).
15314
15315 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15316 (Frequire): Mention get-load-suffixes.
15317
15318 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15319
15320 * window.h (window): Remove clone_number slot.
15321 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15322 Remove.
15323 (make_parent_window, make_window, saved_window)
15324 (Fset_window_configuration, save_window_save): Don't deal with
15325 clone numbers.
15326 * buffer.c (Qclone_number): Remove declaration.
15327 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15328
15329 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15330
15331 Add multiple inheritance to keymaps.
15332 * keymap.c (Fmake_composed_keymap): New function.
15333 (Fset_keymap_parent): Simplify.
15334 (fix_submap_inheritance): Remove.
15335 (access_keymap_1): New function extracted from access_keymap to handle
15336 embedded parents and handle lists of maps.
15337 (access_keymap): Use it.
15338 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15339 (Fcopy_keymap): Handle embedded parents.
15340 (Fcommand_remapping, define_as_prefix): Simplify.
15341 (Fkey_binding): Simplify.
15342 (syms_of_keymap): Move minibuffer-local-completion-map,
15343 minibuffer-local-filename-completion-map,
15344 minibuffer-local-must-match-map, and
15345 minibuffer-local-filename-must-match-map to Elisp.
15346 (syms_of_keymap): Defsubr make-composed-keymap.
15347 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15348 (parse_menu_item): Trivial simplification.
15349
15350 2011-07-01 Glenn Morris <rgm@gnu.org>
15351
15352 * Makefile.in (SETTINGS_LIBS): Fix typo.
15353
15354 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15355
15356 * coding.c (Fencode_coding_string): Record the last coding system
15357 used, as the function doc string says (bug#8738).
15358
15359 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15360
15361 * xsettings.c (store_monospaced_changed): Take new font as arg and
15362 check for change against current_mono_font.
15363 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15364 (emacs_settings_constructor, emacs_settings_get_property)
15365 (emacs_settings_set_property, emacs_settings_class_init)
15366 (emacs_settings_init, gsettings_obj): Remove.
15367 (something_changedCB): New function for HAVE_GSETTINGS.
15368 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15369 with value as argument.
15370 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15371 g_settings_new (Bug#8967). Do not create gsettings_obj.
15372 Remove calls to g_settings_bind. Connect something_changedCB to
15373 "changed".
15374
15375 * xgselect.c: Add defined (HAVE_GSETTINGS).
15376 (xgselect_initialize): Ditto.
15377
15378 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15379 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15380 xg_select.
15381
15382 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15383
15384 * eval.c (struct backtrace): Simplify and port the data structure.
15385 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15386 signed bit field, as this assumption is not portable and it makes
15387 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15388 "char debug_on_exit : 1" as this is not portable either; instead,
15389 use the portable "unsigned int debug_on_exit : 1". Remove unused
15390 member evalargs. Remove obsolete comments about cc bombing out.
15391
15392 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15393
15394 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15395 Let HAVE_GSETTINGS override HAVE_GCONF.
15396 (store_monospaced_changed): New function.
15397 (EMACS_SETTINGS): A new type derived from GObject to handle
15398 GSettings notifications.
15399 (emacs_settings_constructor, emacs_settings_get_property)
15400 (emacs_settings_set_property, emacs_settings_class_init):
15401 New functions.
15402 (gsettings_client, gsettings_obj): New variables.
15403 (GSETTINGS_SCHEMA): New define.
15404 (something_changedCB): Call store_monospaced_changed.
15405 (init_gsettings): New function.
15406 (xsettings_initialize): Call init_gsettings.
15407 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15408 to NULL.
15409
15410 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15411 GCONF_CFLAGS/LIBS.
15412
15413 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15414
15415 * window.c (resize_root_window, grow_mini_window)
15416 (shrink_mini_window): Rename Qresize_root_window to
15417 Qwindow_resize_root_window and Qresize_root_window_vertically to
15418 Qwindow_resize_root_window_vertically.
15419
15420 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15421
15422 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15423
15424 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15425
15426 * makefile.w32-in: Redesign dependencies so they reflect more
15427 clearly which files are directly included by each source file,
15428 and not through other includes.
15429
15430 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15431
15432 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15433 (sort_overlays, overlay_strings): When an overlay's clone number
15434 matches the window's clone number process the overlay even if
15435 the overlay's window property doesn't match the current window.
15436
15437 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15438 (Fwindow_hchild): Rename to Fwindow_left_child.
15439 (Fwindow_next): Rename to Fwindow_next_sibling.
15440 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15441 (resize_window_check): Rename to window_resize_check.
15442 (resize_window_apply): Rename to window_resize_apply.
15443 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15444 (Fdelete_other_windows_internal, resize_frame_windows)
15445 (Fsplit_window_internal, Fdelete_window_internal)
15446 (grow_mini_window, shrink_mini_window)
15447 (Fresize_mini_window_internal): Fix callers accordingly.
15448
15449 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15450
15451 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15452 (emacs_fixed_set_min_size): Remove.
15453 (emacs_fixed_new): Take frame as argument.
15454
15455 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15456 (_EmacsFixedPrivate): Remove minwidth/height.
15457 Add struct frame *f.
15458 (emacs_fixed_init): Initialize priv->f.
15459 (get_parent_class, emacs_fixed_set_min_size): Remove.
15460 (emacs_fixed_new): Set priv->f to argument.
15461 (emacs_fixed_get_preferred_width)
15462 (emacs_fixed_get_preferred_height): Use min_width/height from
15463 frames size_hint to set minimum and natural (Bug#8919).
15464 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15465 and use min_width/height from frames size_hint to set
15466 min_width/height (Bug#8919).
15467
15468 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15469 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15470 Fix indentation.
15471
15472 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15473
15474 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15475 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15476 called at ZV.
15477
15478 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15479
15480 * process.c (wait_reading_process_output): Bypass select if
15481 waiting for a cell while ignoring keyboard input, and input is
15482 pending. Suggested by Jan Djärv (Bug#8869).
15483
15484 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15485
15486 Use gnulib's dup2 module instead of rolling our own.
15487 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15488
15489 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15490
15491 * dispnew.c (scrolling_window): Before scrolling, turn off a
15492 mouse-highlight in the window being scrolled.
15493
15494 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15495
15496 Move DEFSYM to lisp.h and use everywhere.
15497
15498 * character.h (DEFSYM): Move declaration...
15499 * lisp.h (DEFSYM): ...here.
15500
15501 * gnutls.c:
15502 * minibuf.c:
15503 * w32menu.c:
15504 * w32proc.c:
15505 * w32select.c: Don't include character.h.
15506
15507 * alloc.c (syms_of_alloc):
15508 * buffer.c (syms_of_buffer):
15509 * bytecode.c (syms_of_bytecode):
15510 * callint.c (syms_of_callint):
15511 * casefiddle.c (syms_of_casefiddle):
15512 * casetab.c (init_casetab_once):
15513 * category.c (init_category_once, syms_of_category):
15514 * ccl.c (syms_of_ccl):
15515 * cmds.c (syms_of_cmds):
15516 * composite.c (syms_of_composite):
15517 * dbusbind.c (syms_of_dbusbind):
15518 * dired.c (syms_of_dired):
15519 * dispnew.c (syms_of_display):
15520 * doc.c (syms_of_doc):
15521 * editfns.c (syms_of_editfns):
15522 * emacs.c (syms_of_emacs):
15523 * eval.c (syms_of_eval):
15524 * fileio.c (syms_of_fileio):
15525 * fns.c (syms_of_fns):
15526 * frame.c (syms_of_frame):
15527 * fringe.c (syms_of_fringe):
15528 * insdel.c (syms_of_insdel):
15529 * keymap.c (syms_of_keymap):
15530 * lread.c (init_obarray, syms_of_lread):
15531 * macros.c (syms_of_macros):
15532 * msdos.c (syms_of_msdos):
15533 * print.c (syms_of_print):
15534 * process.c (syms_of_process):
15535 * search.c (syms_of_search):
15536 * sound.c (syms_of_sound):
15537 * syntax.c (init_syntax_once, syms_of_syntax):
15538 * terminal.c (syms_of_terminal):
15539 * textprop.c (syms_of_textprop):
15540 * undo.c (syms_of_undo):
15541 * w32.c (globals_of_w32):
15542 * window.c (syms_of_window):
15543 * xdisp.c (syms_of_xdisp):
15544 * xfaces.c (syms_of_xfaces):
15545 * xfns.c (syms_of_xfns):
15546 * xmenu.c (syms_of_xmenu):
15547 * xsettings.c (syms_of_xsettings):
15548 * xterm.c (syms_of_xterm): Use DEFSYM.
15549
15550 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15551
15552 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15553
15554 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15555
15556 Integer and buffer overflow fixes (Bug#8873).
15557
15558 * print.c (printchar, strout): Check for string overflow.
15559 (PRINTPREPARE, printchar, strout):
15560 Don't set size unless allocation succeeds.
15561
15562 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15563 for sizes. Check for string overflow more accurately.
15564 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15565
15566 * macros.c: Integer and buffer overflow fixes.
15567 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15568 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15569 Use ptrdiff_t, not int, for sizes.
15570 Don't increment bufsize until after realloc succeeds.
15571 Check for size-calculation overflow.
15572 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15573
15574 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15575
15576 * lread.c: Integer overflow fixes.
15577 (read_integer): Radix is now EMACS_INT, not int,
15578 to improve quality of diagnostics for out-of-range radices.
15579 Calculate buffer size correctly for out-of-range radices.
15580 (read1): Check for integer overflow in radices, and in
15581 read-circle numbers.
15582 (read_escape): Avoid int overflow.
15583 (Fload, openp, read_buffer_size, read1)
15584 (substitute_object_recurse, read_vector, read_list, map_obarray):
15585 Use ptrdiff_t, not int, for sizes.
15586 (read1): Use EMACS_INT, not int, for sizes.
15587 Check for size overflow.
15588
15589 * image.c (cache_image): Check for size arithmetic overflow.
15590
15591 * lread.c: Integer overflow issues.
15592 (saved_doc_string_size, saved_doc_string_length)
15593 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15594 Now ptrdiff_t, not int.
15595 (read1): Don't assume doc string length fits in int. Check for
15596 out-of-range doc string lengths.
15597 (read_list): Don't assume file position fits in int.
15598 (read_escape): Check for hex character overflow.
15599
15600 2011-06-22 Leo Liu <sdl.web@gmail.com>
15601
15602 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15603 Move to minibuffer.el.
15604
15605 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15606
15607 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15608 The following patches are for when GLYPH_DEBUG && !XASSERT.
15609 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15610 * dispnew.c (flush_stdout):
15611 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15612 Mark as externally visible.
15613 * dispnew.c (check_window_matrix_pointers): Now static.
15614 * dispnew.c (window_to_frame_vpos):
15615 * xfns.c (unwind_create_frame):
15616 * xterm.c (x_check_font): Remove unused local.
15617 * scroll.c (CHECK_BOUNDS):
15618 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15619 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15620 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15621 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15622 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15623 Now static.
15624 (debug_method_add): Use va_list and vsprintf rather than relying
15625 on undefined behavior with wrong number of arguments.
15626 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15627 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15628 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15629 since we're not interested in debugging glyphs with old libraries.
15630 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15631 GCC 4.6.0's static checking.
15632
15633 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15634
15635 Integer overflow and signedness fixes (Bug#8873).
15636 A few related buffer overrun fixes, too.
15637
15638 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15639
15640 * dispextern.h (struct face.stipple):
15641 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15642 (x_bitmap_mask, x_allocate_bitmap_record)
15643 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15644 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15645 (x_create_bitmap_from_xpm_data):
15646 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15647 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15648 (.bitmaps_last):
15649 * xfaces.c (load_pixmap):
15650 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15651 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15652 (.bitmaps_last, struct x_output.icon_bitmap):
15653 Use ptrdiff_t, not int, for bitmap indexes.
15654 (x_allocate_bitmap_record): Check for size overflow.
15655 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15656
15657 Use ptrdiff_t, not int, for overlay counts.
15658 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15659 * editfns.c (overlays_around, get_pos_property):
15660 * textprop.c (get_char_property_and_overlay):
15661 * xdisp.c (next_overlay_change, note_mouse_highlight):
15662 * xfaces.c (face_at_buffer_position):
15663 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15664 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15665 (Fnext_overlay_change, Fprevious_overlay_change)
15666 (mouse_face_overlay_overlaps, Foverlays_in):
15667 Use ptrdiff_t, not int, for sizes.
15668 (overlays_at, overlays_in): Check for size-calculation overflow.
15669
15670 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15671
15672 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15673 (x_session_initialize): Do not assume string length fits in int.
15674
15675 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15676 This is unlikely, but can occur if DPI is outlandish.
15677
15678 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15679 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15680
15681 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15682 * xrdb.c (magic_file_p, search_magic_path):
15683 Omit last arg SUFFIX; it was always 0. All callers changed.
15684 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15685
15686 * xfont.c (xfont_match): Avoid need for strlen.
15687
15688 * xfns.c: Don't assume strlen fits in int.
15689 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15690
15691 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15692 not unsigned long, as we prefer signed integers. All callers changed.
15693 Detect integer overflow in repeat count.
15694 (message_dolog): Don't assume print length fits in 39 bytes.
15695 (display_mode_element): Don't assume strlen fits in int.
15696
15697 * termcap.c: Don't assume sizes fit in int and never overflow.
15698 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15699 (gobble_line): Check for size-calculation overflow.
15700
15701 * minibuf.c (Fread_buffer):
15702 * lread.c (intern, intern_c_string):
15703 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15704 Don't assume string length fits in int.
15705
15706 * keyboard.c (parse_tool_bar_item):
15707 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15708
15709 * font.c: Don't assume string length fits in int.
15710 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15711 Use ptrdiff_t, not int.
15712 (font_intern_prop): Don't assume string length fits in int.
15713 Don't assume integer property fits in fixnum.
15714 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15715
15716 * filelock.c: Fix some buffer overrun and integer overflow issues.
15717 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15718 Reformulate so as not to need the command string.
15719 Invoke gzip -cd rather than gunzip, as it's more portable.
15720 (lock_info_type, lock_file_1, lock_file):
15721 Don't assume pid_t and time_t fit in unsigned long.
15722 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15723 (current_lock_owner): Prefer signed type for sizes.
15724 Use memcpy, not strncpy, where memcpy is what is really wanted.
15725 Don't assume (via atoi) that time_t and pid_t fit in int.
15726 Check for time_t and/or pid_t out of range, e.g., via a network share.
15727 Don't alloca where an auto var works fine.
15728
15729 * fileio.c: Fix some integer overflow issues.
15730 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15731 Don't assume string length fits in int.
15732 (directory_file_name): Don't assume string length fits in long.
15733 (make_temp_name): Don't assume pid fits in int, or that its print
15734 length is less than 20.
15735
15736 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15737
15738 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15739
15740 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15741
15742 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15743 We prefer signed integers, even for size calculations.
15744
15745 * emacs.c: Don't assume string length fits in 'int'.
15746 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15747 (main): Don't invoke strlen when not needed.
15748
15749 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15750 (XD_DEBUG_MESSAGE): Don't waste a byte.
15751
15752 * callproc.c (getenv_internal_1, getenv_internal)
15753 (Fgetenv_internal):
15754 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15755
15756 * lread.c (invalid_syntax): Omit length argument.
15757 All uses changed. This doesn't fix a bug, but it simplifies the
15758 code away from its former Hollerith-constant appearance, and it's
15759 one less 'int' to worry about when looking at integer-overflow issues.
15760 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15761
15762 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15763 This didn't break anything, but it didn't help either.
15764 It's confusing to put a bogus integer in a place where the actual
15765 value does not matter.
15766 (LIST_END_P): Remove unused macro and its bogus comment.
15767 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15768
15769 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15770 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15771 implementation.
15772 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15773 We prefer signed types, and the value cannot exceed the EMACS_INT
15774 range anyway (because otherwise the length would not be representable).
15775 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15776 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15777 This avoids a GCC warning when WIDE_EMACS_INT.
15778
15779 * indent.c (sane_tab_width): New function.
15780 (current_column, scan_for_column, Findent_to, position_indentation)
15781 (compute_motion): Use it. This is just for clarity.
15782 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15783
15784 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15785
15786 * lisp.h (lint_assume): New macro.
15787 * composite.c (composition_gstring_put_cache):
15788 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15789
15790 * editfns.c, insdel.c:
15791 Omit unnecessary forward decls, to simplify future changes.
15792
15793 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15794
15795 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15796
15797 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15798 Use much-faster test for byte-length change.
15799 Don't assume string byte-length fits in 'int'.
15800 Check that character arg fits in 'int'.
15801 (mapcar1): Declare byte as byte, for clarity.
15802
15803 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15804
15805 * fns.c (concat): Catch string overflow earlier.
15806 Do not rely on integer wraparound.
15807
15808 * dispextern.h (struct it.overlay_strings_charpos)
15809 (struct it.selective): Now EMACS_INT, not int.
15810 * xdisp.c (forward_to_next_line_start)
15811 (back_to_previous_visible_line_start)
15812 (reseat_at_next_visible_line_start, next_element_from_buffer):
15813 Don't arbitrarily truncate the value of 'selective' to int.
15814
15815 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15816
15817 * composite.c: Don't truncate sizes to 'int'.
15818 (composition_gstring_p, composition_reseat_it)
15819 (composition_adjust_point): Use EMACS_INT, not int.
15820 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15821 not EMACS_UINT, for indexes.
15822
15823 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15824
15825 * buffer.c: Include <verify.h>.
15826 (struct sortvec.priority, struct sortstr.priority):
15827 Now EMACS_INT, not int.
15828 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15829 (struct sortstr.size, record_overlay_string)
15830 (struct sortstrlist.size, struct sortlist.used):
15831 Don't truncate size to int.
15832 (record_overlay_string): Check for size-calculation overflow.
15833 (init_buffer_once): Check at compile-time, not run-time.
15834
15835 2011-06-22 Jim Meyering <meyering@redhat.com>
15836
15837 Don't leak an XBM-image-sized buffer
15838 * image.c (xbm_load): Free the image buffer after using it.
15839
15840 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15841
15842 Port to Sun C.
15843 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15844 that Sun C diagnosed.
15845 * fns.c (secure_hash): Fix pointer signedness issue.
15846 * intervals.c (static_offset_intervals): New function.
15847 (offset_intervals): Use it.
15848
15849 2011-06-21 Leo Liu <sdl.web@gmail.com>
15850
15851 * deps.mk (fns.o):
15852 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15853 sha512.h.
15854
15855 * fns.c (secure_hash): Rename from crypto_hash_function and change
15856 the first arg to accept symbols.
15857 (Fsecure_hash): New primitive.
15858 (syms_of_fns): New symbols.
15859
15860 2011-06-20 Deniz Dogan <deniz@dogan.se>
15861
15862 * process.c (Fset_process_buffer): Clarify return value in
15863 docstring.
15864
15865 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15866
15867 * dispnew.c (add_window_display_history): Use BVAR.
15868
15869 * xdisp.c (debug_method_add): Use BVAR.
15870 (check_window_end, dump_glyph_matrix, dump_glyph)
15871 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15872
15873 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15874 Likewise.
15875
15876 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15877 check till after the cache is created in init_frame_faces.
15878
15879 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15880
15881 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15882
15883 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15886 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15887 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15888
15889 Improve buffer-overflow checking (Bug#8873).
15890 * fileio.c (Finsert_file_contents):
15891 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15892 Remove the old (too-loose) buffer overflow checks.
15893 They weren't needed, since make_gap checks for buffer overflow.
15894 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15895 The old code merely checked for Emacs fixnum overflow, and relied
15896 on undefined (wraparound) behavior. The new code avoids undefined
15897 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15898
15899 * editfns.c (Finsert_char): Don't dump core with very negative counts.
15900 Tune. Don't use wider integers than needed. Don't use alloca.
15901 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
15902
15903 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15904
15905 * insdel.c, lisp.h (buffer_overflow): New function.
15906 (insert_from_buffer_1, replace_range, replace_range_2):
15907 * insdel.c (make_gap_larger):
15908 * editfns.c (Finsert_char):
15909 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15910
15911 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15912
15913 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15914
15915 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15916
15917 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15918 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15919
15920 * fileio.c: Don't assume EMACS_INT fits in off_t.
15921 (emacs_lseek): New static function.
15922 (Finsert_file_contents, Fwrite_region): Use it.
15923 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15924
15925 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15926
15927 * fns.c: Don't overflow int when computing a list length.
15928 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15929 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15930 truncation on 64-bit hosts. Check for QUIT every
15931 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15932 faster and is responsive enough.
15933 (Flength): Report an error instead of overflowing an integer.
15934 (Fsafe_length): Return a float if the value is not representable
15935 as a fixnum. This shouldn't happen except in contrived situations.
15936 (Fnthcdr, Fsort): Don't assume list length fits in int.
15937 (Fcopy_sequence): Don't assume vector length fits in int.
15938
15939 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15940 (header_size, word_size): New constants.
15941 (allocate_vectorlike): Don't check size overflow here.
15942 (allocate_vector): Check it here instead, since this is the only
15943 caller of allocate_vectorlike that could cause overflow.
15944 Check that the new vector's length is representable as a fixnum.
15945
15946 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15947 The previous code was bogus. For example, next_almost_prime (32)
15948 returned 39, which is undesirable as it is a multiple of 3; and
15949 next_almost_prime (24) returned 25, which is a multiple of 5 so
15950 why was the code bothering to check for multiples of 7?
15951
15952 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15953
15954 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15955
15956 Variadic C functions now count arguments with ptrdiff_t.
15957 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15958 Back then I didn't know that the Emacs coding style prefers signed int.
15959 Also, in the meantime I found a few more instances where arguments
15960 were being counted with int, which may truncate counts on 64-bit
15961 machines, or EMACS_INT, which may be unnecessarily wide.
15962 * lisp.h (struct Lisp_Subr.function.aMANY)
15963 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15964 Arg counts are now ptrdiff_t, not size_t.
15965 All variadic functions and their callers changed accordingly.
15966 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15967 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15968 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15969 * callint.c (Fcall_interactively): Check arg count for overflow,
15970 to avoid potential buffer overrun. Use signed char, not 'int',
15971 for 'varies' array, so that we needn't bother to check its size
15972 calculation for overflow.
15973 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15974 * eval.c (apply_lambda):
15975 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15976 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15977 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15978
15979 * callint.c (Fcall_interactively): Don't use index var as event count.
15980
15981 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15982 * mem-limits.h (SIZE): Remove; no longer used.
15983
15984 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15985
15986 Remove unnecessary casts.
15987 * xterm.c (x_term_init):
15988 * xfns.c (x_set_border_pixel):
15989 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15990 These aren't needed now that we assume ANSI C.
15991
15992 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15993 It's more likely to cause problems (due to unsigned overflow)
15994 than to cure them.
15995
15996 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15997
15998 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15999
16000 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16001
16002 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16003
16004 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16005
16006 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16007
16008 GLYPH_CODE_FACE returns EMACS_INT, not int.
16009 * dispextern.h (merge_faces):
16010 * xfaces.c (merge_faces):
16011 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16012 Don't assume EMACS_INT fits in int.
16013
16014 * character.h (CHAR_VALID_P): Remove unused parameter.
16015 * fontset.c, lisp.h, xdisp.c: All uses changed.
16016
16017 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16018
16019 * fns.c (concat): Minor tuning based on overflow analysis.
16020 This doesn't fix any bugs. Use int to hold character, instead
16021 of constantly refetching from Emacs object. Use XFASTINT, not
16022 XINT, for value known to be a character. Don't bother comparing
16023 a single byte to 0400, as it's always less.
16024
16025 * floatfns.c (Fexpt):
16026 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16027
16028 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16029 for characters.
16030
16031 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16032
16033 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16034 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16035 incorrectly succeed when S was a string, because 4294967386 was
16036 truncated before it was used.
16037
16038 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16039 Otherwise, an out-of-range integer could cause undefined behavior
16040 on a 64-bit host.
16041
16042 * composite.c: Use int, not EMACS_INT, for characters.
16043 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16044 EMACS_INT, for values that are known to be in character range.
16045 This doesn't fix any bugs but is the usual style inside Emacs and
16046 may generate better code on 32-bit machines.
16047
16048 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16049 This is for reasons similar to the recent CHAR_STRING fix.
16050 * charset.c (Fencode_char): Check that character arg is actually
16051 a character. Pass an int to ENCODE_CHAR.
16052 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16053 wider than 'int', as a compile-time check to prevent future regressions
16054 in this area.
16055
16056 * character.c (char_string): Remove unnecessary casts.
16057
16058 Make sure a 64-bit char is never passed to CHAR_STRING.
16059 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16060 by silently ignoring the top 32 bits, allowing some values
16061 that were far too large to be valid characters.
16062 * character.h: Include <verify.h>.
16063 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16064 arguments are no wider than unsigned, as a compile-time check
16065 to prevent future regressions in this area.
16066 * data.c (Faset):
16067 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16068 (Fsubst_char_in_region):
16069 * fns.c (concat):
16070 * xdisp.c (decode_mode_spec_coding):
16071 Adjust to CHAR_STRING's new requirement.
16072 * editfns.c (Finsert_char, Fsubst_char_in_region):
16073 * fns.c (concat): Check that character args are actually
16074 characters. Without this test, these functions did the wrong
16075 thing with wildly out-of-range values on 64-bit hosts.
16076
16077 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16078 These casts should not be needed on 32-bit hosts, either.
16079 * keyboard.c (read_char):
16080 * lread.c (Fload): Remove casts to unsigned.
16081
16082 * lisp.h (UNSIGNED_CMP): New macro.
16083 This fixes comparison bugs on 64-bit hosts.
16084 (ASCII_CHAR_P): Use it.
16085 * casefiddle.c (casify_object):
16086 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16087 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16088 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16089 * dispextern.h (FACE_FROM_ID):
16090 * keyboard.c (read_char): Use UNSIGNED_CMP.
16091
16092 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16093 not to EMACS_INT, to avoid GCC warning.
16094
16095 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16096
16097 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16098 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16099 isn't needed on 32-bit machines.
16100
16101 * buffer.c (Fgenerate_new_buffer_name):
16102 Use EMACS_INT for count, not int.
16103 (advance_to_char_boundary): Return EMACS_INT, not int.
16104
16105 * data.c (Qcompiled_function): Now static.
16106
16107 * window.c (window_body_lines): Now static.
16108
16109 * image.c (gif_load): Rename local to avoid shadowing.
16110
16111 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16112 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16113 * alloc.c (make_save_value): Integer argument is now of type
16114 ptrdiff_t, not int.
16115 (mark_object): Use ptrdiff_t, not int.
16116 * lisp.h (pD): New macro.
16117 * print.c (print_object): Use it.
16118
16119 * alloc.c: Use EMACS_INT, not int, to count objects.
16120 (total_conses, total_markers, total_symbols, total_vector_size)
16121 (total_free_conses, total_free_markers, total_free_symbols)
16122 (total_free_floats, total_floats, total_free_intervals)
16123 (total_intervals, total_strings, total_free_strings):
16124 Now EMACS_INT, not int. All uses changed.
16125 (Fgarbage_collect): Compute overall total using a double, so that
16126 integer overflow is less likely to be a problem. Check for overflow
16127 when converting back to an integer.
16128 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16129 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16130 These were 'int' variables that could overflow on 64-bit hosts;
16131 they were never used, so remove them instead of repairing them.
16132 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16133 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16134 Previously, this ceilinged at INT_MAX, but that doesn't work on
16135 64-bit machines.
16136 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16137
16138 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16139 (allocate_vectorlike): Check for ptrdiff_t overflow.
16140 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16141 when a (possibly-narrower) signed value would do just as well.
16142 We prefer using signed arithmetic, to avoid comparison confusion.
16143
16144 * alloc.c: Catch some string size overflows that we were missing.
16145 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16146 for convenience in STRING_BYTES_MAX.
16147 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16148 The definition here is exact; the one in lisp.h was approximate.
16149 (allocate_string_data): Check for string overflow. This catches
16150 some instances we weren't catching before. Also, it catches
16151 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16152 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16153 and ptrdiff_t and EMACS_INT are both 64 bits.
16154
16155 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16156 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16157 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16158
16159 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16160
16161 * alloc.c (Fmake_string): Check for out-of-range init.
16162
16163 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16164
16165 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16166
16167 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16168
16169 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16170 xg_get_default_scrollbar_width.
16171
16172 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16173 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16174 (style_changed_cb): Call update_theme_scrollbar_width and call
16175 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16176 all frames (Bug#8505).
16177 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16178 Call gtk_window_set_resizable if HAVE_GTK3.
16179 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16180 and height if HAVE_GTK3 (Bug#8505).
16181 (scroll_bar_width_for_theme): New variable.
16182 (update_theme_scrollbar_width): New function.
16183 (xg_get_default_scrollbar_width): Move code to
16184 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16185 (xg_initialize): Call update_theme_scrollbar_width.
16186
16187 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16188
16189 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16190
16191 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16192
16193 * frame.c (make_frame): Call other_buffer_safely instead of
16194 other_buffer.
16195
16196 * window.c (temp_output_buffer_show): Call display_buffer with
16197 second argument Vtemp_buffer_show_specifiers and reset latter
16198 immediately after the call.
16199 (Vtemp_buffer_show_specifiers): New variable.
16200 (auto_window_vscroll_p, next_screen_context_lines)
16201 (Vscroll_preserve_screen_position): Remove leading asterisks from
16202 doc-strings.
16203
16204 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16205
16206 Fix minor problems found by GCC 4.6.0 static checking.
16207 * buffer.c (Qclone_number): Remove for now, as it's unused.
16208 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16209 (record_buffer): Remove unused local.
16210 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16211 (set_frame_buffer_list): Remove; unused.
16212 * frame.h (other_visible_frames): Remove decl.
16213 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16214 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16215 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16216 if HAVE_GPM.
16217 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16218 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16219 Define only if HAVE_GPM.
16220 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16221 (update_hints_inhibit): Remove; never set. All uses removed.
16222 * widgetprv.h (emacsFrameClassRec): Remove decl.
16223 * window.c (delete_deletable_window): Now returns void, since it
16224 wasn't returning anything.
16225 (compare_window_configurations): Remove unused locals.
16226 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16227 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16228 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16229 the same widths as pointers. This follows up on the 2011-05-06 patch.
16230 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16231 * xterm.h: Likewise.
16232 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16233
16234 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16235
16236 * makefile.w32-in: Update dependencies.
16237 (LISP_H): Add lib/intprops.h.
16238
16239 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16240
16241 * image.c (gif_load): Add animation frame delay to the metadata.
16242 (syms_of_image): Use DEFSYM. New symbol `delay'.
16243
16244 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16245
16246 * window.c (delete_deletable_window): Re-add.
16247 (Fset_window_configuration): Rewrite to handle dead buffers and
16248 consequently deletable windows.
16249 (window_tree, Fwindow_tree): Remove. Supply functionality in
16250 window.el.
16251 (compare_window_configurations): Simplify code.
16252
16253 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16254
16255 * image.c (imagemagick_load_image): Fix type mismatch.
16256 (Fimagemagick_types): Likewise.
16257
16258 * window.h (replace_buffer_in_windows): Declare.
16259
16260 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16261
16262 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16263 Qclone_number. Remove external declaration of Qdelete_window.
16264 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16265 code.
16266 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16267 Run Qbuffer_list_update_hook if allowed.
16268 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16269 buffer list implementation.
16270 (other_buffer_safely): New function.
16271 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16272 calls to replace_buffer_in_windows and
16273 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16274 if allowed.
16275 (record_buffer): Inhibit quitting and rewrite using quittable
16276 functions. Run Qbuffer_list_update_hook if allowed.
16277 (Frecord_buffer, Funrecord_buffer): New functions.
16278 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16279 Move switch-to-buffer to window.el.
16280 (bury-buffer): Move to window.el.
16281 (Vbuffer_list_update_hook): New variable.
16282
16283 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16284 section.
16285
16286 * window.h (resize_frame_windows): Move up in code.
16287 (Fwindow_frame): Remove EXFUN.
16288 (replace_buffer_in_all_windows): Remove prototype.
16289 (replace_buffer_in_windows_safely): Add prototype.
16290
16291 * window.c: Declare Qdelete_window static again. Move down
16292 declaration of select_count.
16293 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16294 (Fother_window): Move to window.el.
16295 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16296 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16297 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16298 window.el.
16299 (replace_buffer_in_windows): Implement by calling
16300 Qreplace_buffer_in_windows.
16301 (replace_buffer_in_all_windows): Remove with some functionality
16302 moved into replace_buffer_in_windows_safely.
16303 (replace_buffer_in_windows_safely): New function.
16304 (select_window_norecord, select_frame_norecord): Move in front
16305 of run_window_configuration_change_hook. Remove now obsolete
16306 declarations.
16307 (Fset_window_buffer): Rewrite doc-string.
16308 Call Qrecord_window_buffer.
16309 (keys_of_window): Move binding for other-window to window.el.
16310
16311 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16312
16313 * dispextern.h (struct image): Replace data member, whose int_val
16314 and ptr_val fields were not used by anything, with a single
16315 lisp_val object.
16316
16317 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16318 (gif_clear_image, gif_load, imagemagick_load_image)
16319 (gs_clear_image, gs_load): Callers changed.
16320
16321 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16322
16323 * buffer.h: Include <time.h>, for time_t.
16324 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16325
16326 Fix minor problems found by static checking.
16327
16328 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16329
16330 Make identifiers static if they are not used in other modules.
16331 * data.c (Qcompiled_function, Qframe, Qvector):
16332 * image.c (QimageMagick, Qsvg):
16333 * minibuf.c (Qmetadata):
16334 * window.c (resize_window_check, resize_root_window): Now static.
16335 * window.h (resize_window_check, resize_root_window): Remove decls.
16336
16337 * window.c (window_deletion_count, delete_deletable_window):
16338 Remove; unused.
16339 (window_body_lines): Now static.
16340 (Fdelete_other_windows_internal): Mark vars as initialized.
16341 Make sure 'resize_failed' is initialized.
16342 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16343 (resize_window_apply): Remove unused local.
16344 * window.h (delete_deletable_window): Remove decl.
16345
16346 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16347 (imagemagick_load_image): Fix pointer signedness problem by changing
16348 last arg from unsigned char * to char *. All uses changed.
16349 Also, fix a local for similar reasons.
16350 Remove unused locals. Remove locals to avoid shadowing.
16351 (fn_rsvg_handle_free): Remove; unused.
16352 (svg_load, svg_load_image): Fix pointer signedness problem.
16353 (imagemagick_load_image): Don't use garbage pointer image_wand.
16354
16355 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16356
16357 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16358
16359 * image.c (gif_load): Fix omitted cast error introduced by
16360 2011-06-06 change.
16361
16362 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16363
16364 * window.h (resize_proportionally, orig_total_lines)
16365 (orig_top_line): Remove from window structure.
16366 (set_window_height, set_window_width, change_window_heights)
16367 (Fdelete_window): Remove prototypes.
16368 (resize_frame_windows): Remove duplicate declaration.
16369
16370 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16371
16372 * window.h (resize_frame_windows, resize_window_check)
16373 (delete_deletable_window, resize_root_window)
16374 (resize_frame_windows): Declare prototypes.
16375
16376 * window.c (resize_window_apply): Make definition be "static" to
16377 match the prototype.
16378
16379 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16380
16381 * window.c: Remove declarations of Qwindow_size_fixed,
16382 window_min_size_1, window_min_size_2, window_min_size,
16383 size_window, window_fixed_size_p, enlarge_window, delete_window.
16384 Remove static from declaration of Qdelete_window, it's
16385 temporarily needed by Fbury_buffer.
16386 (replace_window): Don't assign orig_top_line and
16387 orig_total_lines.
16388 (Fdelete_window, delete_window): Remove. Window deletion is
16389 handled by window.el.
16390 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16391 Replace Fdelete_window calls with calls to Qdelete_window.
16392 (Fdelete_other_windows): Remove. Deleting other windows is
16393 handled by window.el.
16394 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16395 handled in window.el.
16396 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16397 Window minimum sizes are handled in window.el.
16398 (shrink_windows, size_window, set_window_height)
16399 (set_window_width, change_window_heights, window_height)
16400 (window_width, CURBEG, CURSIZE, enlarge_window)
16401 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16402 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16403 handled in window.el.
16404 (make_dummy_parent): Rename to make_parent_window and give it a
16405 second argument horflag.
16406 (make_window): Don't set resize_proportionally any more.
16407 (Fsplit_window): Remove. Windows are split in window.el.
16408 (save_restore_action, save_restore_orig_size)
16409 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16410 Resize mini windows in window.el.
16411 (grow_mini_window, shrink_mini_window): Implement by calling
16412 Qresize_root_window_vertically, resize_window_check and
16413 resize_window_apply.
16414 (saved_window, Fset_window_configuration, save_window_save):
16415 Do not handle orig_top_line, orig_total_lines, and
16416 resize_proportionally.
16417 (window_min_height, window_min_width): Move to window.el.
16418 (keys_of_window): Move bindings for delete-other-windows,
16419 split-window, delete-window and enlarge-window to window.el.
16420
16421 * buffer.c: Temporarily extern Qdelete_window.
16422 (Fbury_buffer): Temporarily call Qdelete_window instead of
16423 Fdelete_window (Fbury_buffer will move to window.el soon).
16424
16425 * frame.c (set_menu_bar_lines_1): Remove code handling
16426 orig_top_line and orig_total_lines.
16427
16428 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16429 set_window_height but set heights directly.
16430 (change_frame_size_1): Use resize_frame_windows.
16431
16432 * xdisp.c (init_xdisp): Don't use set_window_height but set
16433 heights directly.
16434
16435 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16436 Use resize_frame_windows instead of change_window_heights and run
16437 run_window_configuration_change_hook.
16438
16439 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16440 instead of change_window_heights and run
16441 run_window_configuration_change_hook.
16442
16443 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16444
16445 * window.c (replace_window): Rename second argument REPLACEMENT to
16446 NEW. New third argument SETFLAG. Rewrite.
16447 (delete_window, make_dummy_parent): Call replace_window with
16448 third argument 1.
16449 (window_list_1): Move down in code.
16450 (run_window_configuration_change_hook): Move set_buffer part
16451 before select_frame_norecord part in order to unwind correctly.
16452 Rename count1 to count.
16453 (recombine_windows, delete_deletable_window, resize_root_window)
16454 (Fdelete_other_windows_internal)
16455 (Frun_window_configuration_change_hook, make_parent_window)
16456 (resize_window_check, resize_window_apply, Fresize_window_apply)
16457 (resize_frame_windows, Fsplit_window_internal)
16458 (Fdelete_window_internal, Fresize_mini_window_internal):
16459 New functions.
16460 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16461
16462 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16463
16464 * window.h (window): Add some new members to window structure -
16465 normal_lines, normal_cols, new_total, new_normal, clone_number,
16466 splits, nest, prev_buffers, next_buffers.
16467 (WINDOW_TOTAL_SIZE): Move here from window.c.
16468 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16469
16470 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16471 Remove.
16472 (make_dummy_parent): Set new members of windows structure.
16473 (make_window): Move down in code. Handle new members of window
16474 structure.
16475 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16476 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16477 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16478 (Fset_window_prev_buffers, Fwindow_next_buffers)
16479 (Fset_window_next_buffers, Fset_window_clone_number):
16480 New functions.
16481 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16482 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16483 Doc-string fixes.
16484 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16485 Argument WINDOW can be now internal window too.
16486 (Fwindow_use_time): Move up in code.
16487 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16488 Rewrite doc-string.
16489 (Fset_window_configuration, saved_window)
16490 (Fcurrent_window_configuration, save_window_save): Handle new
16491 members of window structure.
16492 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16493 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16494 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16495 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16496 Qget_mru_window, Qresize_root_window,
16497 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16498 Qauto_buffer_name; staticpro them.
16499
16500 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16501
16502 * window.c (Fwindow_total_size, Fwindow_left_column)
16503 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16504 (Fwindow_list_1): New functions.
16505 (window_box_text_cols): Replace with window_body_cols.
16506 (Fwindow_width, Fscroll_left, Fscroll_right):
16507 Use window_body_cols instead of window_box_text_cols.
16508 (delete_window, Fset_window_configuration):
16509 Call delete_all_subwindows with window as argument.
16510 (delete_all_subwindows): Take a window as argument and not a
16511 structure. Rewrite.
16512 (window_loop): Remove handling of GET_LRU_WINDOW and
16513 GET_LARGEST_WINDOW.
16514 (Fget_lru_window, Fget_largest_window): Move to window.el.
16515
16516 * window.h: Extern window_body_cols instead of
16517 window_box_text_cols. delete_all_subwindows now takes a
16518 Lisp_Object as argument.
16519
16520 * indent.c (compute_motion, Fcompute_motion):
16521 Use window_body_cols instead of window_box_text_cols.
16522
16523 * frame.c (delete_frame): Call delete_all_subwindows with root
16524 window as argument.
16525
16526 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16527
16528 * fns.c (Fputhash): Document return value.
16529
16530 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16531
16532 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16533
16534 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16535
16536 Cons<->int and similar integer overflow fixes (Bug#8794).
16537
16538 Check for overflow when converting integer to cons and back.
16539 * charset.c (Fdefine_charset_internal, Fdecode_char):
16540 Use cons_to_unsigned to catch overflow.
16541 (Fencode_char): Use INTEGER_TO_CONS.
16542 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16543 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16544 * data.c (long_to_cons, cons_to_long): Remove.
16545 (cons_to_unsigned, cons_to_signed): New functions.
16546 These signal an error for invalid or out-of-range values.
16547 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16548 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16549 * font.c (Ffont_variation_glyphs):
16550 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16551 * lisp.h: Include <intprops.h>.
16552 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16553 (cons_to_signed, cons_to_unsigned): New decls.
16554 (long_to_cons, cons_to_long): Remove decls.
16555 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16556 (Fprimitive_undo): Use CONS_TO_INTEGER.
16557 * xfns.c (Fx_window_property): Likewise.
16558 * xselect.c: Include <limits.h>.
16559 (x_own_selection, selection_data_to_lisp_data):
16560 Use INTEGER_TO_CONS.
16561 (x_handle_selection_request, x_handle_selection_clear)
16562 (x_get_foreign_selection, Fx_disown_selection_internal)
16563 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16564 (lisp_data_to_selection_data): Use cons_to_unsigned.
16565 (x_fill_property_data): Use cons_to_signed.
16566 Report values out of range.
16567
16568 Check for buffer and string overflow more precisely.
16569 * buffer.h (BUF_BYTES_MAX): New macro.
16570 * lisp.h (STRING_BYTES_MAX): New macro.
16571 * alloc.c (Fmake_string):
16572 * character.c (string_escape_byte8):
16573 * coding.c (coding_alloc_by_realloc):
16574 * doprnt.c (doprnt):
16575 * editfns.c (Fformat):
16576 * eval.c (verror):
16577 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16578 since they may not be the same number.
16579 * editfns.c (Finsert_char):
16580 * fileio.c (Finsert_file_contents):
16581 Likewise for BUF_BYTES_MAX.
16582
16583 * image.c: Use ptrdiff_t, not int, for sizes.
16584 (slurp_file): Switch from int to ptrdiff_t.
16585 All uses changed.
16586 (slurp_file): Check that file size fits in both size_t (for
16587 malloc) and ptrdiff_t (for sanity and safety).
16588
16589 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16590 if b->modtime has its maximal value.
16591
16592 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16593
16594 Don't assume time_t can fit into int.
16595 * buffer.h (struct buffer.modtime): Now time_t, not int.
16596 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16597 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16598
16599 Minor fixes for signed vs unsigned integers.
16600 * character.h (MAYBE_UNIFY_CHAR):
16601 * charset.c (maybe_unify_char):
16602 * keyboard.c (read_char, reorder_modifiers):
16603 XINT -> XFASTINT, since the integer must be nonnegative.
16604 * ftfont.c (ftfont_spec_pattern):
16605 * keymap.c (access_keymap, silly_event_symbol_error):
16606 XUINT -> XFASTINT, since the integer must be nonnegative.
16607 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16608 since it makes no difference and we prefer signed.
16609 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16610 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16611 nonnegative.
16612
16613 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16614
16615 * window.h (Fwindow_frame): Declare.
16616
16617 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16618
16619 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16620 (SPARE_MEMORY): Always define.
16621 (LARGE_REQUEST): Remove.
16622 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16623
16624 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16625
16626 * lisp.h: Move EXFUNS for Fframe_root_window,
16627 Fframe_first_window and Fset_frame_selected_window to window.h.
16628
16629 * window.h: Move EXFUNS for Fframe_root_window,
16630 Fframe_first_window and Fset_frame_selected_window here from
16631 lisp.h.
16632
16633 * frame.c (Fwindow_frame, Fframe_first_window)
16634 (Fframe_root_window, Fframe_selected_window)
16635 (Fset_frame_selected_window): Move to window.c.
16636 (Factive_minibuffer_window): Move to minibuf.c.
16637 (Fother_visible_frames_p): New function.
16638
16639 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16640
16641 * window.c (decode_window, decode_any_window): Move up in code.
16642 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16643 (inhibit_frame_unsplittable): Remove unused variable.
16644 (Fwindow_buffer): Move up and rewrite doc-string.
16645 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16646 (Fwindow_prev): New functions.
16647 (Fwindow_frame): Move here from frame.c. Accept any window as
16648 argument.
16649 (Fframe_root_window, Fframe_first_window)
16650 (Fframe_selected_window): Move here from frame.c. Accept frame
16651 or arbitrary window as argument. Update doc-strings.
16652 (Fminibuffer_window): Move up in code.
16653 (Fwindow_minibuffer_p): Move up in code and simplify.
16654 (Fset_frame_selected_window): Move here from frame.c.
16655 Marginal rewrite.
16656 (Fselected_window, select_window, Fselect_window): Move up in
16657 code. Minor doc-string fixes.
16658
16659 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16660
16661 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16662 Do not assume that spare memory exists; that assumption is valid
16663 only if SYSTEM_MALLOC.
16664 (LARGE_REQUEST): New macro, so that the issue of large requests
16665 is separated from the issue of spare memory.
16666
16667 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16668
16669 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16670 format. (Bug#8806)
16671
16672 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16673
16674 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16675 before statements.
16676
16677 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16678
16679 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16680
16681 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16682
16683 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16684 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16685
16686 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16687
16688 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16689
16690 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16691
16692 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16693 (x_clipboard_manager_save): Add return value.
16694 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16695 New error handlers.
16696 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16697 Obey Vx_select_enable_clipboard_manager. Catch errors in
16698 x_clipboard_manager_save (Bug#8779).
16699 (Vx_select_enable_clipboard_manager): New variable.
16700 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16701
16702 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16703
16704 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16705
16706 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16707
16708 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16709 in the current matrix if keep_current_p is non-zero.
16710
16711 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16712
16713 * bidi.c (bidi_level_of_next_char): Fix last change.
16714
16715 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16716
16717 Support bidi reordering of text covered by display properties.
16718
16719 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16720 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16721 (bidi_cache_search, bidi_cache_iterator_state)
16722 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16723 (bidi_level_of_next_char, bidi_move_to_visually_next):
16724 Support character positions inside a run of characters covered by a
16725 display string.
16726 (bidi_paragraph_init, bidi_resolve_explicit_1)
16727 (bidi_level_of_next_char): Call bidi_fetch_char and
16728 bidi_fetch_char_advance instead of FETCH_CHAR and
16729 FETCH_CHAR_ADVANCE.
16730 (bidi_init_it): Initialize new members.
16731 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16732 definitions.
16733 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16734 instead of using explicit *_CHAR codes.
16735 (bidi_resolve_explicit, bidi_resolve_weak):
16736 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16737 bidirectional text is supported only in multibyte buffers.
16738 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16739 it to initialize the frame_window_p member of struct bidi_it.
16740 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16741 (bidi_resolve_explicit, bidi_resolve_weak)
16742 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16743 bidi_it->nchars is non-positive.
16744 (bidi_level_of_next_char): Don't try to lookup the cache for the
16745 next/previous character if nothing is cached there yet, or if we
16746 were just reseat()'ed to a new position.
16747
16748 * xdisp.c (set_cursor_from_row): Set start and stop points
16749 according to the row's direction when priming the loop that looks
16750 for the glyph on which to display cursor.
16751 (single_display_spec_intangible_p): Function deleted.
16752 (display_prop_intangible_p): Reimplement to call
16753 handle_display_spec instead of single_display_spec_intangible_p.
16754 Accept 3 additional arguments needed by handle_display_spec.
16755 This fixes incorrect cursor motion across display property with complex
16756 values: lists, `(when COND...)' forms, etc.
16757 (single_display_spec_string_p): Support property values that are
16758 lists with the argument STRING its top-level element.
16759 (display_prop_string_p): Fix the condition for processing a
16760 property that is a list to be consistent with handle_display_spec.
16761 (handle_display_spec): New function, refactored from the
16762 last portion of handle_display_prop.
16763 (compute_display_string_pos): Accept additional argument
16764 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16765 value of a `display' property is a "replacing spec".
16766 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16767 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16768 the display property, but just return a value indicating whether
16769 the display property will replace the characters it covers.
16770 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16771 frame_window_p members of struct bidi_it.
16772 (compute_display_string_pos, compute_display_string_end):
16773 New functions.
16774 (push_it): Accept second argument POSITION, where pop_it should
16775 jump to continue iteration.
16776 (reseat_1): Initialize bidi_it.disp_pos.
16777
16778 * keyboard.c (adjust_point_for_property): Adjust the call to
16779 display_prop_intangible_p to its new signature.
16780
16781 * dispextern.h (struct bidi_it): New member frame_window_p.
16782 (bidi_init_it): Update prototypes.
16783 (display_prop_intangible_p): Update prototype.
16784 (compute_display_string_pos, compute_display_string_end):
16785 Declare prototypes.
16786 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16787 EMACS_INT.
16788
16789 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16790
16791 Malloc failure behavior now depends on size of allocation.
16792 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16793 * lisp.h: Change signatures accordingly.
16794 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16795 All callers changed. (Bug#8762)
16796
16797 * gnutls.c: Use Emacs's memory allocators.
16798 Without this change, the gnutls library would invoke malloc etc.
16799 directly, which causes problems on non-SYNC_INPUT hosts, and which
16800 runs afoul of improving memory_full behavior. (Bug#8761)
16801 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16802 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16803 xfree instead of the default malloc, realloc, free.
16804 (Fgnutls_boot): No need to check for memory allocation failure,
16805 since xmalloc does that for us.
16806
16807 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16808 * category.c (hash_get_category_set):
16809 * ccl.c (ccl_driver):
16810 * charset.c (Fdefine_charset_internal):
16811 * charset.h (struct charset.hash_index):
16812 * composite.c (get_composition_id, gstring_lookup_cache)
16813 (composition_gstring_put_cache):
16814 * composite.h (struct composition.hash_index):
16815 * dispextern.h (struct image.hash):
16816 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16817 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16818 (hashfn_equal, hashfn_user_defined, make_hash_table)
16819 (maybe_resize_hash_table, hash_lookup, hash_put)
16820 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16821 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16822 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16823 * image.c (make_image, search_image_cache, lookup_image)
16824 (xpm_put_color_table_h):
16825 * lisp.h (struct Lisp_Hash_Table):
16826 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16827 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16828 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16829 * alloc.c (allocate_vectorlike):
16830 Check for overflow in vector size calculations.
16831 * ccl.c (ccl_driver):
16832 Check for overflow when converting EMACS_INT to int.
16833 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16834 need to be updated by these changes.
16835 * fns.c (make_hash_table, maybe_resize_hash_table):
16836 Check for integer overflow with large hash tables.
16837 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16838 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16839 (SXHASH_REDUCE): New macro.
16840 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16841 Use it instead of discarding useful hash info with large hash values.
16842 (sxhash_float): New function.
16843 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16844 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16845 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16846 Rewrite to use FIXNUM_BITS, as this simplifies things.
16847 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16848 Adjust signatures to match updated version of code.
16849 (consing_since_gc): Now EMACS_INT, since a single hash table can
16850 use more than INT_MAX bytes.
16851
16852 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16853
16854 Make it possible to build with GCC-4.6+ -O2 -flto.
16855
16856 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16857
16858 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16859
16860 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16861 Call minibuffer-inactive-mode.
16862
16863 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16864
16865 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16866 Update dependencies.
16867
16868 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16869
16870 * data.c (init_data): Remove code for UTS, this system is not
16871 supported anymore.
16872
16873 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16874
16875 Don't force ./temacs to start in terminal mode.
16876
16877 * frame.c (make_initial_frame): Initialize faces in all cases, not
16878 only when CANNOT_DUMP is defined.
16879 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16880
16881 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16882
16883 * dispnew.c (add_window_display_history): Use const for the string
16884 pointer. Remove declaration, not needed.
16885
16886 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16887
16888 Use 'inline', not 'INLINE'.
16889 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
16890 * alloc.c, fontset.c (INLINE): Remove.
16891 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16892 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16893 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16894 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16895 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16896
16897 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16898
16899 Make it possible to run ./temacs.
16900
16901 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16902 syms_of_callproc does the same thing. Remove test for
16903 "initialized", do it in the caller.
16904 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16905
16906 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16907
16908 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16909 (read_minibuf): Use get_minibuffer.
16910 (syms_of_minibuf): Use DEFSYM.
16911 (Qmetadata): New var.
16912 * data.c (Qbuffer): Don't make it static.
16913 (syms_of_data): Use DEFSYM.
16914
16915 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16916
16917 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16918 (CCL_CODE_MIN): New macro.
16919
16920 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16921
16922 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16923
16924 * eval.c (Qdebug): Now static.
16925 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16926 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16927 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16928
16929 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16930
16931 * image.c: Various fixes to ImageMagick code comments.
16932 (Fimagemagick_types): Doc fix.
16933
16934 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16935
16936 Minor fixes prompted by GCC 4.6.0 warnings.
16937
16938 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16939
16940 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16941 (x_clipboard_manager_save_all): Move extern decl to ...
16942 * xterm.h: ... here, so that it can be checked for consistency.
16943
16944 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16945
16946 * xselect.c (x_clipboard_manager_save_frame)
16947 (x_clipboard_manager_save_all): New functions.
16948 (Fx_clipboard_manager_save): Lisp function deleted.
16949
16950 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16951 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16952
16953 * xterm.h: Update prototype.
16954
16955 2011-05-28 William Xu <william.xwl@gmail.com>
16956
16957 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16958 exiting (Bug#8239).
16959
16960 2011-05-28 Jim Meyering <meyering@redhat.com>
16961
16962 Avoid a sign-extension bug in crypto_hash_function.
16963 * fns.c (to_uchar): Define.
16964 (crypto_hash_function): Use it to convert some newly-signed
16965 variables to unsigned, to avoid sign-extension bugs. For example,
16966 without this change, (md5 "truc") would evaluate to
16967 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16968 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16969 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16970
16971 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16972
16973 Integer overflow fixes.
16974
16975 * dbusbind.c: Serial number integer overflow fixes.
16976 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16977 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16978 to hold a serial number that is too large for a fixnum.
16979 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16980 Check for serial numbers out of range. Decode any serial number
16981 that was so large that it became a float. (Bug#8722)
16982
16983 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16984 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16985 Use XFASTINT rather than XUINT when numbers are nonnegative.
16986 (xd_append_arg, Fdbus_method_return_internal):
16987 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16988 arguments, check that Lisp number is nonnegative, rather than
16989 silently wrapping negative numbers around. (Bug#8722)
16990 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16991 (Bug#8722)
16992
16993 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16994
16995 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16996
16997 ccl: Add integer overflow checks.
16998 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16999 (IN_INT_RANGE): New macros.
17000 (ccl_driver): Use them to check for integer overflow when
17001 decoding a CCL program. Many of the new checks are whether XINT (x)
17002 fits in int; it doesn't always, on 64-bit hosts. The new version
17003 doesn't catch all possible integer overflows, but it's an
17004 improvement. (Bug#8719)
17005
17006 * alloc.c (make_event_array): Use XINT, not XUINT.
17007 There's no need for unsigned here.
17008
17009 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17010 This follows up to the 2011-05-06 change that substituted uintptr_t
17011 for EMACS_INT. This case wasn't caught back then.
17012
17013 Rework Fformat to avoid integer overflow issues.
17014 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17015 now (part of C89). Include <verify.h>.
17016 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17017 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17018 (Fformat): Avoid the prepass trying to compute sizes; it was only
17019 approximate and thus did not catch overflow reliably. Instead, walk
17020 through the format just once, formatting and computing sizes as we go,
17021 checking for integer overflow at every step, and allocating a larger
17022 buffer as needed. Keep track separately whether the format is
17023 multibyte. Keep only the most-recently calculated precision, rather
17024 than them all. Record whether each argument has been converted to
17025 string. Use EMACS_INT, not int, for byte and char and arg counts.
17026 Support field widths and precisions larger than INT_MAX. Avoid
17027 sprintf's undefined behavior with conversion specifications such as %#d
17028 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17029 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17030 formatting out-of-range floating point numbers with int
17031 formats. (Bug#8668)
17032
17033 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17034
17035 * data.c: Avoid integer truncation in expressions involving floats.
17036 * data.c: Include <intprops.h>.
17037 (arith_driver): When there's an integer overflow in an expression
17038 involving floating point, convert the integers to floating point
17039 so that the resulting value does not suffer from catastrophic
17040 integer truncation. For example, on a 64-bit host (* 4
17041 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17042 Do not rely on undefined behavior after integer overflow.
17043
17044 merge count_size_as_multibyte, parse_str_to_multibyte
17045 * character.c, character.h (count_size_as_multibyte):
17046 Rename from parse_str_to_multibyte; all uses changed.
17047 Check for integer overflow.
17048 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17049 since it's now a duplicate of the other. This is more of
17050 a character than a buffer op, so better that it's in character.c.
17051 * fns.c, print.c: Adjust to above changes.
17052
17053 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17054
17055 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17056
17057 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17058
17059 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17060 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17061 (x_clipboard_manager_save): Now static.
17062 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17063
17064 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17065 (crypto_hash_function): Now static.
17066 Fix pointer signedness problems. Avoid unnecessary initializations.
17067
17068 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17069
17070 * termhooks.h (Vselection_alist): Make it terminal-local.
17071
17072 * terminal.c (create_terminal): Initialize it.
17073
17074 * xselect.c: Support for clipboard managers.
17075 (Vselection_alist): Move to termhooks.h as terminal-local var.
17076 (LOCAL_SELECTION): New macro.
17077 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17078 (symbol_to_x_atom): Remove gratuitous arg.
17079 (x_handle_selection_request, lisp_data_to_selection_data)
17080 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17081 (x_own_selection, x_get_local_selection, x_convert_selection):
17082 New arg, specifying work frame. Use terminal-local Vselection_alist.
17083 (some_frame_on_display): Delete unused function.
17084 (Fx_own_selection_internal, Fx_get_selection_internal)
17085 (Fx_disown_selection_internal, Fx_selection_owner_p)
17086 (Fx_selection_exists_p): New optional frame arg.
17087 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17088 (x_handle_selection_clear): Don't treat other terminals with the
17089 same keyboard specially. Use the terminal-local Vselection_alist.
17090 (x_clear_frame_selections): Use Frun_hook_with_args.
17091
17092 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17093
17094 * xterm.h: Add support for those atoms.
17095
17096 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17097
17098 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17099 (converted_selections, conversion_fail_tag): New global variables.
17100 (x_selection_request_lisp_error): Free the above.
17101 (x_get_local_selection): Remove unnecessary code.
17102 (x_reply_selection_request): Args changed; handle arbitrary array
17103 of converted selections stored in converted_selections.
17104 Separate the XChangeProperty and SelectionNotify steps.
17105 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17106 (x_convert_selection): New function.
17107 (x_handle_selection_event): Simplify.
17108 (x_get_foreign_selection): Don't ignore incoming requests while
17109 waiting for an answer; this will fail when we implement
17110 SAVE_TARGETS, and seems unnecessary anyway.
17111 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17112 (Vx_sent_selection_functions): Doc fix.
17113
17114 2011-05-26 Leo Liu <sdl.web@gmail.com>
17115
17116 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17117
17118 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17119
17120 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17121
17122 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17123 for fringe update if it has periodic bitmap.
17124 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17125 and fringe_bitmap_periodic_p.
17126
17127 * fringe.c (get_fringe_bitmap_data): New function.
17128 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17129 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17130 row. Mark glyph row for fringe update if periodicity changed.
17131
17132 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17133 for fringe update unless it has periodic bitmap.
17134
17135 2011-05-25 Kenichi Handa <handa@m17n.org>
17136
17137 * xdisp.c (get_next_display_element): Set correct it->face_id for
17138 a static composition.
17139
17140 2011-05-24 Leo Liu <sdl.web@gmail.com>
17141
17142 * deps.mk (fns.o):
17143 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17144
17145 * fns.c (crypto_hash_function, Fsha1): New function.
17146 (Fmd5): Use crypto_hash_function.
17147 (syms_of_fns): Add Ssha1.
17148
17149 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17150
17151 * gnutls.c: Remove unused macros.
17152 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17153 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17154 Remove macros that are defined and never used.
17155 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17156
17157 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17158
17159 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17160 (Fx_get_selection_internal): Minor cleanup.
17161 (Fx_own_selection_internal): Rename arguments for consistency with
17162 select.el.
17163
17164 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17165
17166 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17167
17168 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17169
17170 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17171
17172 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17173
17174 * dispnew.c (scrolling_window): Don't exclude the case that the
17175 last enabled row in the desired matrix touches the bottom boundary.
17176
17177 2011-05-21 Glenn Morris <rgm@gnu.org>
17178
17179 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17180 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17181 and add some more files.
17182
17183 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17184
17185 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17186 report_file_error introduced by the change from 2011-05-07.
17187
17188 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17189
17190 * systime.h (Time): Define only if emacs is defined.
17191 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17192 where the include path doesn't have X11/X.h by default. See
17193 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17194
17195 2011-05-20 Kenichi Handa <handa@m17n.org>
17196
17197 * composite.c (find_automatic_composition): Fix previous change.
17198
17199 2011-05-20 Glenn Morris <rgm@gnu.org>
17200
17201 * lisp.mk: New file, split from Makefile.in.
17202 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17203 (shortlisp): Remove.
17204 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17205
17206 2011-05-19 Glenn Morris <rgm@gnu.org>
17207
17208 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17209 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17210 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17211 (lisp): Set the order to that of loadup.el.
17212 (shortlisp): Make it a copy of $lisp.
17213 (SOME_MACHINE_LISP): Remove.
17214 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17215 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17216
17217 2011-05-18 Kenichi Handa <handa@m17n.org>
17218
17219 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17220 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17221 (find_automatic_composition): Mostly rewrite for efficiency.
17222
17223 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17224
17225 * makefile.w32-in: Update dependencies.
17226
17227 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17228
17229 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17230 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17231
17232 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17233
17234 Fix some integer overflow issues, such as string length overflow.
17235
17236 * insdel.c (count_size_as_multibyte): Check for string overflow.
17237
17238 * character.c (lisp_string_width): Check for string overflow.
17239 Use EMACS_INT, not int, for string indexes and lengths; in
17240 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17241 the resulting string length overflows an EMACS_INT; instead,
17242 report a string overflow if no precision given. When checking for
17243 precision exhaustion, use a check that cannot possibly have
17244 integer overflow. (Bug#8675)
17245 * character.h (lisp_string_width): Adjust to new signature.
17246
17247 * alloc.c (string_overflow): New function.
17248 (Fmake_string): Use it. This doesn't change behavior, but saves
17249 a few bytes and will simplify future changes.
17250 * character.c (string_escape_byte8): Likewise.
17251 * lisp.h (string_overflow): New decl.
17252
17253 Fixups, following up to the user-interface timestamp change.
17254 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17255 for UI timestamps, instead of unsigned long.
17256 * msdos.c (mouse_get_pos): Likewise.
17257 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17258 * w32gui.h (Time): Define by including "systime.h" rather than by
17259 declaring it ourselves. (Bug#8664)
17260
17261 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17262 * image.c (clear_image_cache): Likewise.
17263
17264 * term.c (term_mouse_position): Don't assume time_t wraparound.
17265
17266 Be more systematic about user-interface timestamps.
17267 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17268 and sometimes 'EMACS_UINT', to represent these timestamps.
17269 This change causes it to use 'Time' uniformly, as that's what X uses.
17270 This makes the code easier to follow, and makes it easier to catch
17271 integer overflow bugs such as Bug#8664.
17272 * frame.c (Fmouse_position, Fmouse_pixel_position):
17273 Use Time, not unsigned long, for user-interface timestamps.
17274 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17275 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17276 * keyboard.h (last_event_timestamp): Likewise.
17277 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17278 * menu.h (xmenu_show): Likewise.
17279 * term.c (term_mouse_position): Likewise.
17280 * termhooks.h (struct input_event.timestamp): Likewise.
17281 (struct terminal.mouse_position_hook): Likewise.
17282 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17283 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17284 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17285 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17286 what it was before.
17287 * menu.h, termhooks.h: Include "systime.h", for Time.
17288
17289 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17290 Don't assume that the difference between two unsigned long values
17291 can fit into an integer. At this point, we know button_down_time
17292 <= event->timestamp, so the difference must be nonnegative, so
17293 there's no need to cast the result if double-click-time is
17294 nonnegative, as it should be; check that it's nonnegative, just in
17295 case. This bug is triggered when events are more than 2**31 ms
17296 apart (about 25 days). (Bug#8664)
17297
17298 * xselect.c (last_event_timestamp): Remove duplicate decl.
17299 (x_own_selection): Remove needless cast to unsigned long.
17300
17301 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17302 that always fit in int. Use a sentinel instead of a counter, to
17303 avoid a temp and to allay GCC's concerns about possible int overflow.
17304 * frame.h (struct frame): Use int for menu_bar_items_used
17305 instead of EMACS_INT, since it always fits in int.
17306
17307 * menu.c (grow_menu_items): Check for int overflow.
17308
17309 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17310
17311 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17312 Before, the code was not consistent. These values cannot exceed
17313 2**31 - 1 so there's no need to make them unsigned.
17314 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17315 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17316 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17317 as modifiers.
17318 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17319
17320 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17321 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17322 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17323 presumably because the widths might not match.
17324
17325 * window.c (size_window): Avoid needless test at loop start.
17326
17327 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17328
17329 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17330
17331 2011-05-12 Drew Adams <drew.adams@oracle.com>
17332
17333 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17334
17335 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17336
17337 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17338 `width' to `bar_area_x' and `bar_area_width', respectively.
17339 (x_scroll_run): Take account of fringe background extension.
17340
17341 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17342 Rename local vars `left' and `width' to `bar_area_x' and
17343 `bar_area_width', respectively.
17344 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17345 background extension.
17346
17347 2011-05-10 Jim Meyering <meyering@redhat.com>
17348
17349 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17350
17351 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17352
17353 * image.c (Finit_image_library): Return t for built-in image types,
17354 like pbm and xbm. (Bug#8640)
17355
17356 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17357
17358 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17359
17360 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17361
17362 * w32console.c (Fset_screen_color): Doc fix.
17363 (Fget_screen_color): New function.
17364 (syms_of_ntterm): Defsubr it.
17365
17366 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17367 unlink the temporary file if Fcall_process didn't create it in the
17368 first place.
17369 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17370 child process will be redirected to a file specified with `:file'.
17371 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17372 cue to call_process_cleanup not to close that handle.
17373
17374 2011-05-07 Ben Key <bkey76@gmail.com>
17375
17376 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17377 one of two shell specific rules, either bootstrap-temacs-CMD or
17378 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17379 to the previous implementation of the bootstrap-temacs rule.
17380 The bootstrap-temacs-CMD rule is similar to the previous
17381 implementation of the bootstrap-temacs rule except that it
17382 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17383 variable.
17384
17385 These changes, along with some changes to nt/configure.bat,
17386 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17387 earlier fix to add support for --cflags and --ldflags options
17388 that include quotes so that it works whether make uses cmd or
17389 sh as the shell.
17390
17391 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17392
17393 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17394 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17395 is a constant.
17396 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17397 a string. Handle both cases.
17398 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17399 (Fdbus_register_method): Use Qinvalid_function.
17400
17401 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17402
17403 * makefile.w32-in: Update dependencies.
17404 (LISP_H): Add inttypes.h and stdin.h.
17405 (PROCESS_H): Add unistd.h.
17406
17407 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17408
17409 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17410 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17411
17412 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17413
17414 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17415
17416 * term.c (vfatal): Remove stray call to va_end.
17417 It's not needed and the C Standard doesn't allow it here anyway.
17418
17419 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17420 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17421
17422 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17423 bytes.
17424
17425 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17426
17427 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17428
17429 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17430
17431 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17432
17433 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17434
17435 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17436 * charset.c (Fdefine_charset_internal): Don't initialize
17437 charset.code_space[15]. The value was garbage, on hosts with
17438 32-bit int (Bug#8600).
17439
17440 * lread.c (read_integer): Be more consistent with string-to-number.
17441 Use string_to_number to do the actual conversion; this avoids
17442 rounding errors and fixes some other screwups. Without this fix,
17443 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17444 (digit_to_number): Move earlier, for benefit of read_integer.
17445 Return -1 if the digit is out of range for the base, -2 if it is
17446 not a digit in any supported base. (Bug#8602)
17447
17448 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17449
17450 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17451 to match comment at start of function. This also removes a
17452 GCC warning about overflow in a 32+64-bit port.
17453
17454 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17455
17456 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17457 Reported by Stefan Monnier in
17458 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17459 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17460 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17461
17462 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17463 (EMACS_UINTPTR): Likewise, with uintptr_t.
17464
17465 * lisp.h: Prefer 64-bit EMACS_INT if available.
17466 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17467 on 32-bit hosts that have 64-bit int, so that they can access
17468 large files.
17469 However, temporarily disable this change unless the temporary
17470 symbol WIDE_EMACS_INT is defined.
17471
17472 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17473
17474 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17475 This removes an assumption that EMACS_INT and long are the same
17476 width as pointers. The assumption is true for Emacs porting targets
17477 now, but we want to make other targets possible.
17478 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17479 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17480 In the rest of the code, change types of integers that hold casted
17481 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17482 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17483 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17484 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17485 No need to cast type when ORing.
17486 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17487 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17488 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17489 assume EMACS_INT is the same width as char *.
17490 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17491 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17492 Remove no-longer-needed casts.
17493 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17494 (xg_tool_bar_help_callback, xg_make_tool_item):
17495 Use EMACS_INTPTR to hold an integer
17496 that will be cast to void *; this can avoid a GCC warning
17497 if EMACS_INT is not the same width as void *.
17498 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17499 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17500 (current_message_1, set_message_1):
17501 Use a local to convert to proper width without a cast.
17502 * xmenu.c (dialog_selection_callback): Likewise.
17503
17504 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17505 Also, don't assume VALBITS / RAND_BITS is less than 5,
17506 and don't rely on undefined behavior when shifting a 1 left into
17507 the sign bit.
17508 * lisp.h (get_random): Change signature to match.
17509
17510 * lread.c (hash_string): Use size_t, not int, for hash computation.
17511 Normally we prefer signed values; but hashing is special, because
17512 it's better to use unsigned division on hash table sizes so that
17513 the remainder is nonnegative. Also, size_t is the natural width
17514 for hashing into memory. The previous code used 'int', which doesn't
17515 retain enough info to hash well into very large tables.
17516 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17517
17518 * dbusbind.c: Don't possibly lose pointer info when converting.
17519 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17520 Use XPNTR rather than XHASH, so that the high-order bits of
17521 the pointer aren't lost when converting through void *.
17522
17523 * eval.c (Fautoload): Don't double-shift a pointer.
17524
17525 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17526
17527 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17528
17529 * gnutls.c (DEF_GNUTLS_FN):
17530 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17531
17532 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17533
17534 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17535 marker. (Bug#8610)
17536
17537 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17538
17539 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17540 New version that can reserve upto 2GB of heap space.
17541
17542 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17543
17544 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17545
17546 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17547
17548 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17549 `gnutls_certificate_set_x509_key_file'.
17550
17551 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17552
17553 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17554 Update dependencies.
17555
17556 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17557
17558 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17559 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17560 Remove unused parameter `fildes'.
17561 * process.c (read_process_output, send_process): Don't pass it.
17562
17563 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17564
17565 Fix previous change: the library cache is defined in w32.c.
17566 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17567 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17568
17569 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17570
17571 Implement dynamic loading of GnuTLS on Windows.
17572
17573 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17574 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17575 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17576 Declare.
17577
17578 * gnutls.c (Qgnutls_dll): Define.
17579 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17580 (gnutls_*): Declare function pointers.
17581 (init_gnutls_functions): New function to initialize function pointers.
17582 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17583 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17584 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17585 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17586 (emacs_gnutls_write, emacs_gnutls_read)
17587 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17588 (Fgnutls_available_p): New function.
17589 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17590 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17591 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17592
17593 * image.c: Include w32.h.
17594 (Vimage_type_cache): Delete.
17595 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17596 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17597 (w32_delayed_load): Move to w32.c.
17598
17599 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17600
17601 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17602 (w32_delayed_load): Move from image.c. When loading a library, record
17603 its filename in the :loaded-from property of the library id.
17604 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17605 Initialize and staticpro them.
17606 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17607
17608 * process.c: Include lisp.h before w32.h, not after.
17609 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17610 instead of gnutls_record_check_pending.
17611
17612 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17613
17614 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17615
17616 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17617 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17618 as passed in.
17619
17620 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17621
17622 * xterm.c (x_set_frame_alpha): Do not set property on anything
17623 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17624
17625 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17626
17627 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17628
17629 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17630
17631 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17632 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17633 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17634 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17635 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17636 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17637 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17638 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17639 (Qgnutls_bootprop_callbacks_verify): Make static.
17640
17641 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17642
17643 * callproc.c: Indentation fixup.
17644
17645 * sysdep.c (wait_for_termination_1): Make static.
17646 (wait_for_termination, interruptible_wait_for_termination):
17647 Move after wait_for_termination_1.
17648
17649 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17650
17651 * sysdep.c (interruptible_wait_for_termination): New function
17652 which is like wait_for_termination, but allows keyboard
17653 interruptions.
17654
17655 * callproc.c (Fcall_process): Add (:file "file") as an option for
17656 the STDOUT buffer.
17657 (Fcall_process_region): Ditto.
17658
17659 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17660
17661 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17662 rather than `XVECTOR (FOO)->size'.
17663
17664 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17665 inttypes.h, as a gnulib replacement is used if it not available in
17666 system headers.
17667
17668 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17669
17670 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17671 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17672 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17673
17674 * coding.c (coding_alloc_by_realloc): Error out if destination
17675 will grow beyond MOST_POSITIVE_FIXNUM.
17676 (decode_coding_emacs_mule): Abort if there isn't enough place in
17677 charbuf for the composition carryover bytes. Reserve an extra
17678 space for up to 2 characters produced in a loop.
17679 (decode_coding_iso_2022): Abort if there isn't enough place in
17680 charbuf for the composition carryover bytes.
17681
17682 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17683
17684 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17685 aborting when %lld or %lll format is passed.
17686 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17687 %llo or %llx format is passed. (Bug#8545)
17688
17689 * window.c (window_scroll_line_based): Use a marker instead of
17690 simple variables to record original value of point. (Bug#7952)
17691
17692 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17693 produced by %s or %c overflows available buffer space. (Bug#8545)
17694
17695 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17696
17697 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17698 (SIZE_MAX): Move defn after all includes, as they might #define it.
17699
17700 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17701
17702 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17703
17704 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17705
17706 * keyboard.c (Qdelayed_warnings_hook): Define.
17707 (command_loop_1): Run `delayed-warnings-hook'
17708 if Vdelayed_warnings_list is non-nil.
17709 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17710 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17711
17712 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17713
17714 * doprnt.c (doprnt): Don't return value smaller than the buffer
17715 size if the message was truncated. (Bug#8545).
17716
17717 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17718
17719 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17720 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17721
17722 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17723
17724 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17725
17726 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17727
17728 * makefile.w32-in: Update dependencies.
17729
17730 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17731
17732 Improve `doprnt' and its usage. (Bug#8545)
17733 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17734 `format_end'. Remove support for %l as a conversion specifier.
17735 Don't use xrealloc. Improve diagnostics when the %l size modifier
17736 is used. Update the commentary.
17737
17738 * eval.c (verror): Simplify calculation of size_t.
17739
17740 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17741 messages.
17742
17743 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17744
17745 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17746 change.
17747
17748 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17749
17750 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17751 This makes this file independent of the recent pseudovector change.
17752
17753 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17754
17755 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17756
17757 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17758 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17759 Remove unused local.
17760 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17761
17762 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17763 GCC 4.6.0 optimizes based on type-based alias analysis.
17764 For example, if b is of type struct buffer * and v of type struct
17765 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17766 != &v->size, and therefore "v->size = 1; b->size = 2; return
17767 v->size;" must therefore return 1. This assumption is incorrect
17768 for Emacs, since it type-puns struct Lisp_Vector * with many other
17769 types. To fix this problem, this patch adds a new type struct
17770 vectorlike_header that documents the constraints on layout of vectors
17771 and pseudovectors, and helps optimizing compilers not get fooled
17772 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17773 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17774 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17775 the size member.
17776 (XSETPVECTYPE): Rewrite in terms of new macro.
17777 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17778 This is a bit clearer, and further avoids the possibility of
17779 undesirable aliasing.
17780 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17781 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17782 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17783 since Lisp_Subr is a special case (no "next" field).
17784 (ASIZE): Now uses header.size rather than size.
17785 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17786 to avoid the hassle of writing XVECTOR (foo)->header.size.
17787 (struct vectorlike_header): New type.
17788 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17789 object, to help avoid aliasing.
17790 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17791 (SUBRP): Likewise, since Lisp_Subr is a special case.
17792 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17793 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17794 (struct Lisp_Hash_Table): Combine first two members into a single
17795 struct vectorlike_header member. All uses of "size" and "next" members
17796 changed to be "header.size" and "header.next".
17797 * buffer.h (struct buffer): Likewise.
17798 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17799 * frame.h (struct frame): Likewise.
17800 * process.h (struct Lisp_Process): Likewise.
17801 * termhooks.h (struct terminal): Likewise.
17802 * window.c (struct save_window_data, struct saved_window): Likewise.
17803 * window.h (struct window): Likewise.
17804 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17805 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17806 * buffer.c (init_buffer_once): Likewise.
17807 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17808 special case.
17809 * process.c (Fformat_network_address): Use local var for size,
17810 for brevity.
17811
17812 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17813
17814 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17815 * data.c (atof): Remove decl; no longer used or needed.
17816 (digit_to_number): Move to lread.c.
17817 (Fstring_to_number): Use new string_to_number function, to be
17818 consistent with how the Lisp reader treats infinities and NaNs.
17819 Do not assume that floating-point numbers represent EMACS_INT
17820 without losing information; this is not true on most 64-bit hosts.
17821 Avoid double-rounding errors, by insisting on integers when
17822 parsing non-base-10 numbers, as the documentation specifies.
17823 * lisp.h (string_to_number): New decl, replacing ...
17824 (isfloat_string): Remove.
17825 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17826 (read1): Do not accept +. and -. as integers; this
17827 appears to have been a coding error. Similarly, do not accept
17828 strings like +-1e0 as floating point numbers. Do not report
17829 overflow for integer overflows unless the base is not 10 which
17830 means we have no simple and reliable way to continue.
17831 Break out the floating-point parsing into a new
17832 function string_to_number, so that Fstring_to_number parses
17833 floating point numbers consistently with the Lisp reader.
17834 (digit_to_number): Move here from data.c. Make it static inline.
17835 (E_CHAR, EXP_INT): Remove, replacing with ...
17836 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17837 (string_to_number): New function, replacing isfloat_string.
17838 This function checks for valid syntax and produces the resulting
17839 Lisp float number too. Rework it so that string-to-number
17840 no longer mishandles examples like "1.0e+". Use strtoumax,
17841 so that overflow for non-base-10 numbers is reported only when
17842 there's no portable and simple way to convert to floating point.
17843
17844 * textprop.c (set_text_properties_1): Rewrite for clarity,
17845 and to avoid GCC warning about integer overflow.
17846
17847 * intervals.h (struct interval): Use EMACS_INT for members
17848 where EMACS_UINT might cause problems. See
17849 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17850 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17851 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17852 All uses changed.
17853 (offset_intervals): Tell GCC not to worry about length overflow
17854 when negating a negative length.
17855
17856 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17857 (overrun_check_free): Likewise.
17858
17859 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17860 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17861 word size.
17862
17863 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17864 (gnutls_make_error): Rename local to avoid shadowing.
17865 (gnutls_emacs_global_deinit): ifdef out; not used.
17866 (Fgnutls_boot): Use const for pointer to readonly storage.
17867 Comment out unused local. Fix pointer signedness problems.
17868
17869 * lread.c (openp): Don't stuff size_t into an 'int'.
17870 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17871 about possible signed overflow.
17872
17873 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17874 (GDK_KEY_g): Don't define if already defined.
17875 (xg_prepare_tooltip): Avoid pointer signedness problem.
17876 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17877
17878 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17879 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17880
17881 * xfns.c (Fx_window_property): Simplify a bit,
17882 to make a bit faster and to avoid GCC 4.6.0 warning.
17883 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17884
17885 * fns.c (internal_equal): Don't assume size_t fits in int.
17886
17887 * alloc.c (compact_small_strings): Tighten assertion a little.
17888
17889 Replace pEd with more-general pI, and fix some printf arg casts.
17890 * lisp.h (pI): New macro, generalizing old pEd macro to other
17891 conversion specifiers. For example, use "...%"pI"d..." rather
17892 than "...%"pEd"...".
17893 (pEd): Remove. All uses replaced with similar uses of pI.
17894 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
17895 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17896 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17897 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17898 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17899 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17900 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17901 64-bit hosts.
17902 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17903 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17904 * print.c (safe_debug_print, print_object): Likewise.
17905 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17906 to int.
17907 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17908 avoiding the 0 flag, which is not portable.
17909 * process.c (Fmake_network_process): Use pI to avoid cast.
17910 * region-cache.c (pp_cache): Likewise.
17911 * xdisp.c (decode_mode_spec): Likewise.
17912 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17913 behavior on 64-bit hosts with printf arg.
17914 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17915 (x_stop_queuing_selection_requests): Likewise.
17916 (x_get_window_property): Don't truncate byte count to an 'int'
17917 when tracing.
17918
17919 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17920 here, since it parses constructs like leading '-' and spaces,
17921 which are not wanted; and it overflows with large numbers.
17922 Instead, simply match F[0-9]+, which is what is wanted anyway.
17923
17924 * alloc.c: Remove unportable assumptions about struct layout.
17925 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17926 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17927 (allocate_vectorlike, make_pure_vector): Use the new macros,
17928 plus offsetof, to remove unportable assumptions about struct layout.
17929 These assumptions hold on all porting targets that I know of, but
17930 they are not guaranteed, they're easy to remove, and removing them
17931 makes further changes easier.
17932
17933 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17934 This doesn't fix a bug but makes the code clearer.
17935 (string_overrun_cookie): Now const. Use initializers that
17936 don't formally overflow signed char, to avoid warnings.
17937 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17938 can cause Emacs to crash when string overrun checking is enabled.
17939 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17940 multiple of sizeof (EMACS_INT); it need not be, if
17941 alignof(EMACS_INT) < sizeof (EMACS_INT).
17942 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17943
17944 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17945
17946 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17947
17948 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17949
17950 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17951 supposed to be handshaking. (Bug#8556)
17952 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17953
17954 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17955
17956 * lisp.h (Qdebug): List symbol.
17957 * eval.c (Qdebug): Restore global linkage.
17958 * keyboard.c (debug-on-event): New variable.
17959 (handle_user_signal): Break into debugger when debug-on-event
17960 matches the current signal symbol.
17961
17962 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17963
17964 * alloc.c (check_sblock, check_string_bytes)
17965 (check_string_free_list): Convert to standard C.
17966
17967 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17968
17969 * w32.c (emacs_gnutls_push): Fix typo.
17970
17971 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17972
17973 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17974 "cast to pointer from integer of different size".
17975
17976 Improve doprnt and its use in verror. (Bug#8545)
17977 * doprnt.c (doprnt): Document the set of format control sequences
17978 supported by the function. Use SAFE_ALLOCA instead of always
17979 using `alloca'.
17980
17981 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17982 is one byte too soon. Don't use xrealloc; instead xfree and
17983 xmalloc anew.
17984
17985 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17986
17987 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17988 callbacks stage.
17989
17990 * gnutls.c: Renamed global_initialized to
17991 gnutls_global_initialized. Added internals for the
17992 :verify-hostname-error, :verify-error, and :verify-flags
17993 parameters of `gnutls-boot' and documented those parameters in the
17994 docstring. Start callback support.
17995 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17996 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17997 on error. Return error code.
17998 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17999 (emacs_gnutls_read): Likewise.
18000 (Fgnutls_boot): Return handshake error code.
18001 (emacs_gnutls_handle_error): New function.
18002 (wsaerror_to_errno): Likewise.
18003
18004 * w32.h (emacs_gnutls_pull): Add prototype.
18005 (emacs_gnutls_push): Likewise.
18006
18007 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18008 (emacs_gnutls_push): Likewise.
18009
18010 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18011
18012 * process.c (wait_reading_process_output): Check if GnuTLS
18013 buffered some data internally if no FDs are set for TLS
18014 connections.
18015
18016 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18017 (LIBS): Link to USER_LIBS.
18018 ($(BLD)/gnutls.$(0)): New target.
18019
18020 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18021
18022 * xdisp.c (handle_single_display_spec): Rename the
18023 display_replaced_before_p argument into display_replaced_p, to
18024 make it consistent with the commentary. Fix typos in the
18025 commentary.
18026
18027 * textprop.c (syms_of_textprop): Remove dead code.
18028 (copy_text_properties): Delete obsolete commentary about an
18029 interface that was deleted long ago. Fix typos in the description
18030 of arguments.
18031
18032 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18033 to changes in oldXMenu/XMenu.h from 2011-04-16.
18034 <menu_help_message, prev_menu_help_message>: Constify.
18035 (IT_menu_make_room): menu->help_text is now `const char **';
18036 adjust.
18037
18038 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18039 to changes in oldXMenu/XMenu.h from 2011-04-16.
18040 (struct XMenu): Declare `help_text' `const char **'.
18041
18042 * xfaces.c <Qunspecified>: Make extern again.
18043
18044 * syntax.c: Include sys/types.h before including regex.h, as
18045 required by POSIX.
18046
18047 * doc.c (get_doc_string): Improve the format passed to `error'.
18048
18049 * doprnt.c (doprnt): Improve commentary.
18050
18051 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18052
18053 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18054 them with etags.
18055
18056 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18057 changes in globals.h immediately force recompilation.
18058 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18059 $(CURDIR)/s/ms-w32.h.
18060 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18061
18062 * character.c (Fchar_direction): Function deleted.
18063 (syms_of_character): Don't defsubr it.
18064 <char-direction-table>: Deleted.
18065
18066 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18067
18068 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18069 * doprnt.c: Include limits.h.
18070 (SIZE_MAX): New macro.
18071 (doprnt): Return a size_t value. 2nd arg is now size_t.
18072 Many local variables are now size_t instead of int or unsigned.
18073 Improve overflow protection. Support `l' modifier for integer
18074 conversions. Support %l conversion. Don't assume an EMACS_INT
18075 argument for integer conversions and for %c.
18076
18077 * lisp.h (doprnt): Restore prototype.
18078
18079 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18080 $(SRC)/character.h.
18081
18082 * Makefile.in (base_obj): Add back doprnt.o.
18083
18084 * deps.mk (doprnt.o): Add back prerequisites.
18085 (callint.o): Depend on character.h.
18086
18087 * eval.c (internal_lisp_condition_case): Include the handler
18088 representation in the error message.
18089 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18090 when breaking from the loop.
18091
18092 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18093
18094 * callint.c (Fcall_interactively): When displaying error message
18095 about invalid control letter, pass the character's codepoint, not
18096 a pointer to its multibyte form. Improve display of the character
18097 in octal and display also its hex code.
18098
18099 * character.c (char_string): Use %x to display the (unsigned)
18100 codepoint of an invalid character, to avoid displaying a bogus
18101 negative value.
18102
18103 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18104 `error', not SYMBOL_NAME itself.
18105
18106 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18107 character arguments to `error'.
18108
18109 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18110 to `error' in error message about FINAL_CHAR argument. Make sure
18111 FINAL_CHAR is a character, and use %c when it is passed as
18112 argument to `error'.
18113
18114 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18115
18116 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18117
18118 * w32.c: Include <time.h>.
18119 (sys_localtime): New function.
18120
18121 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18122
18123 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18124
18125 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18126
18127 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18128
18129 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18130 zombies (Bug#8467).
18131
18132 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18133
18134 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18135 gl_state.e_property when gl_state.object is Qt.
18136
18137 * insdel.c (make_gap_larger): Remove limitation of buffer size
18138 to <= INT_MAX.
18139
18140 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18141
18142 * xdisp.c (lookup_glyphless_char_display)
18143 (produce_glyphless_glyph): Handle cons cell entry in
18144 glyphless-char-display.
18145 (Vglyphless_char_display): Document it.
18146
18147 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18148 glyphless-char-display.
18149
18150 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18151
18152 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18153
18154 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18155
18156 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18157 definition for no-X builds.
18158
18159 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18160
18161 Static checks with GCC 4.6.0 and non-default toolkits.
18162
18163 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18164
18165 * process.c (keyboard_bit_set): Define only if SIGIO.
18166 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18167 (send_process): Repair possible setjmp clobbering.
18168
18169 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18170
18171 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18172
18173 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18174
18175 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18176 Define only if needed.
18177
18178 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18179 by pacifying GCC about it. Maybe it's time to retire it?
18180 * xfaces.c (USG, __TIMEVAL__): Likewise.
18181
18182 * dispextern.h (struct redisplay_interface): Rename param
18183 to avoid shadowing.
18184 * termhooks.h (struct terminal): Likewise.
18185 * xterm.c (xembed_send_message): Likewise.
18186
18187 * insdel.c (make_gap_smaller): Define only if
18188 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18189
18190 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18191 it.
18192
18193 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18194 so that we aren't warned about unused symbols.
18195
18196 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18197
18198 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18199
18200 * xfns.c (x_real_positions): Mark locals as initialized.
18201
18202 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18203
18204 * xterm.c: Fix problems found by static analysis with other toolkits.
18205 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18206 (x_dispatch_event): Declare static if USE_GTK, and
18207 define if USE_GTK || USE_X_TOOLKIT.
18208 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18209 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18210 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18211 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18212
18213 * xmenu.c (menu_help_callback): Pointer type fixes.
18214 Use const pointers when pointing at readonly data. Avoid pointer
18215 signedness clashes.
18216 (FALSE): Remove unused macro.
18217 (update_frame_menubar): Remove unused decl.
18218
18219 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18220
18221 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18222 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18223 (single_menu_item): Rename local to avoid shadowing.
18224
18225 * keyboard.c (make_lispy_event): Remove unused local var.
18226
18227 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18228 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18229
18230 * bitmaps: Change bitmaps from unsigned char back to the X11
18231 compatible char. Avoid the old compiler warnings about
18232 out-of-range initializers by using, for example, '\xab' rather
18233 than 0xab.
18234
18235 * xgselect.c (xgselect_initialize): Check vs interface
18236 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18237
18238 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18239
18240 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18241 to read-only memory.
18242
18243 * fns.c (vector): Remove; this old hack is no longer needed.
18244
18245 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18246 Remove unused var.
18247 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18248
18249 * xrdb.c (x_load_resources): Omit unused local.
18250
18251 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18252 (x_window): Rename locals to avoid shadowing.
18253 (USG): Use the kludged USG macro, to pacify gcc.
18254
18255 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18256 (x_term_init): Remove local to avoid shadowing.
18257
18258 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18259
18260 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18261 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18262
18263 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18264
18265 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18266
18267 Fix regex.c, syntax.c and friends for buffers > 2GB.
18268 * syntax.h (struct gl_state_s): Declare character position members
18269 EMACS_INT.
18270
18271 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18272
18273 * textprop.c (verify_interval_modification, interval_of):
18274 Declare arguments EMACS_INT.
18275
18276 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18277 EMACS_INT.
18278
18279 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18280
18281 * indent.c (Fvertical_motion): Local variable it_start is now
18282 EMACS_INT.
18283
18284 * regex.c (re_match, re_match_2, re_match_2_internal)
18285 (bcmp_translate, regcomp, regexec, print_double_string)
18286 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18287 (re_compile_pattern, re_exec): Declare arguments and local
18288 variables `size_t' and `ssize_t' and return values `regoff_t', as
18289 appropriate.
18290 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18291 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18292 <compile_stack_type>: `size' and `avail' are now `size_t'.
18293
18294 * regex.h <regoff_t>: Use ssize_t, not int.
18295 (re_search, re_search_2, re_match, re_match_2): Arguments that
18296 specify buffer/string position and length are now ssize_t and
18297 size_t. Return type is regoff_t.
18298
18299 2011-04-16 Ben Key <bkey76@gmail.com>
18300
18301 * nsfont.m: Fixed bugs in ns_get_family and
18302 ns_descriptor_to_entity that were caused by using free to
18303 deallocate memory blocks that were allocated by xmalloc (via
18304 xstrdup). This caused Emacs to crash when compiled with
18305 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18306 --enable-checking=xmallocoverrun). xfree is now used to
18307 deallocate these memory blocks.
18308
18309 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18310
18311 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18312
18313 emacs_write: Accept and return EMACS_INT for sizes.
18314 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18315 et seq.
18316 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18317 Accept and return EMACS_INT.
18318 (emacs_gnutls_write): Return the number of bytes written on
18319 partial writes.
18320 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18321 (emacs_read, emacs_write): Remove check for negative size, as the
18322 Emacs source code has been audited now.
18323 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18324 (emacs_read, emacs_write): Use it.
18325 * process.c (send_process): Adjust to the new signatures of
18326 emacs_write and emacs_gnutls_write. Do not attempt to store
18327 a byte offset into an 'int'; it might overflow.
18328 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18329
18330 * sound.c: Don't assume sizes fit in 'int'.
18331 (struct sound_device.period_size, alsa_period_size):
18332 Return EMACS_INT, not int.
18333 (struct sound_device.write, vox_write, alsa_write):
18334 Accept EMACS_INT, not int.
18335 (wav_play, au_play): Use EMACS_INT to store sizes and to
18336 record read return values.
18337
18338 2011-04-15 Ben Key <bkey76@gmail.com>
18339
18340 * keyboard.c (Qundefined): Don't declare static since it is used
18341 in nsfns.m.
18342 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18343 static since they are used in nsfont.m.
18344
18345 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18346
18347 * process.c (Qprocessp): Don't declare static.
18348 * lisp.h (Qprocessp): Declare again.
18349
18350 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18351
18352 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18353
18354 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18355
18356 Improve C-level modularity by making more things 'static'.
18357
18358 Don't publish debugger-only interfaces to other modules.
18359 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18360 (verify_bytepos, count_markers): Move decls to the only modules
18361 that need them.
18362 * region-cache.h (pp_cache): Likewise.
18363 * window.h (check_all_windows): Likewise.
18364 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18365
18366 * sysdep.c (croak): Now static, if
18367 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18368 * syssignal.h (croak): Declare only if not static.
18369
18370 * alloc.c (refill_memory_reserve): Now static if
18371 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18372 * lisp.h (refill_memory_reserve): Declare only if not static.
18373
18374 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18375 Define only if USE_LUCID.
18376
18377 * xrdb.c (x_customization_string, x_rm_string): Now static.
18378
18379 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18380 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18381
18382 * xdisp.c (draw_row_with_mouse_face): Now static.
18383 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18384
18385 * window.h (check_all_windows): Mark externally visible.
18386
18387 * window.c (window_deletion_count): Now static.
18388
18389 * undo.c: Make symbols static if they're not exported.
18390 (last_undo_buffer, last_boundary_position, pending_boundary):
18391 Now static.
18392
18393 * textprop.c (interval_insert_behind_hooks): Now static.
18394 (interval_insert_in_front_hooks): Likewise.
18395
18396 * term.c: Make symbols static if they're not exported.
18397 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18398 (max_frame_lines, tty_set_terminal_modes):
18399 (tty_reset_terminal_modes, tty_turn_off_highlight):
18400 (get_tty_terminal): Now static.
18401 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18402 * termhooks.h (term_mouse_moveto): Do not declare if
18403 HAVE_WINDOW_SYSTEM.
18404 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18405 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18406
18407 * sysdep.c: Make symbols static if they're not exported.
18408 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18409 Now static.
18410 (sigprocmask_set, full_mask): Remove; unused.
18411 (wait_debugging): Mark as visible.
18412 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18413 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18414
18415 * syntax.c (syntax_temp): Define only if !__GNUC__.
18416
18417 * sound.c (current_sound_device, current_sound): Now static.
18418
18419 * search.c (searchbufs, searchbuf_head): Now static.
18420
18421 * scroll.c (scroll_cost): Remove; unused.
18422 * dispextern.h (scroll_cost): Remove decl.
18423
18424 * region-cache.h (pp_cache): Mark as externally visible.
18425
18426 * process.c: Make symbols static if they're not exported.
18427 (process_tick, update_tick, create_process, chan_process):
18428 (Vprocess_alist, proc_buffered_char, datagram_access):
18429 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18430 (deactivate_process): Mark defn as static, as well as decl.
18431 * lisp.h (create_process): Remove decl.
18432 * process.h (chan_process, Vprocess_alist): Remove decls.
18433
18434 * print.c: Make symbols static if they're not exported.
18435 (print_depth, new_backquote_output, being_printed, print_buffer):
18436 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18437 (print_interval, print_number_index, initial_stderr_stream):
18438 Now static.
18439 * lisp.h (Fprinc): Remove decl.
18440 (debug_output_compilation_hack): Mark as externally visible.
18441
18442 * sysdep.c (croak): Move decl from here to syssignal.h.
18443 * syssignal.h (croak): Put it here, so the API can be checked when
18444 'croak' is called from dissociate_if_controlling_tty.
18445
18446 * minibuf.c: Make symbols static if they're not exported.
18447 (minibuf_save_list, choose_minibuf_frame): Now static.
18448 * lisp.h (choose_minibuf_frame): Remove decl.
18449
18450 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18451
18452 * lread.c: Make symbols static if they're not exported.
18453 (read_objects, initial_obarray, oblookup_last_bucket_number):
18454 Now static.
18455 (make_symbol): Remove; unused.
18456 * lisp.h (initial_obarray, make_symbol): Remove decls.
18457
18458 * keyboard.c: Make symbols static if they're not exported.
18459 (single_kboard, recent_keys_index, total_keys, recent_keys):
18460 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18461 (this_single_command_key_start, echoing, last_auto_save):
18462 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18463 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18464 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18465 (Vlispy_mouse_stem, double_click_count):
18466 Now static.
18467 (force_auto_save_soon): Define only if SIGDANGER.
18468 (ignore_mouse_drag_p): Now static if
18469 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18470 (print_help): Remove; unused.
18471 (stop_character, last_timer_event): Mark as externally visible.
18472 * keyboard.h (ignore_mouse_drag_p): Declare only if
18473 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18474 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18475 * lisp.h (echoing): Remove decl.
18476 (force_auto_save_soon): Declare only if SIGDANGER.
18477 * xdisp.c (redisplay_window): Simplify code, to make it more
18478 obvious that ignore_mouse_drag_p is not accessed if !defined
18479 USE_GTK && !defined HAVE_NS.
18480
18481 * intervals.c: Make symbols static if they're not exported.
18482 (merge_properties_sticky, merge_interval_right, delete_interval):
18483 Now static.
18484 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18485
18486 * insdel.c: Make symbols static if they're not exported.
18487 However, leave prepare_to_modify_buffer alone. It's never
18488 called from outside this function, but that appears to be a bug.
18489 (combine_after_change_list, combine_after_change_buffer):
18490 (adjust_after_replace, signal_before_change): Now static.
18491 (adjust_after_replace_noundo): Remove; unused.
18492 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18493 (signal_before_change): Remove decls.
18494
18495 * indent.c (val_compute_motion, val_vmotion): Now static.
18496
18497 * image.c: Make symbols static if they're not exported.
18498 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18499 if USE_GTK.
18500 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18501 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18502
18503 * fringe.c (standard_bitmaps): Now static.
18504 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18505
18506 * frame.c: Make symbols static if they're not exported.
18507 (x_report_frame_params, make_terminal_frame): Now static.
18508 (get_frame_param): Now static, unless HAVE_NS.
18509 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18510 (x_get_resource_string): Remove; not used.
18511 * frame.h (make_terminal_frame, x_report_frame_params):
18512 (x_get_resource_string); Remove decls.
18513 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18514 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18515
18516 * font.c, fontset.c: Make symbols static if they're not exported.
18517 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18518 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18519 * font.c (font_close_object): Now static.
18520 * font.h (font_close_object): Remove.
18521 * fontset.c (FONTSET_OBJLIST): Remove.
18522 (free_realized_fontset) #if-0 the body, which does nothing.
18523 (face_suitable_for_char_p): #if-0, as it's never called.
18524 * fontset.h (face_suitable_for_char_p): Remove decl.
18525 * xfaces.c (face_at_string_position):
18526 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18527 since 0 is always ASCII.
18528
18529 * fns.c (weak_hash_tables): Now static.
18530
18531 * fileio.c: Make symbols static if they're not exported.
18532 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18533 (Vwrite_region_annotation_buffers): Now static.
18534
18535 * eval.c: Make symbols static if they're not exported.
18536 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18537 * lisp.h (backtrace_list): Remove decl.
18538
18539 * emacs.c: Make symbols static if they're not exported.
18540 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18541 (fatal_error_code, fatal_error_signal_hook, standard_args):
18542 Now static.
18543 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18544 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18545 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18546 * lisp.h (fatal_error_signal_hook): Remove decl.
18547 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18548
18549 * editfns.c: Move a (normally-unused) function to its only use.
18550 * editfns.c, lisp.h (get_operating_system_release): Remove.
18551 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18552 worth the hassle of breaking this out.
18553
18554 * xterm.c: Make symbols static if they're not exported.
18555 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18556 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18557 (x_destroy_window, x_delete_display):
18558 Now static.
18559 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18560 (x_mouse_leave): Remove; unused.
18561 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18562 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18563 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18564 Remove decls.
18565 (x_mouse_leave): Declare only if WINDOWSNT.
18566 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18567 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18568 USE_X_TOOLKIT.
18569
18570 * ftxfont.c: Make symbols static if they're not exported.
18571 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18572 HAVE_FREETYPE.
18573 * font.h (ftxfont_driver): Likewise.
18574
18575 * xfns.c: Make symbols static if they're not exported.
18576 (x_last_font_name, x_display_info_for_name):
18577 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18578 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18579 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18580 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18581 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18582 (last_show_tip_args): Now static.
18583 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18584 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18585 (x_screen_planes): Remove; unused.
18586 * dispextern.h (x_screen_planes): Remove decl.
18587
18588 * dispnew.c: Make symbols static if they're not exported.
18589 * dispextern.h (redraw_garbaged_frames, scrolling):
18590 (increment_row_positions): Remove.
18591 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18592 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18593 Now static.
18594 (redraw_garbaged_frames): Remove; unused.
18595
18596 * xfaces.c: Make symbols static if they're not exported.
18597 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18598 Remove decls.
18599 * xterm.h (defined_color): Remove decls.
18600 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18601 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18602 (menu_face_changed_default, defined_color, free_realized_face):
18603 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18604 (ascii_face_of_lisp_face): Remove; unused.
18605
18606 * xdisp.c: Make symbols static if they're not exported.
18607 * dispextern.h (scratch_glyph_row, window_box_edges):
18608 (glyph_to_pixel_coords, set_cursor_from_row):
18609 (get_next_display_element, set_iterator_to_next):
18610 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18611 (show_mouse_face): Remove decls
18612 * frame.h (message_buf_print): Likewise.
18613 * lisp.h (pop_message, set_message, check_point_in_composition):
18614 Likewise.
18615 * xterm.h (set_vertical_scroll_bar): Likewise.
18616 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18617 (message_buf_print, scratch_glyph_row, displayed_buffer):
18618 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18619 (get_next_display_element, show_mouse_face, window_box_edges):
18620 (frame_to_window_pixel_xy, check_point_in_composition):
18621 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18622 (glyph_to_pixel_coords): Remove; unused.
18623
18624 * dired.c (file_name_completion): Now static.
18625
18626 * dbusbind.c (xd_in_read_queued_messages): Now static.
18627
18628 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18629 * data.c (circular_list_error): Remove.
18630
18631 * commands.h (last_point_position, last_point_position_buffer):
18632 (last_point_position_window): Remove decls.
18633 * keyboard.c: Make these variables static.
18634
18635 * coding.h (coding, code_convert_region, encode_coding_gap):
18636 Remove decls.
18637 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18638 (iso_code_class, detect_coding, code_convert_region): Now static.
18639 (encode_coding_gap): Remove; unused.
18640
18641 * chartab.c (chartab_chars, chartab_bits): Now static.
18642
18643 * charset.h (charset_iso_8859_1): Remove decl.
18644 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18645 Now static.
18646
18647 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18648 * ccl.c (Vccl_program_table): Now static.
18649 (check_ccl_update): Remove; unused.
18650
18651 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18652 * category.h: ... from here.
18653 * category.c (check_category_table, set_category_set): Now static.
18654
18655 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18656 * lisp.h: Remove these decls.
18657
18658 * buffer.c (buffer_count): Remove unused var.
18659
18660 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18661 so that it's not optimized away.
18662 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18663 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18664 exported only to the debugger.
18665
18666 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18667 * atimer.h (run_all_atimers): Remove; not exported.
18668
18669 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18670 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18671 was inaccessible from Lisp.
18672 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18673 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18674
18675 alloc.c: Import and export fewer symbols, and remove unused items.
18676 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18677 is defined.
18678 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18679 it's not optimized away by whole-program optimization.
18680 (message_enable_multibyte, free_misc): Remove.
18681 (catchlist, handlerlist, mark_backtrace):
18682 Declare only if BYTE_MARK_STACK.
18683 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18684 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18685 (message_enable_multibyte): Remove decl.
18686 (free_misc, interval_free_list, float_block, float_block_index):
18687 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18688 (cons_free_list, last_marked_index):
18689 Now static.
18690 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18691 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18692 (mark_backtrace): Define only if BYTE_MARK_STACK.
18693 * xdisp.c (message_enable_multibyte): Now static.
18694
18695 Declare Lisp_Object Q* variables to be 'static' if not exported.
18696 This makes it easier for human readers (and static analyzers)
18697 to see whether these variables are used from other modules.
18698 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18699 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18700 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18701 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18702 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18703 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18704 * xmenu.c, xselect.c:
18705 Declare Q* vars static if they are not used in other modules.
18706 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18707 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18708 Remove decls of unexported vars.
18709 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18710
18711 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18712
18713 Make Emacs functions such as Fatom 'static' by default.
18714 This makes it easier for human readers (and static analyzers)
18715 to see whether these functions can be called from other modules.
18716 DEFUN now defines a static function. To make the function external
18717 so that it can be used in other C modules, use the new macro DEFUE.
18718 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18719 (Finit_image_library):
18720 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18721 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18722 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18723 Remove decls, since these functions are now static.
18724 (Funintern, Fget_internal_run_time): New decls, since these functions
18725 were already external.
18726
18727 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18728 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18729 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18730 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18731 * keyboard.c, keymap.c, lread.c:
18732 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18733 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18734 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18735 Mark functions with DEFUE instead of DEFUN,
18736 if they are used in other modules.
18737 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18738 decls for now-static functions.
18739 * buffer.h (Fdelete_overlay): Remove decl.
18740 * callproc.c (Fgetenv_internal): Mark as internal.
18741 * composite.c (Fremove_list_of_text_properties): Remove decl.
18742 (Fcomposition_get_gstring): New forward static decl.
18743 * composite.h (Fcomposite_get_gstring): Remove decl.
18744 * dired.c (Ffile_attributes): New forward static decl.
18745 * doc.c (Fdocumntation_property): New forward static decl.
18746 * eval.c (Ffetch_bytecode): New forward static decl.
18747 (Funintern): Remove extern decl; now in .h file where it belongs.
18748 * fileio.c (Fmake_symbolic_link): New forward static decl.
18749 * image.c (Finit_image_library): New forward static decl.
18750 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18751 * intervals.h (Fprevious_property_change):
18752 (Fremove_list_of_text_properties): Remove decls.
18753 * keyboard.c (Fthis_command_keys): Remove decl.
18754 (Fcommand_execute): New forward static decl.
18755 * keymap.c (Flookup_key): New forward static decl.
18756 (Fcopy_keymap): Now static.
18757 * keymap.h (Flookup_key): Remove decl.
18758 * process.c (Fget_process): New forward static decl.
18759 (Fprocess_datagram_address): Mark as internal.
18760 * syntax.c (Fsyntax_table_p): New forward static decl.
18761 (skip_chars): Remove duplicate decl.
18762 * textprop.c (Fprevious_property_change): New forward static decl.
18763 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18764 Now internal.
18765 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18766 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18767
18768 * editfns.c (Fformat): Remove unreachable code.
18769
18770 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18771
18772 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18773 change. (Bug#8496)
18774
18775 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18776
18777 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18778 when at ZV. (Bug#8487)
18779
18780 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18781
18782 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18783 (Bug#8437)
18784 * keyboard.c (parse_tool_bar_item): Likewise.
18785 * sound.c (sound_cleanup, alsa_close): Likewise.
18786 * termcap.c (tgetent): Likewise.
18787 * xfns.c (x_default_font_parameter): Likewise.
18788 * xsettings.c (read_and_apply_settings): Likewise.
18789
18790 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18791 (overrun_check_free): Protoize.
18792
18793 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18794
18795 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18796 since callers should never pass a negative size.
18797 Change the signature to match that of plain 'read' and 'write'; see
18798 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18799 * lisp.h: Update prototypes of emacs_write and emacs_read.
18800
18801 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18802
18803 * xdisp.c (redisplay_window): Don't try to determine the character
18804 position of the scroll margin if the window start point w->startp
18805 is outside the buffer's accessible region. (Bug#8468)
18806
18807 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18808
18809 Fix write-region and its subroutines for buffers > 2GB.
18810 * fileio.c (a_write, e_write): Modify declaration of arguments and
18811 local variables to support buffers larger than 2GB.
18812 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18813
18814 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18815 argument, local variables, and return value.
18816
18817 * lisp.h: Update prototypes of emacs_write and emacs_read.
18818
18819 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18820
18821 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18822
18823 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18824
18825 Fix more problems found by GCC 4.6.0's static checks.
18826
18827 * xdisp.c (vmessage): Use a better test for character truncation.
18828
18829 * charset.c (load_charset_map): <, not <=, for optimization,
18830 and to avoid potential problems with integer overflow.
18831 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18832 * casetab.c (set_identity, shuffle): Likewise.
18833 * editfns.c (Fformat): Likewise.
18834 * syntax.c (skip_chars): Likewise.
18835
18836 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18837 This also lets GCC 4.6.0 generate slightly better loop code.
18838
18839 * callint.c (Fcall_interactively): <, not <=, for optimization.
18840 (Fcall_interactively): Count the number of arguments produced,
18841 not the number of arguments given. This is simpler and lets GCC
18842 4.6.0 generate slightly better code.
18843
18844 * ftfont.c: Distingish more carefully between FcChar8 and char.
18845 The previous code passed unsigned char * to a functions like
18846 strlen and xstrcasecmp that expect char *, which does not
18847 conform to the C standard.
18848 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18849 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18850 char * when the C standard requires it.
18851
18852 * keyboard.c (read_char): Remove unused var.
18853
18854 * eval.c: Port to Windows vsnprintf (Bug#8435).
18855 Include <limits.h>.
18856 (SIZE_MAX): Define if the headers do not.
18857 (verror): Do not give up if vsnprintf returns a negative count.
18858 Instead, grow the buffer. This ports to Windows vsnprintf, which
18859 does not conform to C99. Problem reported by Eli Zaretskii.
18860 Also, simplify the allocation scheme, by avoiding the need for
18861 calling realloc, and removing the ALLOCATED variable.
18862
18863 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18864
18865 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18866 But keep the doprint source code for now, as we might revamp it
18867 and use it again (Bug#8435).
18868 * lisp.h (doprnt): Remove.
18869 * Makefile.in (base_obj): Remove doprnt.o.
18870 * deps.mk (doprnt.o): Remove.
18871
18872 error: Print 32- and 64-bit integers portably (Bug#8435).
18873 Without this change, on typical 64-bit hosts error ("...%d...", N)
18874 was used to print both 32- and 64-bit integers N, which relied on
18875 undefined behavior.
18876 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
18877 * lisp.h (error, verror): Mark as printf-like functions.
18878 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18879 Report overflow in size calculations when allocating printf buffer.
18880 Do not truncate output string at its first null byte.
18881 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18882 Truncate the output at a character boundary, since vsnprintf does not
18883 do that.
18884 * charset.c (check_iso_charset_parameter): Convert internal
18885 character to string before calling 'error', since %c now has the
18886 printf meaning.
18887 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18888 overflow when computing char to be passed to 'error'. Do not
18889 pass Lisp_Object to 'error'; pass the integer instead.
18890 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18891 formatted with plain %d.
18892
18893 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18894
18895 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18896
18897 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18898
18899 * xterm.c (x_catch_errors): Remove duplicate declaration.
18900
18901 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18902
18903 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18904
18905 2011-04-10 Jim Meyering <meyering@redhat.com>
18906
18907 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18908 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18909 return ssize_t not "int", and use size_t as the buffer length.
18910 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18911 * gnutls.h: Update declarations.
18912 * process.c (read_process_output): Use ssize_t, to match.
18913 (send_process): Likewise.
18914
18915 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18916
18917 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18918
18919 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18920
18921 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18922 Use unsigned char, to match FcChar8 type definition.
18923
18924 * xterm.c (handle_one_xevent):
18925 * xmenu.c (create_and_show_popup_menu):
18926 * xselect.c (x_decline_selection_request)
18927 (x_reply_selection_request): Avoid type-punned deref of X events.
18928
18929 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18930
18931 Fix some uses of `int' instead of EMACS_INT.
18932 * search.c (string_match_1, fast_string_match)
18933 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18934 (scan_buffer, find_next_newline_no_quit)
18935 (find_before_next_newline, search_command, Freplace_match)
18936 (Fmatch_data): Make some `int' variables be EMACS_INT.
18937
18938 * xdisp.c (display_count_lines): 3rd argument and return value now
18939 EMACS_INT. All callers changed.
18940 (pint2hrstr): Last argument is now EMACS_INT.
18941
18942 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18943 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18944 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18945 (decode_coding_utf_16, decode_coding_emacs_mule)
18946 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18947 (decode_coding_ccl, decode_coding_charset)
18948 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18949 (decode_coding_iso_2022, decode_coding_emacs_mule)
18950 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18951 <char_offset, last_offset>: Declare EMACS_INT.
18952 (encode_coding_utf_8, encode_coding_utf_16)
18953 (encode_coding_emacs_mule, encode_invocation_designation)
18954 (encode_designation_at_bol, encode_coding_iso_2022)
18955 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18956 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18957 Declare EMACS_INT.
18958 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18959 (encode_invocation_designation): Last argument P_NCHARS is now
18960 EMACS_INT.
18961 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18962 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18963
18964 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18965 All users changed.
18966
18967 * ccl.c (Fccl_execute_on_string): Declare some variables
18968 EMACS_INT.
18969
18970 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18971
18972 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18973
18974 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18975
18976 * process.c (Fformat_network_address): Doc fix.
18977
18978 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18979
18980 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18981
18982 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18983
18984 * keyboard.c (read_char): Call Lisp function help-form-show,
18985 instead of using internal_with_output_to_temp_buffer.
18986 (Qhelp_form_show): New var.
18987 (syms_of_keyboard): Use DEFSYM macro.
18988
18989 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18990
18991 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18992
18993 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18994
18995 * process.c (Flist_processes): Remove to Lisp.
18996 (list_processes_1): Delete.
18997
18998 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18999
19000 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19001
19002 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19003
19004 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19005
19006 Fix more problems found by GCC 4.6.0's static checks.
19007
19008 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19009
19010 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19011
19012 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19013
19014 * xdisp.c (vmessage): Mark as a printf-like function.
19015
19016 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19017
19018 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19019
19020 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19021 printf-like functions.
19022 (tiff_load): Add casts to remove these marks before passing them
19023 to system-supplied API.
19024
19025 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19026
19027 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19028 This avoids several warnings with gcc -Wstrict-overflow.
19029 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19030 directly, rather than having caller test rule sign. This avoids
19031 some unnecessary tests.
19032 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19033 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19034 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19035
19036 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19037 (xfont_open): Avoid unnecessary tests.
19038
19039 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19040
19041 * composite.h, composite.c (composition_gstring_put_cache):
19042 Use EMACS_INT, not int, for length.
19043
19044 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19045 breaking out part of COMPOSITION_DECODE_RULE.
19046 (COMPOSITION_DECODE_RULE): Use it.
19047 * composite.c (get_composition_id): Remove unused local vars,
19048 by using the new macro.
19049
19050 * textprop.c (set_text_properties_1): Change while to do-while,
19051 since the condition is always true at first.
19052
19053 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19054 (interval_deletion_adjustment): Return unsigned value.
19055 All uses changed.
19056
19057 * process.c (list_processes_1, create_pty, read_process_output):
19058 (exec_sentinel): Remove vars that were set but not used.
19059 (create_pty): Remove unnecessary "volatile"s.
19060 (Fnetwork_interface_info): Avoid possibility of int overflow.
19061 (read_process_output): Do adaptive read buffering even if carryover.
19062 (read_process_output): Simplify nbytes computation if buffered.
19063
19064 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19065
19066 * syntax.c (scan_words): Remove var that was set but not used.
19067 (update_syntax_table): Use unsigned instead of int.
19068
19069 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19070 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19071 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19072
19073 * print.c (print_error_message): Avoid int overflow.
19074
19075 * font.c (font_list_entities): Redo for clarity,
19076 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19077
19078 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19079 (font_score): Avoid potential overflow in diff calculation.
19080
19081 * fns.c (substring_both): Remove var that is set but not used.
19082 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19083
19084 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19085
19086 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19087 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19088 can always succeed if overflow has undefined behavior.
19089
19090 * search.c (boyer_moore, wordify): Remove vars set but not used.
19091 (wordify): Omit three unnecessary tests.
19092
19093 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19094 All callers changed. This avoids the need for an unused var.
19095
19096 * casefiddle.c (casify_region): Remove var that is set but not used.
19097
19098 * dired.c (file_name_completion): Remove var that is set but not used.
19099
19100 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19101
19102 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19103 (Finsert_file_contents): Remove unnecessary code checking fd.
19104
19105 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19106 Check for integer overflow on size calculations.
19107
19108 * buffer.c (Fprevious_overlay_change): Remove var that is set
19109 but not used.
19110
19111 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19112 Remove vars that are set but not used.
19113 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19114 (timer_check_2): Mark vars as initialized.
19115
19116 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19117
19118 * image.c (lookup_image): Remove var that is set but not used.
19119 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19120
19121 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19122 that are set but not used.
19123
19124 * xfns.c (make_invisible_cursor): Don't return garbage
19125 if XCreateBitmapFromData fails (Bug#8410).
19126
19127 * xselect.c (x_get_local_selection, x_handle_property_notify):
19128 Remove vars that are set but not used.
19129
19130 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19131 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19132
19133 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19134 Remove var that is set but not used.
19135 (scroll_bar_windows_size): Now size_t, not int.
19136 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19137 Check for overflow.
19138
19139 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19140 (map_tty_color) [!defined MSDOS]: Likewise.
19141
19142 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19143
19144 * coding.c: Remove vars that are set but not used.
19145 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19146 All callers changed.
19147 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19148 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19149 (decode_coding_charset): Remove vars that are set but not used.
19150
19151 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19152 that is set but not used.
19153
19154 * print.c (print_object): Remove var that is set but not used.
19155
19156 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19157 The gnulib version avoids calling malloc in the usual case,
19158 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19159 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19160 * filelock.c (current_lock_owner): Likewise.
19161 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19162 * sysdep.c: Include allocator.h, careadlinkat.h.
19163 (emacs_no_realloc_allocator): New static constant.
19164 (emacs_readlink): New function.
19165 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19166 ../lib/careadlinkat.h.
19167
19168 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19169
19170 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19171 first non-nil return value).
19172
19173 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19174
19175 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19176 if not defined (Bug#8403).
19177
19178 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19179
19180 * xdisp.c (display_count_lines): Remove parameter `start',
19181 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19182 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19183 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19184 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19185 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19186 and thereabouts. All callers changed.
19187 (get_per_char_metric): Remove parameter `f', unused since
19188 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19189
19190 2011-04-02 Jim Meyering <meyering@redhat.com>
19191
19192 do not dereference NULL upon failed strdup
19193 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19194 (ns_get_family): Likewise.
19195
19196 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19197
19198 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19199
19200 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19201
19202 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19203 later (Bug#8403).
19204
19205 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19206
19207 Add lexical binding.
19208
19209 * window.c (Ftemp_output_buffer_show): New fun.
19210 (Fsave_window_excursion):
19211 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19212
19213 * lread.c (lisp_file_lexically_bound_p): New function.
19214 (Fload): Bind Qlexical_binding.
19215 (readevalloop): Remove `evalfun' arg.
19216 Bind Qinternal_interpreter_environment.
19217 (Feval_buffer): Bind Qlexical_binding.
19218 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19219 Mark as dynamic.
19220 (syms_of_lread): Declare `lexical-binding'.
19221
19222 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19223
19224 * keyboard.c (eval_dyn): New fun.
19225 (menu_item_eval_property): Use it.
19226
19227 * image.c (parse_image_spec): Use Ffunctionp.
19228
19229 * fns.c (concat, mapcar1): Accept byte-code-functions.
19230
19231 * eval.c (Fsetq): Handle lexical vars.
19232 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19233 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19234 (FletX, Flet): Obey lexical binding.
19235 (Fcommandp): Handle closures.
19236 (Feval): New `lexical' arg.
19237 (eval_sub): New function extracted from Feval. Use it almost
19238 everywhere where Feval was used. Look up vars in lexical env.
19239 Handle closures.
19240 (Ffunctionp): Move from subr.el.
19241 (Ffuncall): Handle closures.
19242 (apply_lambda): Remove `eval_flags'.
19243 (funcall_lambda): Handle closures and new byte-code-functions.
19244 (Fspecial_variable_p): New function.
19245 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19246 but without exporting it to Lisp.
19247
19248 * doc.c (Fdocumentation, store_function_docstring):
19249 * data.c (Finteractive_form): Handle closures.
19250
19251 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19252 interactive spec.
19253
19254 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19255 New byte-codes.
19256 (exec_byte_code): New function extracted from Fbyte_code to handle new
19257 calling convention for byte-code-functions. Add new byte-codes.
19258
19259 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19260
19261 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19262
19263 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19264
19265 * xdisp.c (redisplay_internal): Fix prototype.
19266
19267 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19268
19269 * xdisp.c (SCROLL_LIMIT): New macro.
19270 (try_scrolling): Use it when setting scroll_limit.
19271 Limit scrolling to 100 screen lines.
19272 (redisplay_window): Even when falling back on "recentering",
19273 position point in the window according to scroll-conservatively,
19274 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19275
19276 (try_scrolling): When point is above the window, allow searching
19277 as far as scroll_max, or one screenful, to compute vertical
19278 distance from PT to the scroll margin position. This prevents
19279 try_scrolling from unnecessarily failing when
19280 scroll-conservatively is set to a value slightly larger than the
19281 window height. Clean up the case of PT below the margin at bottom
19282 of window: scroll_max can no longer be INT_MAX. When aggressive
19283 scrolling is in use, don't let point enter the opposite scroll
19284 margin as result of the scroll.
19285 (syms_of_xdisp) <scroll-conservatively>: Document the
19286 threshold of 100 lines for never-recentering scrolling.
19287
19288 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19289
19290 * dispextern.h (move_it_by_lines):
19291 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19292 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19293 (message_log_check_duplicate): Remove parameters `prev_bol' and
19294 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19295 (redisplay_internal): Remove parameter `preserve_echo_area',
19296 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19297
19298 * indent.c (Fvertical_motion):
19299 * window.c (window_scroll_pixel_based, Frecenter):
19300 Don't pass `need_y_p' to `move_it_by_lines'.
19301
19302 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19303
19304 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19305 steal a few bits to be more compact.
19306 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19307 Remove unneeded casts.
19308
19309 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19310
19311 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19312
19313 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19314 binding" message (bug#7967).
19315
19316 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19317
19318 Fix more problems found by GCC 4.6.0's static checks.
19319
19320 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19321 Remove unused local var.
19322
19323 * editfns.c (Fmessage_box): Remove unused local var.
19324
19325 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19326 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19327 Omit unused local vars.
19328 * window.c (shrink_windows): Omit unused local var.
19329 * menu.c (digest_single_submenu): Omit unused local var.
19330 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19331 Omit unused local var.
19332
19333 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19334 Don't assume string length fits in int.
19335 (keyremap_step, read_key_sequence): Use size_t for sizes.
19336 (read_key_sequence): Don't check last_real_key_start redundantly.
19337
19338 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19339 instead of alloca (Bug#8344).
19340
19341 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19342 (Fbacktrace_frame): Don't assume nframes fits in int.
19343
19344 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19345
19346 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19347 concerns.
19348
19349 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19350
19351 * cm.c (calccost): Turn while-do into do-while, for clarity.
19352
19353 * keyboard.c (syms_of_keyboard): Use the same style as later
19354 in this function when indexing through an array. This also
19355 works around GCC bug 48267.
19356
19357 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19358
19359 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19360
19361 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19362 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19363
19364 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19365 This avoids undefined behavior on integer overflow, and is a bit
19366 more convenient anyway since it is compared to a size_t variable.
19367
19368 Variadic C functions now count arguments with size_t, not int.
19369 This avoids an unnecessary limitation on 64-bit machines, which
19370 caused (substring ...) to crash on large vectors (Bug#8344).
19371 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19372 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19373 All variadic functions and their callers changed accordingly.
19374 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19375 * data.c (arith_driver, float_arith_driver): Likewise.
19376 * editfns.c (general_insert_function): Likewise.
19377 * eval.c (struct backtrace.nargs, interactive_p)
19378 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19379 (funcall_lambda, mark_backtrace): Likewise.
19380 * fns.c (concat): Likewise.
19381 * frame.c (x_set_frame_parameters): Likewise.
19382 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19383 0 if not found, not -1. All callers changed.
19384
19385 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19386 (stack_copy_size): Now size_t, not int.
19387 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19388
19389 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19390
19391 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19392 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19393 All callers changed.
19394
19395 * lisp.h (multibyte_char_to_unibyte):
19396 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19397 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19398 * character.h (CHAR_TO_BYTE8):
19399 * cmds.c (internal_self_insert):
19400 * editfns.c (general_insert_function):
19401 * keymap.c (push_key_description):
19402 * search.c (Freplace_match):
19403 * xdisp.c (message_dolog, set_message_1): All callers changed.
19404
19405 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19406
19407 * keyboard.c (safe_run_hook_funcall): New function.
19408 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19409 don't set the hook to nil, but remove the offending function instead.
19410 (Qcommand_hook_internal): Remove, unused.
19411 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19412 Vcommand_hook_internal.
19413
19414 * eval.c (enum run_hooks_condition): Remove.
19415 (funcall_nil, funcall_not): New functions.
19416 (run_hook_with_args): Call each function through a `funcall' argument.
19417 Remove `cond' argument, now redundant.
19418 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19419 (Frun_hook_with_args_until_failure): Adjust accordingly.
19420 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19421
19422 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19423
19424 * dispextern.h (string_buffer_position): Remove declaration.
19425
19426 * print.c (strout): Remove parameter `multibyte', unused since
19427 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19428
19429 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19430 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19431 All callers changed.
19432
19433 * w32.c (_wsa_errlist): Use braces for struct initializers.
19434
19435 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19436 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19437 All callers changed.
19438 (string_buffer_position): Likewise. Also, make static (it's never
19439 used outside xdisp.c).
19440 (cursor_row_p): Remove parameter `w', unused since
19441 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19442 (decode_mode_spec): Remove parameter `precision', introduced during
19443 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19444 All callers changed.
19445
19446 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19447
19448 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19449
19450 2011-03-27 Anders Lindgren <andlind@gmail.com>
19451
19452 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19453 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19454 (ns_update_auto_hide_menu_bar): New functions.
19455 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19456 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19457 ns_constrain_all_frames.
19458 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19459 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19460
19461 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19462
19463 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19464
19465 2011-03-27 Glenn Morris <rgm@gnu.org>
19466
19467 * syssignal.h: Replace RETSIGTYPE with void.
19468 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19469 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19470 Replace SIGTYPE with void everywhere.
19471 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19472 * s/template.h (SIGTYPE): Remove commented out definition.
19473
19474 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19475
19476 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19477 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19478
19479 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19480
19481 * w32.c (read_unc_volume): Use parameter `henum', instead of
19482 global variable `wget_enum_handle'.
19483
19484 * keymap.c (describe_vector): Remove parameters `indices' and
19485 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19486 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19487
19488 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19489
19490 * keyboard.c (timer_check): Remove parameter `do_it_now',
19491 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19492 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19493 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19494
19495 * keyboard.c (read_char):
19496 * w32menu.c (w32_menu_display_help):
19497 * xmenu.c (show_help_event, menu_help_callback):
19498 Adjust calls to `show_help_echo'.
19499
19500 * gtkutil.c (xg_maybe_add_timer):
19501 * keyboard.c (readable_events):
19502 * process.c (wait_reading_process_output):
19503 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19504
19505 * insdel.c (adjust_markers_gap_motion):
19506 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19507 (gap_left, gap_right): Don't call it.
19508
19509 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19510
19511 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19512 incurred during fontification.
19513
19514 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19515
19516 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19517 (DEFVAR_PER_BUFFER): Don't pass it.
19518
19519 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19520 (scrolling_window): Don't pass it.
19521
19522 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19523
19524 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19525
19526 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19527 and `suffix'.
19528 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19529 of variables specific to SELinux and computation of `encoded_absname'.
19530
19531 * image.c (XPutPixel): Remove unused variable `height'.
19532
19533 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19534
19535 * unexw32.c (get_section_info): Remove unused variable `section'.
19536
19537 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19538 (system_process_attributes): Remove unused variable `sess'.
19539 (sys_read): Remove unused variable `err'.
19540
19541 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19542 (w32_wnd_proc): Remove unused variable `isdead'.
19543 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19544 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19545 (x_create_tip_frame): Remove unused variable `tem'.
19546
19547 * w32inevt.c (w32_console_read_socket):
19548 Remove unused variable `no_events'.
19549
19550 * w32term.c (x_draw_composite_glyph_string_foreground):
19551 Remove unused variable `width'.
19552
19553 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19554
19555 * w32term.c (x_set_glyph_string_clipping):
19556 Don't pass uninitialized region to CombineRgn.
19557
19558 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19559
19560 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19561 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19562 (Fx_close_connection): Remove unused variable `i'.
19563
19564 * w32font.c (w32font_draw): Return number of glyphs.
19565 (w32font_open_internal): Remove unused variable `i'.
19566 (w32font_driver): Add missing initializer.
19567
19568 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19569 (fill_in_menu): Remove unused variable `items_added'.
19570
19571 * w32term.c (last_mouse_press_frame): Remove static global variable.
19572 (w32_clip_to_row): Remove unused variable `f'.
19573 (x_delete_terminal): Remove unused variable `i'.
19574
19575 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19576 (NOTHING): Remove unused static global variable.
19577 (uniscribe_check_otf): Remove unused variable `table'.
19578 (uniscribe_font_driver): Add missing initializers.
19579
19580 2011-03-23 Julien Danjou <julien@danjou.info>
19581
19582 * term.c (Fsuspend_tty, Fresume_tty):
19583 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19584 * window.c (temp_output_buffer_show):
19585 * insdel.c (signal_before_change):
19586 * frame.c (Fhandle_switch_frame):
19587 * fileio.c (Fdo_auto_save):
19588 * emacs.c (Fkill_emacs):
19589 * editfns.c (save_excursion_restore):
19590 * cmds.c (internal_self_insert):
19591 * callint.c (Fcall_interactively):
19592 * buffer.c (Fkill_all_local_variables):
19593 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19594 Use Frun_hooks.
19595 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19596 unconditionally since it does the check itself.
19597
19598 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19599
19600 Fix more problems found by GCC 4.5.2's static checks.
19601
19602 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19603 the first time through the loop, since we know p0 < p1 then.
19604 This also avoids a gcc -Wstrict-overflow warning.
19605
19606 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19607 leading to a memory leak, possible in functions like
19608 load_charset_map_from_file that can allocate an unbounded number
19609 of objects (Bug#8318).
19610
19611 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19612 that could (at least in theory) be that large.
19613
19614 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19615 This is less likely to overflow, and avoids undefined behavior if
19616 overflow does occur. All callers changed. Use strtoul to scan
19617 for the unsigned long integer.
19618 (pint2hrstr): Simplify and tune code slightly.
19619 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19620
19621 * scroll.c (do_scrolling): Work around GCC bug 48228.
19622 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19623
19624 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19625 This also avoids a warning with gcc -Wstrict-overflow.
19626 (validate_x_resource_name): Simplify count usage.
19627 This also avoids a warning with gcc -Wstrict-overflow.
19628
19629 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19630 fail (Bug#8306).
19631
19632 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19633
19634 * process.c (Fmake_network_process): Use socklen_t, not int,
19635 where POSIX says socklen_t is required in portable programs.
19636 This fixes a porting bug on hosts like 64-bit HP-UX, where
19637 socklen_t is wider than int (Bug#8277).
19638 (Fmake_network_process, server_accept_connection):
19639 (wait_reading_process_output, read_process_output):
19640 Likewise.
19641
19642 * process.c: Rename or move locals to avoid shadowing.
19643 (list_processes_1, Fmake_network_process):
19644 (read_process_output_error_handler, exec_sentinel_error_handler):
19645 Rename or move locals.
19646 (Fmake_network_process): Define label "retry_connect" only if needed.
19647 (Fnetwork_interface_info): Fix pointer signedness.
19648 (process_send_signal): Add cast to avoid pointer signedness problem.
19649 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19650 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19651
19652 Make tparam.h and terminfo.c consistent.
19653 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19654 Include tparam.h instead, since it declares them.
19655 * cm.h (PC): Remove extern decl; tparam.h now does this.
19656 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19657 * terminfo.c: Include tparam.h, to check interfaces.
19658 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19659 (tparam): Adjust signature to match interface in tparam.h;
19660 this removes some undefined behavior. Check that outstring and len
19661 are zero, which they always are with Emacs.
19662 * tparam.h (PC, BC, UP): New extern decls.
19663
19664 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19665 (xftfont_open): Rename locals to avoid shadowing.
19666
19667 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19668 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19669 (OTF_TAG_SYM): Omit macro if not needed.
19670 (ftfont_list): Remove unused local.
19671 (get_adstyle_property, ftfont_pattern_entity):
19672 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19673 Rename locals to avoid shadowing.
19674
19675 * xfont.c (xfont_list_family): Mark var as initialized.
19676
19677 * xml.c (make_dom): Now static.
19678
19679 * composite.c (composition_compute_stop_pos): Rename local to
19680 avoid shadowing.
19681 (composition_reseat_it): Remove unused locals.
19682 (find_automatic_composition, composition_adjust_point): Likewise.
19683 (composition_update_it): Mark var as initialized.
19684 (find_automatic_composition): Mark vars as initialized,
19685 with a FIXME (Bug#8290).
19686
19687 character.h: Rename locals to avoid shadowing.
19688 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19689 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19690 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19691 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19692 to avoid shadowing.
19693
19694 * textprop.c (property_change_between_p): Remove; unused.
19695
19696 * intervals.c (interval_start_pos): Now static.
19697
19698 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19699
19700 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19701 Rename locals to avoid shadowing.
19702
19703 * sound.c (wav_play, au_play, Fplay_sound_internal):
19704 Fix pointer signedness.
19705 (alsa_choose_format): Remove unused local var.
19706 (wav_play): Initialize a variable to 0, to prevent undefined
19707 behavior (Bug#8278).
19708
19709 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19710
19711 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19712
19713 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19714 clobbering (Bug#8298).
19715 * sysdep.c (sys_subshell): Likewise.
19716 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19717
19718 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19719 This should get cleaned up, so that child_setup has the
19720 same signature on all platforms.
19721
19722 * callproc.c (call_process_cleanup): Now static.
19723 (relocate_fd): Rename locals to avoid shadowing.
19724
19725 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19726
19727 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19728 not to be necessary, and produces flickering.
19729
19730 2011-03-20 Glenn Morris <rgm@gnu.org>
19731
19732 * config.in: Remove file.
19733
19734 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19735
19736 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19737 are now in src/globals.h.
19738 (syms_of_minibuf): Remove spurious & from previous change.
19739
19740 2011-03-20 Leo Liu <sdl.web@gmail.com>
19741
19742 * minibuf.c (completing-read-function): New variable.
19743 (completing-read-default): Rename from completing-read.
19744 (completing-read): Call completing-read-function.
19745
19746 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19747
19748 * xfaces.c (Fx_load_color_file):
19749 Read color file from absolute filename (bug#8250).
19750
19751 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19752
19753 * makefile.w32-in: Update dependencies.
19754
19755 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19756
19757 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19758
19759 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19760
19761 Fix more problems found by GCC 4.5.2's static checks.
19762
19763 * process.c (make_serial_process_unwind, send_process_trap):
19764 (sigchld_handler): Now static.
19765
19766 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19767 That way, the code declares only the vars that it needs.
19768 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19769 * s/cygwin.h (PTY_ITERATION): Likewise.
19770 * s/darwin.h (PTY_ITERATION): Likewise.
19771 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19772
19773 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19774 * process.c (allocate_pty): Don't declare stb unless it's needed.
19775
19776 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19777 (CONSTANTLIM): Remove; unused.
19778 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19779 Define only if needed.
19780
19781 * unexelf.c (unexec): Name an expression,
19782 to avoid gcc -Wbad-function-cast warning.
19783 Use a different way to cause a compilation error if anyone uses
19784 n rather than nn, a way that does not involve shadowing.
19785 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19786
19787 * deps.mk (unexalpha.o): Remove; unused.
19788
19789 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19790 * unexec.h: New file.
19791 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19792 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19793 Depend on unexec.h.
19794 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19795 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19796 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19797 Change as necessary to match prototype in unexec.h.
19798
19799 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19800 shadowing.
19801 (back_comment, skip_chars): Mark vars as initialized.
19802
19803 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19804 Rename locals to avoid shadowing.
19805
19806 * lread.c (read1): Rewrite so as not to use empty "else".
19807 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19808
19809 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19810
19811 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19812 warning when compiling print.c.
19813
19814 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19815 instead of using an uninitialized var.
19816 (font_sort_entities): Mark var as initialized.
19817
19818 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19819
19820 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19821 pointers to constants.
19822 (font_parse_fcname): Remove unused vars.
19823 (font_delete_unmatched): Now static.
19824 (font_get_spec): Remove; unused.
19825 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19826 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19827 Rename or move locals to avoid shadowing.
19828
19829 * fns.c (require_nesting_list, require_unwind): Now static.
19830 (Ffillarray): Rename locals to avoid shadowing.
19831
19832 * floatfns.c (domain_error2): Define only if needed.
19833 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19834
19835 * alloc.c (mark_backtrace): Move decl from here ...
19836 * lisp.h: ... to here, so that it can be checked.
19837
19838 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19839 (Fdefvar): Rewrite so as not to use empty "else".
19840 (lisp_indirect_variable): Name an expression,
19841 to avoid gcc -Wbad-function-cast warning.
19842 (Fdefvar): Rename locals to avoid shadowing.
19843
19844 * callint.c (quotify_arg, quotify_args): Now static.
19845 (Fcall_interactively): Rename locals to avoid shadowing.
19846 Use const pointer when appropriate.
19847
19848 * lisp.h (get_system_name, get_operating_system_release):
19849 Move decls here, to check interfaces.
19850 * process.c (get_operating_system_release): Move decl to lisp.h.
19851 * xrdb.c (get_system_name): Likewise.
19852 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19853 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19854 some of which prompt warnings from gcc -Wbad-function-cast.
19855 (Fformat_time_string, Fencode_time, Finsert_char):
19856 (Ftranslate_region_internal, Fformat):
19857 Rename or remove local vars to avoid shadowing.
19858 (Ftranslate_region_internal): Mark var as initialized.
19859
19860 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19861 avoid shadowing.
19862
19863 * lisp.h (eassert): Check that the argument compiles, even if
19864 ENABLE_CHECKING is not defined.
19865
19866 * data.c (Findirect_variable): Name an expression, to avoid
19867 gcc -Wbad-function-cast warning.
19868 (default_value, arithcompare, arith_driver, arith_error): Now static.
19869 (store_symval_forwarding): Rename local to avoid shadowing.
19870 (Fmake_variable_buffer_local, Fmake_local_variable):
19871 Mark variables as initialized.
19872 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
19873
19874 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
19875 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19876 Rename locals to avoid shadowing.
19877 (mark_stack): Move local variables into the #ifdef region where
19878 they're used.
19879 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19880 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19881 needed otherwise.
19882 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19883 (GC_STRING_CHARS): Remove; not used.
19884 (Fmemory_limit): Cast sbrk's returned value to char *.
19885
19886 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19887 avoids undefined behavior in theory.
19888
19889 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19890
19891 Use functions, not macros, for up- and down-casing (Bug#8254).
19892 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19893 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19894 to use the following functions instead of these macros.
19895 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19896 EMACS_INT, since callers assume the returned value fits in int.
19897 (upcase1): Likewise, for UPCASE_TABLE.
19898 (uppercasep, lowercasep, upcase): New static inline functions.
19899 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
19900 the race-condition problem in the old DOWNCASE.
19901
19902 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19903 Rename locals to avoid shadowing.
19904 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
19905 (regex_compile, re_search_2, re_match_2_internal):
19906 Remove unused local vars.
19907 (FREE_VAR): Rewrite so as not to use empty "else",
19908 which gcc can warn about.
19909 (regex_compile, re_match_2_internal): Mark locals as initialized.
19910 (RETALLOC_IF): Define only if needed.
19911 (WORDCHAR_P): Likewise. This one is never needed, but is used
19912 only in a comment talking about a compiler bug, so put inside
19913 the #if 0 of that comment.
19914 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19915 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19916 Remove; unused.
19917
19918 * search.c (boyer_moore): Rename locals to avoid shadowing.
19919 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19920 (PREV_CHAR_BOUNDARY): Likewise.
19921
19922 * search.c (simple_search): Remove unused var.
19923
19924 * dired.c (compile_pattern): Move decl from here ...
19925 * lisp.h: ... to here, so that it can be checked.
19926 (struct re_registers): New forward decl.
19927
19928 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19929
19930 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19931 All uses changed.
19932 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19933 Rename locals to avoid shadowing.
19934 (Fvertical_motion): Mark locals as initialized.
19935
19936 * casefiddle.c (casify_object, casify_region): Now static.
19937 (casify_region): Mark local as initialized.
19938
19939 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19940
19941 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19942 New macros, so that the caller can use some names other than
19943 gcpro1, gcpro2, etc.
19944 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19945 of the new macros.
19946 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19947 argument, for consistency with GCPRO2_VAR, etc: it is now the
19948 prefix of the variable, not the variable itself. All uses
19949 changed.
19950 * dired.c (directory_files_internal, file_name_completion):
19951 Rename locals to avoid shadowing.
19952
19953 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19954 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19955 dired.c's scmp function, had undefined behavior.
19956 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19957 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19958 * buffer.h: ... to here, because these macros use current_buffer,
19959 and the new implementation with inline functions needs to have
19960 current_buffer in scope now, rather than later when the macros
19961 are used.
19962 (downcase, upcase1): New static inline functions.
19963 (DOWNCASE, UPCASE1): Reimplement using these functions.
19964 This avoids undefined behavior in expressions like
19965 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19966 from race conditions in accessing the global variables
19967 case_temp1 and case_temp2.
19968 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19969 * lisp.h (case_temp1, case_temp2): Remove their decls.
19970 * character.h (ASCII_CHAR_P): Move from here ...
19971 * lisp.h: ... to here, so that the inline functions mentioned
19972 above can use them.
19973
19974 * dired.c (directory_files_internal_unwind): Now static.
19975
19976 * fileio.c (file_name_as_directory, directory_file_name):
19977 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19978 Now static.
19979 (file_name_as_directory): Use const pointers when appropriate.
19980 (Fexpand_file_name): Likewise. In particular, newdir might
19981 point at constant storage, so make it a const pointer.
19982 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19983 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19984 signedness issues.
19985 (Fset_file_times, Finsert_file_contents, auto_save_error):
19986 Rename locals to avoid shadowing.
19987
19988 * minibuf.c (choose_minibuf_frame_1): Now static.
19989 (Ftry_completion, Fall_completions): Rename or remove locals
19990 to avoid shadowing.
19991
19992 * marker.c (bytepos_to_charpos): Remove; unused.
19993
19994 * lisp.h (verify_bytepos, count_markers): New decls,
19995 so that gcc does not warn that these functions aren't declared.
19996
19997 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19998 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19999 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20000 (copy_text): Remove unused local var.
20001
20002 * filelock.c (within_one_second): Now static.
20003 (lock_file_1): Rename local to avoid shadowing.
20004
20005 * buffer.c (fix_overlays_before): Mark locals as initialized.
20006 (fix_start_end_in_overlays): Likewise. This function should be
20007 simplified by using pointers-to-pointers, but that's a different
20008 matter.
20009 (switch_to_buffer_1): Now static.
20010 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20011 (report_overlay_modification): Rename locals to avoid shadowing.
20012
20013 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20014 Fix pointer signedness issue.
20015 (sys_subshell): Mark local as volatile if checking for lint,
20016 to suppress a gcc -Wclobbered warning that does not seem to be right.
20017 (MAXPATHLEN): Define only if needed.
20018
20019 * process.c (serial_open, serial_configure): Move decls from here ...
20020 * systty.h: ... to here, so that they can be checked.
20021
20022 * fns.c (get_random, seed_random): Move extern decls from here ...
20023 * lisp.h: ... to here, so that they can be checked.
20024
20025 * sysdep.c (reset_io): Now static.
20026 (wait_for_termination_signal): Remove; unused.
20027
20028 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20029 (copy_keymap_item, append_key, push_text_char_description):
20030 Now static.
20031 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20032 (DENSE_TABLE_SIZE): Remove; unused.
20033 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20034 (describe_map_tree):
20035 Rename locals to avoid shadowing.
20036
20037 * keyboard.c: Declare functions static if they are not used elsewhere.
20038 (echo_char, echo_dash, cmd_error, top_level_2):
20039 (poll_for_input, handle_async_input): Now static.
20040 (read_char, kbd_buffer_get_event, make_lispy_position):
20041 (make_lispy_event, make_lispy_movement, apply_modifiers):
20042 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20043 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20044 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20045 (read_key_sequence, read_char): Mark locals as initialized.
20046 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20047
20048 * keyboard.h (make_ctrl_char): New decl.
20049 (mark_kboards): Move decl here ...
20050 * alloc.c (mark_kboards): ... from here.
20051
20052 * lisp.h (force_auto_save_soon): New decl.
20053
20054 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20055 (DEFINE_DUMMY_FUNCTION): New macro.
20056 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20057 Use it.
20058 (main): Add casts to avoid warnings
20059 if GCC considers string literals to be constants.
20060
20061 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20062
20063 * dbusbind.c: Pointer signedness fixes.
20064 (xd_signature, xd_append_arg, xd_initialize):
20065 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20066 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20067 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20068 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20069
20070 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20071 if GCC considers string literals to be constants.
20072 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20073
20074 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20075
20076 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20077 (print_preprocess, print_object): New macro to fix last change.
20078
20079 * print.c (print_preprocess): Don't forget font objects.
20080
20081 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20082
20083 * emacs.c (USAGE3): Doc fixes.
20084
20085 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20086
20087 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20088 structure.
20089
20090 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20091
20092 * lisp.h (VWindow_system, Qfile_name_history):
20093 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20094 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20095 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20096
20097 * w32select.c: Don't #include "keyboard.h".
20098 (run_protected): Add extern declaration for waiting_for_input.
20099
20100 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20101 * w32console.c (detect_input_pending, read_input_pending)
20102 (encode_terminal_code):
20103 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20104 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20105 (w32_system_caret_y, Qfile_name_history):
20106 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20107 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20108 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20109 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20110 * w32proc.c (Qlocal, report_file_error):
20111 * w32term.c (Vwindow_system, updating_frame):
20112 * w32uniscribe.c (initialized, uniscribe_font_driver):
20113 Remove unneeded extern declarations.
20114
20115 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20116
20117 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20118
20119 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20120
20121 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20122 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20123 These macros can no longer be used for assignment.
20124
20125 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20126 Assign struct members directly, instead of using BUF_BEGV etc.
20127 (record_buffer_markers, fetch_buffer_markers): New functions for
20128 recording and fetching special buffer markers.
20129 (set_buffer_internal_1, set_buffer_temp): Use them.
20130
20131 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20132
20133 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20134
20135 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20136 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20137
20138 * xdisp.c (hscroll_window_tree):
20139 (reconsider_clip_changes): Use PT instead of BUF_PT.
20140
20141 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20142
20143 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20144 $(EMACS_ROOT)/lib/intprops.h.
20145
20146 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20147
20148 Fix more problems found by GCC 4.5.2's static checks.
20149
20150 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20151 to unsigned char * to avoid compiler diagnostic.
20152 (xg_free_frame_widgets): Make it clear that a local variable is
20153 needed only if USE_GTK_TOOLTIP.
20154 (gdk_window_get_screen): Make it clear that this macro is needed
20155 only if USE_GTK_TOOLTIP.
20156 (int_gtk_range_get_value): New function, which avoids a diagnostic
20157 from gcc -Wbad-function-cast.
20158 (xg_set_toolkit_scroll_bar_thumb): Use it.
20159 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20160 diagnostic from gcc -Wbad-function-cast.
20161 (get_utf8_string, xg_get_file_with_chooser):
20162 Rename locals to avoid shadowing.
20163 (create_dialog): Move locals to avoid shadowing.
20164
20165 * xgselect.c (xg_select): Remove unused var.
20166
20167 * image.c (four_corners_best): Mark locals as initialized.
20168 (gif_load): Initialize transparent_p to zero (Bug#8238).
20169 Mark another local as initialized.
20170 (my_png_error, my_error_exit): Mark with NO_RETURN.
20171
20172 * image.c (clear_image_cache): Now static.
20173 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20174 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20175 (x_edge_detection): Remove unnecessary cast that
20176 gcc -Wbad-function-cast diagnoses.
20177 (gif_load): Fix pointer signedness.
20178 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20179 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20180
20181 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20182
20183 Improve quality of tests for time stamp overflow.
20184 For example, without this patch (encode-time 0 0 0 1 1
20185 1152921504606846976) returns the obviously-bogus value (-948597
20186 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20187 reports time overflow. See
20188 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20189 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20190 * editfns.c: Include limits.h and intprops.h.
20191 (TIME_T_MIN, TIME_T_MAX): New macros.
20192 (time_overflow): Move earlier, to before first use.
20193 (hi_time, lo_time): New functions, for an accurate test for
20194 out-of-range times.
20195 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20196 (Fget_internal_run_time): Don't assume time_t fits in int.
20197 (make_time): Use list2 instead of Fcons twice.
20198 (Fdecode_time): More accurate test for out-of-range times.
20199 (check_tm_member): New function.
20200 (Fencode_time): Use it, to test for out-of-range times.
20201 (lisp_time_argument): Don't rely on undefined left-shift and
20202 right-shift behavior when checking for time stamp overflow.
20203
20204 * editfns.c (time_overflow): New function, refactoring common code.
20205 (Fformat_time_string, Fdecode_time, Fencode_time):
20206 (Fcurrent_time_string): Use it.
20207
20208 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20209 * dired.c (make_time): Move to ...
20210 * editfns.c (make_time): ... here.
20211 * systime.h: Note the move.
20212
20213 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20214
20215 * fringe.c (update_window_fringes): Remove unused variables.
20216
20217 * unexmacosx.c (copy_data_segment): Also copy __got section.
20218 (Bug#8223)
20219
20220 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20221
20222 * termcap.c [MSDOS]: Include "msdos.h".
20223 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20224 Constify `char *' arguments and their references according to
20225 prototypes in tparam.h.
20226
20227 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20228
20229 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20230 Adapt all references accordingly.
20231
20232 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20233
20234 2011-03-11 Tom Tromey <tromey@redhat.com>
20235
20236 * buffer.c (syms_of_buffer): Remove obsolete comment.
20237
20238 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20239
20240 * termhooks.h (encode_terminal_code): Declare prototype.
20241
20242 * msdos.c (encode_terminal_code): Don't declare prototype.
20243
20244 * term.c (encode_terminal_code): Now external again, used by
20245 w32console.c and msdos.c.
20246
20247 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20248 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20249
20250 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20251
20252 Fix some minor problems found by GCC 4.5.2's static checks.
20253
20254 * fringe.c (update_window_fringes): Mark locals as initialized
20255 (Bug#8227).
20256 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20257
20258 * alloc.c (mark_fringe_data): Move decl from here ...
20259 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20260 to check its interface.
20261 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20262
20263 * fontset.c (free_realized_fontset): Now static.
20264 (Fset_fontset_font): Rename local to avoid shadowing.
20265 (fontset_font): Mark local as initialized.
20266 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20267
20268 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20269
20270 * xselect.c (x_disown_buffer_selections): Remove; not used.
20271 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20272 (x_own_selection, Fx_disown_selection_internal): Rename locals
20273 to avoid shadowing.
20274 (x_handle_dnd_message): Remove local to avoid shadowing.
20275
20276 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20277 so that the caller can use some name other than gcpro1.
20278 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20279 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20280 (Fx_backspace_delete_keys_p):
20281 Use them to avoid shadowing, and rename vars to avoid shadowing.
20282 (x_decode_color, x_set_name, x_window): Now static.
20283 (Fx_create_frame): Add braces to silence GCC warning.
20284 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20285 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20286 Remove unused locals.
20287 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20288 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20289 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20290 macros.
20291
20292 * xterm.h (x_mouse_leave): New decl.
20293
20294 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20295 Remove unused functions.
20296 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20297 (x_calc_absolute_position): Now static.
20298 (XTread_socket): Don't define label "out" unless it's used.
20299 Don't declare local "event" unless it's used.
20300 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20301 unless they are used.
20302 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20303 (x_fatal_error_signal): Remove; not used.
20304 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20305 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20306 (x_error_catcher, x_connection_closed, x_error_handler):
20307 (x_error_quitter, xembed_send_message, x_iconify_frame):
20308 (my_log_handler): Rename locals to avoid shadowing.
20309 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20310 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20311
20312 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20313 Rename or move locals to avoid shadowing.
20314 (tty_defined_color, merge_face_heights): Now static.
20315 (free_realized_faces_for_fontset): Remove; not used.
20316 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20317 does not deduce is never used uninitialized.
20318 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20319 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20320
20321 * terminal.c (store_terminal_param): Now static.
20322
20323 * xmenu.c (menu_highlight_callback): Now static.
20324 (set_frame_menubar): Remove unused local.
20325 (xmenu_show): Rename parameter to avoid shadowing.
20326 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20327 since they might point to immutable storage.
20328 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20329 since it's unused otherwise.
20330
20331 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20332 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20333 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20334 avoids a gcc -Wuninitialized diagnostic.
20335 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20336 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20337 does not deduce are never used uninitialized.
20338
20339 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20340
20341 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20342 * window.c (window_loop, size_window):
20343 (run_window_configuration_change_hook, enlarge_window): Likewise.
20344
20345 * window.c (display_buffer): Now static.
20346 (size_window): Mark variables that gcc -Wuninitialized
20347 does not deduce are never used uninitialized.
20348 * window.h (check_all_windows): New decl, to forestall
20349 gcc -Wmissing-prototypes diagnostic.
20350 * dispextern.h (bidi_dump_cached_states): Likewise.
20351
20352 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20353 shadowing.
20354 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20355 Include <limits.h>.
20356 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20357 and to avoid gcc -Wuninitialized warning.
20358 (load_charset_map): Mark variables that gcc -Wuninitialized
20359 does not deduce are never used uninitialized.
20360 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20361
20362 * coding.c (coding_set_source, coding_set_destination):
20363 Use "else { /* comment */ }" rather than "else /* comment */;"
20364 for clarity, and to avoid gcc -Wempty-body warning.
20365 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20366 a block, when the outer 'i' will do.
20367 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20368 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20369 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20370 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20371 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20372 Rename locals to avoid shadowing.
20373 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20374 * coding.c (emacs_mule_char, encode_invocation_designation):
20375 Now static, since they're not used elsewhere.
20376 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20377 (decode_coding_object, encode_coding_object, detect_coding_system):
20378 (decode_coding_emacs_mule): Mark variables that gcc
20379 -Wuninitialized does not deduce are never used uninitialized.
20380 (detect_coding_iso_2022): Initialize a local variable that might
20381 be used uninitialized. Leave a FIXME because it's not clear that
20382 this initialization is needed. (Bug#8211)
20383 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20384 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20385 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20386 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20387 Remove unused macros.
20388
20389 * category.c (hash_get_category_set): Remove unused local var.
20390 (copy_category_table): Now static, since it's not used elsewhere.
20391 * character.c (string_count_byte8): Likewise.
20392
20393 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20394 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20395
20396 * chartab.c (copy_sub_char_table): Now static, since it's not used
20397 elsewhere.
20398 (sub_char_table_ref_and_range, char_table_ref_and_range):
20399 Rename locals to avoid shadowing.
20400 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20401
20402 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20403 (BIDI_BOB): Remove unused macro.
20404
20405 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20406 deduce are never used uninitialized.
20407 * term.c (encode_terminal_code): Likewise.
20408
20409 * term.c (encode_terminal_code): Now static. Remove unused local.
20410
20411 * tparam.h: New file.
20412 * term.c, tparam.h: Include it.
20413 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20414 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20415 Move these decls to tparam.h, and make them agree with what
20416 is actually in tparam.c. The previous trick of using incompatible
20417 decls in different modules does not conform to the C standard.
20418 All callers of tparam changed to use tparam's actual API.
20419 * tparam.c (tparam1, tparam, tgoto):
20420 Use const pointers where appropriate.
20421
20422 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20423 * cm.h (struct cm): Likewise.
20424 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20425 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20426 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20427 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20428 (turn_on_face, init_tty): Likewise.
20429 * termchar.h (struct tty_display_info): Likewise.
20430
20431 * term.c (term_mouse_position): Rename local to avoid shadowing.
20432
20433 * alloc.c (mark_ttys): Move decl from here ...
20434 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20435
20436 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20437
20438 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20439
20440 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20441
20442 * search.c (compile_pattern_1): Remove argument regp, unused since
20443 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20444 (compile_pattern): Don't pass it.
20445
20446 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20447
20448 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20449 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20450 for ! HAVE_GTK3.
20451 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20452
20453 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20454
20455 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20456 gdk_window_get_screen, gdk_window_get_geometry,
20457 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20458 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20459 (xg_get_pixbuf_from_pixmap): New function.
20460 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20461 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20462 Call xg_get_pixbuf_from_pixmap instead of
20463 gdk_pixbuf_get_from_drawable.
20464 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20465 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20466 (xg_check_special_colors): Use GtkStyleContext and its functions
20467 for HAVE_GTK3.
20468 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20469 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20470 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20471 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20472 Call gtk_widget_get_preferred_size.
20473 (xg_frame_resized): gdk_window_get_geometry only takes 5
20474 parameters.
20475 (xg_win_to_widget, xg_event_is_for_menubar):
20476 Call gdk_x11_window_lookup_for_display.
20477 (xg_set_widget_bg): New function.
20478 (delete_cb): New function.
20479 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20480 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20481 (xg_set_background_color): Call xg_set_widget_bg.
20482 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20483 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20484 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20485 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20486 if ! HAVE_GTK3.
20487 (update_frame_tool_bar): Call gtk_widget_hide.
20488 (xg_initialize): Use GDK_KEY_g.
20489
20490 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20491 if ! HAVE_GTK3
20492 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20493
20494 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20495 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20496 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20497
20498 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20499
20500 * w32xfns.c (select_palette): Check success of RealizePalette against
20501 GDI_ERROR, not zero.
20502
20503 See ChangeLog.11 for earlier changes.
20504
20505 ;; Local Variables:
20506 ;; coding: utf-8
20507 ;; End:
20508
20509 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20510
20511 This file is part of GNU Emacs.
20512
20513 GNU Emacs is free software: you can redistribute it and/or modify
20514 it under the terms of the GNU General Public License as published by
20515 the Free Software Foundation, either version 3 of the License, or
20516 (at your option) any later version.
20517
20518 GNU Emacs is distributed in the hope that it will be useful,
20519 but WITHOUT ANY WARRANTY; without even the implied warranty of
20520 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20521 GNU General Public License for more details.
20522
20523 You should have received a copy of the GNU General Public License
20524 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.