Fix putenv and unsetenv on MS-Windows.
[bpt/emacs.git] / src / ChangeLog
1 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (unsetenv): Return 0 if the input string is too long.
4
5 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
6
7 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
8 * alloc.c (xputenv): New function.
9 * dbusbind.c (Fdbus_init_bus):
10 * emacs.c (main):
11 * xterm.c (x_term_init):
12 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
13 * editfns.c (initial_tz): Move static var decl up.
14 (tzvalbuf_in_environ): New static var.
15 (init_editfns): Initialize these two static vars.
16 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
17 Save old TZ value on stack, if it's small.
18 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
19 instead, use xputenv+unsetenv to set and restore TZ.
20 (environbuf): Remove static var. All uses removed.
21 (Fset_time_zone_rule): Do not save TZ and environ;
22 no longer needed here.
23 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
24 Move to inside set_time_zone_rule; they don't need file scope any more.
25 (set_time_zone_rule): Maintain the TZ=value string separately.
26 (syms_of_editfns): Don't initialize initial_tz;
27 init_editfns now does it.
28 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
29 * lisp.h (xputenv): New decl.
30
31 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
32
33 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
34
35 2012-12-08 Eli Zaretskii <eliz@gnu.org>
36
37 * w32.c (unsetenv, sys_putenv): New functions.
38
39 2012-12-08 Chong Yidong <cyd@gnu.org>
40
41 * editfns.c (Finsert_char): Make the error message more
42 informative (Bug#12992).
43
44 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
45
46 Simplify get_lim_data.
47 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
48 Remove USG and vlimit methods; no longer used these days.
49 Add #error catchall just in case.
50
51 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
52 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
53 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
54 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
55 (deleted_pid_list, Fdelete_process, create_process)
56 (record_child_status_change, handle_child_signal, deliver_child_signal)
57 (init_process_emacs, syms_of_process):
58 Assume SIGCHLD is defined.
59 (parse_signal): Remove. All uses removed.
60 (abbr_to_signal): New static function.
61 (Fsignal_process): Use it to convert signal names to ints.
62 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
63 kill (getpgrp (), ...).
64 (emacs_sigaction_init): Assume SIGCHLD is defined.
65 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
66 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
67 * syssignal.h (EMACS_KILLPG): Remove.
68 All uses replaced by 'kill' with a negative pid.
69 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
70 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
71
72 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
73
74 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
75 This will cause a production Emacs to dump core instead of
76 infinite-looping.
77
78 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
79
80 * frame.c (make_frame): Do not set window's buffer to t.
81 * window.c (Fsplit_window_internal): Likewise. Previously it was
82 used to indicate that the window is being set up. Now we use
83 set_window_buffer for all new windows, so the condition in ...
84 (Fset_window_buffer): ... is always true and can be removed.
85
86 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Convenient macro to check whether the buffer is hidden.
89 * buffer.h (BUFFER_HIDDEN_P): New macro.
90 * frame.c (make_frame): Use it. Adjust comment.
91 * buffer.c (candidate_buffer): New function.
92 (Fother_buffer, other_buffer_safely): Use it.
93
94 2012-12-06 Eli Zaretskii <eliz@gnu.org>
95
96 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
97 if the child process is still running. Instead, exit the wait
98 loop and return zero. (Bug#13086)
99
100 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
101
102 * frame.h (x_char_width, x_char_height): Remove prototypes.
103 * w32term.h (x_char_width, x_char_height): Likewise.
104 * xfns.c (x_char_width, x_char_height): Remove.
105 * w32fns.c (x_char_width, x_char_height): Likewise.
106 * nsfns.c (x_char_width, x_char_height): Likewise.
107 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
108 all window frames.
109 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
110 * keyboard.c (command_loop_1): Remove prototype.
111 (command_loop_2, top_level_1): Add static to match prototype.
112
113 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
114
115 Fix a recently-introduced delete-process race condition.
116 * callproc.c, process.h (record_kill_process):
117 New function, containing part of the old call_process_kill.
118 (call_process_kill): Use it.
119 This does not change call_process_kill's behavior.
120 * process.c (Fdelete_process): Use record_kill_process to fix a
121 race condition that could cause Emacs to lose track of a child.
122
123 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
124
125 Avoid code duplication between prev_frame and next_frame.
126 * frame.c (candidate_frame): New function. Add comment.
127 (prev_frame, next_frame): Use it. Adjust comment.
128
129 2012-12-06 Eli Zaretskii <eliz@gnu.org>
130
131 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
132 fails, signal an error instead of continuing with an empty
133 string. (Bug#13079)
134 Encode expanded temp file pattern before passing it to mkstemp or
135 mktemp.
136
137 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
138 Encode the file name before passing it to dostounix_filename, in
139 case it will downcase it (under w32-downcase-file-names).
140 (Bug#12933)
141
142 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
143
144 Minor call-process cleanups.
145 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
146 at the same time as other platforms, to simplify analysis.
147 No need for fd0_volatile since we have synch_process_fd.
148 Avoid needless emacs_close; arg is always negative.
149
150 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
151
152 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
153 processes.
154
155 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
156
157 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
158 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
159 and mouse_face_hidden members to a bitfields.
160 * frame.h (struct frame): Remove set-but-not-used space_width member.
161 (FRAME_SPACE_WIDTH): Remove.
162 * nsterm.m, w32term.c, xterm.c: Adjust users.
163 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
164 member. Adjust users. Convert term_initted, delete_in_insert_mode,
165 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
166 members to a bitfields.
167
168 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
169
170 Don't let call-process be a zombie factory (Bug#12980).
171 Fixing this bug required some cleanup of the signal-handling code.
172 As a side effect, this change also fixes a longstanding rare race
173 condition whereby Emacs could mistakenly kill unrelated processes,
174 and it fixes a bug where a second C-g does not kill a recalcitrant
175 synchronous process in GNU/Linux and similar platforms.
176 The patch should also fix the last vestiges of Bug#9488,
177 a bug which has mostly been fixed on the trunk by other changes.
178 * callproc.c, process.h (synch_process_alive, synch_process_death)
179 (synch_process_termsig, sync_process_retcode):
180 Remove. All uses removed, to simplify analysis and so that
181 less consing is done inside critical sections.
182 * callproc.c (call_process_exited): Remove. All uses replaced
183 with !synch_process_pid.
184 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
185 These take the role of what used to be in unwind-protect arg.
186 All uses changed.
187 (block_child_signal, unblock_child_signal):
188 New functions, to avoid races that could kill innocent-victim processes.
189 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
190 (call_process_kill): Record killed processes as deleted, so that
191 zombies do not clutter up the system. Do this inside a critical
192 section, to avoid a race that would allow the clutter.
193 (call_process_cleanup): Fix code so that the second C-g works again
194 on common platforms such as GNU/Linux.
195 (Fcall_process): Create the child process in a critical section,
196 to fix a race condition. If creating an asynchronous process,
197 record it as deleted so that zombies do not clutter up the system.
198 Do unwind-protect for WINDOWSNT too, as that's simpler in the
199 light of these changes. Omit unnecessary call to emacs_close
200 before failure, as the unwind-protect code does that.
201 * callproc.c (call_process_cleanup):
202 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
203 * process.c (record_deleted_pid): New function, containing
204 code refactored out of Fdelete_process.
205 (Fdelete_process): Use it.
206 (process_status_retrieved): Remove. All callers changed to use
207 child_status_change.
208 (record_child_status_change): Remove, folding its contents into ...
209 (handle_child_signal): ... this signal handler. Now, this
210 function is purely a handler for SIGCHLD, and is not called after
211 a synchronous waitpid returns; the synchronous code is moved to
212 wait_for_termination. There is no need to worry about reaping
213 more than one child now.
214 * sysdep.c (get_child_status, child_status_changed): New functions.
215 (wait_for_termination): Now takes int * status and bool
216 interruptible arguments, too. Do not record child status change;
217 that's now the caller's responsibility. All callers changed.
218 Reimplement in terms of get_child_status.
219 (wait_for_termination_1, interruptible_wait_for_termination):
220 Remove. All callers changed to use wait_for_termination.
221 * syswait.h: Include <stdbool.h>, for bool.
222 (record_child_status_change, interruptible_wait_for_termination):
223 Remove decls.
224 (record_deleted_pid, child_status_changed): New decls.
225 (wait_for_termination): Adjust to API changes noted above.
226
227 * bytecode.c, lisp.h (Qbytecode): Remove.
228 No longer needed after 2012-11-20 interactive-p changes.
229
230 2012-12-03 Eli Zaretskii <eliz@gnu.org>
231
232 * xdisp.c (redisplay_window): If the cursor is visible, but inside
233 the scroll margin, move point outside the margin. (Bug#13055)
234
235 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
236
237 * gtkutil.c (my_log_handler): New function.
238 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
239
240 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
241
242 * lisp.h (modify_region): Rename to...
243 (modify_region_1): ...new prototype.
244 * textprop.c (modify_region): Now static. Adjust users.
245 * insdel.c (modify_region): Rename to...
246 (modify_region_1): ...new function to work with current buffer.
247 Adjust comment and users. Use true and false for booleans.
248
249 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
250
251 * alloc.c (free_save_value): New function.
252 (safe_alloca_unwind): Use it.
253 * lisp.h (free_save_value): New prototype.
254 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
255 Add comment.
256 (save_excursion_restore): Adjust to match saved data structure.
257 Use free_save_value to offload some work from GC. Drop obsolete
258 #if 0 code.
259
260 2012-12-03 Chong Yidong <cyd@gnu.org>
261
262 * fileio.c (Vauto_save_list_file_name): Doc fix.
263
264 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
265
266 * w32fns.c: Remove prototype of atof.
267 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
268 builds.
269 (file_dialog_callback): Declared UINT_PTR.
270
271 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
272 with 64-bit builds.
273
274 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
275 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
276 defined.
277
278 2012-12-03 Glenn Morris <rgm@gnu.org>
279
280 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
281
282 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
283
284 Fix xpalloc confusion after memory is exhausted.
285 * alloc.c (xpalloc): Comment fix.
286 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
287 and signals an error, do not clear charset_table_size, as
288 charset_table is still valid.
289 * doprnt.c (evxprintf): Clear *BUF after freeing it.
290
291 Use execve to avoid need to munge environ (Bug#13054).
292 * callproc.c (Fcall_process):
293 * process.c (create_process):
294 Don't save and restore environ; no longer needed.
295 * callproc.c (child_setup):
296 Use execve, not execvp, to preserve environ.
297
298 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
299
300 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
301
302 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
303
304 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
305 display for sliced images (Bug#10500).
306
307 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
308
309 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
310
311 * doc.c (Fdocumentation): Re-add handling of function-documentation,
312 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
313
314 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
315
316 * xdisp.c (window_outdated): Remove eassert since it hits
317 some suspicious corner cases (see Bug#13007 and Bug#13012).
318 (mode_line_update_needed): New function.
319 (redisplay_internal, redisplay_window): Use it.
320 (ensure_selected_frame): New function.
321 (redisplay_internal, unwind_redisplay): Use it.
322 (redisplay_internal): Move comment about buffer_shared...
323 (buffer_shared_and_changed): ...near to its real use.
324
325 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
326
327 * callproc.c (Fcall_process): Don't misreport vfork failure.
328
329 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
330
331 * callproc.c (Fcall_process): Fix vfork portability problems.
332 Do not assume that fd[0], count, filefd, and save_environ survive
333 vfork. Fix bug whereby wrong errno value could be reported for
334 pipe failure. Some minor cleanups, too, as follows. Move buf and
335 bufsize to the context where they're needed. Change new_argv to
336 be of type char **, as this is more convenient and avoids casts.
337 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
338 Now local constants, not macros.
339
340 2012-11-18 Kenichi Handa <handa@gnu.org>
341
342 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
343 for the variable "f".
344
345 2012-11-13 Kenichi Handa <handa@gnu.org>
346
347 * font.c (font_unparse_xlfd): Exclude special characters from the
348 generating XLFD name.
349
350 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
351
352 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
353 * dired.c (stat_uname, stat_gname):
354 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
355
356 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
357 * dired.c (directory_files_internal, file_name_completion):
358 Assume EAGAIN and EINTR are defined.
359
360 * fileio.c (Fcopy_file): Assume EISDIR is defined.
361 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
362 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
363 * lread.c (readbyte_from_file): Assume EINTR is defined.
364 * process.c (wait_reading_process_output, send_process) [subprocesses]:
365 Assume EIO and EAGAIN are defined.
366 * unexcoff.c (write_segment): Assume EFAULT is defined.
367
368 2012-11-27 Eli Zaretskii <eliz@gnu.org>
369
370 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
371 (Bug#11964)
372
373 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
374 highlighting on the frame was cleared. Prevents assertion
375 violations when repeatedly clicking on the "Top" link of the
376 "bread-crumbs" in Info buffers.
377
378 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
379
380 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
381
382 2012-11-24 Ken Brown <kbrown@cornell.edu>
383
384 * keyboard.c (HAVE_MOUSE):
385 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
386 were always defined.
387
388 2012-11-24 Eli Zaretskii <eliz@gnu.org>
389
390 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
391 between bpos_covered and bpos_max. This fixes cursor display when
392 several display strings follow each other.
393
394 * .gdbinit (pgx): If the glyph's object is a string, display the
395 pointer to string data, rather than the value of the string object
396 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
397
398 * indent.c (Fvertical_motion): If the starting position is covered
399 by a display string, return to one position before that, to avoid
400 overshooting it inside move_it_to. (Bug#12930)
401
402 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
403
404 * frame.h (struct frame): Remove display_preempted member
405 since all users are dead long ago.
406 * nsterm.h (struct x_output): Use the only dummy member.
407 * w32menu.c (pending_menu_activation): Remove since not
408 really used.
409 (set_frame_menubar): Adjust user.
410 * w32term.h (struct x_output): Drop outdated #if 0 code.
411 (struct w32_output): Use bitfields for explicit_parent,
412 asked_for_visible and menubar_active members. Drop
413 unused pending_menu_activation member.
414 * xterm.h (struct x_output): Drop outdated #if 0 code.
415 Use bitfields for explicit_parent, asked_for_visible,
416 has_been_visible and net_wm_state_hidden_seen members.
417
418 2012-11-23 Eli Zaretskii <eliz@gnu.org>
419
420 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
421 of a literal "/". (Bug#12955)
422 (gl-stamp): Invoke fc.exe directly, not through cmd.
423
424 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
425
426 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
427 * dired.c: Assume HAVE_DIRENT_H.
428 (NAMLEN): Remove, replacing with ...
429 (dirent_namelen): New function. All uses changed. Use the GNU macro
430 _D_EXACT_NAMELEN if available, as it's faster than strlen.
431 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
432 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
433 * makefile.w32-in (DIR_H): Remove. All uses replaced with
434 $(NT_INC)/dirent.h.
435 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
436 * ndir.h: Rename to ../nt/inc/dirent.h.
437 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
438 Do not include <dirent.h>; no longer needed.
439 * w32.c: Include <dirent.h> rather than "ndir.h".
440
441 2012-11-23 Chong Yidong <cyd@gnu.org>
442
443 * xftfont.c (xftfont_open): Remove duplicate assignment.
444
445 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
446
447 * alloc.c (Fgarbage_collect): Unblock input after clearing
448 gc_in_progress to avoid note_mouse_highlight glitch with GC.
449 * frame.h (FRAME_MOUSE_UPDATE): New macro.
450 * msdos.c (IT_frame_up_to_date): Use it here...
451 * w32term.c (w32_frame_up_to_date): ...here...
452 * xterm.c (XTframe_up_to_date): ...and here...
453 * nsterm.m (ns_frame_up_to_date): ...but not here.
454 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
455 Adjust users.
456 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
457 Do not check whether GC is in progress.
458
459 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
460
461 * xdisp.c (window_buffer_changed): New function.
462 (update_menu_bar, update_tool_bar): Use it to
463 simplify large 'if' statements.
464 (redisplay_internal): Generalize commonly used
465 'tail' and 'frame' local variables.
466
467 2012-11-22 Eli Zaretskii <eliz@gnu.org>
468
469 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
470 with Windows system header.
471
472 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
473
474 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
475 * alloc.c: Assume unistd.h exists.
476 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
477 * sysdep.c (get_current_dir_name): Assume getcwd exists.
478 (getwd) [USG]: Remove; no longer needed.
479 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
480 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
481 * w32.h (getcwd): Remove decl.
482
483 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
484
485 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
486 Make it set selected_window as well.
487 (update_tool_bar): Use it.
488
489 2012-11-21 Ken Brown <kbrown@cornell.edu>
490
491 * emacs.c (main): Set the G_SLICE environment variable for all
492 Cygwin builds, not just GTK builds. See
493 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
494
495 2012-11-21 Eli Zaretskii <eliz@gnu.org>
496
497 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
498 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
499 Define for the MSVC compiler.
500
501 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
502
503 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
504 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
505 dostounix_filename. Prevents crashes down the road, because
506 dostounix_filename assumes it gets a unibyte string. Reported by
507 Michel de Ruiter <michel@sentient.nl>, see
508 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
509
510 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
511
512 Conflate Qnil and Qunbound for `symbol-function'.
513 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
514 * lread.c (init_obarray): Set `function' fields to Qnil.
515 * eval.c (Fcommandp): Ignore Qunbound.
516 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
517 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
518 Test NILP rather than Qunbound.
519 (Ffmakunbound): Set to Qnil.
520 (Fsymbol_function): Never signal an error.
521 (Finteractive_form): Ignore Qunbound.
522
523 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
524
525 * eval.c (interactive_p): Remove no-longer-used decl.
526
527 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
528
529 * xdisp.c (buffer_shared): Adjust comment.
530 (buffer_shared_and_changed): New function.
531 (prepare_menu_bars, redisplay_internal): Use it to
532 decide whether all windows or frames should be updated.
533 (window_outdated): New function.
534 (text_outside_line_unchanged_p, redisplay_window): Use it.
535 (redisplay_internal): Likewise. Fix indentation.
536
537 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
538
539 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
540 (syms_of_eval): Remove corresponding defsubr.
541 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
542
543 2012-11-19 Daniel Colascione <dancol@dancol.org>
544
545 * w32fns.c (Fx_file_dialog):
546 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
547 cygwin_convert_file_name*.
548
549 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
550 Rename cygwin_convert_path* to cygwin_convert_file_name*.
551
552 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
553
554 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
555
556 2012-11-18 Eli Zaretskii <eliz@gnu.org>
557
558 * w32select.c: Include w32common.h before w32term.h, so that
559 windows.h gets included before w32term.h uses some of its
560 features, see below.
561
562 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
563 New typedefs.
564 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
565 New prototypes.
566 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
567
568 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
569
570 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
571 (ns_select): Return at once if events are held (Bug#12834).
572
573 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
574
575 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
576 Needed following 2012-10-20 change. (Bug#12902)
577
578 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
579
580 * w32proc.c (waitpid): Remove unused label get_result.
581
582 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
583
584 * makefile.w32-in (SYSWAIT_H): New macro.
585 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
586 ($(BLD)/sysdep.$(O)): Update dependencies.
587
588 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
589
590 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
591 * callproc.c (relocate_fd): Assume F_DUPFD.
592 * emacs.c, term.c (O_RDWR): Remove.
593 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
594 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
595 * nsterm.m: Assume <fcntl.h> exists.
596 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
597 (create_pty, Fmake_network_process, server_accept_connection)
598 (wait_reading_process_output, init_process_emacs):
599 Assume O_NONBLOCK.
600 (wait_reading_process_output): Put in a special case for WINDOWSNT
601 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
602 It's not clear this is needed, but it's a more-conservative change.
603 (create_process): Assume FD_CLOEXEC.
604 (create_process, create_pty): Assume O_NOCTTY.
605 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
606 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
607 Omit if not DOS_NT, since F_GETFL is not defined there.
608 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
609 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
610 (O_NOCTTY): Remove.
611 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
612 lack it, since gnulib guarantees this.
613 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
614
615 2012-11-17 Eli Zaretskii <eliz@gnu.org>
616
617 * w32.c (faccessat): Pretend that directories have the execute bit
618 set. Emacs expects that, e.g., in files.el:cd-absolute.
619
620 * w32proc.c (create_child): Don't clip the PID of the child
621 process to fit into an Emacs integer, as this is no longer a
622 restriction.
623 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
624 reaping only the process specified by PID argument, if that is
625 positive. Use PID instead of dead_child to know which process to
626 reap. Wait for the child to die only if WNOHANG is not in
627 OPTIONS.
628 (sys_select): Don't set dead_child.
629
630 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
631 as it is no longer needed.
632
633 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
634 no longer needed.
635 (record_child_status_change): Remove the setting of
636 record_at_most_one_child for the !WNOHANG case.
637
638 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
639
640 Fix problems in ns port found by static checking.
641 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
642 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
643 not to process group.
644 (ns_select): Use emacs_write, not write, as that's more robust
645 in the presence of signals.
646 (fd_handler:): Check for read errors.
647
648 2012-11-16 Glenn Morris <rgm@gnu.org>
649
650 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
651
652 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
653
654 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
655
656 2012-11-16 Eli Zaretskii <eliz@gnu.org>
657
658 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
659 use the same value of thread handle.
660 (start_timer_thread): If the timer thread exited (due to error),
661 clean up by closing the two handles it used. Duplicate the caller
662 thread's handle here, so it gets duplicated only once, when
663 launching the timer thread. Set priority of the timer thread, not
664 the caller thread.
665 (getitimer): Don't duplicate the caller thread's handle here.
666 (Bug#12832)
667
668 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
669
670 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
671 called (Bug#12834).
672
673 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
674
675 Remove no-longer-used pty_max_bytes variable.
676 * process.c (pty_max_bytes): Remove; unused.
677 (send_process): Do not set it.
678
679 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
680
681 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
682 Update dependencies.
683
684 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
685
686 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
687 This follows up on the 2012-09-29 patch that removed indirection
688 for the 'function' field. Reported by Sergey Vinokurov in
689 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
690
691 2012-11-14 Eli Zaretskii <eliz@gnu.org>
692
693 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
694 different name, as the MS runtime does not have such a function,
695 and probably never will.) All callers changed. Ignore DIRFD
696 value if PATH is an absolute file name, to match Posix spec
697 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
698 symlinks.
699
700 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
701
702 * xdisp.c (echo_area_display, redisplay_internal):
703 Omit redundant check whether frame_garbaged is set.
704
705 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
706
707 Use faccessat, not access, when checking file permissions (Bug#12632).
708 This fixes a bug that has been present in Emacs since its creation.
709 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
710 which must set some sort of record. (Torek's bug report was against
711 a predecessor of GNU Emacs, but GNU Emacs happened to have the
712 same common flaw.) See Torek's Usenet posting
713 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
714 Posted: Fri Apr 8 14:18:56 1983.
715 * Makefile.in (LIB_EACCESS): New macro.
716 (LIBES): Use it.
717 * callproc.c (init_callproc):
718 * charset.c (init_charset):
719 * fileio.c (check_existing, check_executable, check_writable)
720 (Ffile_readable_p):
721 * lread.c (openp, load_path_check):
722 * process.c (allocate_pty):
723 * xrdb.c (file_p):
724 Use effective UID when checking permissions, not real UID.
725 * callproc.c (init_callproc):
726 * charset.c (init_charset):
727 * lread.c (load_path_check, init_lread):
728 Test whether directories are accessible, not merely whether they exist.
729 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
730 * fileio.c (check_existing, check_executable, check_writable)
731 (Ffile_readable_p):
732 Use symbolic names instead of integers for the flags, as they're
733 portable now.
734 (check_writable): New arg AMODE. All uses changed.
735 Set errno on failure.
736 (Ffile_readable_p): Use faccessat, not stat + open + close.
737 (Ffile_writable_p): No need to call check_existing + check_writable.
738 Just call check_writable and then look at errno. This saves a syscall.
739 dir should never be nil; replace an unnecessary runtime check
740 with an eassert. When checking the parent directory of a nonexistent
741 file, check that the directory is searchable as well as writable, as
742 we can't create files in unsearchable directories.
743 (file_directory_p): New function, which uses 'stat' on most platforms
744 but faccessat with D_OK (for efficiency) if WINDOWSNT.
745 (Ffile_directory_p, Fset_file_times): Use it.
746 (file_accessible_directory_p): New function, which uses a single
747 syscall for efficiency.
748 (Ffile_accessible_directory_p): Use it.
749 * xrdb.c (file_p): Use file_directory_p.
750 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
751 * lread.c (openp): When opening a file, use fstat rather than
752 stat, as that avoids a permissions race. When not opening a file,
753 use file_directory_p rather than stat.
754 (dir_warning): First arg is now a usage string, not a format.
755 Use errno. All uses changed.
756 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
757 that merely introduced a race.
758 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
759 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
760 and similarly for the other O_* flags.
761 * w32.c (sys_faccessat): Rename from sys_access and switch to
762 faccessat's API. All uses changed.
763 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
764 (magic_db): Rename from magic_file_p.
765 (magic_db, search_magic_path): Return an XrmDatabase rather than a
766 char *, so that we don't have to test for file existence
767 separately from opening the file for reading. This removes a race
768 fixes a permission-checking problem, and simplifies the code.
769 All uses changed.
770 (file_p): Remove; no longer needed.
771
772 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
773
774 Omit glyphs initialization at startup.
775 * dispnew.c (glyphs_initialized_initially_p): Remove.
776 (adjust_frame_glyphs_initially): Likewise. Adjust users.
777 (Fredraw_frame): Move actual code from here...
778 (redraw_frame): ...to here. Add eassert. Adjust comment.
779 (Fredraw_display): Use redraw_frame.
780 * xdisp.c (clear_garbaged_frames): Likewise.
781
782 2012-11-13 Eli Zaretskii <eliz@gnu.org>
783
784 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
785 passed to pint2str and pint2hrstr to be at most the size of the
786 frame's decode_mode_spec_buffer. This avoids crashes with very
787 large values of FIELD_WIDTH argument to decode_mode_spec.
788 (Bug#12867)
789
790 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
791
792 Fix a race with verify-visited-file-modtime (Bug#12863).
793 Since at least 1991 Emacs has ignored an mtime difference of no
794 more than one second, but my guess is that this was to work around
795 file system bugs that were fixed long ago. Since the race is
796 causing problems now, let's remove that code.
797 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
798 whose time stamp is off by no more than a second. Insist that the
799 file time stamps match exactly.
800
801 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
802
803 * frame.h (struct frame): Convert external_tool_bar member to
804 1-bit unsigned bitfield.
805 * termhooks.h (struct terminal): Remove mouse_moved member since
806 all users are long dead. Adjust comment on mouse_position_hook.
807
808 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
809
810 Simplify by using FOR_EACH_FRAME here and there.
811 * frame.c (next_frame, prev_frame, other_visible_frames)
812 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
813 * w32term.c (x_window_to_scroll_bar): Likewise.
814 * window.c (window_list): Likewise.
815 * xdisp.c (x_consider_frame_title): Likewise.
816 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
817 * xfns.c (x_window_to_frame, x_any_window_to_frame)
818 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
819 * xmenu.c (menubar_id_to_frame): Likewise.
820 * xselect.c (frame_for_x_selection): Likewise.
821 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
822 (x_window_to_menu_bar): Likewise.
823 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
824
825 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
826
827 * data.c (Qdefalias_fset_function): Now static.
828
829 Another tweak to vectorlike_header change.
830 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
831 Remove, and replace all uses with ...
832 (next_in_free_list, set_next_in_free_list):
833 New functions, which respect C's aliasing rules better.
834
835 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
836
837 * window.c (list4i): Rename from 'quad'. All uses changed.
838 Needed because <sys/types.h> defines 'quad' on Solaris 10.
839
840 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
841
842 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
843 warning about mixing declarations and code in ISO C90.
844
845 2012-11-10 Martin Rudalics <rudalics@gmx.at>
846
847 * window.c (Fsplit_window_internal): Set combination limit of
848 new parent window to t iff Vwindow_combination_limit is t;
849 fixing a regression introduced with the change from 2012-09-22.
850 (Fset_window_combination_limit): Fix doc-string.
851
852 2012-11-10 Eli Zaretskii <eliz@gnu.org>
853
854 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
855 amount when the scroll margins are too large. When scrolling
856 backwards in the buffer, give up if cannot reach point or the
857 scroll margin within a reasonable number of screen lines.
858 Fixes point position in window under scroll-up/down-aggressively when
859 point is positioned many lines beyond the window top/bottom.
860 (Bug#12811)
861
862 * ralloc.c (relinquish): If real_morecore fails to return memory
863 to the system, don't crash; instead, leave the last heap
864 unchanged and return. (Bug#12774)
865
866 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
867
868 * lisp.h (AUTOLOADP): New macro.
869 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
870 * data.c (Ffset): Remove special ad-advice-info handling.
871 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
872 (Fsubr_arity): CSE.
873 (Finteractive_form): Simplify.
874 (Fquo): Don't insist on having at least 2 arguments.
875 (Qdefalias_fset_function): New var.
876
877 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
878
879 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
880
881 * nsfont.m (Qcondensed, Qexpanded): New variables.
882 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
883 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
884
885 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
886
887 Fix recently introduced crash on MS-Windows (Bug#12839).
888 * w32term.h (struct scroll_bar): Use convenient header.
889 (SCROLL_BAR_VEC_SIZE): Remove.
890 * w32term.c (x_scroll_bar_create): Use VECSIZE.
891
892 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
893
894 Tweak last vectorlike_header change.
895 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
896 vectorlike object on the free list. This is introduced to avoid
897 some (but not all) pointer casting and aliasing problems, see
898 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
899 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
900 objects.
901 (xvectype, xvecsize): Use them to examine Lisp_Object values.
902
903 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
904
905 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
906 been removed, so remove them here also.
907
908 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
909
910 * doc.c (Fdocumentation): Handle new property
911 dynamic-docstring-function to replace the old ad-advice-info.
912
913 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
914
915 * fns.c (Qeql, hashtest_eq): Now static.
916
917 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
918
919 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
920 * fns.c (hashfn_eq, hashfn_eql, sxhash):
921 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
922 * buffer.c (compare_overlays): Use XLI rather than XHASH.
923
924 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
925
926 Use same hash function for hashfn_profiler as for hash_string etc.
927 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
928 * lisp.h (sxhash_combine): New inline function, with the contents
929 of the old SXHASH_COMBINE.
930 * profiler.c (hashfn_profiler): Use it, instead of having a
931 special hash function containing a comparison that always yields 1.
932
933 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
934
935 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
936 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
937 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
938 Remove unused vars.
939
940 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
941
942 * image.c (xpm_make_color_table_h): Fix compiler error because
943 make_hash_table changed.
944
945 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
946
947 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
948
949 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
950
951 Use ad-hoc comparison function for the profiler's hash-tables.
952 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
953 (make_log): Use them.
954 (handle_profiler_signal): Don't inhibit quit any longer since we don't
955 call Fequal any more.
956 (Ffunction_equal): New function.
957 (cmpfn_profiler, hashfn_profiler): New functions.
958 (syms_of_profiler): Initialize them.
959 * lisp.h (struct hash_table_test): New struct.
960 (struct Lisp_Hash_Table): Use it.
961 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
962 * fns.c (make_hash_table): Take a struct to describe the test.
963 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
964 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
965 (hash_lookup, hash_remove_from_table): Move assertion checking of
966 hashfn result here. Check hash-equality before calling cmpfn.
967 (Fmake_hash_table): Adjust call to make_hash_table.
968 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
969 (syms_of_fns): Initialize them.
970 * emacs.c (main): Move syms_of_fns earlier.
971 * xterm.c (syms_of_xterm):
972 * category.c (hash_get_category_set): Adjust call to make_hash_table.
973 * print.c (print_object): Adjust to new hash-table struct.
974 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
975
976 2012-11-08 Eli Zaretskii <eliz@gnu.org>
977
978 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
979 value of w32-scroll-lock-modifier is neither nil nor one of the
980 known key modifiers. (Bug#12806)
981
982 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
983
984 Shrink struct vectorlike_header to the only size field.
985 * lisp.h (enum pvec_type): Avoid explicit enum member values.
986 Adjust comment.
987 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
988 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
989 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
990 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
991 information from the vector header. Adjust comment.
992 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
993 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
994 layout.
995 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
996 (struct vectorlike_header): Remove next member. Adjust comment.
997 (struct Lisp_Subr): Add convenient header. Adjust comment.
998 (allocate_pseudovector): Adjust prototype.
999 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1000 (sweep_string, lisp_malloc): Remove useless prototypes.
1001 (enum mem_type): Adjust comment.
1002 (NEXT_IN_FREE_LIST): New macro.
1003 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1004 (Fmake_bool_vector): Likewise.
1005 (struct large_vector): New type to represent allocation unit for
1006 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1007 (large_vectors): Change type to struct large_vector.
1008 (allocate_vector_from_block): Simplify.
1009 (PSEUDOVECTOR_NBYTES): Replace with...
1010 (vector_nbytes): ...new function. Adjust users.
1011 (sweep_vectors): Adjust processing of large vectors.
1012 (allocate_vectorlike): Likewise.
1013 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1014 Add easserts. Adjust XSETPVECTYPESIZE usage.
1015 (allocate_buffer): Use BUFFER_PVEC_INIT.
1016 (live_vector_p): Adjust to match large vector.
1017 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1018 * buffer.h (struct buffer): Add next member.
1019 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1020 New macros.
1021 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1022 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1023 (copy_hash_table): Adjust to match vector header change.
1024 * lread.c (defsubr): Use XSETPVECTYPE.
1025 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1026 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1027 (xvecsize): New command.
1028
1029 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1030
1031 * keyboard.c (event_to_kboard): Do not dereference
1032 frame_or_window field of SELECTION_REQUEST_EVENT
1033 and SELECTION_CLEAR_EVENT events (Bug#12814).
1034 * xterm.h (struct selection_input_event): Adjust comment.
1035
1036 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1037
1038 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1039 such as Scroll Lock, if the respective keys are treated as
1040 function keys, not as modifiers. This avoids destroying non-ASCII
1041 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1042
1043 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1046
1047 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 Restore some duplicate definitions (Bug#12814).
1050 This undoes part of the 2012-11-03 changes. Some people build
1051 with plain -g rather than with -g3, and they need the duplicate
1052 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1053 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1054 Define as macros, as well as as enums or as constants.
1055
1056 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1057
1058 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1059 to keypad keys (Bug#12816).
1060
1061 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1062
1063 Minor adjustments of recently-changed frame functions.
1064 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1065 known to be a frame (we're in the FRAMEP branch).
1066 * lisp.h (Qframep): Remove decl. frame.h declares this.
1067 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1068 since they're meant for Lisp fixnum values.
1069
1070 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1071
1072 * window.c (Fwindow_combination_limit): Revert to the only
1073 required argument and adjust docstring as suggested in
1074 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1075 by Martin Rudalics <rudalics@gmx.at>.
1076
1077 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 Widely used frame validity and checking functions.
1080 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1081 * frame.c (decode_live_frame, decode_any_frame): New functions.
1082 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1083 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1084 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1085 (Fframe_pointer_visible_p): Use decode_any_frame.
1086 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1087 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1088 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1089 (Fframe_focus): Likewise. Allow zero number of arguments.
1090 Adjust docstring.
1091 (frame_buffer_list, frame_buffer_predicate): Remove.
1092 * lisp.h (frame_buffer_predicate): Remove prototype.
1093 * buffer.c (Fother_buffer): Use decode_any_frame.
1094 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1095 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1096 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1097 (Fclose_font, Ffont_info): Use decode_live_frame.
1098 * fontset.c (check_fontset_name): Likewise.
1099 * terminal.c (Fframe_terminal): Likewise.
1100 * w32fns.c (check_x_frame): Likewise.
1101 * window.c (Fminibuffer_window, Fwindow_at)
1102 (Fcurrent_window_configuration): Likewise.
1103 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1104 Likewise. Allow zero number of arguments. Adjust docstring.
1105 * dispnew.c (Fredraw_frame): Likewise.
1106 * xfaces.c (frame_or_selected_frame): Remove.
1107 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1108 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1109 (Fframe_face_alist): Use decode_live_frame.
1110 * xfns.c (check_x_frame): Likewise.
1111
1112 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1113
1114 * window.c (quad): New function.
1115 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1116 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1117 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1118 (Fwindow_line_height): Use it.
1119 (Fwindow_fringes): Use list3.
1120 (Fwindow_scroll_bars): Use list4.
1121 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1122 (Fwindow_combination_limit): Allow zero number of arguments.
1123
1124 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1125
1126 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1127
1128 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1129 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1130 file descriptor 2 for standard error. (Bug#12805)
1131
1132 2012-11-05 Chong Yidong <cyd@gnu.org>
1133
1134 * process.c (wait_reading_process_output): Revert previous change.
1135
1136 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1137
1138 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1139 This removes code that has been obsolete since around 1990.
1140 * callproc.c (Fcall_process):
1141 * emacs.c (main):
1142 * process.c (create_process):
1143 * term.c (dissociate_if_controlling_tty):
1144 Assume setsid exists.
1145 * callproc.c (child_setup): Assume setpgid exists and behaves as
1146 per POSIX.1-1988 or later.
1147 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1148 * emacs.c (shut_down_emacs):
1149 * sysdep.c (sys_suspend, init_foreground_group):
1150 Assume getpgrp behaves as per POSIX.1-1998 or later.
1151 * msdos.c (setpgrp): Remove.
1152 (tcgetpgrp, setpgid, setsid): New functions.
1153 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1154 * term.c (no_controlling_tty): Remove; unused.
1155 * w32proc.c (setpgrp): Remove.
1156 (setsid, tcgetpgrp): New functions.
1157
1158 Simplify by assuming __fpending.
1159 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1160 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1161 Do not assume that __fpending's result fits in int.
1162
1163 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1164
1165 Remove EMACS_OUTQSIZE+sleep hack.
1166 * dispnew.c (update_frame_1): Remove hack for terminals slower
1167 than 2400 bps, which throttled Emacs by having it sleep.
1168 This code hasn't worked since at least 2007, when the multi-tty stuff
1169 was added, and anyway those old terminals are long dead.
1170 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1171 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1172
1173 Fix data-loss with --version (Bug#9574).
1174 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1175 as we can't assume that emacs_strerror is initialized, and strerror
1176 is good enough here.
1177 (main): Invoke atexit earlier, to catch earlier instances of
1178 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1179
1180 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1181
1182 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1183 (keyDown): Remap keypad keys to X11 virtual key codes.
1184
1185 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 Fix data-loss with --batch (Bug#9574).
1188 * emacs.c: Include <close-stream.h>.
1189 (close_output_streams): New function.
1190 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1191 and handles errors appropriately.
1192 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1193 does that now.
1194
1195 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1196 The symptom is a diagnostic "GLib-WARNING **: In call to
1197 g_spawn_sync(), exit status of a child process was requested but
1198 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1199 waitpid(), so exit status can't be returned." The diagnostic
1200 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1201 The real bug is a race condition between Emacs and glib: Emacs
1202 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1203 so that glib can't find it. Work around the bug by invoking
1204 waitpid only on subprocesses that Emacs itself creates.
1205 * process.c (create_process, record_child_status_change):
1206 Don't use special value -1 in pid field, as the caller now must
1207 know the pid rather than having the callee infer it.
1208 The inference was sometimes incorrect anyway, due to another race.
1209 (create_process): Set new 'alive' member if child is created.
1210 (process_status_retrieved): New function.
1211 (record_child_status_change): Use it.
1212 Accept negative 1st argument, which means to wait for the
1213 processes that Emacs already knows about. Move special-case code
1214 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1215 processes that have already been waited for, by testing and
1216 clearing new 'alive' member.
1217 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1218 now does this internally.
1219 (handle_child_signal): Let record_child_status_change do all
1220 the work, since we do not want to reap all exited child processes,
1221 only the child processes that Emacs itself created.
1222 * process.h (Lisp_Process): New boolean member 'alive'.
1223
1224 Omit duplicate definitions no longer needed with gcc -g3.
1225 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1226 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1227 Define only as macros. There's no longer any need to also define
1228 these symbols as enums or as constants, since we now assume
1229 gcc -g3 when debugging.
1230
1231 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1232
1233 * lisp.mk: Adjust comments to the fact that term/internal is now
1234 loaded from loadup.el.
1235
1236 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1237 (msdos_fatal_signal): New function.
1238 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1239 its argument list.
1240
1241 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1242 for GCC versions before 4.
1243 (emacs_raise): Define to call msdos_fatal_signal.
1244
1245 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1246 iterator when starting in the middle of a display or overlay
1247 string. (Bug#12745)
1248
1249 2012-11-03 Chong Yidong <cyd@gnu.org>
1250
1251 * process.c (wait_reading_process_output): Clean up the last
1252 change.
1253
1254 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1255
1256 * process.c (wait_reading_process_output): Avoid a race condition
1257 with SIGIO delivery (Bug#11536).
1258
1259 2012-11-03 Chong Yidong <cyd@gnu.org>
1260
1261 * buffer.c (cursor_type): Untabify docstring.
1262
1263 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 * frame.h (struct frame): Drop can_have_scroll_bars member
1266 which is meaningless for a long time. Adjust comments.
1267 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1268 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1269
1270 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1271
1272 * window.c (decode_next_window_args): Update window arg after
1273 calling decode_live_window and so fix crash reported at
1274 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1275 by Juanma Barranquero <lekktu@gmail.com>.
1276 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1277 * font.c (Ffont_at): Likewise.
1278
1279 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1280
1281 * widget.c (resize_cb): New function.
1282 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1283 (EmacsFrameResize): Check if all is up to date before changing frame
1284 size.
1285
1286 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1287
1288 Implement backtrace output for fatal errors on MS-Windows.
1289 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1290 (BACKTRACE_LIMIT_MAX): New macro.
1291 (w32_backtrace): New function.
1292 (emacs_abort): Use w32_backtrace when the user chooses not to
1293 attach a debugger. Update the text of the abort dialog.
1294
1295 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1296
1297 Window-related stuff cleanup here and there.
1298 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1299 Use decode_any_window.
1300 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1301 * xdisp.c (Fformat_mode_line): Likewise.
1302 * font.c (Ffont_at): Use decode_live_window.
1303 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1304 * window.c (decode_next_window_args): Likewise.
1305 (decode_any_window): Remove static.
1306 * window.h (decode_any_window): Add prototype.
1307 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1308 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1309 respectively.
1310
1311 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1312
1313 Remove pad from struct input_event.
1314 * termhooks.h (struct input_event): Remove padding field.
1315 Adjust comment.
1316 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1317 member is never cons for a long time. Adjust comment.
1318 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1319 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1320 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1321 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1322
1323 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1324
1325 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1326
1327 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1328
1329 Fix crash when using Emacs as commit editor for git (Bug#12697).
1330 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1331 and it is configured in conf_post.h.
1332 (Fcall_process): Don't invoke both setsid and setpgid; the former
1333 is enough, if it exists.
1334 * callproc.c (Fcall_process, child_setup):
1335 * process.c (create_process): Use setpgid.
1336 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1337 for the real thing.
1338 * dispnew.c (init_display): Initialize the foreground group
1339 if we are running a tty display.
1340 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1341 * lisp.h (init_foreground_group): New decl.
1342 * sysdep.c (inherited_pgroup): New static var.
1343 (init_foreground_group, tcsetpgrp_without_stopping)
1344 (narrow_foreground_group, widen_foreground_group): New functions.
1345 (init_sys_modes): Narrow foreground group.
1346 (reset_sys_modes): Widen foreground group.
1347
1348 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1349
1350 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1351
1352 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1353
1354 * minibuf.c (read_minibuf): Restore current buffer since
1355 choose_minibuf_frame calling Fset_frame_selected_window may
1356 change it (Bug#12766).
1357
1358 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1359
1360 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1361
1362 2012-10-30 Kenichi Handa <handa@gnu.org>
1363
1364 * font.c (Ffont_at): If WINDOW is specified and it is not
1365 displaying the current buffer, signal an error.
1366
1367 2012-10-29 Daniel Colascione <dancol@dancol.org>
1368
1369 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1370 In preparation for fixing bug#12739, move these functions from
1371 here...
1372
1373 * coding.h, coding.c: ... to here, and compile them only when
1374 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1375 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1376
1377 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1378
1379 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1380 (timer_loop, getitimer, setitimer): Use it instead of
1381 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1382 'clock'.
1383 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1384 literal 10000.
1385
1386 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1387
1388 * nsterm.m (NO_APPDEFINED_DATA): New define.
1389 (last_appdefined_event_data): New variable
1390 (last_appdefined_event): Remove.
1391 (ns_select): Initialize t from last_appdefined_event_data instead
1392 of [last_appdefined_event data1].
1393 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1394 remove last_appdefined_event (Bug#12698).
1395
1396 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1397
1398 * frame.c (x_set_font): Catch internal error.
1399
1400 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1401
1402 Avoid overflow in w32 implementation of interval timers.
1403 When possible, for ITIMER_PROF count only times the main thread
1404 actually executes.
1405 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1406 'volatile ULONGLONG' types. All the other data which was
1407 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1408 (GetThreadTimes_Proc): New typedef.
1409 (w32_get_timer_time): New function, returns a suitable time value
1410 for the timer.
1411 (timer_loop): Enter critical section when accessing ULONGLONG
1412 values of the itimer_data struct, as these accesses are no longer
1413 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1414 Remove unused variable.
1415 (init_timers): Initialize s_pfn_Get_Thread_Times.
1416 (start_timer_thread): Don't assign itimer->caller_thread here.
1417 (getitimer): Assign itimer->caller_thread here.
1418 (setitimer): Always call getitimer to get the value of ticks_now.
1419 (sys_spawnve): Avoid compiler warning about format mismatch.
1420
1421 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1422
1423 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1424 mouse movement events if the menu bar is active. This avoids
1425 producing a busy "hour-glass" cursor by Windows if the mouse
1426 pointer is positioned over a tooltip shown for some menu item.
1427
1428 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1429
1430 Don't assume process IDs fit in int.
1431 * emacs.c (shut_down_emacs) [!DOS_NT]:
1432 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1433 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1434 Use pid_t, not int, to store process IDs, as 'int'
1435 is not wide enough on a few platforms (e.g., AIX and IRIX).
1436
1437 2012-10-23 Kenichi Handa <handa@gnu.org>
1438
1439 The following change is to make face-font-rescale-alist work
1440 correctly for non-ASCII fonts.
1441
1442 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1443 (font_open_for_lface): Handle Vface_font_rescale_alist.
1444
1445 2012-10-23 Chong Yidong <cyd@gnu.org>
1446
1447 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1448
1449 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1450
1451 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1452 for screen font.
1453 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1454
1455 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1456 event (Bug#12681).
1457
1458 2012-10-21 Glenn Morris <rgm@gnu.org>
1459
1460 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1461
1462 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1463
1464 Port to OpenBSD 5.1.
1465 * frame.c (Fmouse_position, Fmouse_pixel_position):
1466 * xdisp.c (produce_stretch_glyph):
1467 Declare local vars only when they're needed.
1468 This is clearer and avoids a warning on OpenBSD about unused vars.
1469 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1470 This is safer, and avoids OpenBSD warnings about unused vars.
1471 * keyboard.c (record_menu_key): Remove unnecessary decl.
1472 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1473 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1474 as our definition clashes with OpenBSD's.
1475 * xfaces.c (load_face_colors, check_lface_attrs)
1476 (get_lface_attributes_no_remap, get_lface_attributes)
1477 (lface_fully_specified_p, x_supports_face_attributes_p)
1478 (tty_supports_face_attributes_p, face_fontset, realize_face)
1479 (realize_x_face, realize_tty_face):
1480 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1481 merely Lisp_Object *. This is more informative and avoids
1482 a warning on OpenBSD about accessing beyond an object's size.
1483
1484 2012-10-20 Chong Yidong <cyd@gnu.org>
1485
1486 * lread.c (Fload): Doc fix (Bug#12592).
1487
1488 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1489
1490 * font.c (Ffont_at): Fix previous change.
1491
1492 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1493
1494 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1495 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1496 for the reasons.
1497
1498 * alloc.c (NSTATICS): Decrease to 0x800.
1499
1500 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1501
1502 * fns.c (Fnreverse): Include the problem element when signalling an
1503 error (bug#12677).
1504
1505 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1506
1507 * nsterm.m (ns_select): Check writefds before call to
1508 FD_ISSET (Bug#12668).
1509
1510 2012-10-18 Daniel Colascione <dancol@dancol.org>
1511
1512 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1513 (staticpro): If we run out of staticpro slots, die with an
1514 informative error instead of just calling emacs_abort.
1515
1516 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1517
1518 Fix two flaws reported by Dmitry Antipov.
1519 * window.c (Ftemp_output_buffer_show): Remove.
1520 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1521 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1522
1523 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1524
1525 * makefile.w32-in ($(BLD)/w32.$(O)):
1526 ($(BLD)/vm-limit.$(O)):
1527 ($(BLD)/term.$(O)):
1528 ($(BLD)/unexw32.$(O)):
1529 ($(BLD)/fileio.$(O)):
1530 ($(BLD)/dispnew.$(O)): Update dependencies.
1531
1532 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1533 Add prototypes.
1534
1535 * w32proc.c: Include ctype.h.
1536
1537 * w32.h (init_environment, check_windows_init_file)
1538 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1539 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1540 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1541 (sys_link): Add prototypes.
1542
1543 * w32.c: Include w32select.h.
1544 (sys_access, e_malloc, sys_select): Add prototypes.
1545 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1546
1547 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1548
1549 * unexw32.c: Include lisp.h and w32.h.
1550
1551 * term.c [WINDOWSNT]: Include w32term.h.
1552
1553 * process.c [WINDOWSNT]: Add prototype of sys_select.
1554
1555 * fileio.c [WINDOWSNT]: Include w32.h.
1556
1557 * dispnew.c [WINDOWSNT]: Include w32.h.
1558
1559 * cygw32.c (Fcygwin_convert_path_to_windows)
1560 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1561 Lisp_Object values. (Bug#12661)
1562
1563 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1564 to Lisp_Object. (Bug#12661)
1565
1566 2012-10-17 Kenichi Handa <handa@gnu.org>
1567
1568 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1569 invalidate.
1570
1571 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1572
1573 * buffer.c (Fkill_buffer): When unchaining the marker,
1574 reset its buffer pointer to NULL (Bug#12652).
1575
1576 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1577
1578 Do not verify indirection counters of killed buffers (Bug#12579).
1579 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1580 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1581
1582 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1583
1584 * alloc.c (Fmake_byte_code): Fix typo in comment.
1585 * print.c (print_interval): Define as static to match prototype.
1586 * indent.c (disptab_matches_widthtab, recompute_width_table):
1587 Convert to eassert.
1588
1589 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1590
1591 * editfns.c (get_system_name): Remove.
1592 * lisp.h (get_system_name): Remove prototype.
1593 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1594 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1595
1596 2012-10-15 Daniel Colascione <dancol@dancol.org>
1597
1598 * dbusbind.c: Add comment explaining reason for previous change.
1599
1600 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1601
1602 * window.c (Fwindow_end): Rewrite check whether cached position
1603 can be used (Bug#12600).
1604 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1605 Set windows_or_buffers_changed.
1606
1607 2012-10-15 Daniel Colascione <dancol@dancol.org>
1608
1609 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1610 enabled by undefining the symbol "interface", which the platform
1611 headers define to something incompatible.
1612
1613 2012-10-14 Daniel Colascione <dancol@dancol.org>
1614
1615 * image.c (init_tiff_functions, init_imagemagick_functions)
1616 (init_svg_functions): Fix cygw32 build break by using these
1617 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1618
1619 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1620
1621 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1622
1623 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1624
1625 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1626
1627 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1628
1629 * coding.c (detect_coding): Set coding->id before calling
1630 this->detector.
1631
1632 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1633
1634 * fileio.c: Formatting fixes.
1635
1636 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1637
1638 Fix some stat-related races.
1639 * fileio.c (Fwrite_region): Avoid race condition if a file is
1640 removed or renamed by some other process immediately after Emacs
1641 writes it but before Emacs stats it. Do not assume that stat (or
1642 fstat) succeeds.
1643 * image.c (slurp_file): Resolve the file name with fopen + fstat
1644 rather than stat + fopen.
1645 (pbm_read_file) [0]: Remove unused code with stat race.
1646 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1647 Remove ineffective code with stat race.
1648
1649 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1650
1651 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1652
1653 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1654
1655 * nsterm.m (hold_event_q): New static variable.
1656 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1657 ! q_event_ptr.
1658 (hold_event): New function.
1659 (ns_read_socket): If hold_event_q have events, store them and
1660 return (Bug#12384).
1661 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1662 is zero (Bug#12384).
1663
1664 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1665
1666 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1667
1668 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1669
1670 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1671
1672 * fileio.c (check_existing): New function.
1673 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1674 instead of calling 'stat', when what's needed is to check whether
1675 a file exists. This avoids expensive system calls on MS-Windows.
1676 (Bug#12587)
1677
1678 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1679
1680 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1681 determine whether a file exists and is not a directory.
1682
1683 * lisp.h (check_existing): Add prototype.
1684
1685 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1686
1687 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1688
1689 2012-10-12 Glenn Morris <rgm@gnu.org>
1690
1691 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1692
1693 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1694
1695 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1696
1697 * eval.c (Fautoload): Remember previous autoload status in load-history.
1698
1699 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1700
1701 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1702 * lread.c (load_each_byte, new_backquote_flag, readchar)
1703 (read_filtered_event, lisp_file_lexically_bound_p)
1704 (safe_to_load_version, Fload, complete_filename_p, openp)
1705 (build_load_history, readevalloop, read_escape, read1)
1706 (string_to_number, read_vector, read_list):
1707 * macros.c (Fstart_kbd_macro):
1708 * marker.c (CONSIDER):
1709 * menu.c (parse_single_submenu, digest_single_submenu)
1710 (find_and_return_menu_selection, Fx_popup_menu):
1711 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1712 (Ftry_completion):
1713 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1714 (ns_menu_show):
1715 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1716 (xmenu_show, xdialog_show):
1717 Use bool for booleans.
1718 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1719 as it's not a predicate. All uses changed. Omit unnecessary
1720 buffer termination.
1721
1722 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1723
1724 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1725 (save_excursion_restore): Do not restore mark if it was not saved.
1726
1727 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1728
1729 * marker.c (cached_modiff): EMACS_INT, not int.
1730
1731 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1732 instead of having a wrong decl.
1733 * nsmenu.m (waiting_for_input): Remove wrong decl.
1734
1735 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 keyboard.c, keymap.c: Use bool for booleans.
1738 * dispnew.c (sit_for): Distinguish between 3-way display_option
1739 and boolean do_display.
1740 * keyboard.c (single_kboard, this_command_key_count_reset)
1741 (waiting_for_input, echoing, immediate_quit, input_pending)
1742 (interrupt_input, interrupts_deferred, pop_kboard)
1743 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1744 (command_loop_1, adjust_point_for_property)
1745 (safe_run_hooks_error, input_polling_used, read_char):
1746 (help_char_p, readable_events, kbd_buffer_events_waiting)
1747 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1748 (lucid_event_type_list_p, get_input_pending):
1749 (gobble_input, menu_separator_name_p, menu_bar_item)
1750 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1751 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1752 (keyremap_step, test_undefined, read_key_sequence)
1753 (detect_input_pending, detect_input_pending_ignore_squeezables)
1754 (detect_input_pending_run_timers, requeued_events_pending_p)
1755 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1756 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1757 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1758 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1759 (accessible_keymaps_1, Fkey_description, push_key_description):
1760 (shadow_lookup, struct where_is_internal_data)
1761 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1762 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1763 (describe_map, describe_vector):
1764 * menu.c (single_menu_item):
1765 * nsmenu.m (ns_update_menubar):
1766 * process.c (wait_reading_process_output):
1767 * search.c (scan_buffer, scan_newline):
1768 Use bool for boolean.
1769 * keyboard.c (timers_run, swallow_events)
1770 (detect_input_pending_run_timers):
1771 * process.c (wait_reading_process_output):
1772 Use unsigned for counter where wraparound-on-overflow is desired,
1773 since unsigned is guaranteed to have that behavior and signed is not.
1774 (read_char): Use ptrdiff_t for string length.
1775 (get_input_pending): Remove first argument, since it was always
1776 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1777 and behave as if it had that value. Return new value of
1778 input_pending. All callers changed.
1779 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1780 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1781 a string length.
1782 * keymap.c (push_key_description): Omit last arg, which was always 1.
1783 All callers changed.
1784
1785 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1786
1787 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1788
1789 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1790 ($(BLD)/term.$(O)): Update dependencies.
1791
1792 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1793
1794 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1795 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1796 initializer for PVEC_NORMAL_VECTOR.
1797
1798 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 Clean out old termopts cruft.
1801 * termopts.h (flow_control, meta_key): Remove unused decls.
1802 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1803 Don't include termopts.h.
1804
1805 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1806
1807 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1808
1809 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1810
1811 * commands.h (immediate_quit): Remove duplicate decl.
1812
1813 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1814
1815 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1816 caching.
1817 (nsfont_open): Remove setting of Vfonts_in_cache.
1818 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1819
1820 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1821
1822 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1823 match what GetLastError returns. Explain why the function is
1824 needed.
1825
1826 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1827 'is_tooltip_frame', to avoid confusion with its global namesake.
1828
1829 2012-10-08 Daniel Colascione <dancol@dancol.org>
1830
1831 * xdisp.c (start_hourglass): Call w32_note_current_window when
1832 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1833 build that caused Emacs to display the hourglass cursor forever.
1834
1835 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1836 which is broken under remote desktop, calculate the number of
1837 colors available for a display based on the display's number of
1838 planes and number of bits per pixel per plane. (bug#10397).
1839
1840 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1841
1842 * nsfont.m (Vfonts_in_cache): New variable.
1843 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1844 are used. Add cached fonts to Vfonts_in_cache.
1845 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1846
1847 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1848
1849 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1850 in nt/config.nt.
1851 (FONT_H): Define after FRAME_H.
1852 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1853 Update dependencies.
1854
1855 * w32term.c: Remove leftover declaration of keyboard_codepage.
1856
1857 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1858
1859 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1860 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1861 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1862 (GLOBAL_SOURCES): Add cygw32.c.
1863 ($(BLD)/unexw32.$(O)):
1864 ($(BLD)/w32.$(O)):
1865 ($(BLD)/w32console.$(O)):
1866 ($(BLD)/w32fns.$(O)):
1867 ($(BLD)/w32heap.$(O)):
1868 ($(BLD)/w32menu.$(O)):
1869 ($(BLD)/w32proc.$(O)): Add w32common.h.
1870
1871 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1872 'const char *'.
1873 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1874
1875 2012-10-08 Daniel Colascione <dancol@dancol.org>
1876
1877 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1878 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1879 accidental message numbering hole. Change other messages to
1880 match.
1881
1882 * w32select.h (HAVE_W32SELECT): Remove.
1883
1884 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1885 w32common.h instead of w32heap.h.
1886
1887 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1888 (get_allocation_unit, get_processor_type, get_w32_major_version)
1889 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1890 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1891 (OS_NT, os_subtype, cache_system_info): Move declarations to
1892 w32common.
1893
1894 * w32heap.c: Include w32common.h.
1895 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1896 (w32_minor_version, w32_build_number, w32_subtype):
1897 Remove duplicate definitions.
1898
1899 * w32fns.c: Include w32common.h; include w32heap.h only in
1900 WINDOWSNT.
1901
1902 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1903 Use `report_file_error' instead of `error' in order to better
1904 inform users of what went wrong. Increase NTGUI_UNICODE file
1905 dialog box file name length to 32k, the maximum allowed by the NT
1906 kernel.
1907
1908 * w32common.h: New file.
1909 (ROUND_UP, ROUND_DOWN, get_page_size)
1910 (get_allocation_unit, get_processor_type, get_w32_major_version)
1911 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1912 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1913 (OS_NT, os_subtype, cache_system_info): Move here.
1914
1915 * unexw32.c, unexcw.c: Include w32common.h.
1916
1917 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1918 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1919 to call syms_of_w32select.
1920
1921 * cygw32.h: Remove obsolete EXFUN declarations.
1922
1923 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1924
1925 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1926 of w32inevt.o from SOME_MACHINE_OBJECTS.
1927
1928 2012-10-08 Daniel Colascione <dancol@dancol.org>
1929
1930 * image.c: Permanent fix for JPEG compilation issue --- limit
1931 jpeglib `boolean' redefinition to Cygwin builds.
1932
1933 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1934
1935 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1936
1937 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1938 Cygwin.
1939
1940 2012-10-08 Daniel Colascione <dancol@dancol.org>
1941
1942 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1943 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1944 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1945 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1946 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1947 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1948 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1949 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1950 now a supported configuration.
1951
1952 * Makefile.in: consolidate image variables into LIBIMAGE; add
1953 W32_OBJ and W32_LIBS. Compile new files.
1954
1955 * conf_post.h:
1956 (_DebPrint) declare tracing facility for W32 debugging. We need
1957 to unify tracing later.
1958
1959 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1960 unconditional use of W32 Unicode functions. Cygwin runs only on
1961 100% Unicode operating systems.
1962
1963 * cygw32.c: New file. Define Cygwin-specific facilities.
1964 (Fcygwin_convert_path_to_windows)
1965 (Fcygwin_convert_path_from_windows): New user functions for
1966 accessing Cygwin path-munging routines.
1967
1968 * cygw32.h: New file.
1969 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1970 UTF-16LE strings temporarily inside non-Lisp-visible string
1971 objects.
1972
1973 (w32_strerror): Just what it says on the tin.
1974
1975 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1976 also run for Cygwin; both systems have the same problem with using
1977 GUI facilities in a forked child. Also call syms_of_cygw32,
1978 syms_of_w32select in correct places.
1979
1980 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1981 needs fork-then-exec for daemon launching.
1982
1983 * font.h: Include frame.h.
1984
1985 * image.c: Use the image library cache machinery only when we're
1986 compiling for native WINDOWSNT; Cygwin can use shared libraries
1987 like any other Unixlike system.
1988
1989 * keyboard.c: Clarify a comment regarding the input loop.
1990
1991 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1992 functions directly instead of trying to detect at runtime that our
1993 host operating system supports them. We make this change for two
1994 reasons: Cygwin lacks support for the multibyte character
1995 conversion functions used by the legacy menu code, and Cygwin
1996 never needs to rely on non-Unicode APIs.
1997
1998 * unexw32.c (hinst): Declare extern.
1999
2000 * w32.c: Change header order;
2001 (w32_strerror): Move to w32fns.c because we need it for
2002 non-WINDOWSNT builds.
2003
2004 * w32.h: Add #error macro to make sure we don't include w32.h for
2005 Cygwin builds. Remove w32select declarations.
2006
2007 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2008 w32fns.c. w32console.c is WINDOWSNT-only.
2009
2010 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2011 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2012 POSIXy alternative.
2013 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2014 (w32_major_version, w32_minor_version, w32_build_number)
2015 (os_subtype, sound_type): Define here
2016 (w32_defined_color): Make color parameter const for consistency
2017 with other _defined_color functions.
2018 (w32_createwindow): Unconditionally call w32_init_class instead of
2019 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2020 through the code is complex and unnecessary because class
2021 registration is practically free.
2022 (w32_name_of_message): New EMACSDEBUG-only function.
2023 (Fset_message_beep): Move here
2024 (Fx_open_connection): Require that the display name for Windows be
2025 "w32" for consistency, emacsclient disambiguation, and maybe, one
2026 day, multi-window-system support.
2027 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2028 Cygwin files for W32 GUI facilities, since these clearly don't
2029 expect Cygwin names.
2030 (_DebPrint): Define.
2031 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2032 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2033 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2034 (w32_last_error): Remove.
2035
2036 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2037
2038 * w32heap.c (syspage_mask): Declare here.
2039 (cache_system_info): Remove.
2040
2041 * w32inevt.c (faked_key): Define globally, not statically.
2042 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2043 (w32_console_toggle_lock_key): Move to w32fns.c.
2044
2045 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2046
2047 * w32proc.c (_DebPrint): Move to w32fns.c.
2048 * w32select.c: Include string.h, stdio.h for Cygwin.
2049 * w32select.h: New File.
2050
2051 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2052 get_osfhandle.
2053 (w32_message_fd): New variable. Under Cygwin, holds the file
2054 descriptor the system used to tell us about pending thread
2055 messages.
2056
2057 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2058 that prevented compilation under non-WINDOWSNT systems.
2059
2060 (w32_initialize): Open /dev/windows and assign it to
2061 w32_message_fd. Provide w32 feature.
2062
2063 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2064 (WM_EMACS_INPUT_READY): add.
2065 (prepend_msg, w32_message_fd): Declare globally.
2066
2067 * w32xfns.c:
2068 (keyboard_handle): Use only when WINDOWSNT.
2069 (notify_msg_ready): New function. Posts a message to the main
2070 thread's message queue under CYGWIN, which wakes up the main
2071 thread from select(2) by making the /dev/windows file descriptor
2072 ready. Under WINDOWSNT, it sets an event the same way the old
2073 code did.
2074
2075 (post, prepend_msg): Actually call notify_msg_ready instead of
2076 setting the input event directly.
2077
2078 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2079
2080 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2081 but it still has blocs in it, don't return it to the system,
2082 instead of aborting. (Bug#12402)
2083
2084 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2085
2086 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2087
2088 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2089 MAC_OS_X_VERSION_10_6.
2090 (syms_of_nsterm): Remove comment about Panther and above for
2091 ns-antialias-text.
2092 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2093 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2094 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2095
2096 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2097 MAC_OS_X_VERSION_10_4.
2098
2099 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2100 MAC_OS_X_VERSION_10_2.
2101
2102 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2103
2104 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2105 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2106
2107 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2108 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2109 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2110 Remove ns_in_resize check.
2111 (ns_clear_frame_area): Remove resize handle code.
2112
2113 * nsfns.m (ns_in_resize): Remove.
2114 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2115 Remove ns_in_resize check.
2116
2117 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 Improve sys_siglist detection.
2120 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2121 defined as a macro, as is done in Solaris.
2122 (sys_siglist_entries): New macro.
2123 (save_strsignal): Use it.
2124 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2125 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2126
2127 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2128
2129 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2130 fullscreen/Fullscreen.
2131
2132 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2133 tobar_height is new.
2134
2135 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2136 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2137 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2138 (windowDidResize:): Check for correct window if old style fullscreen.
2139 Capitalize word in comment. Remove incorrect comment.
2140 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2141 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2142 error in drawing background.
2143 (toggleFullScreen:): Remove comment. Rearrange calls.
2144 Set toolbar values to zero, save old height in tobar_height.
2145 Restore tool bar height when leaving fullscreen.
2146 (canBecomeMainWindow): New function.
2147
2148 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2149
2150 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2151
2152 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2153
2154 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2155
2156 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2157 that time stamps of directories could also be changed.
2158 Don't request the too broad GENERIC_WRITE, only the more restrictive
2159 FILE_WRITE_ATTRIBUTES access rights.
2160
2161 * fileio.c (Fset_file_times): Special-case ignoring errors for
2162 directories only on MSDOS, not on MS-Windows.
2163
2164 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2165
2166 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2167
2168 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2169
2170 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2171 see whether CreateFile failed.
2172
2173 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2174
2175 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2176 to avoid similar races.
2177 * keyboard.c (pending_signals): Now bool, not int.
2178
2179 Port timers to OpenBSD, plus check for timer failures.
2180 OpenBSD problem reported by Han Boetes.
2181 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2182 and/or setitimer.
2183 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2184 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2185 like OpenBSD, which has timer_settime but does not declare it.
2186 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2187 whether to use itimerspec-related primitives. All uses of
2188 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2189
2190 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2191
2192 * profiler.c (handle_profiler_signal): Fix a malloc race
2193 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2194
2195 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2196
2197 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2198
2199 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2200
2201 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2202 consistent with the change in return value of 'safe_strsignal'.
2203
2204 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 Prefer plain 'static' to 'static inline' (Bug#12541).
2207 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2208 (bidi_set_sor_type, bidi_push_embedding_level)
2209 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2210 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2211 (bidi_cache_search, bidi_cache_ensure_space)
2212 (bidi_cache_iterator_state, bidi_cache_find)
2213 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2214 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2215 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2216 Now 'static', not 'static inline'.
2217
2218 Count overruns when profiling; change units to ns.
2219 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2220 Give extra weight to samples after overruns, to attempt to count
2221 the time more accurately.
2222 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2223 the underlying primitives nominally do ns.
2224 (Fprofiler_cpu_start): Document the change. Mention that
2225 the sampling intervals are only approximate.
2226
2227 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2228
2229 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2230
2231 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2232 case for the special 0 coding-system.
2233
2234 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2235 (Fmake_overlay): Remove redundant tests.
2236 (fix_start_end_in_overlays): Remove redundant recentering.
2237
2238 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2239
2240 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2241 Update dependencies.
2242
2243 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2244
2245 Fix a malloc race condition involving strsignal.
2246 A signal can arrive in the middle of a malloc, and Emacs's signal
2247 handler can invoke strsignal, which can invoke malloc, which is
2248 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2249 Fix it by altering the signal handler so that it does not invoke
2250 strsignal.
2251 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2252 * process.c (status_message): Use const pointer, in case strsignal
2253 is #defined to safe_strsignal.
2254 * sysdep.c (sys_siglist, init_signals): Always define and
2255 initialize a substitute sys_siglist if the system does not define
2256 one, even if HAVE_STRSIGNAL.
2257 (safe_strsignal): Rename from strsignal. Always define,
2258 using sys_siglist. Return a const pointer.
2259 * syssignal.h (safe_strsignal): New decl.
2260 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2261
2262 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2263
2264 * w32proc.c (timer_loop): Fix code that waits for timer
2265 expiration, to avoid high CPU usage.
2266
2267 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2268
2269 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2270 (sweep_weak_table): Remove redundant prototypes.
2271
2272 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2273
2274 * emacs.c: Move the inclusion of TERM_HEADER after including
2275 windows.h on WINDOWSNT. This avoids compilation problems with
2276 MSVC.
2277
2278 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2279
2280 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2281 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2282 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2283 as the previous version used 'void *'.
2284
2285 * ralloc.c (ROUNDUP): Fix last change.
2286 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2287 'size_t'.
2288
2289 * w32proc.c <disable_itimers>: New static flag.
2290 (init_timers): Initialize it to zero, after creating the critical
2291 sections used by the timer threads.
2292 (term_timers): Set to 1 before deleting the critical sections.
2293 (getitimer, setitimer): If disable_itimers is non-zero, return an
2294 error indication without doing anything. Reported by Fabrice
2295 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2296 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2297 return results.
2298 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2299 support timers.
2300
2301 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2302 term_ntproc after all the other bookkeeping, to get timers working
2303 as long as possible.
2304
2305 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2306
2307 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2308 Suggested by Juri Linkov in
2309 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2310
2311 Prefer plain 'static' to 'static inline' (Bug#12541).
2312 With static functions, modern compilers inline pretty well by
2313 themselves; advice from programmers often hurts as much as it helps.
2314 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2315 this change shrinks the text size of the Emacs executable by 1.1%
2316 without affecting CPU significantly in my benchmark.
2317 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2318 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2319 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2320 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2321 (bset_auto_fill_function, bset_auto_save_file_format)
2322 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2323 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2324 (bset_cache_long_line_scans, bset_case_fold_search)
2325 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2326 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2327 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2328 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2329 (bset_header_line_format, bset_indicate_buffer_boundaries)
2330 (bset_indicate_empty_lines, bset_invisibility_spec)
2331 (bset_left_fringe_width, bset_major_mode, bset_mark)
2332 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2333 (bset_name, bset_overwrite_mode, bset_pt_marker)
2334 (bset_right_fringe_width, bset_save_length)
2335 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2336 (bset_scroll_up_aggressively, bset_selective_display)
2337 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2338 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2339 (set_buffer_overlays_after):
2340 * category.c (bset_category_table):
2341 * charset.c (read_hex):
2342 * coding.c (produce_composition, produce_charset)
2343 (handle_composition_annotation, handle_charset_annotation)
2344 (char_encodable_p):
2345 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2346 (assign_row, set_frame_matrix_frame, make_current)
2347 (add_row_entry):
2348 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2349 * fns.c (maybe_resize_hash_table):
2350 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2351 * gmalloc.c (register_heapinfo):
2352 * image.c (lookup_image_type):
2353 * intervals.c (set_interval_object, set_interval_left)
2354 (set_interval_right, copy_interval_parent, rotate_right)
2355 (rotate_left, balance_possible_root_interval):
2356 * keyboard.c (kset_echo_string, kset_kbd_queue)
2357 (kset_keyboard_translate_table, kset_last_prefix_arg)
2358 (kset_last_repeatable_command, kset_local_function_key_map)
2359 (kset_overriding_terminal_local_map, kset_real_last_command)
2360 (kset_system_key_syms, clear_event, set_prop):
2361 * lread.c (digit_to_number):
2362 * marker.c (attach_marker, live_buffer, set_marker_internal):
2363 * nsterm.m (ns_compute_glyph_string_overhangs):
2364 * process.c (pset_buffer, pset_command)
2365 (pset_decode_coding_system, pset_decoding_buf)
2366 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2367 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2368 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2369 * syntax.c (bset_syntax_table, dec_bytepos):
2370 * terminal.c (tset_param_alist):
2371 * textprop.c (interval_has_some_properties)
2372 (interval_has_some_properties_list):
2373 * window.c (wset_combination_limit, wset_dedicated)
2374 (wset_display_table, wset_hchild, wset_left_fringe_width)
2375 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2376 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2377 (wset_right_fringe_width, wset_right_margin_cols)
2378 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2379 (wset_vertical_scroll_bar_type, wset_window_parameters):
2380 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2381 (wset_column_number_displayed, wset_region_showing)
2382 (window_box_edges, run_window_scroll_functions)
2383 (append_glyph_string_lists, prepend_glyph_string_lists)
2384 (append_glyph_string, set_glyph_string_background_width)
2385 (append_glyph, append_composite_glyph)
2386 (take_vertical_position_into_account):
2387 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2388 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2389 (lface_hash, lface_same_font_attributes_p, lookup_face):
2390 * xml.c (libxml2_loaded_p):
2391 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2392 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2393 Now 'static', not 'static inline'.
2394
2395 * bidi.c: Tune.
2396 (bidi_copy_it): Do the whole copy with a single memcpy.
2397 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2398
2399 Revert the FOLLOW-SYMLINKS change for file-attributes.
2400 Doing it right would require several changes to Tramp, and there's
2401 not enough time to get that tested before the freeze today.
2402 * dired.c (directory_files_internal, Ffile_attributes):
2403 Undo last change.
2404
2405 * frame.c (x_report_frame_params): Port better to wider ints.
2406 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2407 or that pointers can be printed in 15 decimal digits.
2408 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2409
2410 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2411
2412 Support x64 build on MS-Windows.
2413 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2414 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2415 compatibility with x64.
2416 (x_get_focus_frame): Add prototype.
2417
2418 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2419 defining an XRectangle structure.
2420
2421 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2422 arithmetics for compatibility with x64.
2423
2424 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2425 compatibility with x64.
2426
2427 * w32heap.h: Adjust prototypes and declarations.
2428
2429 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2430 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2431 DWORD, long, and unsigned long, for compatibility with x64.
2432 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2433 (sbrk): Argument is now of type ptrdiff_t.
2434
2435 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2436 less than 0x0500.
2437 (w32_msg_pump): Use WPARAM type for 'result'.
2438
2439 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2440 architecture.
2441 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2442 compatibility with x64.
2443
2444 * vm-limit.c (lim_data): Now size_t.
2445 (check_memory_limits): Adjust prototypes of real_morecore and
2446 __morecore to receive argument of type ptrdiff_t. Use size_t for
2447 five_percent and data_size.
2448
2449 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2450 variables, for compatibility with x64.
2451 (rva_to_section, offset_to_section, relocate_offset)
2452 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2453 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2454 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2455 for compatibility with x64.
2456
2457 * sysdep.c (STDERR_FILENO): Define if not already defined.
2458
2459 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2460 (__morecore): Argument type is now ptrdiff_t.
2461 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2462 (relinquish): Use ptrdiff_t type for 'excess'.
2463 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2464
2465 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2466 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2467 instead of a literal number.
2468
2469 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2470 (min): Define only if not already defined.
2471
2472 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2473 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2474 hosts.
2475
2476 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2477 'bitmaps' is a pointer.
2478
2479 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2480
2481 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2482
2483 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2486 * dired.c (directory_files_internal, Ffile_attributes):
2487 New arg follow_symlinks. All uses changed.
2488
2489 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2490
2491 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2492
2493 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2494
2495 Support atimers and CPU profiler via profile.c on MS-Windows.
2496 * w32proc.c (sig_mask, crit_sig): New static variables.
2497 (sys_signal): Support SIGALRM and SIGPROF.
2498 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2499 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2500 sigfillset, and sigprocmask are no longer no-ops.
2501 (sigismember): New function.
2502 (struct itimer_data): New definition.
2503 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2504 (crit_prof): New static variables.
2505 (MAX_SINGLE_SLEEP): New definition.
2506 (timer_loop, stop_timer_thread, term_timers, init_timers)
2507 (start_timer_thread, getitimer, setitimer): New functions.
2508 (alarm): No longer a no-op, calls setitimer.
2509
2510 * w32.c (term_ntproc): Call term_timers.
2511 (init_ntproc): Make sure all signals are unblocked at startup, to
2512 erase any traces of dumping. Call init_timers.
2513
2514 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2515 Windows-specific code to display the hourglass mouse pointer is no
2516 longer used.
2517 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2518 to hourglass timer expiration.
2519 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2520 Remove, no longer used.
2521 (w32_note_current_window, show_hourglass, hide_hourglass):
2522 New functions, in support of hourglass cursor display similar to other
2523 window systems.
2524 (syms_of_w32fns): Don't initialize hourglass_timer.
2525
2526 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2527 WINDOWSNT as well.
2528 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2529
2530 * w32.h (init_timers, term_timers): Add prototypes.
2531
2532 2012-09-30 Kenichi Handa <handa@gnu.org>
2533
2534 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2535 to the buffer relocation which may be caused by ccl_driver.
2536
2537 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2538
2539 * xfns.c (Fx_file_dialog): Update comment.
2540
2541 * w32fns.c (Fx_file_dialog): Update comment.
2542
2543 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2544 Initialize panel name field if OSX >= 10.6.
2545
2546 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2547
2548 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2549
2550 * nsterm.m (NEW_STYLE_FS): New define.
2551 (ns_fullscreen_hook, windowWillEnterFullScreen)
2552 (windowDidEnterFullScreen, windowWillExitFullScreen)
2553 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2554 (setFSValue): New functions.
2555 (EmacsFSWindow): New implementation.
2556 (canBecomeKeyWindow): New function for EmacsFSWindow.
2557 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2558 (dealloc): Release nonfs_window if in fullscreen.
2559 (updateFrameSize:): Call windowDidMove to update top/left.
2560 (windowWillResize:toSize:): Check if frame is still maximized.
2561 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2562 next_maximized, maximized_width, maximized_height and nonfs_window.
2563 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2564 tbar_height.
2565 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2566 fullscreen. Set maximized_width/height. Act on next_maximized.
2567
2568 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2569 (EmacsView): Add variables for fullscreen.
2570 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2571 (EmacsFSWindow): New interface for fullscreen.
2572
2573 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2574
2575 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2576
2577 2012-09-30 Chong Yidong <cyd@gnu.org>
2578
2579 * fns.c (Frandom): Doc fix.
2580
2581 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2582
2583 * window.c (Vwindow_combination_limit): New default value.
2584 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2585
2586 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2589 Suggested by Eli Zaretskii in
2590 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2591
2592 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2593
2594 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2595 HAVE_TIMER_SETTIME is defined.
2596
2597 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2598
2599 Profiler improvements: more-accurate timers, overflow checks.
2600 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2601 signal.h, setjmp.h. Include systime.h instead.
2602 (saturated_add): New function.
2603 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2604 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2605 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2606 New static vars.
2607 (enum profiler_cpu_running): New enum.
2608 (profiler_cpu_running): Now of that enum type, not bool.
2609 All uses changed to store the new value.
2610 (handle_profiler_signal): Rename from sigprof_handler_1,
2611 for consistency with other handlers. Do not check whether
2612 cpu_log is a hash-table if garbage collecting, since it
2613 doesn't matter in that case.
2614 (deliver_profiler_signal): Rename from sigprof_handler,
2615 for consistency with other handlers.
2616 (setup_cpu_timer): New function, with much of what used to be in
2617 Fprofiler_cpu_start. Check for out-of-range argument.
2618 Prefer timer_settime if available, and prefer
2619 thread cputime clocks, then process cputime clocks, then
2620 monotonic clocks, to the old realtime clock. Use make_timeval
2621 to round more-correctly when falling back to setitimer.
2622 (Fprofiler_cpu_start): Use it.
2623 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2624 Don't assume that passing NULL as the 2nd argument of setitimer
2625 is the same as passing a pointer to all-zero storage.
2626 Ignore SIGPROF afterwards.
2627 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2628 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2629 non-fatal signal handlers. Ignore SIGPROF on startup.
2630 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2631 in profiler.c, since sysdep.c now uses it.
2632
2633 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2634 Suggested by Eli Zaretskii in
2635 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2636
2637 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2638
2639 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2640
2641 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2642
2643 * lisp.h (struct backtrace): Remove indirection for `function' field.
2644 * xdisp.c (redisplay_internal):
2645 * profiler.c (record_backtrace, sigprof_handler_1):
2646 * alloc.c (Fgarbage_collect):
2647 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2648 (Fbacktrace_frame): Adjust accordingly.
2649
2650 2012-09-28 Glenn Morris <rgm@gnu.org>
2651
2652 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2653 (Frun_hook_with_args_until_failure): Doc fixes.
2654
2655 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2656
2657 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2658 Qautomatic_redisplay and change the symbol name. All users changed.
2659
2660 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2661
2662 * profiler.c (sigprof_handler): Fix race condition.
2663
2664 2012-09-28 Glenn Morris <rgm@gnu.org>
2665
2666 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2667
2668 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2669
2670 Check more robustly for timer_settime.
2671 * Makefile.in (LIB_TIMER_TIME): New macro.
2672 (LIBES): Add it.
2673 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2674 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2675 call timer_settime.
2676
2677 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2678
2679 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2680
2681 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2682
2683 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2684
2685 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2686
2687 * character.h (MAYBE_UNIFY_CHAR): Remove.
2688 * charset.c, charset.h (maybe_unify_char): Now static.
2689 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2690 Since this stuff is now private to charset.c, there's no need for
2691 a public macro and no need to inline by hand.
2692
2693 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2694 Stefan Monnier <monnier@iro.umontreal.ca>
2695 Juanma Barranquero <lekktu@gmail.com>
2696
2697 * profiler.c: New file.
2698 * Makefile.in (base_obj): Add profiler.o.
2699 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2700 ($(BLD)/profiler.$(O)): New target.
2701 * emacs.c (main): Call syms_of_profiler.
2702 * alloc.c (Qautomatic_gc): New constant.
2703 (MALLOC_PROBE): New macro.
2704 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2705 (total_bytes_of_live_objects): New function.
2706 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2707 Call malloc_probe for the memory profiler.
2708 (syms_of_alloc): Define Qautomatic_gc.
2709 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2710 race condition.
2711 (struct backtrace): Move definition...
2712 * lisp.h (struct backtrace): ..here.
2713 (Qautomatic_gc, profiler_memory_running): Declare vars.
2714 (malloc_probe, syms_of_profiler): Declare functions.
2715 * xdisp.c (Qautomatic_redisplay): New constant.
2716 (redisplay_internal): Record itself in backtrace_list.
2717 (syms_of_xdisp): Define Qautomatic_redisplay.
2718
2719 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2720 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2721
2722 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2723
2724 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2725
2726 Prefer POSIX timers if available.
2727 They avoid a race if the timer is too close to the current time.
2728 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2729 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2730 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2731
2732 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2733
2734 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2735 CHAR_STRING_ADVANCE.
2736 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2737 STRING_CHAR_ADVANCE.
2738
2739 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2740
2741 Move Vlibrary_cache to emacs.c and reset before dumping.
2742
2743 * lisp.h (reset_image_types): Declare.
2744 [WINDOWSNT] (Vlibrary_cache): Declare.
2745
2746 * image.c (reset_image_types): New function.
2747
2748 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2749 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2750 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2751
2752 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2753 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2754
2755 * w32.h (Vlibrary_cache): Do not declare.
2756
2757 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2758
2759 * w32proc.c (sys_signal): Handle all signals defined by the
2760 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2761 handlers for signals supported by Windows. Don't override
2762 term_ntproc as the handler for SIGABRT.
2763 (sigaction): Rewrite to call sys_signal instead of duplicating its
2764 code.
2765 (sys_kill): Improve commentary.
2766
2767 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2768 consistency with a signature of a signal handler. All callers
2769 changed.
2770 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2771 install term_ntproc as a signal handler for SIGABRT, as that
2772 should be done by the dumped Emacs.
2773
2774 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2775
2776 * w32select.c (term_w32select): Protect against repeated
2777 invocation by setting clipboard_owner to NULL after calling
2778 DestroyWindow.
2779
2780 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2781 and term_ntproc to their modified signatures.
2782
2783 * character.c (char_string, string_char): Remove calls to
2784 MAYBE_UNIFY_CHAR. See the discussion starting at
2785 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2786 for the details.
2787
2788 2012-09-25 Chong Yidong <cyd@gnu.org>
2789
2790 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2791
2792 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2793
2794 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2795 when encountering an unknown bytecode.
2796
2797 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2798
2799 image.c, indent.c: Use bool for booleans.
2800 * dispextern.h (struct image_type): Members valid_p, load, init
2801 now return bool, not int. All uses changed.
2802 * image.c: Omit unnecessary static decls.
2803 (x_create_bitmap_mask, x_build_heuristic_mask):
2804 Return void, not int, since callers don't care about the return value.
2805 (x_create_bitmap_mask, define_image_type, valid_image_p)
2806 (struct image_keyword, parse_image_spec, image_spec_value)
2807 (check_image_size, image_background)
2808 (image_background_transparent, x_clear_image_1)
2809 (postprocess_image, lookup_image, x_check_image_size)
2810 (x_create_x_image_and_pixmap, xbm_image_p)
2811 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2812 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2813 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2814 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2815 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2816 (png_image_p, init_png_functions, png_load_body, png_load)
2817 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2818 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2819 (init_gif_functions, gif_load, imagemagick_image_p)
2820 (imagemagick_load_image, imagemagick_load, svg_image_p)
2821 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2822 (gs_load):
2823 * nsimage.m (ns_load_image):
2824 * nsterm.m (ns_defined_color):
2825 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2826 * xfns.c (x_defined_color):
2827 * xterm.c (x_alloc_lighter_color_for_widget)
2828 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2829 (x_alloc_lighter_color):
2830 * indent.c (disptab_matches_widthtab, current_column)
2831 (scan_for_column, string_display_width, indented_beyond_p)
2832 (compute_motion, vmotion, Fvertical_motion):
2833 Use bool for booleans.
2834
2835 2012-09-24 Chong Yidong <cyd@gnu.org>
2836
2837 * chartab.c (Fset_char_table_default): Obsolete function removed.
2838
2839 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2840
2841 Move pid_t related decls out of lisp.h.
2842 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2843 (interruptible_wait_for_termination):
2844 Move these decls from lisp.h to syswait.h, since they use pid_t.
2845 Needed on FreeBSD; see Herbert J. Skuhra in
2846 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2847 * callproc.c: Include syswait.h.
2848
2849 gnutls.c, gtkutil.c: Use bool for boolean.
2850 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2851 (emacs_gnutls_handle_error):
2852 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2853 (xg_hide_tooltip, xg_create_frame_widgets)
2854 (create_dialog, xg_uses_old_file_dialog)
2855 (xg_get_file_with_chooser, xg_get_file_with_selection)
2856 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2857 (xg_item_label_same_p, xg_update_menubar)
2858 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2859 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2860 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2861 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2862 (update_frame_tool_bar, free_frame_tool_bar):
2863 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2864 * nsmenu.m (ns_update_menubar):
2865 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2866 * xfns.c (Fx_show_tip) [USE_GTK]:
2867 Use bool for boolean.
2868 * gtkutil.c (xg_update_frame_menubar):
2869 * xmenu.c (update_frame_menubar):
2870 Return void, not int, since caller ignores return value.
2871 * gtkutil.c (xg_change_toolbar_position):
2872 Return void, not 1.
2873
2874 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2875
2876 * makefile.w32-in (BLOCKINPUT_H): Remove.
2877 (SYSSIGNAL_H): New macro.
2878 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2879 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2880 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2881 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2882 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2883 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2884 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2885 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2886 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2887 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2888 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2889 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2890 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2891 ($(BLD)/w32xfns.$(O)): Update dependencies.
2892
2893 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2894
2895 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2896 fatal_error_backtrace.
2897
2898 * w32proc.c (sys_kill): Undo last change: don't do anything when
2899 invoked to deliver SIGABRT to our own process. This is now
2900 handled by emacs_raise.
2901
2902 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2903
2904 * w32term.c (w32_read_socket): Remove leftover reference to
2905 interrupt_input_pending.
2906
2907 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 Do not use SA_NODEFER.
2910 Problem reported by Dani Moncayo in
2911 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2912 * alloc.c (die):
2913 * sysdep.c (emacs_abort): Do not reset signal handler.
2914 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2915 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2916 wanted even on POSIXish hosts, and it doesn't work on Windows.
2917
2918 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2919
2920 * xterm.c (x_term_init): Call fixup_locale before and after calling
2921 gtk_init (Bug#12392).
2922
2923 2012-09-23 Chong Yidong <cyd@gnu.org>
2924
2925 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2926 Vdynamic_library_alist.
2927
2928 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2929 (Fgnutls_available_p): Caller changed.
2930
2931 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2932 (Flibxml_parse_xml_region): Likewise.
2933
2934 * dispextern.h (struct image_type): Remove arg from init function.
2935
2936 * image.c (Finit_image_library, lookup_image_type)
2937 (define_image_type): Remove now-unneeded second arg.
2938 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2939 (init_tiff_functions, init_gif_functions, init_svg_functions):
2940 Arglist and w32_delayed_load calling convention changed.
2941 (gs_type): Remove init_gs_functions; there is no such function.
2942 (valid_image_p, make_image): Fix caller to lookup_image_type.
2943
2944 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2945
2946 Simplify and avoid signal-handling races (Bug#12471).
2947 * alloc.c (die):
2948 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2949 Avoid recursive loop if there's a fatal error in the function itself.
2950 * atimer.c (pending_atimers):
2951 * blockinput.h: Don't include "atimer.h"; no longer needed.
2952 (interrupt_input_pending): Remove. All uses removed.
2953 pending_signals now counts both atimers and ordinary interrupts.
2954 This is less racy than having three separate pending-signal flags.
2955 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2956 (input_blocked_p):
2957 Rename from their upper-case counterparts BLOCK_INPUT,
2958 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2959 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2960 This makes it easier to access volatile variables more accurately.
2961 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2962 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2963 that's more reliable if the code is buggy and sets
2964 interrupt_input_blocked to a negative value. All uses changed.
2965 * atimer.c (deliver_alarm_signal):
2966 Remove. No need to deliver this to the parent; any thread can
2967 handle this signal now. All uses replaced by underlying handler.
2968 * atimer.c (turn_on_atimers):
2969 * dispnew.c (handle_window_change_signal):
2970 * emacs.c (handle_danger_signal):
2971 * keyboard.c (kbd_buffer_get_event):
2972 Don't reestablish signal handler; not needed with sigaction.
2973 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2974 (UNBLOCK_INPUT_TO):
2975 Rework to avoid unnecessary accesses to volatile variables.
2976 (UNBLOCK_INPUT_TO): Now a function.
2977 (totally_unblock_input, unblock_input): New decls.
2978 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2979 (init_data): Remove. Necessary stuff now done in init_signal.
2980 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2981 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2982 (fatal_error_code): Remove; no longer needed.
2983 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2984 it doesn't always backtrace. All uses changed. No need to reset
2985 signal to default, since sigaction and/or die does that for us now.
2986 Use emacs_raise (FOO), not kill (getpid (), FOO).
2987 (main): Check more-accurately whether we're dumping.
2988 Move fatal-error setup to sysdep.c
2989 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2990 * gtkutil.c (xg_get_file_name, xg_get_font):
2991 Remove no-longer-needed signal-mask manipulation.
2992 * keyboard.c, process.c (POLL_FOR_INPUT):
2993 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2994 * keyboard.c (read_avail_input): Remove.
2995 All uses replaced by gobble_input.
2996 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2997 (kbd_buffer_store_event_hold, gobble_input):
2998 (record_asynch_buffer_change) [USABLE_SIGIO]:
2999 (store_user_signal_events):
3000 No need to mess with signal mask.
3001 (gobble_input): If blocking input and there are terminals, simply
3002 set pending_signals to 1 and return. All hooks changed to not
3003 worry about whether input is blocked.
3004 (process_pending_signals): Clear pending_signals before processing
3005 them, in case a signal comes in while we're processing.
3006 By convention callers now test pending_signals before calling us.
3007 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3008 New functions, to support changes to blockinput.h.
3009 (handle_input_available_signal): Now extern.
3010 (reinvoke_input_signal): Remove. All uses replaced by
3011 handle_async_input.
3012 (quit_count): Now volatile, since a signal handler uses it.
3013 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3014 All callers changed. Block SIGINT only if not already blocked.
3015 Clear sigmask reliably, even if Fsignal returns, which it can.
3016 Omit unnecessary accesses to volatile var.
3017 (quit_throw_to_read_char): No need to restore sigmask.
3018 * keyboard.c (gobble_input, handle_user_signal):
3019 * process.c (wait_reading_process_output):
3020 Call signal-handling code rather than killing ourselves.
3021 * lisp.h: Include <float.h>, for...
3022 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3023 (pending_signals): Now volatile.
3024 (syms_of_data): Now const if IEEE floating point.
3025 (handle_input_available_signal) [USABLE_SIGIO]:
3026 (terminate_due_to_signal, record_child_status_change): New decls.
3027 * process.c (create_process): Avoid disaster if memory is exhausted
3028 while we're processing a vfork, by tightening the critical section
3029 around the vfork.
3030 (send_process_frame, process_sent_to, handle_pipe_signal)
3031 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3032 ignores SIGPIPE.
3033 (send_process): No need for setjmp/longjmp any more, since the
3034 SIGPIPE stuff is now gone. Instead, report an error if errno
3035 is EPIPE.
3036 (record_child_status_change): Now extern. PID and W are now args.
3037 Return void, not bool. All callers changed.
3038 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3039 Remove. All uses removed. This bug should be fixed now in a
3040 different way.
3041 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3042 and record the child status change directly. This avoids the
3043 need to futz with the signal mask.
3044 (process_fatal_action): Move here from emacs.c.
3045 (emacs_sigaction_flags): New function, containing
3046 much of what used to be in emacs_sigaction_init.
3047 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3048 caught by emacs, to make races less likely.
3049 (deliver_process_signal): Rename from handle_on_main_thread.
3050 All uses changed.
3051 (BACKTRACE_LIMIT_MAX): Now at top level.
3052 (thread_backtrace_buffer, threadback_backtrace_pointers):
3053 New static vars.
3054 (deliver_thread_signal, deliver_fatal_thread_signal):
3055 New functions, for more-accurate delivery of thread-specific signals.
3056 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3057 (deliver_arith_signal): Handle in this thread, not
3058 in the main thread, since it's triggered by this thread.
3059 (maybe_fatal_sig): New function.
3060 (init_signals): New arg DUMPING so that we can be more accurate
3061 about whether we're dumping. Caller changed.
3062 Treat thread-specific signals differently from process-general signals.
3063 Block all signals while handling fatal error; that's safer.
3064 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3065 on IEEE hosts.
3066 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3067 Ignore SIGPIPE unless batch.
3068 (emacs_backtrace): Output backtrace for the appropriate thread,
3069 which is not necessarily the main thread.
3070 * syssignal.h: Include <stdbool.h>.
3071 (emacs_raise): New macro.
3072 * xterm.c (x_connection_signal): Remove; no longer needed
3073 now that we use sigaction.
3074 (x_connection_closed): No need to mess with sigmask now.
3075 (x_initialize): No need to reset SIGPIPE handler here, since
3076 init_signals does this for us now.
3077
3078 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3079
3080 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3081 background rect may be larger (Bug#12245).
3082
3083 2012-09-23 Chong Yidong <cyd@gnu.org>
3084
3085 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3086
3087 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * .gdbinit: Just stop at fatal_error_backtrace.
3090 See Stefan Monnier's request in
3091 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3092 Remove no-longer-used query of system type.
3093
3094 2012-09-22 Chong Yidong <cyd@gnu.org>
3095
3096 * search.c (Freplace_match): Doc fix (Bug#12325).
3097
3098 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3099
3100 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3101 (Fline_end_position): Doc fix.
3102
3103 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3104
3105 2012-09-22 Chong Yidong <cyd@gnu.org>
3106
3107 * dispextern.h (struct image_type): Add new slot, storing a type
3108 initialization function.
3109
3110 * image.c (define_image_type): Call the image initializer function
3111 if it is defined. Arguments and return value changed.
3112 (valid_image_p, make_image): Callers changed.
3113 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3114 (gif_type, imagemagick_type, svg_type, gs_type):
3115 Add initialization functions.
3116 (Finit_image_library): Call lookup_image_type.
3117 (CHECK_LIB_AVAILABLE): Macro deleted.
3118 (lookup_image_type): Call define_image_type here, rather than via
3119 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3120 (syms_of_image): Move define_image_type calls for xbm_type and
3121 pbm_type to lookup_image_type.
3122
3123 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3124
3125 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3126 'idle_timers' from here ...
3127 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3128 lists, to avoid infloops when the timer does something stupid,
3129 like reinvoke itself with the same or smaller time-out.
3130 (Bug#12447)
3131
3132 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3133
3134 * window.c (Fsplit_window_internal): Handle only Qt value of
3135 Vwindow_combination_limit separately.
3136 (Qtemp_buffer_resize): New symbol.
3137 (Vwindow_combination_limit): New default value.
3138 Rewrite doc-string.
3139
3140 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3141
3142 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3143 the new overlay string. (Bug#10159)
3144
3145 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3148 or that fprintf is async-signal-safe. POSIX doesn't require
3149 either assumption.
3150
3151 2012-09-22 Chong Yidong <cyd@gnu.org>
3152
3153 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3154 (Bug#8207).
3155
3156 2012-09-22 Kenichi Handa <handa@gnu.org>
3157
3158 * composite.c (composition_reseat_it): Handle the case that a
3159 grapheme cluster is not covered by a single font (Bug#12352).
3160
3161 2012-09-21 Chong Yidong <cyd@gnu.org>
3162
3163 * image.c (define_image_type): Avoid adding duplicate types to
3164 image_types (Bug#12463). Suggested by Jörg Walter.
3165
3166 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3167
3168 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3169 (print_load_command_name): Add case LC_DATA_IN_CODE.
3170 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3171
3172 2012-09-21 Glenn Morris <rgm@gnu.org>
3173
3174 * eval.c (Frun_hook_with_args_until_success)
3175 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3176
3177 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3178
3179 * fileio.c (Ffile_selinux_context): Only call freecon when
3180 lgetfilecon succeeded.
3181 (Fset_file_selinux_context): Likewise. (Bug#12444)
3182
3183 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3184
3185 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3186 reordering, locate the cursor by calling set_cursor_from_row; if
3187 that fails, clear the desired glyph matrix before returning a
3188 failure indication to the caller. Fixes leaving garbled display
3189 when fast scrolling with a down-key. (Bug#12403)
3190 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3191 scrolling through multibyte text.
3192
3193 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3194
3195 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3196 calling mark_vectorlike since that's the one that marks the window.
3197 (mark_discard_killed_buffers): Mark the final cdr.
3198 * window.h (struct window): Move prev/next_buffers to the
3199 non-standard fields.
3200 * window.c (make_window): Initialize prev/next_buffers manually.
3201
3202 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3203
3204 Omit unused arg EXPECTED from socket hooks.
3205 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3206 * nsterm.m (ns_term_init):
3207 * termhooks.h (struct terminal.read_socket_hook):
3208 * w32inevt.c (w32_console_read_socket):
3209 * w32term.c (w32_read_socket):
3210 * xterm.c (XTread_socket):
3211 Omit unused arg EXPECTED. All callers changed.
3212 (store_user_signal_events): Return void, not int, since callers no
3213 longer care about the return value. All uses changed.
3214
3215 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3216
3217 * w32gui.h (XParseGeometry): Do not declare.
3218
3219 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3220
3221 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3222 Ignore 'expected'. See Eli Zaretskii in
3223 <http://bugs.gnu.org/12471#8> (last line).
3224
3225 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3226 (XParseGeometry): Now static. Substitute extremal values for
3227 values that are out of range.
3228
3229 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3230
3231 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3232
3233 * nsfns.m (XParseGeometry): Remove.
3234 (Fx_create_frame): Call x_set_offset to correctly interpret
3235 top_pos in geometry.
3236
3237 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3238 (Fx_parse_geometry): If there is a space in string, call
3239 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3240
3241 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3242
3243 * search.c (scan_buffer): Use character positions in calls to
3244 region_cache_forward and region_cache_backward, not byte
3245 positions. (Bug#12196)
3246
3247 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3248 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3249
3250 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3251 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3252 emacs_blocked_malloc, now deleted.
3253
3254 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3255
3256 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3257 The workaround was for improving performance on Solaris 2.4, but
3258 is getting in the way now. Emacs will still work if someone is
3259 still running Solaris 2.4 in a museum somewhere; Sun dropped
3260 support for Solaris 2.4 in 2003.
3261 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3262 * process.c (create_process) [HAVE_WORKING_VFORK]:
3263 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3264 since Emacs no longer uses vfork on that platform.
3265
3266 2012-09-17 Glenn Morris <rgm@gnu.org>
3267
3268 * emacs.c: Use COPYRIGHT.
3269
3270 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 Remove configure's --without-sync-input option (Bug#12450).
3273 When auditing signal-handling in preparation for cleaning it up,
3274 I found that SYNC_INPUT has race conditions and would be a real
3275 pain to fix. Since it's an undocumented and deprecated
3276 configure-time option, now seems like a good time to remove it.
3277 Also see <http://bugs.gnu.org/11080#16>.
3278 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3279 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3280 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3281 (malloc_hysteresis):
3282 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3283 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3284 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3285 (dont_register_blocks, bytes_used_when_reconsidered)
3286 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3287 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3288 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3289 Remove. All uses removed.
3290 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3291 implementation, one that depends on whether the new macro
3292 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3293 is defined.
3294 * atimer.c (run_timers, handle_alarm_signal):
3295 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3296 (handle_async_input, process_pending_signals)
3297 (handle_input_available_signal, init_keyboard):
3298 * nsterm.m (ns_read_socket):
3299 * process.c (wait_reading_process_output):
3300 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3301 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3302 (emacs_write):
3303 * xterm.c (XTread_socket):
3304 Assume SYNC_INPUT.
3305 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3306 * eval.c (handling_signal): Remove. All uses removed.
3307 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3308 All uses replaced with the SYNC_INPUT version.
3309 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3310 Remove decls.
3311 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3312 Now static.
3313
3314 * font.c (Ffont_shape_gstring): Remove unused local.
3315
3316 2012-09-16 Glenn Morris <rgm@gnu.org>
3317
3318 * Makefile.in (clean): No longer run nextstep's clean.
3319
3320 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3321 (ns_frag): Remove.
3322 (ns-app): Move here from ns.mk, and simplify.
3323 (clean): Simplify nextstep entry.
3324 * ns.mk: Remove file.
3325
3326 2012-09-17 Kenichi Handa <handa@gnu.org>
3327
3328 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3329 not covert the last few charactes.
3330
3331 2012-09-16 Kenichi Handa <handa@gnu.org>
3332
3333 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3334 here, but just check the validity of glyphs in the glyph-string.
3335
3336 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3337
3338 * window.c (Fwindow_parameter, Fset_window_parameter):
3339 Accept any window as argument (Bug#12452).
3340
3341 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3342
3343 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3344 to ns_term_init to avoid memory leak.
3345
3346 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3347 explicit retain/release.
3348 (ns_term_init): Only allow one display. Initialize outerpool and
3349 ns_*_types.
3350
3351 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3352
3353 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3354 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3355 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3356 the Microsoft problem in a different way, by altering ../nt/config.nt.
3357
3358 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3359
3360 * w32xfns.c:
3361 * w32uniscribe.c:
3362 * w32term.c:
3363 * w32select.c:
3364 * w32reg.c:
3365 * w32proc.c:
3366 * w32menu.c:
3367 * w32inevt.c:
3368 * w32heap.c:
3369 * w32font.c:
3370 * w32fns.c:
3371 * w32console.c:
3372 * w32.c:
3373 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3374 by lisp.h. This completes removal of setjmp.h inclusion
3375 erroneously announced in the previous commit. (Bug#12446)
3376
3377 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3378 more accurate.
3379
3380 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3381 not defined as a macro. The latter happens on MS-Windows.
3382 (Bug#12446)
3383
3384 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3387 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3388 Some instances of '#include <setjmp.h>' removed, if the
3389 only reason for the instance was because "lisp.h" was included.
3390 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3391 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3392 and _longjmp with the new symbols. Emacs already uses _setjmp if
3393 available, so this change affects only POSIXish hosts that have
3394 sigsetjmp but not _setjmp, such as some versions of Solaris and
3395 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3396 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3397 (png_load_body) [HAVE_PNG]:
3398 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3399 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3400 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3401 since PNG requires jmp_buf. This is the only exception to the
3402 general rule that we now use sys_setjmp and sys_longjmp.
3403 This exception is OK since this code does not change the signal
3404 mask or longjmp out of a signal handler.
3405
3406 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3407
3408 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3409 Include "syssignal.h", for 'main_thread'.
3410
3411 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3412
3413 Avoid out-of-range marker position (Bug#12426).
3414 * insdel.c (replace_range, replace_range_2):
3415 Adjust markers before overlays, as suggested by comments.
3416 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3417 Remove redundant check before calling offset_intervals.
3418
3419 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3420
3421 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3422 current buffer (Bug#12387).
3423
3424 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3425
3426 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3427
3428 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3429
3430 Use a more backwards-compatible timer format (Bug#12430).
3431 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3432 vector element, not from the 4th, since PSECS is now at the end.
3433 (Fcurrent_idle_time): Doc fix.
3434
3435 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3436
3437 Function to mark objects and remove killed buffers at once.
3438 * alloc.c (discard_killed_buffers): Rename to ...
3439 (mark_discard_killed buffers) ... new name. Add marking
3440 of remaining objects. Fix comment. Adjust users.
3441 (mark_object): Do not touch frame buffer lists here.
3442 * frame.c (delete_frame): Reset frame buffer lists here.
3443
3444 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3445
3446 Better workaround for GNOME bug when --enable-gcc-warnings.
3447 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3448 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3449 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3450
3451 Simplify SIGIO usage (Bug#12408).
3452 The code that dealt with SIGIO was crufty and confusing, e.g., it
3453 played tricks like "#undef SIGIO" but these tricks were not used
3454 consistently. Simplify mostly by not #undeffing standard symbols,
3455 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3456 or not as we please) rather than "defined SIGIO" (standard symbol
3457 that we probably shouldn't #undef).
3458 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3459 Modules that need it can include it.
3460 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3461 * dispextern.h (ignore_sigio): New decl.
3462 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3463 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3464 * emacs.c (shut_down_emacs):
3465 * keyboard.c (kbd_buffer_store_event_hold):
3466 Use ignore_sigio rather than invoking 'signal' directly.
3467 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3468 for FIONREAD.
3469 (FIONREAD, SIGIO): Do not #undef.
3470 (tty_read_avail_input): Use #error rather than a syntax error.
3471 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3472 for I_PIPE, used by SETUP_SLAVE_PTY.
3473 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3474 * sysdep.c (croak): Remove; no longer needed. This bit of
3475 temporary code, with Fred N. Fish's comment that it's temporary,
3476 has been in Emacs since at least 1992!
3477 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3478 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3479 * syssignal.h (croak): Remove decl.
3480 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3481 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3482 now that we're termios-only.
3483 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3484 * term.c (dissociate_if_controlling_tty): Use #error rather than
3485 a run-time error.
3486
3487 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3488 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3489 to work around GNOME bug 683906.
3490 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3491 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3492 This works around GCC bug 54561.
3493
3494 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3495
3496 More fixes for 'volatile' and setjmp/longjmp.
3497 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3498 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3499 (png_load_body) [HAVE_PNG]:
3500 (jpeg_load_body) [HAVE_JPEG]:
3501 New function, with most of the old parent function's body.
3502 (png_load) [HAVE_PNG]:
3503 (jpeg_load) [HAVE_JPEG]:
3504 Invoke the new function, to avoid longjmp munging our locals.
3505 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3506 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3507 longjmp is passed 2, as the C standard doesn't guarantee this.
3508 Instead, store the failure code into mgr->failure_code.
3509
3510 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3511
3512 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3513 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3514 (syms_of_keyboard): Remove support for unread-command-char.
3515
3516 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3517
3518 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3519 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3520 violation. (Bug#12426)
3521
3522 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3525
3526 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3527
3528 * eval.c: Add `inhibit-debugger'.
3529 (Qinhibit_debugger): New symbol.
3530 (call_debugger): Bind it instead of Qdebug_on_error.
3531 (maybe_call_debugger): Test Vinhibit_debugger.
3532 (syms_of_eval): Define inhibit-debugger.
3533 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3534 (syms_of_xdisp): Remove inhibit-debug-on-message.
3535
3536 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3537
3538 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3539 If a nonvolatile local variable is written before a _longjmp to
3540 the frame containing the variable, and is read after the _longjmp,
3541 the value read is indeterminate. Some local variables of type
3542 'struct handler' and 'struct catchtag' are used in this way, so
3543 mark each of their slots as volatile if the slot can be set before
3544 _longjmp and read afterwards.
3545 * lisp.h (struct handler): var and chosen_clause are now volatile.
3546 (struct catchtag): val, next, and pdlcount are now volatile.
3547
3548 * bidi.c (bidi_push_it, bidi_pop_it):
3549 * fns.c (copy_hash_table):
3550 * image.c (define_image_type):
3551 * keyboard.c (kbd_buffer_store_event_hold):
3552 * process.c (Fprocess_send_eof):
3553 * xfaces.c (x_create_gc) [HAVE_NS]:
3554 * xgselect.c (xg_select):
3555 Prefer assignment to memcpy when either will do.
3556
3557 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3558 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3559 time an item is removed. No need to mark this function 'inline';
3560 the compiler knows better than we do.
3561
3562 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3563
3564 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3565 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3566 to change_frame_size (Bug#12388).
3567 (windowDidResize:): Pass YES to updateFrameSize.
3568
3569 * nsterm.h: Add delay parameter to updateFrameSize.
3570
3571 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3572
3573 Discard killed buffers from deleted window and frame objects.
3574 This reduces an amount of references to killed buffers and
3575 helps GC to reclaim them faster.
3576 * alloc.c (discard_killed_buffers): New function.
3577 (mark_object): Use it for deleted windows and frames.
3578 (mark_object): If symbol's value is set up for a killed buffer
3579 or deleted frame, restore its global binding.
3580 * data.c (swap_in_global_binding): Add GC notice.
3581 (swap_in_symval_forwarding): Use convenient set_blv_where.
3582 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3583 * window.h: ... to here.
3584
3585 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3586
3587 Convenient macro to check whether the buffer is live.
3588 * buffer.h (BUFFER_LIVE_P): New macro.
3589 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3590 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3591
3592 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3593
3594 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3595 composition cases (Bug#12364).
3596
3597 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3598 overhang of succeeding glyphs overlapping box cursor.
3599
3600 * w32term.c (x_draw_glyph_string): Likewise.
3601
3602 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3603
3604 Simplify, document, and port floating-point (Bug#12381).
3605 The porting part of this patch fixes bugs on non-IEEE platforms
3606 with frexp, ldexp, logb.
3607 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3608 Now static.
3609 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3610 support, by removing commented-out code and briefly listing the
3611 C89 functions excluded. The commented-out stuff was confusing
3612 maintenance, e.g., we thought we needed cbrt but it was commented out.
3613 (logb): Remove decl; no longer needed.
3614 (isfinite): New macro, if not already supplied.
3615 (isnan): Don't replace any existing macro.
3616 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3617 are present on all C89 platforms.
3618 (Ffrexp): Do not special-case zero, as frexp does the right thing
3619 for that case.
3620 (Flogb): Do not use logb, as it doesn't have the desired meaning
3621 on hosts that use non-base-2 floating point. Instead, stick with
3622 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3623 frexp, to avoid getting an unspecified result.
3624
3625 * xdisp.c (Qinhibit_debug_on_message): Now static.
3626
3627 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3630 NSBezierPath (Bug#12131).
3631
3632 2012-09-10 Chong Yidong <cyd@gnu.org>
3633
3634 * fns.c (Fdelq, Fdelete): Doc fix.
3635
3636 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3637
3638 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3639 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3640
3641 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3642
3643 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3644 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3645 Use it.
3646
3647 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3648
3649 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3650 left fringe if the window has a left margin. This avoids leaving
3651 traces of the cursor because its leftmost pixel is not drawn over.
3652
3653 * dispnew.c (update_window_line): When the left margin area of a
3654 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3655 that screen line. (Bug#12277)
3656
3657 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3658
3659 Assume C89 or later for math functions (Bug#12381).
3660 This simplifies the code, and makes it a bit smaller and faster,
3661 and (most important) makes it easier to clean up signal handling
3662 since we can stop worring about floating-point exceptions in
3663 library code. That was a problem before C89, but the problem
3664 went away many years ago on all practical Emacs targets.
3665 * data.c, image.c, lread.c, print.c:
3666 Don't include <math.h>; no longer needed.
3667 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3668 might be autoconfigured, as that never happens.
3669 * data.c (fmod):
3670 * doprnt.c (DBL_MAX_10_EXP):
3671 * print.c (DBL_DIG):
3672 Remove. C89 or later always defines these.
3673 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3674 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3675 (arith_error, domain_error, domain_error2):
3676 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3677 no longer needed -- we simply return what C returns. All uses removed.
3678 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3679 the wrapped code.
3680 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3681 Remove. All uses expanded, as these macros are no longer used
3682 more than once and are now more trouble than they're worth.
3683 (Ftan): Use tan, not sin / cos.
3684 (Flogb): Assume C89 frexp.
3685 (fmod_float): Assume C89 fmod.
3686 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3687 (init_floatfns): Remove. All uses removed.
3688
3689 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3690
3691 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3692 compositeToPoint for OSX < 10.6 (Bug#12390).
3693
3694 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3695
3696 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3697 This produces more-accurate results.
3698
3699 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3700
3701 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3702 changes (Bug#12088).
3703
3704 2012-09-08 Chong Yidong <cyd@gnu.org>
3705
3706 * syntax.c (Fstring_to_syntax): Doc fix.
3707
3708 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3709
3710 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3711 in the internal border.
3712 (x_set_window_size): Remove static variables and their usage.
3713 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3714 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3715 Remove fringe/internal border adjustment (Bug#11052).
3716 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3717 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3718 (ns_fix_rect_ibw): Remove.
3719 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3720 (ns_dumpglyphs_box_or_relief): Ditto.
3721 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3722 adjustment.
3723 (ns_dumpglyphs_image): Ditto.
3724 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3725 border adjustment.
3726 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3727 their usage. Add fringe_extended_p and its use as in other terms.
3728 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3729 scroll bar was removed.
3730 (updateFrameSize): New function.
3731 (windowDidResize): Move code to updateFrameSize and call it.
3732
3733 * nsterm.h (EmacsView): Add updateFrameSize.
3734
3735 2012-09-07 Chong Yidong <cyd@gnu.org>
3736
3737 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3738
3739 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3740
3741 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3742
3743 More signal-handler cleanup (Bug#12327).
3744 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3745 Problem introduced when merging patches. Noted by Eli Zaretskii in
3746 <http://bugs.gnu.org/12327#67>.
3747 * floatfns.c: Comment fix.
3748 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3749 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3750 and anyway the declaration is harmless even if SIGDANGER is not defined.
3751 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3752 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3753 source files not surprisingly expected syssignal.h to define, or
3754 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3755 Include <sys/ioctl.h>, for FIONREAD.
3756 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3757 This eliminates a problem whereby other files mysteriously had
3758 to include "syssignal.h" before including "systty.h" if they
3759 wanted to use "#ifdef SIGIO".
3760
3761 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3762
3763 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3764
3765 * w32.c (sigemptyset): Empty the set.
3766 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3767
3768 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3769
3770 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3771
3772 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3773 (mark_object): Likewise for frame objects.
3774
3775 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3776
3777 * syssignal.h (handle_on_main_thread): Always declare,
3778 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3779 This ports to platforms without HAVE_PTHREAD.
3780
3781 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3782
3783 Signal-handler cleanup (Bug#12327).
3784 Emacs's signal handlers were written in the old 4.2BSD style with
3785 sigblock and sigmask and so forth, and this led to some
3786 inefficiencies and confusion. Rewrite these to use
3787 pthread_sigmask etc. without copying signal sets around. Also,
3788 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3789 'signal', and instead use functions that do not attempt to take
3790 over the system name space. This patch causes Emacs's text
3791 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3792 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3793 Do not include <signal.h> or "syssignal.h", as these
3794 modules do not use signals.
3795 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3796 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3797 Do not include <signal.h>, as "syssignal.h" does that for us now.
3798 * atimer.c (sigmask_atimers): New function.
3799 (block_atimers, unblock_atimers): New functions,
3800 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3801 All uses replaced.
3802 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3803 no longer needed here.
3804 * emacs.c (main): Inspect existing signal handler with sigaction,
3805 so that there's no need to block and unblock SIGHUP.
3806 * sysdep.c (struct save_signal): New member 'action', replacing
3807 old member 'handler'.
3808 (save_signal_handlers, restore_signal_handlers):
3809 Use sigaction instead of 'signal' to save and restore.
3810 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3811 New function. All users of 'signal' modified to use set_sighandler
3812 if they're writeonly, and to use sys_signal if they're read+write.
3813 (emacs_sigaction_init, forwarded_signal): New functions.
3814 (sys_signal): Remove. All uses replaced by calls to sigaction
3815 and emacs_sigaction_init, or by direct calls to 'signal'.
3816 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3817 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3818 all uses replaced by pthread_sigmask etc. calls.
3819 * syssignal.h: Include <signal.h>.
3820 (emacs_sigaction_init, forwarded_signal): New decls.
3821 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3822 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3823 (sigmask, sys_sigmask): Remove; no longer needed.
3824 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3825 (sigblock, sigunblock, sigfree):
3826 (sigsetmask) [!defined sigsetmask]:
3827 Remove. All uses replaced by pthread_sigmask.
3828 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3829 no longer need to be replaced, and its typical old uses
3830 are now done via emacs_sigaction_init and sigaction.
3831 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3832 (sys_sigdel): Remove; unused.
3833 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3834
3835 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3836
3837 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3838 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3839
3840 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3841
3842 Explicitly mark buffer_defaults and buffer_local_symbols.
3843 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3844 mark_local_symbols here.
3845 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3846 since special buffers aren't marked here any more.
3847 (allocate_buffer): Chain new buffer with all_buffers here...
3848 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3849 not here.
3850 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3851 (syms_of_buffer): Remove staticpro of the above.
3852 (init_buffer_once): Set names for buffer_defaults and
3853 buffer_local_symbols.
3854
3855 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3856
3857 Use bool for booleans in font-related modules.
3858 * font.c (font_intern_prop, font_style_to_value)
3859 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3860 (generate_otf_features, font_check_otf_features, font_check_otf)
3861 (font_match_p, font_list_entities, font_at):
3862 * fontset.c (fontset_id_valid_p, reorder_font_vector
3863 (fontset_find_font, Fset_fontset_font)
3864 (face_suitable_for_char_p) [0]:
3865 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3866 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3867 (m17n_flt_initialized, ftfont_shape_by_flt):
3868 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3869 * nsfont.m (nsfont_draw):
3870 * w32font.c (w32font_draw):
3871 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3872 Use bool for booleans.
3873 * font.h: Adjust to above API changes.
3874 (struct font, struct font_driver, struct font_driver_list):
3875 Use bool for booleans.
3876 (struct font): Remove useless member encoding_type.
3877 All users removed.
3878 * fontset.c, xftfont.c: Omit unnecessary static decls.
3879
3880 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3881
3882 * alloc.c (mark_object): Revert window marking code
3883 since it's unsafe for the Fset_window_configuration.
3884
3885 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 Fix race conditions with signal handlers and errno (Bug#12327).
3888 Be more systematic about preserving errno whenever a signal
3889 handler returns, even if it's not in the main thread. Do this by
3890 renaming signal handlers to distinguish between signal delivery
3891 and signal handling. All uses changed.
3892 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3893 * data.c (deliver_arith_signal): Rename from arith_error.
3894 * dispnew.c (deliver_window_change_signal): Rename from
3895 window_change_signal.
3896 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3897 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3898 * keyboard.c (deliver_input_available_signal): Rename from
3899 input_available_signal.
3900 (deliver_user_signal): Rename from handle_user_signal.
3901 (deliver_interrupt_signal): Rename from interrupt_signal.
3902 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3903 (deliver_child_signal): Rename from sigchld_handler.
3904 * atimer.c (handle_alarm_signal):
3905 * data.c (handle_arith_signal):
3906 * dispnew.c (handle_window_change_signal):
3907 * emacs.c (handle_fatal_signal, handle_danger_signal):
3908 * keyboard.c (handle_input_available_signal):
3909 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3910 * process.c (handle_pipe_signal, handle_child_signal):
3911 New functions, with the actual signal-handling code taken from the
3912 original respective signal handlers, sans the sporadic attempts to
3913 preserve errno, since that's now done by handle_on_main_thread.
3914 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3915 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3916 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3917 Move to sysdep.c.
3918 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3919 Move initialization of main_thread to sysdep.c's init_signals.
3920 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3921 our usage, and simplifies the mainline code.
3922 (record_child_status_change): New static function, as a helper
3923 for handle_child_signal, and with most of the old child handler's
3924 contents.
3925 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3926 (handle_child_signal): Use the above.
3927 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3928 Moved here from emacs.c.
3929 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3930 code moved here from emacs.c's main function.
3931 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3932 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3933 This lets callers save and restore errno properly.
3934
3935 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3936
3937 Remove redundant or unused things here and there.
3938 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3939 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3940 * editfns.c (Fcompare_buffer_substrings): Likewise.
3941 * frame.h (struct terminal, struct font_driver_list):
3942 Remove redundant declarations.
3943 * window.h (Qleft, Qright): Likewise.
3944
3945 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3946
3947 Do not mark objects from deleted buffers, windows and frames.
3948 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3949 (mark_object): Likewise for windows and frames.
3950
3951 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3954 buffer_defaults and buffer_local_symbols as valid objects.
3955 Return special value to denote them.
3956
3957 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3958
3959 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3960 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3961 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3962 (file_name_absolute_p, Fsubstitute_in_file_name):
3963 (check_executable, check_writable, Ffile_accessible_directory_p)
3964 (Fset_file_selinux_context, Fdefault_file_modes)
3965 (Finsert_file_contents, choose_write_coding_system)
3966 (Fwrite_region, build_annotations, a_write, e_write)
3967 (Fdo_auto_save):
3968 * filelock.c (boot_time_initialized, get_boot_time)
3969 (get_boot_time_1, lock_file_1, within_one_second):
3970 * floatfns.c (in_float):
3971 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3972 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3973 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3974 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3975 * window.c (compare_window_configurations):
3976 Use bool for booleans.
3977 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3978 (Fdefault_file_modes): Now mode_t, not int, for modes.
3979 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3980 (internal_delete_file): Now returns void, not a (boolean) int,
3981 since nobody was looking at the return value.
3982 * lisp.h, window.h: Adjust to above API changes.
3983
3984 * xdisp.c (set_message): Simplify and reindent last change.
3985
3986 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3987
3988 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3989
3990 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3991
3992 * eval.c (call_debugger): Make the function non-static so that we
3993 can call it from set_message.
3994
3995 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3996 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3997
3998 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3999
4000 Give more-useful info on a fatal error (Bug#12328).
4001 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4002 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4003 of doing the work ourselves.
4004 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4005 do most of the work.
4006 (fatal_error_backtrace): New function, taken from the guts
4007 of the old fatal_error_signal, but with a new option to output
4008 a backtrace.
4009 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4010 info about the signal than just its number.
4011 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4012 * sysdep.c: Include <execinfo.h>
4013 (emacs_backtrace): New function, taken partly from the previous
4014 code of the 'die' function.
4015 (emacs_abort): Call fatal_error_backtrace rather than abort.
4016
4017 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4018
4019 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4020 eager (load-time) macro-expansion.
4021 * lisp.mk (lisp): Add macroexp.
4022
4023 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4024
4025 Simplify redefinition of 'abort' (Bug#12316).
4026 Do not try to redefine the 'abort' function. Instead, redo
4027 the code so that it calls 'emacs_abort' rather than 'abort'.
4028 This removes the need for the NO_ABORT configure-time macro
4029 and makes it easier to change the abort code to do a backtrace.
4030 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4031 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4032 Remove; sysdep.c's emacs_abort now takes its place.
4033 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4034 'abort' changed to use 'emacs_abort'.
4035 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4036 (abort) [!defined abort]: Rename to ...
4037 (emacs_abort): ... new name.
4038 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4039 the place of the old 'abort' in emacs.c.
4040 * w32.c, w32fns.c (abort): Do not #undef.
4041 * w32.c (emacs_abort): Rename from w32_abort.
4042
4043 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4044
4045 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4046 offsets[j].dv, since the y axis of the screen coordinates points
4047 down, while the y axis of the font definition coordinates points
4048 up. This fixes display of Arabic diacritics such as KASRA and
4049 KASRATAN. (Bug#11860)
4050
4051 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4052
4053 Be more systematic about _setjmp vs setjmp.
4054 * alloc.c (test_setjmp, mark_stack):
4055 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4056 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4057 (png_load, my_error_exit, jpeg_load):
4058 * process.c (send_process_trap, send_process):
4059 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4060 The underscored versions are up to 30x faster on some hosts.
4061 Formerly, the code used setjmp+longjmp sometimes and
4062 _setjmp+_longjmp at other times, with no particular reason to
4063 prefer setjmp+longjmp.
4064
4065 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4066
4067 Fix minor problem found by static checking.
4068 * buffer.c (Fdelete_all_overlays): Return nil.
4069
4070 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4071
4072 * buffer.c (Fdelete_all_overlays): New function.
4073
4074 2012-09-03 Chong Yidong <cyd@gnu.org>
4075
4076 * gtkutil.c: Add extern decl for Qxft.
4077
4078 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 * emacs.c, eval.c: Use bool for boolean.
4081 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4082 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4083 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4084 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4085 (main, decode_env_path, Fdaemon_initialized):
4086 * eval.c (call_debugger, Finteractive_p, interactive_p):
4087 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4088 (maybe_call_debugger, Fbacktrace):
4089 * process.c (read_process_output, exec_sentinel):
4090 Use bool for booleans.
4091 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4092 All callers changed.
4093 * eval.c (interactive_p): Omit always-true boolean argument
4094 EXCLUDE_SUBRS_P. All callers changed.
4095 * dispextern.h, lisp.h: Reflect above API changes.
4096 * firstfile.c (dummy): Use the address of 'main', whose signature
4097 won't change, instead of the address of 'initialize', whose
4098 signature just changed from int to bool.
4099 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4100 * msdos.c (fatal_error_in_progress): ... from here.
4101 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4102 of incrementing it.
4103 (redisplay_internal, unwind_redisplay): Simply clear
4104 REDISPLAYING_P when unwinding, instead of saving its previous,
4105 always-false value and then restoring it.
4106
4107 Clean up some extern decls.
4108 Mostly, this hoists extern decls out of .c files and into .h files.
4109 That way, we're more likely to catch errors if the interfaces change.
4110 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4111 declare xg_mark_data.
4112 * dispextern.h (x_frame_parm_handlers):
4113 * font.h (Qxft):
4114 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4115 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4116 (Qultra_bold, Qoblique, Qitalic):
4117 Move extern decl here from .c file.
4118 * alloc.c (xg_mark_data) [USE_GTK]:
4119 * doc.c (Qclosure):
4120 * eval.c (Qlexical_binding):
4121 * fns.c (time) [!HAVE_UNISTD_H]:
4122 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4123 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4124 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4125 * lread.c (Qinternal_interpreter_environment):
4126 * minibuf.c (Qbuffer):
4127 * process.c (QCfamily, QCfilter):
4128 * widget.c (free_frame_faces):
4129 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4130 * xfont.c (x_clear_errors):
4131 * xterm.c (x_frame_parm_handlers):
4132 Remove now-redundant extern decls.
4133 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4134 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4135 Now static.
4136 * xfaces.c: Remove unnecessary static decls.
4137 * xterm.c (updating_frame): Remove decl of nonexistent object.
4138
4139 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4140 when building globals.h, as the objects that are not built on
4141 this host are not needed to compile C files on this host.
4142
4143 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4144
4145 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4146
4147 * frame.h: Add missing prototype for x_wm_set_size_hint.
4148
4149 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4150
4151 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4152 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4153 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4154 (Fsubstitute_command_keys):
4155 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4156 (save_excursion_save, save_excursion_restore)
4157 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4158 (format_time_string, general_insert_function)
4159 (make_buffer_string, make_buffer_string_both)
4160 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4161 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4162 (copy_text, insert_1, insert_1_both, insert_from_string)
4163 (insert_from_string_before_markers, insert_from_string_1)
4164 (insert_from_buffer, insert_from_buffer_1, replace_range)
4165 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4166 (del_range_2, modify_region):
4167 * intervals.c (intervals_equal, balance_possible_root_interval)
4168 (adjust_intervals_for_insertion, merge_properties_sticky)
4169 (graft_intervals_into_buffer, lookup_char_property)
4170 (adjust_for_invis_intang, set_point_both)
4171 (get_property_and_range, compare_string_intervals)
4172 (set_intervals_multibyte_1, set_intervals_multibyte):
4173 * keyboard.c (decode_timer):
4174 Use bool for boolean.
4175 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4176 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4177
4178 2012-09-02 Chong Yidong <cyd@gnu.org>
4179
4180 * keymap.c (push_key_description): Print M-TAB as C-M-i
4181 (Bug#11758).
4182
4183 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4184
4185 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4186 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4187 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4188 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4189 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4190 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4191 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4192
4193 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4194
4195 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4196 more than one grapheme cluster passed to the shaper: compute the
4197 offset adjustment values separately for each cluster. (Bug#11860)
4198
4199 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4200 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4201 about implicit conversions from integer to pointer.
4202
4203 2012-09-01 Daniel Colascione <dancol@dancol.org>
4204
4205 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4206 system used too early.
4207
4208 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4209
4210 Better seed support for (random).
4211 * emacs.c (main): Call init_random.
4212 * fns.c (Frandom): Set the seed from a string argument, if given.
4213 Remove long-obsolete Gentzel cruft.
4214 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4215 (init_random): New function.
4216
4217 2012-09-01 Daniel Colascione <dancol@dancol.org>
4218
4219 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4220 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4221 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4222 x_wm_set_size_hint, x_query_colors, x_real_positions,
4223 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4224 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4225 all of which have been moved to common code.
4226
4227 * xfaces.c: Include TERM_HEADER instead of listing all possible
4228 window-system headers.
4229
4230 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4231 to match header.
4232
4233 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4234 directly accessing frame internals.
4235
4236 * w32font.h: Include font.h. Define syms_of_w32font and
4237 globals_of_w32font.
4238
4239 * process.c: Include TERM_HEADER instead of listing all possible
4240 window-system headers.
4241
4242 * nsterm.h: Remove declarations now in frame.h.
4243 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4244
4245 * menu.c: Include TERM_HEADER instead of listing all possible
4246 window-system headers.
4247
4248 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4249 window system.
4250
4251 * keyboard.c: Include TERM_HEADER instead of listing all possible
4252 window-system headers.
4253
4254 * image.c: Include TERM_HEADER instead of listing all possible
4255 window-system headers. Declare Vlibrary_cache when compiling for
4256 Windows.
4257
4258 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4259 window system declarations.
4260
4261 * frame.h: Move common functions here: set_frame_menubar,
4262 x_set_window_size, x_sync, x_get_focus_frame,
4263 x_set_mouse_position, x_set_mouse_pixel_position,
4264 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4265 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4266 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4267 x_activate_menubar, x_real_positions, x_bitmap_icon,
4268 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4269 and x_query_colors.
4270
4271 * frame.c: Include TERM_HEADER instead of listing all possible
4272 window-system headers.
4273
4274 * font.c: Include TERM_HEADER instead of listing all possible
4275 window-system headers.
4276
4277 * emacs.c: Include TERM_HEADER.
4278
4279 * dispnew.c: Include TERM_HEADER instead of listing all possible
4280 window-system headers.
4281
4282 * ccl.h: Include character.h.
4283
4284 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4285 the current window system; include in list of objects to link into
4286 Emacs.
4287
4288 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4289
4290 Remove mark_ttys function and fix tty_display_info initialization.
4291 * lisp.h (mark_ttys): Remove prototype.
4292 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4293 to mark_ttys because all possible values of 'top_frame' slot are
4294 the frames which are reachable from Vframe_list.
4295 * term.c (mark_ttys): Remove.
4296 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4297
4298 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4299
4300 Change struct frame bitfields from unsigned char to unsigned.
4301 * frame.h (struct frame): Change type of 'display_preempted',
4302 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4303 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4304 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4305 bitfields from unsigned char to unsigned.
4306
4307 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4308
4309 Remove unused member of struct x_output and struct w32_output.
4310 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4311 * w32term.h (struct w32_output): Likewise.
4312
4313 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4314
4315 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4316 does not become zero (Bug#12234).
4317
4318 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4319
4320 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4321 for GCC 4.7.1 x86-64.
4322
4323 2012-08-30 Glenn Morris <rgm@gnu.org>
4324
4325 * lread.c (init_lread): For out-of-tree builds, only add the
4326 source directory's site-lisp dir to the load-path if it exists,
4327 consistent with in-tree builds. (Bug#12302)
4328
4329 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4330
4331 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4332 button_values to NULL. Call setStykeMask so dialogs get a close button.
4333 (windowShouldClose:): Set window_closed.
4334 (dealloc): New member, free button_values.
4335 (process_dialog:): Make member function. Remove window argument,
4336 replace window with self. Count buttons and allocate and store values
4337 in button_values.
4338 (addButton:value:row:): value is int with the name tag. Call setTag
4339 with tag. Remove return self, declare return value as void.
4340 (addString:row:): Remove return self, declare return value as void.
4341 (addSplit): Remove return self, declare return value as void.
4342 (clicked:): Remove return self, declare return value as void.
4343 Set dialog_return to button_values[seltag]. Code formatting change.
4344 (initFromContents:isQuestion:): Adjust call to process_dialog.
4345 Code formatting change.
4346 (timeout_handler:): Set timer_fired to YES.
4347 (runDialogAt:): Set timer_fired to NO.
4348 Handle click on close button as quit.
4349
4350 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4351 Add window_closed and button_values. Add void as return value for
4352 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4353 Add process_dialog as new member.
4354
4355 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4356
4357 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4358 is not one of the heaps we manage. (Bug#12242)
4359
4360 2012-08-28 Glenn Morris <rgm@gnu.org>
4361
4362 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4363
4364 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4365
4366 * window.c (Fset_window_configuration): Remove handling of
4367 auto-buffer-name window parameter. Install revision of reverted
4368 fix.
4369
4370 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4371
4372 Do not allow to set major mode for a dead buffer.
4373 * buffer.c (Fset_buffer_major_mode): Signal an error
4374 if the buffer is dead.
4375 (Fother_buffer, other_buffer_safely): Remove redundant
4376 nested declaration.
4377
4378 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4379
4380 Always use set_buffer_if_live to restore original buffer at unwind.
4381 * buffer.h (record_unwind_current_buffer): New function.
4382 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4383 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4384 * undo.c, window.c: Adjust users.
4385 * buffer.c (set_buffer_if_live): Fix comment.
4386
4387 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4388
4389 Fix usage of set_buffer_internal.
4390 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4391 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4392 * coding.c (decode_coding): Omit redundant test.
4393 * fileio.c (decide_coding_unwind): Likewise.
4394 * fns.c (secure_hash): Likewise.
4395 * insdel.c (modify_region): Likewise.
4396 * keyboard.c (command_loop_1): Likewise.
4397 * print.c (PRINTFINISH): Likewise.
4398 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4399
4400 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4401
4402 * dispnew.c: Use bool for boolean.
4403 (frame_garbaged, display_completed, delayed_size_change)
4404 (fonts_changed_p, add_window_display_history)
4405 (add_frame_display_history, verify_row_hash)
4406 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4407 (row_equal_p, realloc_glyph_pool)
4408 (allocate_matrices_for_frame_redisplay)
4409 (showing_window_margins_p)
4410 (adjust_frame_glyphs_for_frame_redisplay)
4411 (build_frame_matrix_from_leaf_window, make_current)
4412 (mirrored_line_dance, mirror_line_dance, update_frame)
4413 (update_window_tree, update_single_window)
4414 (check_current_matrix_flags, update_window, update_text_area)
4415 (update_window_line, set_window_update_flags, scrolling_window)
4416 (update_frame_1, scrolling, buffer_posn_from_coords)
4417 (do_pending_window_change, change_frame_size)
4418 (change_frame_size_1, sit_for):
4419 Use bool for boolean.
4420 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4421 and remove last int (actually boolean) argument, which was always 0.
4422 All callers changed.
4423 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4424 * dispextern.h (struct composition_it): Use bool for boolean.
4425 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4426 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4427 * dired.c (file_name_completion):
4428 Use bool for boolean. (This was missed in an earlier change.)
4429
4430 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4431
4432 * window.c (Fset_window_configuration): Revert first part of
4433 last change.
4434
4435 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4436
4437 * nsterm.h (NSPanel): New class variable dialog_return.
4438
4439 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4440 Initialize dialog_return.
4441 (windowShouldClose:): Use stop instead of stopModalWithCode.
4442 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4443 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4444 event.
4445 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4446 modal loop returns.
4447
4448 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4449
4450 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4451 * composite.c (find_composition, composition_gstring_p)
4452 (composition_reseat_it, find_automatic_composition):
4453 * data.c (let_shadows_buffer_binding_p)
4454 (let_shadows_global_binding_p, set_internal, make_blv)
4455 (Fmake_variable_buffer_local, Fmake_local_variable)
4456 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4457 (cons_to_signed, arith_driver):
4458 * dbusbind.c (xd_in_read_queued_messages):
4459 * dired.c (directory_files_internal, file_name_completion):
4460 Use bool for booleans.
4461 * dired.c (file_name_completion):
4462 * process.h (fd_callback):
4463 Omit int (actually boolean) argument. It wasn't being used.
4464 All uses changed.
4465 * composite.h, lisp.h: Reflect above API changes.
4466
4467 * cmds.c, coding.c: Use bool for booleans.
4468 * cmds.c (move_point, Fself_insert_command):
4469 * coding.h (struct composition status, struct coding_system):
4470 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4471 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4472 (emacs_mule_char, decode_coding_emacs_mule)
4473 (encode_coding_emacs_mule, detect_coding_iso_2022)
4474 (decode_coding_iso_2022, encode_invocation_designation)
4475 (encode_designation_at_bol, encode_coding_iso_2022)
4476 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4477 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4478 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4479 (encode_coding_raw_text, detect_coding_charset)
4480 (decode_coding_charset, encode_coding_charset, detect_eol)
4481 (detect_coding, get_translation_table, produce_chars)
4482 (consume_chars, reused_workbuf_in_use)
4483 (make_conversion_work_buffer, code_conversion_save)
4484 (decode_coding_object, encode_coding_object)
4485 (detect_coding_system, char_encodable_p)
4486 (Funencodable_char_position, code_convert_region)
4487 (code_convert_string, code_convert_string_norecord)
4488 (Fset_coding_system_priority):
4489 * fileio.c (Finsert_file_contents):
4490 Use bool for booleans.
4491 * coding.h, lisp.h: Reflect above API changes.
4492 * coding.c: Remove unnecessary static function decls.
4493 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4494 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4495 not a boolean 'int', since callers never look at the return value.
4496 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4497 * coding.h (decoding_buffer_size, encoding_buffer_size)
4498 (emacs_mule_string_char): Remove unused extern decls.
4499 (struct iso_2022_spec, struct coding_system):
4500 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4501 (struct emacs_mule_spec): Remove unused field 'full_support'.
4502 All initializations removed.
4503 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4504
4505 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4506
4507 Fix spare memory change (Bug#12286).
4508 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4509 (valid_lisp_object_p): Likewise.
4510
4511 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4512
4513 * window.c (Fset_window_configuration): Record any window's old
4514 buffer if it's replaced (see Bug#8789). If the new current
4515 buffer doesn't appear in the selected window, go to its old
4516 point (Bug#12208).
4517
4518 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4519
4520 Special MEM_TYPE_SPARE to denote reserved memory.
4521 * alloc.c (enum mem_type): New memory type.
4522 (refill_memory_reserve): Use new type for spare memory.
4523 This prevents live_cons_p and live_string_p from incorrect
4524 detection of uninitialized objects from spare memory as live.
4525
4526 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 Spelling fixes.
4529 * Makefile.in (.PHONY): versioclean -> versionclean.
4530
4531 Remove unused external symbols.
4532 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4533 * window.c (Qwindow_valid_p, decode_valid_window):
4534 Now static, not extern.
4535 * data.c (Qinterval): Remove; unused.
4536 (syms_of_data): Do not define 'interval'.
4537 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4538 * window.h (decode_valid_window):
4539 Remove decls.
4540
4541 * character.c, charset.c, chartab.c: Use bool for booleans.
4542 * character.c (lisp_string_width, string_count_byte8)
4543 (string_escape_byte8):
4544 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4545 (load_charset_map_from_file, map_charset_chars)
4546 (Fdefine_charset_internal, define_charset_internal)
4547 (Fdeclare_equiv_charset, find_charsets_in_text)
4548 (Ffind_charset_region, char_charset, Fiso_charset):
4549 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4550 (sub_char_table_set, sub_char_table_set_range)
4551 (char_table_set_range, optimize_sub_char_table)
4552 (map_sub_char_table):
4553 Use bool for boolean.
4554 * character.c (str_to_unibyte): Omit last boolean argument; it was
4555 always 0. All callers changed.
4556 * character.h, charset.h: Adjust to match previous changes.
4557 * character.h (char_printable_p): Remove decl of nonexistent function.
4558 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4559 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4560 are all boolean, so make them single-bit bitfields.
4561
4562 * lisp.h (ASET): Remove attempt to detect side effects.
4563 It was meant to be temporary and it often doesn't work,
4564 because when IDX has side effects the behavior of IDX==IDX
4565 is undefined. See Stefan Monnier in
4566 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4567
4568 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4569
4570 * lisp.h (functionp): New function (extracted from Ffunctionp).
4571 (FUNCTIONP): Use it.
4572 * eval.c (Ffunctionp): Use it.
4573
4574 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4575
4576 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4577 as that's faster and simpler than static storage. Don't bother
4578 with the g_main_context_query overhead if g_main_context_pending
4579 says no events are pending.
4580 (gfds, gfds_size): Remove these static vars.
4581 (xgselect_initialize): Remove; no longer needed.
4582 All uses and decls removed.
4583
4584 * emacs.c (fatal_error_signal_hook): Remove.
4585 All uses removed. This leftover from old code was always 0.
4586
4587 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4588 * casefiddle.c (casify_object, casify_region):
4589 * casetab.c (set_case_table):
4590 * category.c, category.h (word_boundary_p):
4591 * category.h (CHAR_HAS_CATEGORY):
4592 Use bool for booleans, instead of int.
4593
4594 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4595
4596 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4597
4598 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 On assertion failure, print backtrace if available.
4601 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4602 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4603 * Makefile.in (LIB_EXECINFO): New macro.
4604 (LIBES): Use it.
4605
4606 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4607 * bytecode.c (exec_byte_code):
4608 * callint.c (check_mark, Fcall_interactively):
4609 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4610 (getenv_internal, sync_process_alive, call_process_exited):
4611 * lisp.h (USE_SAFE_ALLOCA):
4612 Use bool for booleans, instead of int.
4613 * lisp.h, process.h: Adjust prototypes to match above changes.
4614 * callint.c (Fcall_interactively): Don't assume the mark's
4615 offset fits in 'int'.
4616
4617 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4618
4619 * buffer.c, buffer.h: Use bool for boolean.
4620 * buffer.c (reset_buffer_local_variables)
4621 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4622 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4623 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4624 (overlay_touches_p, overlay_strings, Foverlay_put)
4625 (report_overlay_modification, call_overlay_mod_hooks):
4626 (mmap_enlarge, mmap_set_vars):
4627 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4628 Use bool for booleans, instead of int.
4629 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4630 since the 1-or-0 return value is always ignored anyway.
4631 (mmap_initialized_p):
4632 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4633 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4634
4635 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4636
4637 * bidi.c: Use bool for boolean.
4638 This is a bit more readable, and makes the text segment of bidi.o
4639 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4640 Presumably it's faster too.
4641 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4642 Now bool.
4643 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4644 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4645 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4646 (bidi_explicit_dir_char, bidi_level_of_next_char)
4647 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4648 Use bool for booleans, instead of int.
4649 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4650 (bidi_unshelve_cache): Adjust decls to match code.
4651
4652 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4653
4654 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4655 argument.
4656
4657 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4660 * atimer.h: Include <stdbool.h>.
4661
4662 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4663
4664 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4665 compile time tests instead of run time tests on systems that do
4666 not use them.
4667 (FRAME_MAC_P): Remove leftover from deleted code.
4668 * frame.c (syms_of_frame): Remove leftover from deleted code.
4669
4670 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4671
4672 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4673
4674 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4675
4676 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4677 Otherwise, the compiler complains about (A?B:C) where B is void
4678 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4679 (fontset_add): Return void, for FONTSET_ADD.
4680
4681 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * alloc.c: Use bool for booleans.
4684 (gc_in_progress, abort_on_gc)
4685 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4686 (dont_register_blocks) [GC_MALLOC_CHECK]:
4687 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4688 (check_string_bytes, make_specified_string, memory_full)
4689 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4690 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4691 (mark_stack, valid_pointer_p, make_pure_string)
4692 (Fgarbage_collect, survives_gc_p, gc_sweep):
4693 Use bool for booleans, instead of int.
4694 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4695 Remove unused local.
4696 * alloc.c (PURE_POINTER_P):
4697 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4698 * editfns.c (Fformat):
4699 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4700 (Fdo_auto_save):
4701 * fns.c (sweep_weak_table):
4702 * lisp.h (suppress_checking, push_message, survives_gc_p)
4703 (make_pure_string, gc_in_progress, abort_on_gc):
4704 * lread.c (readchar, read1):
4705 * print.c (Fprin1_to_string):
4706 * xdisp.c (push_message):
4707 Use bool for booleans affected directly or indirectly by
4708 alloc.c's changes.
4709
4710 Make recently-introduced setters macros.
4711 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4712 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4713 (set_fontset_default, set_fontset_fallback): Rename from their
4714 upper-case counterparts, and make them functions rather than macros.
4715 This is more consistent with the other recently-introduced setters.
4716 These don't need to be inline, since they're local.
4717
4718 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4719
4720 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4721 the loop (Bug#12247).
4722
4723 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4724
4725 * lisp.h (vcopy): Use memcpy rather than our own loop.
4726 This fixes a performance regression introduced by the recent
4727 addition of vcopy. This means 'vcopy' will need to be modified
4728 for a copying collector, but that's OK. Also, tighten the
4729 checking in the assertion.
4730
4731 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4732
4733 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4734 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4735 non-base glyph for the width of the base character, according to
4736 what x_draw_composite_glyph_string_foreground expects.
4737 Generate WADJUST value according to composition_gstring_width's
4738 expectations, to produce correct width of the composed character.
4739 Reverse the sign of the DU offset produced by ScriptPlace.
4740
4741 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4742
4743 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4744
4745 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4746
4747 Avoid direct writes to contents member of struct Lisp_Vector.
4748 * lisp.h (vcopy): New function to copy data into vector.
4749 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4750 * fns.c (Ffillarray): Use ASET.
4751 * keyboard.c (timer_check_2): Use AREF and ASET.
4752 (append_tool_bar_item, Frecent_keys): Use vcopy.
4753 * lread.c (read_vector): Use ASET.
4754 * msdos.c (Frecent_doskeys): Use vcopy.
4755 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4756 (Finternal_merge_in_global_face): Use ASET and vcopy.
4757 * xfont.c (xfont_list_pattern): Likewise.
4758
4759 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4760
4761 * window.c (Fwindow_point): For the selected window always return
4762 the position of its buffer's point.
4763 (Fset_window_point): For the selected window always go in its
4764 buffer to the specified position.
4765
4766 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4767
4768 Setter macros for fontsets.
4769 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4770 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4771 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4772 Adjust users.
4773
4774 2012-08-20 Glenn Morris <rgm@gnu.org>
4775
4776 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4777 Don't assume that `ln -f' works.
4778
4779 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4780
4781 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4782 and later about non-assignments with no effect. See discussion at
4783 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4784 details.
4785
4786 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4787
4788 Inline setter functions for Lisp_Objects slots of struct specbinding.
4789 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4790 Adjust users.
4791
4792 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4793
4794 * window.c (select_window): Always make selected window's buffer
4795 current.
4796
4797 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4798
4799 Use AREF and ASET for docstrings of category tables.
4800 * category.h (CATEGORY_DOCSTRING): Use AREF.
4801 (SET_CATEGORY_DOCSTRING): Use ASET.
4802 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4803
4804 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4805
4806 Inline setter functions for hash table members.
4807 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4808 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4809 (set_hash_key_and_value, set_hash_index, set_hash_next)
4810 (set_hash_hash): New functions.
4811 * charset.c, fns.c: Adjust users.
4812
4813 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4814
4815 Inline getter and setter functions for per-buffer values.
4816 * buffer.h (per_buffer_default, set_per_buffer_default)
4817 (per_buffer_value, set_per_buffer_value): New functions.
4818 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4819 * buffer.c, data.c: Adjust users.
4820
4821 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4822
4823 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4824
4825 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4826
4827 Rely on <config.h> + <unistd.h> to declare 'environ',
4828 as gnulib does this if the system doesn't.
4829 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4830 Remove declaration. MS-Windows declares it on stdlib.h which is
4831 included by conf_post.h.
4832 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4833 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4834 * vm-limit.c: Include <unistd.h>, for 'environ'.
4835
4836 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4837 (start_of_data): Remove decl; mem-limits.h provides it.
4838
4839 * xdisp.c (handle_invisible_prop): Make it a bit faster
4840 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4841
4842 2012-08-19 Chong Yidong <cyd@gnu.org>
4843
4844 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4845 ends (Bug#3874).
4846
4847 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4848
4849 * .gdbinit: Use call instead of set when calling a function in the
4850 inferior.
4851
4852 * data.c (set_internal): Don't use set_blv_found.
4853 (Fkill_local_variable): Likewise.
4854
4855 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4856
4857 * nsfont.m (ns_ascii_average_width): Ensure the string
4858 ascii_printable is initialized with a null-terminated character
4859 array. Otherwise, it can contain undesired extra characters.
4860
4861 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4862
4863 port new setting code to Sun C 5.8 2005/10/13
4864 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4865 Return void, not Lisp_Object. Otherwise, the compiler
4866 complains about (A?B:C) where B is void and C is Lisp_Object
4867 when compiling CHAR_TABLE_SET, due to the recent change to
4868 the API of sub_char_table_set_contents.
4869
4870 2012-08-18 Chong Yidong <cyd@gnu.org>
4871
4872 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4873 for the string case (Bug#3874).
4874
4875 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4876
4877 * buffer.h (BSET): Remove (Bug#12215).
4878 Replace all uses with calls to new setter functions.
4879 (bset_bidi_paragraph_direction, bset_case_canon_table)
4880 (bset_case_eqv_table, bset_directory, bset_display_count)
4881 (bset_display_time, bset_downcase_table)
4882 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4883 (bset_last_selected_window, bset_local_var_alist)
4884 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4885 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4886 (bset_width_table):
4887 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4888 (bset_auto_fill_function, bset_auto_save_file_format)
4889 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4890 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4891 (bset_cache_long_line_scans, bset_case_fold_search)
4892 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4893 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4894 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4895 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4896 (bset_header_line_format, bset_indicate_buffer_boundaries)
4897 (bset_indicate_empty_lines, bset_invisibility_spec)
4898 (bset_left_fringe_width, bset_major_mode, bset_mark)
4899 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4900 (bset_name, bset_overwrite_mode, bset_pt_marker)
4901 (bset_right_fringe_width, bset_save_length)
4902 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4903 (bset_scroll_up_aggressively, bset_selective_display)
4904 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4905 (bset_word_wrap, bset_zv_marker):
4906 * category.c (bset_category_table):
4907 * syntax.c (bset_syntax_table):
4908 New setter functions.
4909
4910 * process.h (PSET): Remove (Bug#12215).
4911 Replace all uses with calls to new setter functions.
4912 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4913 (PROCESS_INLINE): New macro.
4914 (pset_childp): New setter function.
4915 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4916 * process.c (PROCESS_INLINE):
4917 Define to EXTERN_INLINE, so that the corresponding functions
4918 are compiled into code.
4919 (pset_buffer, pset_command, pset_decode_coding_system)
4920 (pset_decoding_buf, pset_encode_coding_system)
4921 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4922 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4923 (pset_type, pset_write_queue): New setter functions.
4924
4925 * window.h (WSET): Remove (Bug#12215).
4926 Replace all uses with calls to new setter functions.
4927 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4928 (WINDOW_INLINE): New macro.
4929 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4930 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4931 (wset_total_lines, wset_vertical_scroll_bar)
4932 (wset_window_end_pos, wset_window_end_valid)
4933 (wset_window_end_vpos): New setter functions.
4934 * window.c (WINDOW_INLINE):
4935 Define to EXTERN_INLINE, so that the corresponding functions
4936 are compiled into code.
4937 (wset_combination_limit, wset_dedicated, wset_display_table)
4938 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4939 (wset_new_normal, wset_new_total, wset_next_buffers)
4940 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4941 (wset_prev_buffers, wset_right_fringe_width)
4942 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4943 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4944 (wset_window_parameters):
4945 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4946 (wset_column_number_displayed, wset_region_showing):
4947 New setter functions.
4948
4949 * termhooks.h (TSET): Remove (Bug#12215).
4950 Replace all uses with calls to new setter functions.
4951 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4952 (TERMHOOKS_INLINE): New macro.
4953 (tset_charset_list, tset_selection_alist): New setter functions.
4954 * terminal.c (TERMHOOKS_INLINE):
4955 Define to EXTERN_INLINE, so that the corresponding functions
4956 are compiled into code.
4957 (tset_param_alist): New setter function.
4958
4959 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * keyboard.h (KSET): Remove (Bug#12215).
4962 Replace all uses with calls to new setter functions.
4963 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4964 (KEYBOARD_INLINE): New macro.
4965 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4966 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4967 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4968 New setter functions.
4969 * keyboard.c (KEYBOARD_INLINE):
4970 Define to EXTERN_INLINE, so that the corresponding functions
4971 are compiled into code.
4972 (kset_echo_string, kset_kbd_queue)
4973 (kset_keyboard_translate_table, kset_last_prefix_arg)
4974 (kset_last_repeatable_command, kset_local_function_key_map)
4975 (kset_overriding_terminal_local_map, kset_real_last_command)
4976 (kset_system_key_syms): New setter functions.
4977
4978 * frame.h (FSET): Remove (Bug#12215).
4979 Replace all uses with calls to new setter functions.
4980 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4981 (FRAME_INLINE): New macro.
4982 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4983 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4984 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4985 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4986 (fset_param_alist, fset_root_window, fset_scroll_bars)
4987 (fset_selected_window, fset_title, fset_tool_bar_items)
4988 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4989 * frame.c (FRAME_INLINE):
4990 Define to EXTERN_INLINE, so that the corresponding functions
4991 are compiled into code.
4992 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4993
4994 A few more naming-convention fixes for getters and setters.
4995 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4996 and rename from buffer_overlays_set_before.
4997 (set_buffer_overlays_after): Move here from buffer.h, and rename
4998 from buffer_overlays_set_after.
4999 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5000 All uses changed.
5001 (set_buffer_intervals): Rename from buffer_set_intervals.
5002 * intervals.c (set_interval_object): Move here from intervals.h,
5003 and rename from interval_set_object.
5004 (set_interval_left): Move here from intervals.h, and rename from
5005 interval_set_left.
5006 (set_interval_right): Move here from intervals.h, and rename from
5007 interval_set_right.
5008 (copy_interval_parent): Move here from intervals.h, and rename from
5009 interval_copy_parent.
5010 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5011 (set_interval_plist): Rename from interval_set_plist.
5012 Return void, not Lisp_Object, since no caller uses the result.
5013 * lisp.h (string_intervals): Rename from string_get_intervals.
5014 (set_string_intervals): Rename from string_set_intervals.
5015
5016 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5017 (set_char_table_contents): Rename from char_table_set_contents.
5018 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5019 All uses changed. See the end of
5020 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5021
5022 * lisp.h (CSET): Remove (Bug#12215).
5023 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5024 (set_char_table_purpose): New functions,
5025 replacing CSET. All uses changed. For example, replace
5026 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5027 "set_char_table_parent (char_table, parent);".
5028 The old version was confusing because it used the same name
5029 'parent' for two different things.
5030
5031 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5032
5033 Functions to get and set Lisp_Object fields of buffer-local variables.
5034 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5035 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5036 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5037 * data.c, eval.c, frame.c: Adjust users.
5038
5039 2012-08-17 Chong Yidong <cyd@gnu.org>
5040
5041 * xfaces.c (merge_face_vectors): If the target font specfies a
5042 font spec, make the font's attributes take precedence over
5043 directly-specified attributes.
5044 (merge_face_ref): Recognize :font.
5045
5046 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5047
5048 Do not use memcpy for copying intervals.
5049 * intervals.c (reproduce_interval): New function.
5050 (reproduce_tree, reproduce_tree_obj): Use it.
5051 (reproduce_tree_obj): Remove prototype.
5052
5053 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5054
5055 * lisp.h (duration_to_sec_usec): Remove unused decl.
5056
5057 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5058
5059 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5060 to an allocated instance of NSString, not to the class itself.
5061
5062 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5063
5064 * makefile.w32-in (C_CTYPE_H): New macro.
5065 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5066 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5067 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5068
5069 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5070
5071 Use ASCII tests for character types.
5072 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5073 * xfns.c, xterm.c:
5074 Don't include <ctype.h>; was not needed.
5075 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5076 * sysdep.c, xfaces.c:
5077 Include <c-ctype.h> instead of <ctype.h>.
5078 * nsterm.m: Include <c-ctype.h>.
5079 * charset.c (read_hex):
5080 * doc.c (Fsnarf_documentation):
5081 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5082 (DRIVE_LETTER) [DOS_NT]:
5083 (Ffile_name_directory, Fexpand_file_name)
5084 (Fsubstitute_in_file_name):
5085 * font.c (font_parse_xlfd, font_parse_fcname):
5086 * frame.c (x_set_font_backend):
5087 * gtkutil.c (xg_get_font):
5088 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5089 * nsimage.m (hexchar):
5090 * nsterm.m (ns_xlfd_to_fontname):
5091 * sysdep.c (system_process_attributes):
5092 * xfaces.c (hash_string_case_insensitive):
5093 Use C-locale tests instead of locale-specific tests for character
5094 types, since we want the ASCII interpretation here, not the
5095 interpretation suitable for whatever happens to be the current locale.
5096
5097 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5098
5099 Consistently check windows for validity/liveness
5100 (Bug#11984, Bug#12025, Bug#12026).
5101 * lisp.h (CHECK_VALID_WINDOW): New macro.
5102 * window.c (decode_window): Rename to decode_live_window.
5103 (decode_valid_window, Fwindow_valid_p): New functions.
5104 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5105 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5106 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5107 (Fwindow_prev_sibling, Fwindow_combination_limit)
5108 (Fset_window_combination_limit, Fwindow_use_time)
5109 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5110 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5111 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5112 (Fwindow_hscroll, Fset_window_hscroll)
5113 (Fwindow_redisplay_end_trigger)
5114 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5115 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5116 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5117 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5118 (Fwindow_end, Fset_window_point, Fset_window_start)
5119 (Fpos_visible_in_window_p, Fwindow_line_height)
5120 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5121 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5122 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5123 (Fset_window_parameter, Fwindow_display_table)
5124 (Fset_window_display_table, Fdelete_other_windows_internal)
5125 (Fset_window_buffer, Fset_window_new_total)
5126 (Fset_window_new_normal, Fdelete_window_internal)
5127 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5128 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5129 (Fwindow_scroll_bars): Check whether argument window is a valid or
5130 live window. Update doc-strings.
5131 (syms_of_window): New symbol Qwindow_valid_p.
5132 * keyboard.c (Fposn_at_x_y): Check whether argument
5133 frame_or_window denotes a valid window.
5134
5135 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5136
5137 Fix previous char table change.
5138 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5139 * chartab.c (optimize_sub_char_table): Likewise.
5140
5141 2012-08-16 Chong Yidong <cyd@gnu.org>
5142
5143 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5144
5145 * xfont.c (xfont_open):
5146 * xftfont.c (xftfont_open): Set the font's max_width field.
5147
5148 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5149 min_width to space_width and average_width to the average over
5150 printable ASCII characters.
5151 (ns_char_width): Code cleanup.
5152 (ns_ascii_average_width): New utility function.
5153
5154 * font.h (struct font): Update comments.
5155
5156 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5157
5158 Simple interface to set Lisp_Object fields of character tables.
5159 * lisp.h (CSET): New macro.
5160 (char_table_set_extras, char_table_set_contents)
5161 (sub_char_table_set_contents): New function.
5162 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5163 * syntax.c: Adjust users.
5164
5165 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5166
5167 * eval.c (eval_sub): Bind lexical-binding.
5168 * lread.c (Qlexical_binding): Make non-static.
5169
5170 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5171
5172 * nsmenu.m (popupSession): Remove.
5173 (pop_down_menu): Remove endModalSession.
5174 (timeout_handler:): New method.
5175 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5176 Call runModalForWindow. Check timer_fired when it returns.
5177 If not set, cancel timer and break out of loop.
5178 Otherwise loop again, with a new timeout.
5179
5180 * nsterm.m: Include fcntl.h if present.
5181 (fd_entry, t_readfds, inNsSelect): Remove.
5182 (select_writefds, select_valid, select_timeout, selfds)
5183 (select_mutex, apploopnr): Add.
5184 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5185 Otherwise call kbd_buffer_store_event.
5186 (ns_send_appdefined): Remove release of fd_entry.
5187 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5188 Increment and decrement apploopnr.
5189 (ns_select): If no file descriptors, just do a NSTimer.
5190 Otherwise copy read/write masks and start select thread (fd_handler).
5191 Start main loop and wait for application defined event.
5192 Inform select thread to stop selecting after main loop is exited.
5193 (ns_term_init): Create selfds pipe and set non-blocking.
5194 Initialize select_mutex. Start the select thread (fd_handler).
5195 (fd_handler:): Loop forever, wait for info from the main thread
5196 to either start or stop selecting. When select returns, send
5197 and appdefined event.
5198 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5199 If not call kbd_buffer_store_event.
5200
5201 * nsterm.h (EmacsApp): fd_handler takes id argument.
5202 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5203
5204 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5205
5206 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5207
5208 * region-cache.c (move_cache_gap): Update gap_len using the actual
5209 growth of the boundaries array. Do not change cache_len.
5210 (Bug#12196)
5211
5212 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5213
5214 Generalize and cleanup font subsystem checks.
5215 * font.h (FONT_DEBUG, font_assert): Remove.
5216 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5217 Change font_assert to eassert. Use eassert where appropriate.
5218
5219 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5220
5221 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5222
5223 2012-08-15 Chong Yidong <cyd@gnu.org>
5224
5225 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5226 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5227 extract the font descriptor instead of just the font name.
5228 In that case, return a font spec instead of a string.
5229 (x_last_font_name): Move to this file from xfns.c.
5230
5231 * xfns.c (Fx_select_font): The return value can also be a font
5232 spec. Move x_last_font_name management to gtkutil.c.
5233
5234 * xfaces.c: Make font weight and style symbols non-static.
5235
5236 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5237
5238 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5239 (bug#12117).
5240
5241 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5242
5243 * alloc.c (Fgarbage_collect): Use plural form consistently.
5244
5245 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5246
5247 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5248 iteration through the command loop. Fixes a problem whereby mouse
5249 movements are ignored until the first mouse click.
5250
5251 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5252
5253 Use bool, not int, for Lisp booleans.
5254 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5255 makes Emacs a bit smaller and presumably a bit faster.
5256 * lisp.h: Include <stdbool.h>.
5257 (struct Lisp_Boolfwd, defvar_bool):
5258 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5259 * regex.c [!emacs]: Include <stdbool.h>.
5260 (false, true): Remove; <stdbool.h> does this for us now.
5261
5262 2012-08-14 Chong Yidong <cyd@gnu.org>
5263
5264 * character.c (Fcharacterp): Doc fix (Bug#12076).
5265
5266 * data.c (Findirect_variable): Doc fix (Bug#11040).
5267
5268 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5269
5270 * editfns.c (Fformat): Doc fix (Bug#12059).
5271 (Fsave_current_buffer): Doc fix (Bug#11542).
5272
5273 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5274
5275 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5276 (bug#12022).
5277
5278 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5279
5280 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5281 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5282 * minibuf.c (choose_minibuf_frame, read_minibuf):
5283 * w32fns.c (x_create_tip_frame):
5284 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5285 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5286
5287 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5288
5289 * intervals.c (offset_intervals): Remove obsolete comment.
5290
5291 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5292
5293 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5294
5295 2012-08-14 Gergely Risko <gergely@risko.hu>
5296
5297 * coding.c (decode_coding): Record buffer modification before
5298 disabling undo_list (Bug#11773).
5299
5300 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5301
5302 Revert and cleanup some recent overlay changes.
5303 * buffer.h (enum overlay_type): Remove.
5304 (buffer_get_overlays, buffer_set_overlays): Likewise.
5305 (buffer_set_overlays_before, buffer_set_overlays_after):
5306 New function. Adjust users.
5307 (unchain_both): Add eassert.
5308
5309 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5312
5313 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5314
5315 * gtkutil.c (xg_mark_data): Don't assume C99.
5316
5317 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5318
5319 * gtkutil.c (xg_frame_tb_info): New struct.
5320 (TB_INFO_KEY): New define.
5321 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5322 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5323 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5324 if not present.
5325 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5326 is up to date. Otherwise store new data.
5327 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5328
5329 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5330
5331 Use KSET for write access to Lisp_Object members of struct kboard.
5332 * keyboard.h (KSET): New macro.
5333 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5334 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5335 * xterm.c: Adjust users.
5336
5337 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5338
5339 Use BSET for write access to Lisp_Object members of struct buffer.
5340 * buffer.h (BSET): New macro.
5341 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5342 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5343 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5344 * window.c, xdisp.c, xfns.c: Adjust users.
5345
5346 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5347
5348 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5349
5350 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5351
5352 * nsterm.m (not_in_argv): New function.
5353 (application:openFile, application:openTempFile:):
5354 (application:openFileWithoutUI:, application:openFiles:): Open file
5355 if not_in_argv returns non-zero (bug#12171).
5356
5357 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5358 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5359 Define for Gtk+ versions less than 3.2.
5360 (xg_get_font_name): Use those functions/macros here.
5361 Reported by Frans Oilinki <moilinki@gmail.com>.
5362
5363 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5364
5365 * unexmacosx.c (copy_data_segment): Copy initialized data in
5366 statically linked libraries from input file rather than memory.
5367
5368 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5369 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5370 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5371
5372 2012-08-10 Glenn Morris <rgm@gnu.org>
5373
5374 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5375 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5376
5377 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5378
5379 Fix last change to allow compilation with low optimization levels.
5380 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5381 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5382
5383 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5384
5385 Use common inline syntax in intervals.h.
5386 * intervals.h (INTERVALS_INLINE): New macro.
5387 Change all users from LISP_INLINE.
5388
5389 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5390
5391 Define Qnone once for all platforms.
5392 * frame.c (Qnone): Define here.
5393 (syms_of_frame): DEFSYM it.
5394 * lisp.h (Qnone): New declaration.
5395 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5396 * xfns.c: Remove duplication. Adjust users.
5397
5398 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5399
5400 Remove unused macros from intervals.h.
5401 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5402 * intervals.c: Adjust comment.
5403
5404 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5405
5406 * w32fns.c <w32_unicode_gui>: New static variable.
5407 (globals_of_w32fns): Initialize it according to os_subtype.
5408 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5409 testing os_subtype.
5410
5411 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5412 Eli Zaretskii <eliz@gnu.org>
5413
5414 Fix bug #10299 with Unicode characters sent by customized
5415 keyboards created by MSKLC.
5416 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5417 (w32_init_class): Use it to initialize the Emacs class with either
5418 ANSI or Unicode API calls.
5419 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5420 later.
5421 (w32_wnd_proc): If the character code sent by WM_CHAR or
5422 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5423 original message. Call DefWindowProcW on NT and later.
5424
5425 2012-08-10 Glenn Morris <rgm@gnu.org>
5426
5427 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5428
5429 * lisp.h (DIRECTORY_SEP): Let configure set it.
5430
5431 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5432
5433 Use TSET for write access to Lisp_Object slots of struct terminal.
5434 * termhooks.h (TSET): New macro.
5435 * coding.c, terminal.c, xselect.c: Adjust users.
5436
5437 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5438
5439 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5440 the failing expression, include them in the error message.
5441 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5442 * lisp.h (internal_condition_case_n): Update declaration.
5443
5444 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5445
5446 Inline functions to examine and change buffer overlays.
5447 * buffer.c (unchain_both): New function.
5448 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5449 (buffer_has_overlays): New function.
5450 (enum overlay_type): New enum.
5451 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5452 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5453
5454 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 Inline functions to examine and change buffer intervals.
5457 * alloc.c (mark_interval_tree): Remove.
5458 (MARK_INTERVAL_TREE): Simplify.
5459 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5460 * intervals.c (buffer_balance_intervals): New function.
5461 (graft_intervals_into_buffer): Adjust indentation.
5462 (set_intervals_multibyte): Simplify.
5463 * buffer.h (BUF_INTERVALS): Remove.
5464 (buffer_get_intervals, buffer_set_intervals): New function.
5465 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5466 * intervals.c, textprop.c: Adjust users.
5467
5468 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5469
5470 Inline functions to examine and change string intervals.
5471 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5472 (string_get_intervals, string_set_intervals): New function.
5473 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5474 * lread.c, print.c, textprop.c: Adjust users.
5475
5476 2012-08-08 Glenn Morris <rgm@gnu.org>
5477
5478 * lisp.mk (lisp): Remove language/persian.elc.
5479
5480 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5481
5482 Cleanup intervals.
5483 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5484 (NULL_INTERVAL_P): Likewise. Adjust users.
5485 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5486 Adjust comment. Move under #if 0.
5487 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5488 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5489
5490 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5491
5492 Check total length of intervals with eassert.
5493 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5494 * intervals.c: Change all users to eassert.
5495
5496 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5497
5498 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5499 Rename fields to match removal of FGET and WGET and disuse of
5500 INTERNAL_FIELD in Lisp_Cons.
5501
5502 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5503
5504 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5505 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5506 name since all xname users are fixed long time ago. Do not
5507 use INTERNAL_FIELD.
5508 (set_symbol_name, set_symbol_function, set_symbol_plist):
5509 (set_symbol_next, set_overlay_plist): New function.
5510 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5511 (struct Lisp_Overlay): Likewise.
5512 (CVAR, MVAR, SVAR): Remove.
5513 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5514 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5515 * xterm.c: Adjust users.
5516 * .gdbinit: Change to use name field of struct Lisp_Symbol
5517 where appropriate.
5518
5519 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 Basic functions to set Lisp_Object and pointer slots of intervals.
5522 * intervals.h (interval_set_parent, interval_set_object):
5523 (interval_set_left, interval_set_right, interval_set_plist):
5524 (interval_copy_parent): New function.
5525 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5526 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5527 Adjust indentation.
5528 (INTERVAL_SIZE): Remove. Adjust users.
5529 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5530
5531 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5532
5533 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5534 * process.h (PGET): Remove.
5535 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5536 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5537
5538 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5539
5540 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5541 * window.h (WGET): Remove.
5542 (struct window): Do not use INTERNAL_FIELD.
5543 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5544 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5545 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5546 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5547 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5548 Adjust users.
5549
5550 2012-08-07 Chong Yidong <cyd@gnu.org>
5551
5552 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5553 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5554 (Fdelete_window_internal): Signal an error if the window is not on
5555 a live frame (Bug#12025).
5556
5557 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5558
5559 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5560 * frame.h (FGET): Remove.
5561 (struct frame): Do not use INTERNAL_FIELD.
5562 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5563 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5564 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5565 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5566
5567 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5568
5569 * w32.c: Silence compiler warnings.
5570 (map_w32_filename): Remove unused variable `is_fat'.
5571 (chase_symlinks): Add parentheses around expression.
5572
5573 2012-08-06 Glenn Morris <rgm@gnu.org>
5574
5575 * sysdep.c: Respect BROKEN_GETWD.
5576
5577 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5578 Let configure handle it.
5579 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5580
5581 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5582
5583 Use GCALIGNMENT where appropriate.
5584 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5585 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5586 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5587
5588 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5589
5590 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5591 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5592
5593 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5594
5595 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5596 that should be sufficient for everyone.
5597
5598 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5599
5600 * keyboard.c (timer_check_2): Add break so timer_check returns next
5601 timeout.
5602
5603 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5604
5605 Fix Windows build errors introduced after converting to WGET and WSET.
5606 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5607 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5608
5609 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5610
5611 * nsterm.m (ns_frame_rehighlight): Use FSET.
5612
5613 * nsmenu.m (ns_update_menubar): Use FSET.
5614
5615 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5616
5617 Separate read and write access to Lisp_Object slots of Lisp_Process.
5618 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5619 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5620
5621 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5622
5623 Separate read and write access to Lisp_Object slots of struct window.
5624 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5625 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5626 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5627 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5628 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5629 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5630 Adjust users.
5631
5632 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5633
5634 Fix Windows build errors introduced after converting to FGET and FSET.
5635 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5636 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5637 (w32_judge_scroll_bars): Change to use FSET.
5638 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5639
5640 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5641
5642 Fix replacement typo.
5643 * window.c (replace_window): Set root_window instead of
5644 selected_window. This fixes a total window subsystem
5645 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5646
5647 2012-08-06 Glenn Morris <rgm@gnu.org>
5648
5649 * lisp.mk (lisp): Add language/persian.elc.
5650
5651 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5652
5653 Separate read and write access to Lisp_Object slots of struct frame.
5654 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5655 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5656 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5657 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5658 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5659
5660 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5661
5662 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5663
5664 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5665
5666 Generalize common compile-time constants.
5667 * lisp.h (header_size, bool_header_size, word_size): Now here.
5668 (struct Lisp_Vector): Add comment.
5669 (struct Lisp_Bool_Vector): Move up to define handy constants.
5670 (VECSIZE, PSEUDOVECSIZE): Simplify.
5671 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5672 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5673 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5674 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5675 * xfont.c, xmenu.c: Use word_size where appropriate.
5676
5677 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5678
5679 * search.c (Freplace_match): Treat \? in the replacement text
5680 literally (Bug#8161).
5681
5682 2012-08-05 Chong Yidong <cyd@gnu.org>
5683
5684 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5685 * frame.c (Vdelete_frame_functions):
5686 * emacs.c (Vkill_emacs_hook): Doc fix.
5687
5688 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5689
5690 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5691 --with-x-toolkit=no builds.
5692 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5693
5694 2012-08-04 Chong Yidong <cyd@gnu.org>
5695
5696 * syntax.c (Fmodify_syntax_entry): Doc fix.
5697
5698 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5699
5700 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5701 * w32.c (init_environment): Change the default values of many
5702 environment variables in dflt_envvars[] to NULL, to avoid pushing
5703 them into environment when they were not already defined.
5704 Remove the code that deletes site-lisp subdirectories from the default
5705 value of EMACSLOADPATH, as it is no longer needed.
5706 (check_windows_init_file): Now external, not static.
5707 Use Vload_path as is, without adding anything, as this function is now
5708 called when Vload_path is already set up.
5709
5710 * w32.h (check_windows_init_file): Add prototype.
5711
5712 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5713 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5714 compatibility with Posix platforms.
5715 (main): Move the call to check_windows_init_file to here from
5716 w32.c.
5717 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5718 any, in the DEFALT argument into the root of the Emacs build or
5719 installation tree, as appropriate.
5720
5721 * callproc.c (init_callproc_1): Call decode_env_path instead of
5722 doing its equivalent by hand.
5723 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5724 the code that sets Vexec_path run on MS-Windows.
5725
5726 * lread.c (init_lread): Add comments to #ifdef's.
5727
5728 * msdos.c (dos_set_window_size, IT_update_begin)
5729 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5730 instead of direct references.
5731
5732 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5733
5734 Export DEFAULT_REHASH_* to GDB.
5735 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5736 Now constants, not macros.
5737
5738 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 Remove unnecessary casts involving pointers.
5741 These casts are no longer needed now that we assume C89 or later,
5742 since they involve casting to or from void *.
5743 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5744 (make_pure_float, make_pure_vector):
5745 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5746 * macros.c (Fstart_kbd_macro):
5747 * menu.c (find_and_return_menu_selection):
5748 * minibuf.c (read_minibuf_noninteractive):
5749 * sysdep.c (closedir):
5750 * xdisp.c (x_produce_glyphs):
5751 * xfaces.c (compare_fonts_by_sort_order):
5752 * xfns.c (x_real_positions, select_visual):
5753 * xselect.c (x_stop_queuing_selection_requests)
5754 (x_get_window_property, x_get_window_property_as_lisp_data):
5755 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5756 Remove unnecessary pointer casts.
5757 * alloc.c (record_xmalloc): New function.
5758 * lisp.h (record_xmalloc): New decl.
5759 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5760 more like a function. This is because the pointer cast is not
5761 needed. All uses changed.
5762 * print.c (print_string, print_error_message): Avoid length recalc.
5763
5764 Improve fix for macroexp crash with debugging (Bug#12118).
5765 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5766 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5767 not supposed to be invoked from the garbage collector.
5768 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5769 (gc_aset): New function, which is like ASET but can be
5770 used in the garbage collector.
5771 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5772 (set_hash_index): Use it instead of ASET.
5773
5774 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5775
5776 Support symlinks on latest versions of MS-Windows.
5777 * w32.c: Include winioctl.h and aclapi.h.
5778 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5779 (revert_to_self): Forward declarations of static functions.
5780 <static BOOL g_b_init_get_security_info>:
5781 <g_b_init_create_symbolic_link>: New static flags.
5782 (globals_of_w32): Initialize them to zero.
5783 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5784 (map_w32_filename): Improve commentary. Simplify switch.
5785 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5786 headers (most versions of MinGW w32api don't).
5787 (get_security_info, create_symbolic_link)
5788 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5789 New functions.
5790 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5791 in the argument file name.
5792 (sys_access): Call unc_volume_file_attributes only if
5793 GetFileAttributes fails with network-related error codes.
5794 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5795 have the required privileges.
5796 (get_file_security_desc_by_name): Rename from
5797 get_file_security_desc.
5798 (stat_worker): New function, with most of the guts of 'stat', and
5799 with addition of handling of symlinks and support for 'lstat'.
5800 If possible, get file's attributes and security information by
5801 handle, not by name. Produce S_IFLNK bit for symlinks, when
5802 called from 'lstat'.
5803 (stat, lstat): New functions, call 'stat_worker'.
5804 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5805 symlinks when the underlying filesystem supports them.
5806
5807 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5808
5809 Fix macroexp crash on Windows with debugging (Bug#12118).
5810 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5811 checking subscripts; problem introduced with the recent
5812 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5813 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5814 since it's used in non-static inline functions now.
5815
5816 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5817 Don't assume buffer size fits in 'int'. Remove unused local.
5818
5819 Use C99-style 'extern inline' if available.
5820 * buffer.h (BUFFER_INLINE):
5821 * category.h (CATEGORY_INLINE):
5822 * character.h (CHARACTER_INLINE):
5823 * charset.h (CHARSET_INLINE):
5824 * composite.h (COMPOSITE_INLINE):
5825 * dispextern.h (DISPEXTERN_INLINE):
5826 * lisp.h (LISP_INLINE):
5827 * systime.h (SYSTIME_INLINE):
5828 New macro, replacing 'static inline' in this header.
5829 * buffer.h, category.h, character.h, charset.h, composite.h:
5830 * dispextern.h, lisp.h, systime.h:
5831 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5832 * alloc.c (LISP_INLINE):
5833 * buffer.c (BUFFER_INLINE):
5834 * category.c (CATEGORY_INLINE):
5835 * character.c (CHARACTER_INLINE):
5836 * charset.c (CHARSET_INLINE):
5837 * composite.c (COMPOSITE_INLINE):
5838 * dispnew.c (DISPEXTERN_INLINE):
5839 * sysdep.c (SYSTIME_INLINE):
5840 Define to EXTERN_INLINE, so that the corresponding functions
5841 are compiled into code.
5842 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5843 (INLINE_HEADER_END): New macros.
5844 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5845 since it's used in non-static inline functions now.
5846 (VALMASK) [!USE_LSB_TAG]: Likewise.
5847
5848 2012-08-02 Glenn Morris <rgm@gnu.org>
5849
5850 * s/: Remove empty directory.
5851
5852 * s/ms-w32.h: Move to ../nt/inc.
5853 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5854 Update for new ms-w32.h location.
5855
5856 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5857
5858 Port to Solaris 8.
5859 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5860
5861 2012-08-02 Glenn Morris <rgm@gnu.org>
5862
5863 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5864 hard-coding the path separator.
5865
5866 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5867
5868 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5869 This how ASET and AREF are supposed to work, and makes
5870 it easier to think about future improvements. See
5871 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5872 * charset.h (set_charset_attr): New function.
5873 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5874 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5875 (aref_addr): New function. All uses of &AREF(...) changed.
5876 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5877 (set_hash_index): New functions. All lvalue-style uses of
5878 HASH_KEY etc. changed.
5879 * keyboard.c (set_prop): New function. All lvalue-style uses
5880 of PROP changed.
5881
5882 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5883
5884 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5885 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5886 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5887 * nsfns.m (ns_set_name_as_filename): Likewise.
5888 * nsmenu.m (ns_update_menubar): Likewise.
5889 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5890
5891 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5892
5893 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5894 Adapt to latest changes in field names of the corresponding Lisp
5895 objects.
5896
5897 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5898
5899 2012-08-01 Glenn Morris <rgm@gnu.org>
5900
5901 * s/msdos.h: Remove file.
5902 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5903 * Makefile.in (S_FILE): Remove.
5904 (config_h): Remove S_FILE.
5905
5906 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5907
5908 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5909 Remove; moved to nt/config.nt.
5910
5911 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5912
5913 Use INTERNAL_FIELD for conses and overlays.
5914 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5915 Remove obsolete comment.
5916 (MVAR): New macro.
5917 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5918 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5919
5920 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5921
5922 Use INTERNAL_FIELD for symbols.
5923 * lisp.h (SVAR): New macro. Adjust users.
5924 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5925 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5926
5927 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5928
5929 Use INTERNAL_FIELD for processes.
5930 * process.h (PVAR): New macro. Adjust style.
5931 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5932 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5933
5934 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5935
5936 Use INTERNAL_FIELD for windows.
5937 * window.h (WVAR): New macro.
5938 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5939 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5940 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5941 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5942 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5943 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5944
5945 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5946
5947 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5948
5949 2012-08-01 Glenn Morris <rgm@gnu.org>
5950
5951 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5952 Move to configure.ac.
5953
5954 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5955
5956 * makefile.w32-in (CONFIG_H): Update dependencies.
5957 (CONF_POST_H): New macro.
5958
5959 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5960
5961 2012-07-31 Glenn Morris <rgm@gnu.org>
5962
5963 * Makefile.in (S_FILE): No longer set by configure.
5964
5965 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5966 is available.
5967 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5968
5969 * process.h (NULL_DEVICE):
5970 * emacs.c (SEPCHAR):
5971 * editfns.c (USER_FULL_NAME): Let configure set them.
5972
5973 * s/README, s/template.h: Remove files.
5974
5975 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5976
5977 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5978 Move to configure.ac.
5979
5980 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5981
5982 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5983 resulting renaming of 'struct frame' members.
5984
5985 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5986
5987 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5988 after introduction of FVAR.
5989
5990 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5991
5992 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5993
5994 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5995 instead of compositeToPoint.
5996 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5997
5998 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
5999
6000 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6001
6002 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6003 * lisp.h (INTERNAL_FIELD): New macro.
6004 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6005 (BVAR): Change to use INTERNAL_FIELD.
6006 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6007 (KVAR): Change to use INTERNAL_FIELD.
6008 * frame.h (FVAR): New macro.
6009 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6010 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6011 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6012 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6013 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6014
6015 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6016
6017 Miscellaneous fixes for non-default X toolkits.
6018 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6019 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6020 Move under #ifdef USE_LUCID.
6021 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6022 definition and usage to avoid warnings.
6023
6024 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6025
6026 * nsterm.m (openFiles): Fix previous checkin.
6027
6028 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6029
6030 * indent.c (compute_motion): Remove unused local.
6031
6032 2012-07-31 Glenn Morris <rgm@gnu.org>
6033
6034 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6035
6036 * conf_post.h [USG5_4]:
6037 Move remaining contents of s/usg5-4-common.h here.
6038 * s/usg5-4-common.h: Remove file.
6039
6040 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6041 * s/irix6-5.h: Remove file.
6042
6043 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6044 * s/darwin.h: Remove file.
6045
6046 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6047 * s/hpux10-20.h: Remove file, which is now empty.
6048
6049 2012-07-30 Glenn Morris <rgm@gnu.org>
6050
6051 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6052 * Makefile.in (config_h): Add conf_post.h.
6053 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6054
6055 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6056
6057 * nsterm.m (ns_do_open_file): New variable.
6058 (ns_term_init): Set ns_do_open_file to YES after run returns.
6059 (openFile, openTempFile, openFileWithoutUI, openFiles):
6060 Open files only if ns_do_open_file.
6061
6062 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6065 This no-op macro hasn't been needed for many years.
6066 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6067
6068 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6069 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6070 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6071 gdb_make_enums_visible.
6072 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6073 (DIRECTORY_SEP): Now a constant, not a macro.
6074
6075 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6076
6077 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6078 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6079
6080 * w32term.c <w32_keyboard_codepage>: Renamed from
6081 keyboard_codepage and now external. All users changed.
6082
6083 * w32term.h: Add declaration of w32_keyboard_codepage.
6084
6085 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6086 the codepage to translate keys to Unicode. If this argument is
6087 -1, use the value returned by GetConsoleCP. All callers changed.
6088
6089 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6090
6091 Update .PHONY listings in makefiles.
6092 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6093 bootstrap-clean, distclean, maintainer-clean, versioclean,
6094 extraclean, frc.
6095
6096 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6097 This is a bit clearer. Fix some commentary typos.
6098
6099 2012-07-30 Glenn Morris <rgm@gnu.org>
6100
6101 * s/netbsd.h: Let configure include signal.h if needed.
6102 Remove file, which is now empty.
6103
6104 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6105 Let configure set them.
6106 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6107 No more need to undefine.
6108
6109 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6110
6111 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6112 non-single-byte char when adding meta modifier. (Bug#12090)
6113
6114 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6115
6116 Convert safe_call to use variable number of arguments.
6117 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6118 (safe_call2): Fix comment.
6119 * lisp.h (safe_call): Adjust prototype.
6120 * coding.c (encode_coding_object): Change to use safe_call2.
6121 * xfaces.c (merge_face_heights): Change to use safe_call1.
6122
6123 2012-07-30 Glenn Morris <rgm@gnu.org>
6124
6125 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6126 does that unconditionally. Remove file, which is now empty.
6127
6128 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6129 Remove empty files.
6130
6131 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6132
6133 Export to GDB most of lisp.h's remaining object-like macros.
6134 * lisp.h (min, max): Move earlier, because they're used earlier now.
6135 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6136 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6137 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6138 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6139 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6140 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6141 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6142 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6143 Now constants, for GDB. They need not be macros.
6144 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6145 Now constants, for GDB, as well as macros, for static initializers.
6146 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6147 Move to after the definition of struct Lisp_Char_Table,
6148 since the former now needs that type defined.
6149 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6150 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6151 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6152 New enums, for gdb_make_enums_visible.
6153 (GLYPH_MODE_LINE_FACE): Remove; unused.
6154 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6155 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6156 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6157 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6158 enum maxargs, enum MAX_ALLOCA.
6159 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6160 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6161 no longer needed, now that they are done in lisp.h.
6162
6163 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6164
6165 Cleanup string bytes checking.
6166 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6167 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6168 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6169 (check_sblock, compact_small_strings): Simplify.
6170
6171 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6172
6173 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6174 These macros are confusing and no longer need to be defined, as
6175 the enum values now suffice. All uses replaced with definiens.
6176 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6177
6178 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6179
6180 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6181 ($(BLD)/w32console.$(O)): Update dependencies.
6182
6183 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6184
6185 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6186 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6187 time. Adjust users.
6188 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6189
6190 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6191
6192 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6193 setting sitelisp (Bug#12010).
6194
6195 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6196
6197 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6198
6199 * w32heap.c (cache_system_info):
6200 * w32.c (sys_rename):
6201 * w32proc.c (find_child_console, sys_kill): All users changed.
6202
6203 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6204
6205 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6206
6207 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6208
6209 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6210
6211 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6212
6213 Cleanup statistics calculation in Fgarbage_collect.
6214 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6215 Fix zombies percentage calculation. Simplify elapsed time calculation.
6216
6217 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6218
6219 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6220 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6221 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6222 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6223 (replace_range, replace_range_2, del_range_2): Change to eassert.
6224 * marker.c (byte_char_debug_check): Adjust style.
6225
6226 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6229 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6230 long-ago-commented-out code that talks about "WIN32".
6231 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6232 All uses changed.
6233
6234 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6235
6236 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6237 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6238 Simplify by using alignof.
6239 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6240 * lisp.h: Include <stdalign.h>.
6241 (GCALIGNMENT): New macro and constant.
6242 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6243 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6244 (stdalign): New macro, if not already defined.
6245
6246 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6247
6248 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6249 * w32inevt.c: Include w32inevt.h.
6250 (w32_read_console_input): New inline function, calls either
6251 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6252 w32_console_unicode_input.
6253 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6254 (w32_kbd_patch_key, key_event): Use the codepage returned by
6255 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6256 (key_event): use uChar.UnicodeChar only if
6257 w32_console_unicode_input is non-zero.
6258
6259 * w32console.c: Include w32heap.h.
6260 <w32_console_unicode_input>: New global variable.
6261 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6262 family of Windows, zero otherwise.
6263
6264 * w32inevt.h: Declare w32_console_unicode_input.
6265
6266 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6267 --without-x. (Bug#11742)
6268
6269 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6270
6271 Adjust GDB to reflect pvec_type changes (Bug#12036).
6272 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6273 2012-07-04 changes to pseudovector representation.
6274 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6275
6276 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6277
6278 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6279 bus address.
6280 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6281
6282 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6283
6284 * alloc.c (listn): Fix the order the arguments are consed onto the
6285 list.
6286
6287 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6288 enumeration constants, as PURE and HEAP are too general, and clash
6289 with other headers and sources, such as gmalloc.c and the
6290 MS-Windows system headers. All users changed.
6291
6292 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6293
6294 Revert last save_excursion_save and save_excursion_restore changes.
6295 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6296 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6297
6298 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6299
6300 Fix recently-introduced typos in Windows port.
6301 Reported by Martin Rudalics <rudalics@gmx.at>.
6302 * w32.c (init_environment): Replace comma with semicolon.
6303 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6304
6305 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 Improve GDB symbol export (Bug#12036).
6308 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6309 arms of an 'if', not using conditional expressions; otherwise GDB
6310 complains about the types in the unevaluated arm when the argument
6311 is an integer literal.
6312 (xgetint): Simplify expression.
6313 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6314 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6315 Zaretskii in <http://bugs.gnu.org/12036#13>.
6316 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6317 needed now that we have gdb_make_enums_visible.
6318 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6319 (enum enum_USE_LSB_TAG):
6320 New enum types, packaging up enums that need to be exported to GDB.
6321
6322 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6323
6324 Utility function to make a list from specified amount of objects.
6325 * lisp.h (enum constype): New datatype.
6326 (listn): New prototype.
6327 * alloc.c (listn): New function.
6328 (Fmemory_use_count, syms_of_alloc): Use it.
6329 * buffer.c (syms_of_buffer): Likewise.
6330 * callint.c (syms_of_callint): Likewise.
6331 * charset.c (define_charset_internal): Likewise.
6332 * coding.c (syms_of_coding): Likewise.
6333 * keymap.c (syms_of_keymap): Likewise.
6334 * search.c (syms_of_search): Likewise.
6335 * syntax.c (syms_of_syntax): Likewise.
6336 * w32.c (init_environment): Likewise.
6337 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6338 * xdisp.c (syms_of_xdisp): Likewise.
6339 * xfns.c (syms_of_xfns): Likewise.
6340
6341 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6342
6343 Fast save_excursion_save and save_excursion_restore.
6344 * lisp.h (struct Lisp_Excursion): New data type.
6345 (PVEC_EXCURSION): New pseudovector type.
6346 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6347 to deal with it. Adjust comments.
6348 (init_marker, attach_marker): New prototype.
6349 (unchain_marker): Adjust prototype.
6350 * marker.c (attach_marker): Change to global.
6351 (init_marker): New function.
6352 * alloc.c (Fmake_marker, build_marker): Use it.
6353 (build_marker): More easserts.
6354 (mark_object): Handle struct Lisp_Excursion.
6355 * editfns.c (save_excursion_save, save_excursion_restore):
6356 Reimplement to use struct Lisp_Excursion. Add comments.
6357
6358 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 Fix export of symbols to GDB (Bug#12036).
6361 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6362 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6363 emacs.c, as this is a more-suitable home. Had this been done earlier
6364 the fix for 12036 would have avoided some of the problems noted in
6365 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6366 would have been more obvious.
6367 * emacs.c: Do not include <verify.h>; no longer needed.
6368 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6369 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6370 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6371 Remove; now done in lisp.h.
6372 * lisp.h (PUBLISH_TO_GDB): New macro.
6373 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6374 (DATA_SEG_BITS): Use it.
6375 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6376 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6377 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6378 not be usable in #if. This simplifies things.
6379
6380 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6381
6382 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6383
6384 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6385
6386 Simplify export of symbols to GDB (Bug#12036).
6387 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6388 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6389 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6390 Adjust to changes in lisp.h and emacs.c, by using
6391 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6392 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6393 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6394 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6395 instead of gdb_valbits.
6396 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6397 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6398 instead of gdb_array_mark_flag.
6399 (xboolvector): Get size from $->size, not $->header.size.
6400 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6401 (xreload, hook-run, hookpost-run): Remove.
6402 * emacs.c: Include <verify.h>.
6403 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6404 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6405 Remove.
6406 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6407 (gdb_USE_LSB_TAG): New enum constants.
6408 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6409 Also define these as enum constants, so they're visible to GDB.
6410 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6411 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6412 as constants, so they're visible to GDB.
6413 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6414 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6415 Now enum constants, not macros, so they're visible to GDB.
6416 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6417 more convenient now. All uses changed.
6418 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6419 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6420
6421 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6422
6423 Explicitly free restriction data that are not needed anymore.
6424 * editfns.c (save_restriction_restore): Free restriction data.
6425
6426 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6427
6428 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6429 add argument, tune behavior, and adjust all callers.
6430
6431 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 Use typedef for EMACS_INT, EMACS_UINT.
6434 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6435 than macros. This simplifies debugging in the usual case, since
6436 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6437 and it allows expressions involving EMACS_INT casts.
6438 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6439
6440 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6441
6442 * nsterm.m (ns_read_socket): Return early if there is a modal
6443 window (Bug#12043).
6444
6445 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6446
6447 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6448 that FOCUS-FRAME can be omitted.
6449
6450 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6451
6452 Adjust buffer text indirection counters at the end of Fkill_buffer.
6453 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6454 buffer is definitely dead. This should really fix an issue reported
6455 by Christoph Scholtes again. (Bug#12007).
6456 (init_buffer_once): Initialize indirection counters of
6457 buffer_defaults and buffer_local_symbols (for sanity and safety).
6458
6459 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6460
6461 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6462 and continuation glyphs on tooltip frames, leave them at zero.
6463 Avoids continued lines in tooltips. (Bug#11832)
6464
6465 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6466
6467 Simplify copy_overlay.
6468 * buffer.c (copy_overlay): Simplify. Use build_marker.
6469 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6470
6471 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6472
6473 * print.c (print_object): Don't crash when a frame's name is nil
6474 or invalid. (Bug#12025)
6475
6476 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6477 it signals an error when a tooltip frame is being created.
6478
6479 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6480
6481 Cleanup miscellaneous objects allocation and initialization.
6482 * alloc.c (allocate_misc): Change to static. Add argument to
6483 specify the subtype. Adjust comment and users.
6484 (build_overlay): New function.
6485 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6486 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6487 (allocate_misc): Remove prototype.
6488 (build_overlay): Add prototype.
6489
6490 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6491
6492 Swap buffer text indirection counters in Fbuffer_swap_text.
6493 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6494 This avoids crash reported by Christoph Scholtes at
6495 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6496
6497 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6498
6499 * nsmenu.m (Popdown_data): New struct.
6500 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6501 free Popdown_data.
6502 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6503 (initWithContentRect): Make imgView and contentView non-static
6504 and autorelease them. Also autorelease img and matrix (Bug#12005).
6505 (dealloc): Remove (Bug#12005).
6506
6507 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6508
6509 Adjust consing_since_gc when objects are explicitly freed.
6510 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6511 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6512 (free_cons, free_misc): Subtract object size from consing_since_gc.
6513
6514 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6515
6516 Simplify and cleanup markers positioning code.
6517 * marker.c (attach_marker): More useful eassert.
6518 (live_buffer, set_marker_internal): New function.
6519 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6520 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6521
6522 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6523
6524 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6525 as it's limited by the amount of memory, not by INT_MAX.
6526
6527 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6528
6529 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6530 in special-event-map. See the discussion at
6531 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6532 for the reasons.
6533
6534 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6535 info.dwItemData. Fixes crashes on 64-bit Windows.
6536 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6537
6538 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6539
6540 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6541 (conversationIdentifier): Return value is NSInteger.
6542 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6543
6544 2012-07-21 Chong Yidong <cyd@gnu.org>
6545
6546 * window.c (decode_any_window): Signal an error if the window is
6547 on a dead frame (Bug#11984).
6548
6549 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6550
6551 Add indirection counting to speed up Fkill_buffer.
6552 * buffer.h (struct buffer): New member.
6553 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6554 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6555 base buffer indirection counter.
6556 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6557 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6558 through buffer list if indirection counter is 0.
6559
6560 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6561
6562 Extend the value returned by Fgarbage_collect with heap statistics.
6563 * alloc.c (Qheap): New symbol.
6564 (syms_of_alloc): DEFSYM it.
6565 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6566 (Fmemory_free): Remove.
6567 (syms_of_alloc): Don't defsubr it.
6568 * buffer.c (Fcompact_buffer): Remove.
6569 (syms_of_buffer): Don't defsubr it.
6570
6571 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6572
6573 Make maybe_gc inline.
6574 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6575 * lisp.h (consing_since_gc, gc_relative_threshold)
6576 (memory_full_cons_threshold): Revert declaration.
6577 (maybe_gc): Remove prototype, define as inline.
6578 * alloc.c: Remove old commented-out code.
6579 (consing_since_gc, gc_relative_threshold)
6580 (memory_full_cons_threshold): Revert to global.
6581 (maybe_gc): Remove.
6582
6583 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6584
6585 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6586 * lisp.h (build_unibyte_string): New function.
6587 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6588 * sysdep.c, w32fns.c, xfns.c: Use it.
6589 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6590 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6591 Adjust users accordingly.
6592 * font.h (font_open_by_name): Adjust prototype.
6593
6594 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6595
6596 Cleanup calls to Fgarbage_collect.
6597 * lisp.h (maybe_gc): New prototype.
6598 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6599 Remove declarations.
6600 * alloc.c (maybe_gc): New function.
6601 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6602 Make them static.
6603 * bytecode.c (MAYBE_GC): Use maybe_gc.
6604 * eval.c (eval_sub, Ffuncall): Likewise.
6605 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6606 to avoid dependency from auto-save feature.
6607
6608 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6609
6610 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6611 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6612 'for_each_per_buffer_object_at'.
6613 All uses changed. It's better to use upper-case for macros that
6614 cannot be implemented as functions, to give the reader a clue
6615 that they're special.
6616
6617 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6618
6619 * alloc.c (Fgarbage_collect): Tweak docstring.
6620
6621 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Tweak the value returned from Fgarbage_collect again.
6624 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6625 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6626 Adjust documentation.
6627 (total_vector_bytes): Rename to total_vector_slots, adjust
6628 accounting.
6629 (total_free_vector_bytes): Rename to total_free_vector_slots,
6630 adjust accounting.
6631 (Qstring_bytes, Qvector_slots): New symbols.
6632 (syms_of_alloc): DEFSYM them.
6633
6634 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6635
6636 Buffer compaction primitive which may be used from Lisp.
6637 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6638 (syms_of_buffer): Register Fcompact_buffer.
6639 * alloc.c (Fgarbage_collect): Use compact_buffer.
6640 * buffer.h (compact_buffer): New prototype.
6641 (struct buffer_text): New member.
6642
6643 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6644
6645 New macro to iterate over all buffers, miscellaneous cleanups.
6646 * lisp.h (all_buffers): Remove declaration.
6647 * buffer.h (all_buffers): Add declaration, with comment.
6648 (for_each_buffer): New macro.
6649 * alloc.c (Fgarbage_collect, mark_object): Use it.
6650 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6651 (init_buffer): Likewise.
6652 * data.c (Fset_default): Likewise.
6653 * coding.c (code_conversion_restore): Remove redundant check
6654 for dead buffer.
6655 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6656
6657 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6658
6659 Fix bug that created negative-length intervals.
6660 * intervals.c (merge_interval_right, merge_interval_left):
6661 Do not zero out this interval if it is absorbed by its children,
6662 as this interval's total length doesn't change in that case. See
6663 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6664
6665 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6666
6667 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6668 when invoking (make-bool-vector N t) and N is a positive
6669 multiple of 8 -- the last 8 bits were mistakenly cleared.
6670
6671 Remove some struct layout assumptions in bool vectors.
6672 * alloc.c (bool_header_size): New constant.
6673 (header_size, word_size): Move earlier, as they're now used earlier.
6674 Use 'word_size' in a few more places, where it's appropriate.
6675 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6676 padding before the data member of a bool vector.
6677 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6678 than doing the check by hand with an abort ().
6679
6680 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6681
6682 * eval.c (Fdefvar): Don't check constants since we only set the var if
6683 it's not yet defined anyway (bug#11904).
6684
6685 * lisp.h (last_undo_boundary): Declare new var.
6686 * keyboard.c (command_loop_1): Set it.
6687 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6688 were auto-added by the command loop (bug#11774).
6689
6690 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6691
6692 * w32font.c (Qsymbol): Remove local definition.
6693 (syms_of_w32font): Don't DEFSYM it.
6694
6695 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6696
6697 Fix sweep_vectors to handle large bool vectors correctly.
6698 * alloc.c (sweep_vectors): Account total_vector_bytes for
6699 bool vectors larger than VBLOCK_BYTES_MAX.
6700
6701 2012-07-18 Chong Yidong <cyd@gnu.org>
6702
6703 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6704 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6705
6706 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6707
6708 Return more descriptive data from Fgarbage_collect.
6709 Suggested by Stefan Monnier in
6710 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6711 * alloc.c (bounded_number): New function.
6712 (total_buffers, total_vectors): New variable.
6713 (total_string_size): Rename to total_string_bytes, adjust users.
6714 (total_vector_size): Rename to total_vector_bytes, adjust users.
6715 (sweep_vectors): Account total_vectors and total_vector_bytes.
6716 (Fgarbage_collect): New return value. Adjust documentation.
6717 (gc_sweep): Account total_buffers.
6718 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6719 (VECTOR_SIZE): Remove.
6720 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6721 (Qinterval, Qmisc): New symbols.
6722 (syms_of_data): Initialize them.
6723 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6724 (Qcons, Qbuffer): New declarations.
6725
6726 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6727
6728 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6729 Round up, not down. Improve doc.
6730
6731 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6732
6733 Restore old code in allocate_string_data to avoid Faset breakage.
6734 Reported by Julien Danjou <julien@danjou.info> in
6735 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6736 * alloc.c (allocate_string_data): Restore old code with minor
6737 adjustments, fix comment to explain this subtle issue.
6738
6739 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6740
6741 Remove FILE_SYSTEM_CASE.
6742 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6743
6744 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6745 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6746 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6747 call-process-region passes it through expand-file-name.
6748
6749 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6750
6751 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6752
6753 Fix crash when creating indirect buffer (Bug#11917)
6754 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6755 Don't handle unbound variables specially if non-zero.
6756 (Fbuffer_local_variables): Pass zero.
6757 (clone_per_buffer_values): Pass non-zero.
6758
6759 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6760
6761 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6762 to make the loop interruptible.
6763
6764 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6765
6766 * gnutls.c (emacs_gnutls_handshake): Only retry if
6767 GNUTLS_E_INTERRUPTED.
6768
6769 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6770
6771 Cleanup and convert miscellaneous checks to eassert.
6772 * alloc.c (mark_interval): Fix comment, partially rephrase
6773 old comment from intervals.h (see below).
6774 * intervals.c (find_interval, adjust_intervals_for_insertion)
6775 (delete_interval, adjust_intervals_for_deletion)
6776 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6777 Convert to eassert.
6778 (adjust_intervals_for_insertion, make_new_interval):
6779 Remove obsolete and unused code.
6780 * intervals.h (struct interval): Remove obsolete comment.
6781 * textprotp.c (erase_properties): Remove unused code.
6782 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6783 (Fremove_list_of_text_properties): Convert to eassert.
6784
6785 2012-07-17 Chong Yidong <cyd@gnu.org>
6786
6787 * editfns.c (Finsert_char): Doc fix.
6788
6789 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6790
6791 Fix previous change to make Fmemory_free always accurate.
6792 * alloc.c (make_interval): Update total_free_intervals.
6793 (make_float): Likewise for total_free_floats.
6794 (free_cons, Fcons): Likewise for total_free_conses.
6795 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6796 Likewise for total_free_vector_bytes.
6797 (Fmake_symbol): Likewise for total_free_symbols.
6798 (bytes_free): Remove.
6799
6800 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6801
6802 Simple free memory accounting feature.
6803 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6804 (sweep_vectors): Accumulate size of free vectors.
6805 (Fgarbage_collect): Setup bytes_free.
6806 (Fmemory_free): New function.
6807 (syms_of_alloc): Register it.
6808
6809 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6810
6811 Cleanup overlays checking.
6812 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6813 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6814 eassert and OVERLAYP.
6815 (sort_overlays): Change to use OVERLAYP.
6816
6817 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6818
6819 * editfns.c (Finsert_char): Make it interactive, and make the
6820 second arg optional. Copy interactive spec and docstring from
6821 ucs-insert.
6822
6823 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6824
6825 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6826 Unlike the other wrapped functions, fabs has an unspecified
6827 effect on errno.
6828
6829 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6830
6831 * nsterm.m (keyDown): Interpret flags without left/right bits
6832 as the left key (Bug#11670).
6833
6834 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6835
6836 Remove empty and useless init functions.
6837 * lisp.h (init_character_once, init_fns, init_image)
6838 (init_filelock, init_sound): Remove prototype.
6839 * character.c (init_character_once): Remove.
6840 * filelock.c (init_filelock): Likewise.
6841 * fns.c (init_fns): Likewise.
6842 * image.c (init_image): Likewise.
6843 * sound.c (init_sound): Likewise.
6844 * emacs.c (main): Adjust accordingly.
6845
6846 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6847
6848 * gtkutil.h: Tiny cleanups.
6849 (use_old_gtk_file_dialog): Remove useless declaration.
6850 (xg_uses_old_file_dialog): Add suggested const attribute.
6851
6852 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6853
6854 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6855 (bidi_paragraph_init): Use it to limit search forward for a strong
6856 directional character in abnormally large paragraphs full of
6857 neutral or weak characters. (Bug#11943)
6858
6859 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6860
6861 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6862 the toolbar (Bug#9451).
6863 (xg_make_tool_item): Give the widget event box a transparent
6864 background.
6865
6866 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6867
6868 Cleanup basic allocation variables and functions.
6869 * alloc.c (ignore_warnings, init_intervals, init_float)
6870 (init_cons, init_symbol, init_marker): Remove.
6871 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6872 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6873 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6874 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6875 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6876 (staticidx, init_alloc_once, init_strings, free_ablock):
6877 Remove redundant initialization.
6878 * fns.c (init_weak_hash_tables): Remove.
6879 * lisp.h (init_weak_hash_tables): Remove prototype.
6880
6881 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6882
6883 Use zero_vector where appropriate.
6884 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6885 accordingly.
6886 * lisp.h (zero_vector): New declaration.
6887 * font.c (null_vector): Remove.
6888 (syms_of_font): Remove initialization and staticpro.
6889 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6890 * keymap.c (Faccessible_keymaps): Likewise.
6891
6892 2012-07-15 Leo Liu <sdl.web@gmail.com>
6893
6894 * fringe.c: Fix typo in comments.
6895
6896 2012-07-14 Leo Liu <sdl.web@gmail.com>
6897
6898 * fringe.c: Add a new bitmap exclamation-mark.
6899
6900 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6901
6902 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6903
6904 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6905 (HAVE_MENUS): Don't define, defined by editing config.in with
6906 msdos/sed2v2.inp.
6907 (GMALLOC_INHIBIT_VALLOC): Don't define.
6908 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6909
6910 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6911
6912 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6913
6914 2012-07-14 Glenn Morris <rgm@gnu.org>
6915
6916 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6917 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6918 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6919
6920 2012-07-13 Glenn Morris <rgm@gnu.org>
6921
6922 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6923
6924 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6925 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6926
6927 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6928
6929 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6930 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6931 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6932 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6933 where appropriate.
6934 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6935 as boolean expression.
6936 (x_set_window_size): Remove unused variable toolbar.
6937 (ns_get_color_default, ns_mod_to_lisp): Remove.
6938 (ns_mouse_position): Remove unused variables xchar and ychar.
6939 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6940 (ns_set_vertical_scroll_bar): Remove unused variable count.
6941 (ns_delete_terminal): Remove unused variable i.
6942 (ns_term_init): Remove unused variables r, g and b.
6943 (mouseDown): Remove unused variable window.
6944 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6945 (initFrameFromEmacs): Remove unused variable vbextra.
6946 (mouseEntered): Remove unused variables p and dpyinfo.
6947 (mouseExited): Remove unused variables p and r.
6948 (ns_define_frame_cursor, ns_clear_frame_area)
6949 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6950 (menuDown): Assign [sender tag] to variable and cast the variable.
6951
6952 * nsterm.h (menuDown): Add id as type to argument sender.
6953 (ns_display_info_for_name): Add Lisp_Object argument.
6954 (ns_term_init): Add Lisp_Object argument.
6955 (ns_map_event_to_object): Add void argument.
6956 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6957 prototype with arguments and only declare if __OBJC__.
6958 (nxatoms_of_nsselect): Add void argument.
6959 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6960 (ns_alloc_autorelease_pool): Add void argument.
6961 (ns_release_autorelease_pool): Add void* argument.
6962 (ns_get_defaults_value): Add const char* argument.
6963
6964 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6965 (initFromContents): Use SSDATA where appropriate.
6966 (ns_update_menubar): Add braces to ambigous if-else.
6967 (initWithTitle): Put () around assignment in if statement.
6968 (ns_menu_show): Remove unused variables window and keymap.
6969 (update_frame_tool_bar): Remove unused variable selected_p.
6970 (initWithContentRect): Remove unused variable this_cmd_name.
6971
6972 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6973 appropriate.
6974 (setXBMColor): Remove unused variable len.
6975 (setPixmapData): Put () around assignment in loop statement.
6976
6977 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6978 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6979 where appropriate.
6980 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6981 around assignment in loop statement.
6982 (nsfont_open): Remove unused variable i.
6983 (nsfont_open): Remove unused variable len.
6984 (nsfont_draw): Remove unused variable cs.
6985
6986 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6987 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6988 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6989 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6990 (Fns_font_name, Fns_perform_service)
6991 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6992 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6993 (ns_set_name): Remove unused variable view.
6994 (x_set_menu_bar_lines): Remove unused variable olines.
6995 (x_set_tool_bar_lines): Remove unused variable root_window.
6996 (Fns_list_colors): Put () around assignment in while statement.
6997 (Fns_perform_service): Remove unused variable len.
6998 (Fns_display_usable_bounds): Remove unused variable top.
6999 (syms_of_nsfns): Remove unused variable i.
7000
7001 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7002 memcpy (Bug#11907).
7003
7004 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7005
7006 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7007 and free it with DestroyExceptionInfo (Bug#11558).
7008
7009 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7010
7011 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7012 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7013 Set here, not in nt/config.nt.
7014
7015 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7016
7017 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7018 cursor overflow into the last glyph on display line when the right
7019 fringe is off. (Bug#11832)
7020
7021 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7022
7023 * xdisp.c (produce_special_glyphs): Now static.
7024 * dispextern.h (produce_special_glyphs): Remove decl.
7025
7026 2012-07-13 Glenn Morris <rgm@gnu.org>
7027
7028 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7029 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7030
7031 * s/usg5-4-common.h (USG, USG5):
7032 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7033 * s/sol2-6.h (SOLARIS2):
7034 * s/irix6-5.h (IRIX6_5):
7035 * s/hpux10-20.h (USG, USG5, HPUX):
7036 * s/gnu-linux.h (USG, GNU_LINUX):
7037 * s/freebsd.h (BSD_SYSTEM):
7038 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7039 * s/cygwin.h (CYGWIN):
7040 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7041 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7042
7043 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7044
7045 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7046
7047 2012-07-13 Glenn Morris <rgm@gnu.org>
7048
7049 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7050
7051 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7052
7053 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7054 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7055
7056 2012-07-12 Glenn Morris <rgm@gnu.org>
7057
7058 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7059
7060 * process.c (init_process_emacs): Rename from init_process.
7061 The old name is also the name of a Mach system call.
7062 * lisp.h, emacs.c: Update for this name change.
7063 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7064 longer needed.
7065
7066 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7067
7068 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7069 memmove call that removes glyphs covered by the left truncation
7070 glyph. Improve commentary.
7071 (display_line): Fix display of continuation glyphs on GUI frames
7072 when the right fringe is turned off and variable-size fonts are
7073 used in the window. Move the code that appends a stretch glyph to
7074 produce_special_glyphs, so that it could be used for truncation
7075 and continuation glyphs alike.
7076 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7077 glyph of a suitably computed width, to align the special glyphs at
7078 the window margin. Code moved from display_line. (Bug#11832)
7079
7080 2012-07-12 Glenn Morris <rgm@gnu.org>
7081
7082 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7083
7084 * s/gnu-linux.h, s/hpux10-20.h:
7085 Do not unconditionally define HAVE_XRMSETDATABASE.
7086
7087 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7088
7089 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7090
7091 Fix typos that broke OS X build.
7092 Reported by Randal L. Schwartz in
7093 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7094 * nsterm.m (ns_timeout): Add missing local decl.
7095 (ns_get_color): snprintf -> sprintf, to fix typo.
7096
7097 2012-07-12 Glenn Morris <rgm@gnu.org>
7098
7099 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7100 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7101 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7102 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7103
7104 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7105 Move PTY_OPEN to configure.
7106
7107 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7108 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7109 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7110
7111 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7112
7113 Use empty_unibyte_string where applicable.
7114 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7115 * lread.c (read1): Likewise.
7116 * xsettings.c (syms_of_xsettings): Likewise.
7117
7118 2012-07-12 Glenn Morris <rgm@gnu.org>
7119
7120 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7121 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7122 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7123 * s/hpux10-20.h (RUN_TIME_REMAP):
7124 * s/bsd-common.h (TABDLY): Move to configure.
7125
7126 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7127
7128 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7129
7130 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7131 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7132
7133 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7134
7135 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7136 * s/template.h: Move NARROWPROTO to configure.
7137
7138 2012-07-11 Glenn Morris <rgm@gnu.org>
7139
7140 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7141 unused since 2011-01-17 change to systty.h.
7142
7143 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7144 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7145 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7146
7147 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7150
7151 2012-07-11 Glenn Morris <rgm@gnu.org>
7152
7153 * s/darwin.h, s/gnu-linux.h, s/template.h:
7154 Move INTERRUPT_INPUT to configure.
7155
7156 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7157
7158 Minor adjustments to interning code.
7159 * lisp.h (intern, intern_c_string): Redefine as static inline
7160 wrappers for intern_1 and intern_c_string_1, respectively.
7161 (intern_1, intern_c_string_1): Rename prototypes.
7162 * lread.c (intern_1, intern_c_string_1, oblookup):
7163 Simplify Vobarray checking.
7164 * font.c (font_intern_prop): Likewise. Adjust comment.
7165 * w32font.c (intern_font_name): Likewise.
7166
7167 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7168
7169 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7170
7171 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7172 of Fcar/Fcdr if possible.
7173 * font.c (check_otf_features): Likewise.
7174 * fontset.c (Fnew_fontset): Likewise.
7175 * gnutls.c (Fgnutls_boot): Likewise.
7176 * minibuf.c (read_minibuf): Likewise.
7177 * msdos.c (IT_set_frame_parameters): Likewise.
7178 * xmenu.c (Fx_popup_dialog): Likewise.
7179 * w32menu.c (Fx_popup_dialog): Likewise.
7180
7181 2012-07-11 Glenn Morris <rgm@gnu.org>
7182
7183 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7184 since nothing has defined it on these platforms.
7185
7186 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7187 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7188
7189 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7190 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7191 Move CLASH_DETECTION to configure.
7192
7193 * s/gnu.h: Remove file, which is now empty.
7194
7195 * s/gnu.h, s/gnu-linux.h:
7196 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7197
7198 2012-07-11 John Wiegley <johnw@newartisans.com>
7199
7200 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7201 function attribute, so we only use it if it exists in the
7202 compiler.
7203
7204 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7205
7206 Avoid call to strlen in fast_c_string_match_ignore_case.
7207 * search.c (fast_c_string_match_ignore_case): Change to use
7208 length argument. Adjust users accordingly.
7209 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7210
7211 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 Assume mkdir, rmdir.
7214 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7215 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7216
7217 Assume rename.
7218 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7219
7220 Assume perror.
7221 * s/hpux10-20.h (HAVE_PERROR): Remove.
7222 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7223 Remove dummy definition, as this problem was obsolete long ago.
7224
7225 Assume strerror.
7226 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7227
7228 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7229
7230 Avoid calls to strlen in font processing functions.
7231 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7232 (font_open_by_name): Change to use length argument.
7233 Adjust users accordingly.
7234 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7235 Adjust prototypes.
7236 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7237 Change to return ptrdiff_t.
7238 (xfont_list_pattern, xfont_match): Use length returned by
7239 xfont_decode_coding_xlfd.
7240 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7241
7242 2012-07-11 Glenn Morris <rgm@gnu.org>
7243
7244 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7245 Move DONT_REOPEN_PTY to configure.
7246
7247 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7248 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7249
7250 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7251
7252 Remove "#define unix" that is no longer needed (Bug#11905).
7253 * s/aix4-2.h (unix): Remove; no longer needed.
7254
7255 EMACS_TIME simplification (Bug#11875).
7256 This replaces macros (which typically do not work in GDB)
7257 with functions, typedefs and enums, making the code easier to debug.
7258 The functional style also makes code easier to read and maintain.
7259 * systime.h: Include <sys/time.h> on all hosts, not just if
7260 WINDOWSNT, since 'struct timeval' is needed in general.
7261 (EMACS_TIME): Now a typedef, not a macro.
7262 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7263 not macros.
7264 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7265 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7266 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7267 (EMACS_TIME_LE): Now functions, not macros.
7268 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7269 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7270 which are not functions. All uses rewritten to use:
7271 (make_emacs_time): New function.
7272 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7273 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7274 not functions. All uses rewritten to use the following, respectively:
7275 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7276 (add_emacs_time, sub_emacs_time): New functions.
7277 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7278 * fileio.c (Fcopy_file):
7279 * xterm.c (XTflash): Get the current time closer to when it's used.
7280 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7281
7282 * bytecode.c (targets): Suppress -Woverride-init warnings.
7283
7284 Simplify by avoiding confusing use of strncpy etc.
7285 * doc.c (Fsnarf_documentation):
7286 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7287 * frame.c (Fmake_terminal_frame):
7288 * gtkutil.c (get_utf8_string):
7289 * lread.c (openp):
7290 * nsmenu.m (ns_update_menubar):
7291 * regex.c (regerror):
7292 Prefer memcpy to strncpy and strncat when either will do.
7293 * fileio.c (Fsubstitute_in_file_name):
7294 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7295 (menu_separator_name_p):
7296 * nsmenu.m (ns_update_menubar):
7297 Prefer memcmp to strncmp when either will do.
7298 * nsterm.m: Include <ftoastr.h>.
7299 (ns_get_color):
7300 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7301 Prefer snprintf to strncpy.
7302 * nsterm.m (ns_term_init):
7303 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7304 * nsterm.m (ns_term_init):
7305 Avoid the need for strncpy, by using build_string or
7306 make_unibyte_string directly. Use dtoastr, not snprintf.
7307 * process.c (Fmake_network_process): Diagnose service names that
7308 are too long, rather than silently truncating them or creating
7309 non-null-terminated names.
7310 (Fnetwork_interface_info): Likewise, for interface names.
7311 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7312 Prefer sprintf to strncat.
7313 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7314 Prefer vsnprintf to vsprintf + strncpy.
7315
7316 2012-07-10 Glenn Morris <rgm@gnu.org>
7317
7318 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7319 Clarify fallback case.
7320
7321 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7322
7323 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7324 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7325 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7326 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7327 where argument type is known to be a Lisp_Cons.
7328
7329 2012-07-10 Tom Tromey <tromey@redhat.com>
7330
7331 * bytecode.c (BYTE_CODE_THREADED): New macro.
7332 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7333 (enum byte_code_op): New type.
7334 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7335 (exec_byte_code): Use them. Use token threading when applicable.
7336
7337 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7338
7339 Optimize pure C strings initialization.
7340 * lisp.h (make_pure_string): Fix prototype.
7341 (build_pure_c_string): New function, defined as static inline. This
7342 provides a better opportunity to optimize away calls to strlen when
7343 the function is called with compile-time constant argument.
7344 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7345 argument, adjust users accordingly. Use build_pure_c_string where
7346 appropriate.
7347 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7348 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7349 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7350
7351 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7352
7353 Avoid calls to strlen in miscellaneous functions.
7354 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7355 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7356 * lread.c (openp): Likewise.
7357
7358 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7359
7360 Avoid calls to strlen in path processing functions.
7361 * fileio.c (file_name_as_directory): Add comment. Change to add
7362 srclen argument and return the length of result. Adjust users
7363 accordingly.
7364 (directory_file_name): Fix comment. Change to add srclen argument,
7365 swap 1st and 2nd arguments to obey the common convention.
7366 Adjust users accordingly.
7367 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7368
7369 2012-07-10 Glenn Morris <rgm@gnu.org>
7370
7371 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7372 Move PENDING_OUTPUT_COUNT definition to configure.
7373
7374 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7375 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7376 * s/gnu.h (DATA_START): Move definitions to configure.
7377
7378 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7379 We include usg5-4-common.h, which defines them both.
7380
7381 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7382 O_RDONLY already includes it).
7383
7384 Stop ns builds setting the EMACSLOADPATH environment variable.
7385 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7386 Now it does not set EMACSLOADPATH, just returns the load-path string.
7387 * nsterm.h: Update accordingly.
7388 * lread.c [HAVE_NS]: Include nsterm.h.
7389 (init_lread) [HAVE_NS]: Use ns_load_path.
7390 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7391
7392 2012-07-09 Glenn Morris <rgm@gnu.org>
7393
7394 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7395 since the included bsd-common.h does so.
7396
7397 Stop ns builds setting the EMACSPATH environment variable.
7398 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7399 (ns_init_paths): Do not set EMACSPATH.
7400 * nsterm.h (ns_exec_path): Add it.
7401 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7402 Use ns_exec_path.
7403
7404 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7405
7406 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7407
7408 * process.c (wait_reading_process_output): 'waitchannels' was unset
7409 when read_kbd || !NILP (wait_for_cell); fix this.
7410
7411 Add GCC-style 'const' attribute to functions that can use it.
7412 * character.h (char_resolve_modifier_mask):
7413 * keyboard.h (make_ctrl_char):
7414 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7415 (init_character_once, next_almost_prime, init_fns, init_image)
7416 (flush_pending_output, init_sound):
7417 * mem-limits.h (start_of_data):
7418 * menu.h (finish_menu_items):
7419 Add ATTRIBUTE_CONST.
7420 * emacs.c (DEFINE_DUMMY_FUNCTION):
7421 Declare the dummy function with ATTRIBUTE_CONST.
7422 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7423 Add decls with ATTRIBUTE_CONST.
7424
7425 Minor improvements to make_formatted_string.
7426 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7427 where int is good enough, as vsprintf returns an int.
7428 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7429
7430 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7431
7432 Use make_formatted_string to avoid double length calculation.
7433 * lisp.h (make_formatted_string): New prototype.
7434 * alloc.c (make_formatted_string): New function.
7435 * buffer.c (Fgenerate_new_buffer_name): Use it.
7436 * dbusbind.c (syms_of_dbusbind): Likewise.
7437 * editfns.c (Fcurrent_time_zone): Likewise.
7438 * filelock.c (get_boot_time): Likewise.
7439 * frame.c (make_terminal_frame, set_term_frame_name)
7440 (x_report_frame_params): Likewise.
7441 * image.c (gs_load): Likewise.
7442 * minibuf.c (get_minibuffer): Likewise.
7443 * msdos.c (dos_set_window_size): Likewise.
7444 * process.c (make_process): Likewise.
7445 * xdisp.c (ensure_echo_area_buffers): Likewise.
7446 * xsettings.c (apply_xft_settings): Likewise.
7447
7448 2012-07-09 Glenn Morris <rgm@gnu.org>
7449
7450 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7451 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7452 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7453 * nsterm.h (ns_etc_directory): Add it.
7454 * callproc.c [HAVE_NS]: Include nsterm.h.
7455 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7456
7457 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7458
7459 Move marker debugging code under MARKER_DEBUG.
7460 * marker.c (MARKER_DEBUG): Move marker debugging code under
7461 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7462 for bootstrap with --enable-checking (~3x slowdown reported
7463 by Juanma Barranquero <lekktu@gmail.com>).
7464 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7465
7466 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7469 See <http://bugs.gnu.org/11825#29>.
7470
7471 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7472
7473 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7474 has no font, use the frame's font. (Bug#11813)
7475 (display_line): Add commentary about displaying truncation glyphs
7476 on GUI frames.
7477 (produce_special_glyphs): Move here from term.c.
7478
7479 * term.c (produce_special_glyphs): Move to xdisp.c.
7480
7481 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7482 section.
7483
7484 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7485
7486 * xdisp.c (display_line): Avoid warning about implicit declaration
7487 of FRAME_FONT.
7488
7489 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7490
7491 * lisp.h: Remove empty conditional.
7492
7493 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7494
7495 * lread.c (load_path_check): Now static.
7496
7497 Fix some minor --with-ns problems found by static checking.
7498 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7499 (x_set_font) [!HAVE_X_WINDOWS]:
7500 * image.c (xpm_load_image) [HAVE_NS]:
7501 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7502 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7503 Remove unused local.
7504 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7505 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7506 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7507 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7508 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7509 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7510 Fix pointer signedness problem.
7511 * xfaces.c (FRAME_X_FONT_TABLE):
7512 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7513
7514 2012-07-07 Glenn Morris <rgm@gnu.org>
7515
7516 * lread.c (load_path_check): New function, split from init_lread.
7517 (init_lread): Reorganize. Motivation:
7518 If EMACSLOADPATH is set, check/warn about that rather than the
7519 defaults, which we are not going to use. Hence we can remove
7520 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7521 Don't warn if site-lisp directories are missing.
7522 If not installed, start from a blank load-path, since
7523 PATH_LOADSEARCH refers to the eventual installation directories.
7524
7525 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7526
7527 Support truncation and continuation glyphs on GUI frames, when
7528 fringes are disabled. (Bug#11832)
7529 * xdisp.c (init_iterator): Get dimensions of truncation and
7530 continuation glyphs even if on GUI frames.
7531 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7532 or both, are absent.
7533 (start_display, move_it_in_display_line_to): Handle the case of a
7534 GUI frame without a fringe to display continuation or truncation
7535 glyphs.
7536 (insert_left_trunc_glyphs): Support GUI frames: make sure
7537 truncation glyphs overwrite enough glyphs from the current line to
7538 have sufficient space in pixels.
7539 (display_line): Support truncation and continuation glyphs on GUI
7540 frames. If some spare pixels are left on the line after inserting
7541 the truncation glyphs, fill that space with a stretch glyph of a
7542 suitably computed width.
7543
7544 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7545 produce_glyphs, to support GUI sessions.
7546
7547 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7550
7551 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7552
7553 Do not require float-time's arg to fit in time_t (Bug#11825).
7554 This works better on hosts where time_t is unsigned, and where
7555 float-time is applied to the (negative) difference between two times.
7556 * editfns.c (decode_time_components): Last arg is now double *,
7557 not int *, and means to store all the result as a double, without
7558 worrying about whether the seconds part fits in time_t.
7559 All callers changed.
7560 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7561 All callers changed.
7562 (Ffloat_time): Do not fail merely because the specified time falls
7563 outside of time_t range.
7564
7565 2012-07-07 Glenn Morris <rgm@gnu.org>
7566
7567 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7568 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7569 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7570
7571 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7572
7573 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7574 Update dependencies.
7575
7576 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7577
7578 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7579
7580 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7581 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7582 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7583 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7584 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7585 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7586
7587 * xfont.c (compare_font_names): Redo to omit the need for casts.
7588
7589 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7590
7591 * xfns.c (Fx_change_window_property): Doc fix.
7592 * w32fns.c (Fx_change_window_property): Doc fix.
7593
7594 * w32fns.c (Fx_window_property): Accept the same arguments as the
7595 X Windows version. Doc fix.
7596 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7597
7598 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7599 Eli Zaretskii <eliz@gnu.org>
7600
7601 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7602 Windows-specific code from nt/config.nt moved here.
7603 Obsolete settings removed.
7604
7605 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7606
7607 * process.c: Avoid unnecessary calls to gettime.
7608 (wait_reading_process_output): Don't get the time of day
7609 when gobbling data immediately and not waiting, as there's no need
7610 for it in that case. This removes a FIXME.
7611
7612 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7613
7614 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7615 is defined (Bug#11768).
7616
7617 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7618
7619 Fix marker debugging code.
7620 * marker.c (byte_char_debug_check): Do not perform the check
7621 if buffer is not multibyte.
7622 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7623 Call byte_char_debug_check with correct arguments.
7624
7625 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7626
7627 Compile marker debugging code only if ENABLE_CHECKING is defined.
7628 * marker.c (byte_char_debug_check, count_markers):
7629 Use only if ENABLE_CHECKING is defined.
7630 (byte_debug_flag): Remove.
7631 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7632 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7633
7634 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7635
7636 Avoid code repetition in marker-related functions.
7637 * marker.c (attach_marker): New function.
7638 (Fset_marker, set_marker_restricted, set_marker_both)
7639 (set_marker_restricted_both): Use it.
7640 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7641 Consistently rename charno to charpos.
7642 (marker_position): Add eassert.
7643 (marker_byte_position): Convert to eassert.
7644
7645 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7646
7647 Simplify list operations in unchain_overlay and unchain_marker.
7648 * buffer.c (unchain_overlay): Simplify. Add comment.
7649 * marker.c (unchain_marker): Simplify. Fix comments.
7650
7651 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7652
7653 Introduce fast path for the widely used marker operation.
7654 * alloc.c (build_marker): New function.
7655 * lisp.h (build_marker): New prototype.
7656 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7657 * composite.c (autocmp_chars): Likewise.
7658 * editfns.c (buildmark): Remove.
7659 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7660 (save_restriction_save): Use build_marker.
7661 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7662 * window.c (save_window_save): Likewise.
7663
7664 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7665
7666 Do not use Fdelete_overlay in delete_all_overlays
7667 to avoid redundant calls to unchain_overlay.
7668 * buffer.c (drop_overlay): New function.
7669 (delete_all_overlays, Fdelete_overlay): Use it.
7670 * minibuf.c (get_minibuffer): Fix comment.
7671
7672 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 Port to OpenBSD 5.1 amd64.
7675 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7676 This is needed for OpenBSD, and should be harmless on all BSD systems.
7677 Also, include <sys/sysctl.h>, as it should be available on all
7678 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7679 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7680 use p_pid member, not kp_proc.pid.
7681
7682 2012-07-06 Glenn Morris <rgm@gnu.org>
7683
7684 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7685
7686 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7687
7688 More xmalloc and related cleanup.
7689 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7690 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7691 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7692 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7693 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7694 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7695 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7696 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7697 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7698 * xterm.c:
7699 Omit needless casts involving void * pointers and allocation.
7700 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7701 as the former is more robust if P's type is changed.
7702 Prefer xzalloc to xmalloc + memset 0.
7703 Simplify malloc-or-realloc to realloc.
7704 Don't worry about xmalloc returning a null pointer.
7705 Prefer xstrdup to xmalloc + strcpy.
7706 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7707 growing it.
7708 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7709 alloca of a constant.
7710
7711 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7712
7713 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7714 hscroll is larger than the line width. Fixes long and futile
7715 looping inside extend_face_to_end_of_line (on a TTY) producing
7716 glyphs that are not needed and thrown away.
7717
7718 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7719
7720 * marker.c (set_marker_restricted_both): Simplify by using
7721 clip_to_bounds.
7722
7723 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7724
7725 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7726
7727 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7728
7729 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7730 not defined (Bug#11768).
7731 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7732 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7733 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7734 followed by gtk_box_set_homogeneous (Bug#11768).
7735 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7736 (update_theme_scrollbar_width, xg_create_scroll_bar):
7737 Use gtk_scrollbar_new (Bug#11768).
7738 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7739 (is_box_type): New function (Bug#11768).
7740 (xg_tool_item_stale_p): Call is_box_type.
7741 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7742 with default display (Bug#11768).
7743
7744 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7745
7746 * xdisp.c (window_hscroll_limited): New function.
7747 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7748 coordinates when window's hscroll is set to insanely large
7749 values. (Bug#11857)
7750
7751 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7752
7753 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7754 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7755
7756 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7757
7758 Cleanup xmalloc.
7759 * lisp.h (xzalloc): New prototype. Omit needless casts.
7760 * alloc.c (xzalloc): New function. Omit needless casts.
7761 * charset.c: Omit needless casts. Convert all calls to
7762 xmalloc with following memset to xzalloc.
7763 * dispnew.c: Likewise.
7764 * fringe.c: Likewise.
7765 * image.c: Likewise.
7766 * sound.c: Likewise.
7767 * term.c: Likewise.
7768 * w32fns.c: Likewise.
7769 * w32font.c: Likewise.
7770 * w32term.c: Likewise.
7771 * xfaces.c: Likewise.
7772 * xfns.c: Likewise.
7773 * xterm.c: Likewise.
7774 * atimer.c: Omit needless casts.
7775 * buffer.c: Likewise.
7776 * callproc.c: Likewise.
7777 * ccl.c: Likewise.
7778 * coding.c: Likewise.
7779 * composite.c: Likewise.
7780 * doc.c: Likewise.
7781 * doprnt.c: Likewise.
7782 * editfns.c: Likewise.
7783 * emacs.c: Likewise.
7784 * eval.c: Likewise.
7785 * filelock.c: Likewise.
7786 * fns.c: Likewise.
7787 * gtkutil.c: Likewise.
7788 * keyboard.c: Likewise.
7789 * lisp.h: Likewise.
7790 * lread.c: Likewise.
7791 * minibuf.c: Likewise.
7792 * msdos.c: Likewise.
7793 * print.c: Likewise.
7794 * process.c: Likewise.
7795 * region-cache.c: Likewise.
7796 * search.c: Likewise.
7797 * sysdep.c: Likewise.
7798 * termcap.c: Likewise.
7799 * terminal.c: Likewise.
7800 * tparam.c: Likewise.
7801 * w16select.c: Likewise.
7802 * w32.c: Likewise.
7803 * w32reg.c: Likewise.
7804 * w32select.c: Likewise.
7805 * w32uniscribe.c: Likewise.
7806 * widget.c: Likewise.
7807 * xdisp.c: Likewise.
7808 * xmenu.c: Likewise.
7809 * xrdb.c: Likewise.
7810 * xselect.c: Likewise.
7811
7812 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 * fileio.c (time_error_value): Check the right error number.
7815 Problem reported by Troels Nielsen in
7816 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7817
7818 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7821 This should be fixed in a better way; see Eli Zaretskii in
7822 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7823 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7824
7825 * fileio.c (time_error_value): Rename from special_mtime.
7826 The old name's problems were noted by Eli Zaretskii in
7827 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7828
7829 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7830 This variable's comment says Emacs needs at least one GDB-visible
7831 symbol of type enum pvec_type, to work around GDB problems.
7832 The symbol's value doesn't matter.
7833
7834 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7835 that causes compilation to fail on pre-C99 compilers.
7836
7837 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7838
7839 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7840 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7841
7842 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7843
7844 * buffer.c (init_buffer_once): Fix initialization of
7845 headers for buffer_defaults and buffer_local_symbols.
7846 Reported by Juanma Barranquero <lekktu@gmail.com>.
7847
7848 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7849
7850 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7851 * lisp.h (enum pvec_type): Use fewer bits.
7852 (PSEUDOVECTOR_SIZE_BITS): New constant.
7853 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7854 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7855 change in pvec_type.
7856 (PSEUDOVECTOR_TYPEP): New macro.
7857 (TYPED_PSEUDOVECTORP): Use it.
7858 * fns.c (internal_equal): Adapt code to extract pvectype.
7859 * emacs.c (gdb_pvec_type): Update type.
7860 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7861 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7862 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7863 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7864 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7865 abusing vector->header.next.nbytes.
7866 (live_vector_p): Use PVEC_TYPE.
7867 (mark_object): Adapt code to extract pvectype. Use switch.
7868
7869 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7870
7871 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7872 Tighten new eassert a bit.
7873
7874 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7875
7876 Fix compilation with --enable-gcc-warnings and -O1
7877 optimization level.
7878 * doprnt.c (doprnt): Change type of tem to int, initialize
7879 to avoid compiler warning. Add eassert.
7880 * search.c (simple_search): Initialize match_byte to avoid
7881 compiler warning. Add eassert.
7882
7883 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7884
7885 Avoid weird behavior with large horizontal scrolls.
7886 Without this change, for example, large hscroll values would
7887 mess up Emacs's display on Fedora 15 x86, presumably due to
7888 overflows in int calculations in the display code.
7889 Also, if buffers had long lines, Emacs would freeze.
7890 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7891 (set_window_hscroll): New function, containing the old guts of
7892 Fset_window_hscroll. Return the clipped value.
7893 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7894 This avoids the need to check against PTRDIFF_MAX.
7895
7896 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7897
7898 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7899
7900 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7901
7902 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7905 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7906 since GCC 4.4.6 issues a bogus warning for them.
7907
7908 Fix bugs in file timestamp newness comparisons.
7909 * fileio.c (Ffile_newer_than_file_p):
7910 * lread.c (Fload): Use full timestamp resolution of files,
7911 not just the 1-second resolution, so that files that are only
7912 slightly newer still count as newer.
7913 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7914 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7915
7916 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7917
7918 * fileio.c: Improve handling of file time marker. (Bug#11852)
7919 (special_mtime): New function.
7920 (Finsert_file_contents, Fverify_visited_file_modtime):
7921 Use it to set special mtime values consistently.
7922
7923 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7924
7925 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7926 marker for non-existing file. (Bug#11852)
7927
7928 2012-07-03 Glenn Morris <rgm@gnu.org>
7929
7930 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7931 and did not make it into globals.h).
7932
7933 2012-07-03 Tom Tromey <tromey@redhat.com>
7934
7935 * window.c (Fset_window_margins, Fset_window_fringes)
7936 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7937 * textprop.c (Fprevious_property_change): No longer static.
7938 * syntax.c (Fsyntax_table_p): No longer static.
7939 * process.c (Fget_process, Fprocess_datagram_address): No longer
7940 static.
7941 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7942 * keyboard.c (Fcommand_execute): No longer static.
7943 Remove EXFUN.
7944 * insdel.c (Fcombine_after_change_execute): No longer static.
7945 * image.c (Finit_image_library): No longer static.
7946 * fileio.c (Fmake_symbolic_link): No longer static.
7947 * eval.c (Ffetch_bytecode): No longer static.
7948 * editfns.c (Fuser_full_name): No longer static.
7949 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7950 No longer static.
7951 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7952 static.
7953 * dired.c (Ffile_attributes): No longer static.
7954 * composite.c (Fcomposition_get_gstring): No longer static.
7955 * callproc.c (Fgetenv_internal): No longer static.
7956
7957 * ccl.h: Remove EXFUNs.
7958 * buffer.h: Remove EXFUNs.
7959 * dispextern.h: Remove EXFUNs.
7960 * intervals.h: Remove EXFUNs.
7961 * fontset.h: Remove EXFUN.
7962 * font.h: Remove EXFUNs.
7963 * dosfns.c (system_process_attributes): Remove EXFUN.
7964 * keymap.h: Remove EXFUNs.
7965 * lisp.h: Remove EXFUNs.
7966 * w32term.h: Remove EXFUNs.
7967 * window.h: Remove EXFUNs.
7968 * xsettings.h: Remove EXFUN.
7969 * xterm.h: Remove EXFUN.
7970
7971 2012-07-03 Glenn Morris <rgm@gnu.org>
7972
7973 * lisp.h (Frandom): Make it visible to C.
7974 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7975 buffer for invisible buffers. (Bug#1229)
7976
7977 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7978
7979 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7980 values which aren't power of 2.
7981 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7982 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7983 accordingly.
7984
7985 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7986
7987 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7988
7989 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7990
7991 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7992
7993 * alloc.c (allocate_vector_block): Remove redundant
7994 calls to mallopt if DOUG_LEA_MALLOC is defined.
7995 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7996 avoid calls to mallopt if zero_vector is returned.
7997
7998 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7999
8000 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8001 is enabled, avoid dereferencing NULL current_sblock if
8002 running undumped.
8003
8004 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8005
8006 Cleanup basic buffer management.
8007 * buffer.h (struct buffer): Change layout to use generic vector
8008 marking code. Fix some comments. Change type of 'clip_changed'
8009 to bitfield. Remove unused #ifndef old.
8010 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8011 (GET_OVERLAYS_AT): Fix indentation.
8012 (for_each_per_buffer_object_at): New macro.
8013 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8014 (Fbuffer_local_variables): Use it.
8015 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8016 * alloc.c (allocate_buffer): Adjust to match new layout of
8017 struct buffer. Fix comment.
8018 (mark_overlay): New function.
8019 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8020 Lisp area of struct buffer.
8021 (mark_object): Use it. Adjust marking of misc objects
8022 and related comments.
8023
8024 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8025
8026 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8027 wrapper that is not needed because the wrapped code is a no-op (zero
8028 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8029 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8030
8031 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8032
8033 * alloc.c (mark_buffer): Simplify. Remove prototype.
8034 (mark_object): Add comment. Reorganize marking of vector-like
8035 objects. Use CHECK_LIVE for all vector-like objects except buffers
8036 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8037 Avoid redundant calls to mark_vectorlike for bool vectors.
8038
8039 2012-06-30 Glenn Morris <rgm@gnu.org>
8040
8041 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8042
8043 * epaths.in (PATH_SITELOADSEARCH): New.
8044 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8045 This is rather than relying on --enable-locallisppath elements
8046 having "site-lisp" in their names. (Bug#10208#25, 11658)
8047
8048 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8049
8050 * w32proc.c (sys_select): Accept and ignore one more argument.
8051
8052 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8053
8054 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8055 (pselect) [!MS_DOS]: Redirect to sys_select.
8056
8057 * sysdep.c: Don't include dos.h and dosfns.h.
8058
8059 * process.c (sys_select):
8060 * msdos.c (sys_select): Accept one more argument and ignore it.
8061
8062 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8063 adapt data types and code to that.
8064
8065 * dosfns.c:
8066 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8067 which clashes with the gnulib function of the same name.
8068
8069 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8070
8071 * font.c (font_style_to_value, font_style_symbolic)
8072 (font_prop_validate_style): Add type checks for values in
8073 font_style_table.
8074
8075 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8076 argument.
8077 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8078 uses.
8079
8080 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8081
8082 * xdisp.c (try_window_id): Undo last change.
8083
8084 * w32.c (getwd): Adjust commentary about startup_dir.
8085 (init_environment): Always call sys_access, even in non-MSVC
8086 builds. Don't chdir to the directory of the Emacs executable.
8087 This undoes code from 1997 which was justified by the need to
8088 "avoid conflicts when removing and renaming directories". But its
8089 downside was that every relative file name was being interpreted
8090 relative to the directory of the Emacs executable, which can never
8091 be TRT. In particular, it broke sys_access when called with
8092 relative file names.
8093 (sys_access): Map GetLastError to errno.
8094
8095 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8096
8097 * window.h (struct window): Change type of 'fringes_outside_margins'
8098 to bitfield. Fix comment. Adjust users accordingly.
8099 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8100 Adjust comment.
8101 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8102 to ptrdiff_t.
8103
8104 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8105
8106 * gnutls.c (emacs_gnutls_handshake):
8107 Add QUIT to make the loop interruptible.
8108
8109 2012-06-29 Glenn Morris <rgm@gnu.org>
8110
8111 * charset.c (init_charset): Make lack of etc/charsets fatal.
8112
8113 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8114
8115 * editfns.c (region_limit): Fix type mismatch.
8116
8117 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8118
8119 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8120 undefined. Convert from xassert to eassert.
8121 * nsmenu.m: Convert from xassert to eassert.
8122 * nsterm.m: Likewise.
8123
8124 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8125
8126 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8127
8128 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8129
8130 Avoid integer overflow on scroll-left and scroll-right.
8131 * window.c (HSCROLL_MAX): New macro.
8132 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8133 overflow when requested scroll falls outside ptrdiff_t range.
8134
8135 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8136
8137 * window.h (struct window): Change type of 'hscroll',
8138 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8139 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8140 Adjust users accordingly.
8141 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8142 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8143 from EMACS_INT to ptrdiff_t.
8144 (make_window): Omit redundant initialization.
8145
8146 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8147
8148 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8149
8150 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8151
8152 * window.h (struct window): Change type of 'use_time' and
8153 'sequence_number' from Lisp_Object to int.
8154 * frame.c (make_frame): Adjust users accordingly.
8155 * print.c (print_object): Likewise.
8156 * window.c (select_window, Fwindow_use_time, make_parent_window)
8157 (make_window): Likewise.
8158
8159 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8160
8161 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8162 enabled with --enable-checking=[all,glyphs] configure option.
8163 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8164 adjust comments accordingly.
8165 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8166 undefined, adjust comments accordingly.
8167 * image.c: Likewise.
8168 * scroll.c: Likewise.
8169 * w32fns.c: Likewise.
8170 * w32term.c: Likewise.
8171 * xdisp.c: Likewise.
8172 * xfaces.c: Likewise.
8173 * xfns.c: Likewise.
8174 * xterm.c: Likewise.
8175
8176 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8177
8178 Generalize run-time debugging checks.
8179 * dispextern.h (XASSERTS): Remove.
8180 * fontset.c (xassert): Remove.
8181 Convert from xassert to eassert.
8182 * alloc.c: Convert from xassert to eassert.
8183 * bidi.c: Likewise.
8184 * dispnew.c: Likewise.
8185 * fns.c: Likewise.
8186 * fringe.c: Likewise.
8187 * ftfont.c: Likewise.
8188 * gtkutil.c: Likewise.
8189 * image.c: Likewise.
8190 * keyboard.c: Likewise.
8191 * menu.c: Likewise.
8192 * process.c: Likewise.
8193 * scroll.c: Likewise.
8194 * sound.c: Likewise.
8195 * term.c: Likewise.
8196 * w32console.c: Likewise.
8197 * w32fns.c: Likewise.
8198 * w32term.c: Likewise.
8199 * window.c: Likewise.
8200 * xdisp.c: Likewise.
8201 * xfaces.c: Likewise.
8202 * xfns.c: Likewise.
8203 * xselect.c: Likewise.
8204 * xterm.c: Likewise.
8205
8206 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8207
8208 * fns.c (maybe_resize_hash_table): Output message when growing the
8209 purify-hashtable.
8210
8211 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8212
8213 * alloc.c (allocate_string_data): Remove dead code.
8214 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8215 avoid GCC warning about unused macro.
8216
8217 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8218
8219 * alloc.c (allocate_string): Omit intervals initialization.
8220 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8221 as in make_pure_string and make_pure_c_string.
8222
8223 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8224
8225 * alloc.c (allocate_string): Fix last change.
8226
8227 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8228
8229 * alloc.c (allocate_string): Remove two redundant calls
8230 to memset, add explicit initialization where appropriate.
8231
8232 2012-06-27 Glenn Morris <rgm@gnu.org>
8233
8234 * lisp.mk (lisp): Remove paths.elc.
8235
8236 2012-06-27 Chong Yidong <cyd@gnu.org>
8237
8238 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8239
8240 2012-06-26 John Wiegley <johnw@newartisans.com>
8241
8242 * unexmacosx.c (copy_data_segment): Add two section names used
8243 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8244
8245 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8246 when building with Clang.
8247
8248 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8249
8250 * eval.c (Fapply): Allow calling it with a single argument.
8251
8252 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8253
8254 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8255 _stricmp and _strnicmp.
8256 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8257
8258 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8259
8260 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8261 allocated window.
8262 (allocate_process): Likewise for new process.
8263 (allocate_terminal): Change to use offsetof.
8264 (allocate_frame): Likewise.
8265 * frame.c (make_frame): Omit redundant initialization.
8266 * window.c (make_parent_window): Use memset.
8267 (make_window): Omit redundant initialization.
8268 * process.c (make_process): Omit redundant initialization.
8269 * terminal.c (create_terminal): Likewise.
8270
8271 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8272
8273 * term.c (delete_tty): Remove redundant call to memset.
8274
8275 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8276
8277 * alloc.c: Remove build_string.
8278 * lisp.h: Define build_string as static inline. This provides
8279 a better opportunity to optimize away calls to strlen when the
8280 function is called with compile-time constant argument.
8281 * image.c (imagemagick_error): Convert to build_string.
8282 * w32proc.c (sys_spawnve): Likewise.
8283 * xterm.c (x_term_init): Likewise.
8284
8285 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8286
8287 Use sprintf return value instead of invoking strlen on result.
8288 In the old days this wasn't portable, since some sprintf
8289 implementations returned char *. But they died out years ago and
8290 Emacs already assumes sprintf returns int.
8291 Similarly for float_to_string.
8292 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8293 * ccl.c (ccl_driver):
8294 * character.c (string_escape_byte8):
8295 * data.c (Fnumber_to_string):
8296 * doprnt.c (doprnt):
8297 * print.c (print_object):
8298 * xdisp.c (message_dolog):
8299 * xfns.c (syms_of_xfns):
8300 Use sprintf or float_to_string result to avoid need to call strlen.
8301 * data.c (Fnumber_to_string):
8302 Use make_unibyte_string, since the string must be ASCII.
8303 * lisp.h, print.c (float_to_string): Now returns int length.
8304 * term.c (produce_glyphless_glyph):
8305 Use sprintf result rather than recomputing it.
8306
8307 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8308 * Makefile.in (ALL_CFLAGS):
8309 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8310 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8311
8312 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8313
8314 * dispextern.h (xstrcasecmp): Define to library function
8315 strcasecmp if available.
8316 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8317
8318 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8319
8320 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8321 Avoid comma operator.
8322 * menu.c (push_submenu_start, push_submenu_end)
8323 (push_left_right_boundary, push_menu_pane): Likewise.
8324 * msdos.c (dos_rawgetc): Likewise.
8325
8326 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8327
8328 * xfns.c (xic_create_fontsetname): Remove redundant calls
8329 to memset.
8330
8331 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8334 sprintf already null-terminates its output.
8335
8336 * xfns.c (x_window): Remove redundant cast.
8337
8338 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8339
8340 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8341 `const char *' to `char *' to avoid compiler warning.
8342
8343 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8344
8345 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8346 instead of truncating it to 63 (admittedly a generous limit).
8347
8348 * process.c: Fix spelling and caps in comments.
8349
8350 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8351
8352 * emacs.c (setpgrp): Remove definition, unused.
8353 * sysdep.c (setpgrp): Remove definition, not used in this file.
8354
8355 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8356
8357 * makefile.w32-in: Update dependencies.
8358
8359 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8360
8361 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8362 (SYSTIME_H): Add nt/inc/sys/time.h.
8363
8364 * systime.h [WINDOWSNT]: Include sys/time.h.
8365
8366 * s/ms-w32.h (struct timespec): Definition moved from
8367 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8368
8369 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8370
8371 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8372 * buffer.h (buffer_slot_type_mismatch):
8373 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8374 * eval.c (unwind_to_catch):
8375 * image.c (my_png_error, my_error_exit):
8376 * keyboard.c (quit_throw_to_read_char, user_error)
8377 (Fexit_recursive_edit, Fabort_recursive_edit):
8378 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8379 (wrong_type_argument, buffer_overflow, __executable_start)
8380 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8381 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8382 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8383 (fatal):
8384 (child_setup) [!DOS_NT]:
8385 * lread.c (end_of_file_error, invalid_syntax):
8386 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8387 * puresize.h (pure_write_error):
8388 * search.c (matcher_overflow):
8389 * sound.c (sound_perror, alsa_sound_perror):
8390 * sysdep.c, syssignal.h (croak):
8391 * term.c (maybe_fatal, vfatal):
8392 * textprop.c (text_read_only):
8393 * undo.c (user_error):
8394 * unexmacosx.c (unexec_error):
8395 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8396 Use _Noreturn rather than NO_RETURN.
8397 No need for separate decl merely because of _Noreturn.
8398 * sound.c (sound_warning, parse_sound):
8399 Remove unnecessary forward decls.
8400
8401 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8404 * lisp.h (WAIT_READING_MAX): New macro.
8405 * dispnew.c (Fsleep_for, sit_for):
8406 * keyboard.c (kbd_buffer_get_event):
8407 * process.c (Faccept_process_output):
8408 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8409 This improves on the previous patch, which introduced a bug
8410 when time_t is unsigned and as wide as intmax_t.
8411 See <http://bugs.gnu.org/9000#51>.
8412
8413 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8414
8415 * dispnew.c (sit_for, Fsleep_for):
8416 * keyboard.c (kbd_buffer_get_event):
8417 * process.c (Faccept_process_output): Avoid compiler warnings when
8418 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8419
8420 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8421
8422 * makefile.w32-in: Update dependencies.
8423
8424 * w32.c (ltime): Add return type and declare static.
8425 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8426
8427 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8428
8429 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8430 Privately reported by Herbert J. Skuhra.
8431 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8432 All uses changed.
8433 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8434 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8435
8436 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8437
8438 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8439 last argument of make_unibyte_string.
8440
8441 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8442 language ID in the event parameters.
8443
8444 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8445 event.code, not the obscure "character set ID".
8446
8447 2012-06-23 Chong Yidong <cyd@gnu.org>
8448
8449 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8450
8451 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8452
8453 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8454 * w32.c (fdutimens): New function.
8455
8456 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8457
8458 * s/ms-w32.h (pselect): Redirect to sys_select.
8459
8460 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8461
8462 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8463 in the logic of incrementing and decrementing the value of
8464 use_relocatable_buffers.
8465
8466 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8467
8468 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8469 Privately reported by Herbert J. Skuhra.
8470 [__FreeBSD__]: Remove "*/" typo after "#include".
8471 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8472 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8473 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8474 Don't assume EMACS_TIME and struct timeval are the same type.
8475
8476 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 Support higher-resolution time stamps (Bug#9000).
8479 The time stamps are only nanosecond-resolution at the C level,
8480 since that's the best that any real-world system supports now.
8481 But they are picosecond-resolution at the Lisp level, as that's
8482 easy, and leaves room for future OS improvements.
8483
8484 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8485 (LIBES): Use it.
8486
8487 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8488 Don't get current time unless it's needed.
8489
8490 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8491 now provides it if it's absent.
8492 (start_atimer): Port to higher-res time stamps.
8493 Check for time stamp overflow. Don't get current time more
8494 often than is needed.
8495
8496 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8497 Include systime.h, not time.h.
8498 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8499
8500 * dired.c: Include stat-time.h.
8501 (Ffile-attributes): File times now have higher resolution.
8502
8503 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8504 (struct image): Timestamp now has higher resolution.
8505
8506 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8507 has at least microseconds now. All uses removed.
8508 (update_frame, update_single_window, update_window, update_frame_1)
8509 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8510 (duration_to_sec_usec): Remove; no longer needed.
8511
8512 * editfns.c (time_overflow): Now extern.
8513 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8514 (float-time, Fformat_time_string, Fcurrent_time_string)
8515 (Fcurrent_time_zone): Accept and generate higher-resolution
8516 time stamps.
8517 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8518 (decode_time_components, lisp_seconds_argument): New functions.
8519 (make_time): Now static.
8520 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8521 Report an error if the time is invalid, rather than having the caller
8522 do that.
8523
8524 * fileio.c: Include <stat-time.h>
8525 (Fcopy_file): Copy higher-resolution time stamps.
8526 Prefer to set the time stamp via a file descriptor if that works.
8527 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8528 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8529 (Fvisited_file_modtime, Fset_visited_file_modtime):
8530 Support higher-resolution time stamps.
8531
8532 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8533
8534 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8535
8536 * image.c (prepare_image_for_display, clear_image_cache)
8537 (lookup_image): Port to higer-resolution time stamps.
8538
8539 * keyboard.c (start_polling, bind_polling_period):
8540 Check for time stamp overflow.
8541 (read_char, kbd_buffer_get_event, timer_start_idle)
8542 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8543 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8544 Port to higher-resolution time stamps. Do not assume time_t is signed.
8545 (decode_timer): New function. Timers are now vectors of length 9,
8546 not 8, to accommodate the picosecond component.
8547 (timer_check_2): Use it.
8548
8549 * nsterm.m (select_timeout, timeval_subtract): Remove.
8550 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8551 as they're a bit more accurate and handle overflow better.
8552 (ns_select): Change prototype to be compatible with pselect.
8553 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8554 * nsterm.h (ns_select): Adjust prototype.
8555
8556 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8557 us-resolution time stamps.
8558 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8559
8560 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8561
8562 * lisp.h (time_overflow): New decl.
8563 (wait_reading_process_output): First arg is now intmax_t, not int,
8564 to accommodate larger waits.
8565
8566 * process.h (struct Lisp_Process.read_output_delay):
8567 Now counts nanoseconds, not microseconds.
8568 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8569 EMACS_HAS_USECS.
8570 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8571 (wait_reading_process_output):
8572 Port to ns-resolution time stamps.
8573 (Faccept_process_output, wait_reading_process_output):
8574 Check for time stamp overflow. Do not assume time_t is signed.
8575 (select_wrapper): Remove; we now use pselect.
8576 (Fprocess_attributes): Now generates ns-resolution time stamps.
8577
8578 * sysdep.c: Include utimens.h. Don't include utime.h
8579 or worry about struct utimbuf; gnulib does that for us now.
8580 (gettimeofday): Remove; gnulib provides a substitute.
8581 (make_timeval): New function.
8582 (set_file_times): Now sets ns-resolution time stamps.
8583 New arg FD; all uses changed.
8584 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8585 (system_process_attributes):
8586 Now returns ns-resolution time stamp. All uses changed.
8587 Check for time stamp overflow.
8588
8589 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8590 provides a substitute now.
8591
8592 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8593 since it guarantees struct timespec.
8594 (EMACS_TIME): Now struct timespec, so that we can support
8595 ns-resolution time stamps.
8596 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8597 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8598 (EMACS_USECS): Remove.
8599 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8600 so multiply the arg by 1000 before storing it.
8601 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8602 New macros.
8603 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8604 Port to ns-resolution time stamps.
8605 (EMACS_TIME_NEG_P): Remove; replaced by....
8606 (EMACS_TIME_SIGN): New macro.
8607 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8608 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8609 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8610 (make_timeval, make_lisp_time, decode_time_components): New decls.
8611 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8612 that it mishandled time_t overflow. You can't compare by subtracting!
8613 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8614 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8615
8616 * term.c: Include <sys/time.h>.
8617 (timeval_to_Time): New function, for proper overflow wraparound.
8618 (term_mouse_position, term_mouse_click): Use it.
8619
8620 * undo.c (record_first_change): Support higher-resolution time stamps
8621 in the undo buffer.
8622 (Fprimitive_undo): Use them when restoring time stamps.
8623
8624 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8625 (w32_get_internal_run_time):
8626 Port to higher-resolution Emacs time stamps.
8627 (ltime): Now accepts single 64-bit integer, as that's more convenient
8628 for callers.
8629
8630 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8631
8632 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8633 for compatibility with pselect. Support ns-resolution time stamps.
8634
8635 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8636
8637 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8638 Check for time stamp overflow, and support ns-resolution time stamps.
8639
8640 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8641 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8642 (timeval_subtract): Remove; no longer needed.
8643 (XTflash, XTring_bell, x_wait_for_event):
8644 Port to ns-resolution time stamps. Don't assume time_t is signed.
8645
8646 2012-06-22 Chong Yidong <cyd@gnu.org>
8647
8648 * xdisp.c (x_consider_frame_title): Revert last change.
8649
8650 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8651
8652 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8653 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8654 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8655 staticidx goes up to 1597 out of 1600 = 0x640.)
8656
8657 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8658
8659 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8660 Otherwise, the umask might be mistakenly 0 while handling input signals.
8661
8662 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8663
8664 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8665
8666 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8667
8668 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8669 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8670 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8671 access to `contents' member of Lisp_Vector objects with AREF and ASET
8672 where appropriate.
8673
8674 2012-06-19 Chong Yidong <cyd@gnu.org>
8675
8676 * frame.c (delete_frame): When selecting a frame on a different
8677 text terminal, do not alter the terminal's top-frame.
8678
8679 * xdisp.c (format_mode_line_unwind_data): Record the target
8680 frame's selected window and its terminal's top-frame.
8681 (unwind_format_mode_line): Restore them.
8682 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8683 Callers changed.
8684 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8685 since tty frames can be explicitly named.
8686 (prepare_menu_bars): Likewise.
8687
8688 * term.c (Ftty_top_frame): New function.
8689
8690 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8691
8692 Port byte-code-meter to modern targets.
8693 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8694 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8695 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8696 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8697 (METER_1, METER_2): Simplify.
8698
8699 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8700
8701 * data.c (Fdefalias): Return `symbol' (bug#11686).
8702
8703 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8704
8705 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8706 gets killed during executing of this function (Bug#11665).
8707 Try to always return Qt when the buffer has been actually killed.
8708 (Vkill_buffer_query_functions): In doc-string say that functions
8709 run by this hook should not change the current buffer.
8710
8711 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8712
8713 Fix recently-introduced process.c problems found by static checking.
8714 * process.c (write_queue_push, write_queue_pop, send_process):
8715 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8716 (write_queue_pop): Fix pointer signedness problem.
8717 (send_process): Remove unused local.
8718
8719 2012-06-17 Chong Yidong <cyd@gnu.org>
8720
8721 * xdisp.c (redisplay_internal): No need to redisplay terminal
8722 frames that are not on top.
8723
8724 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8725
8726 * process.c (make_process): Initialize write_queue.
8727 (write_queue_push, write_queue_pop): New functions.
8728 (send_process): Use them to maintain correct ordering of process
8729 writes (Bug#10815).
8730
8731 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8732
8733 * lisp.h (eassert): Assume C89 or later.
8734 This removes the need for CHECK.
8735 (CHECK): Remove. Its comments about always evaluating its
8736 argument were confusing, as 'eassert' typically does not evaluate
8737 its argument.
8738
8739 * coding.c (produce_chars): Use ptrdiff_t, not int.
8740
8741 * xterm.c (x_draw_underwave): Check for integer overflow.
8742 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8743
8744 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8745
8746 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8747 referenced (Bug#11583).
8748
8749 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8750
8751 Implement wave-style variant of underlining.
8752 * dispextern.h (face_underline_type): New enum.
8753 (face): Add field for underline type.
8754 * nsterm.m (ns_draw_underwave): New function.
8755 (ns_draw_text_decoration): Use it.
8756 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8757 New functions.
8758 (x_draw_glyph_string): Use them.
8759 * xfaces.c (Qline, Qwave): New Lisp objects.
8760 (check_lface_attrs, merge_face_ref)
8761 (Finternal_set_lisp_face_attribute, realize_x_face):
8762 Handle wave-style underline face attributes.
8763 * xterm.c (x_draw_underwave): New function.
8764 (x_draw_glyph_string): Use it.
8765
8766 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8767
8768 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8769 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8770 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8771 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8772 ($(BLD)/w32select.$(O)): Update dependencies.
8773
8774 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8775
8776 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8777 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8778 * character.c (_fetch_multibyte_char_p): Remove.
8779 * alloc.c: Include "character.h" before "buffer.h".
8780 * bidi.c: Likewise.
8781 * buffer.c: Likewise.
8782 * bytecode.c: Likewise.
8783 * callint.c: Likewise.
8784 * callproc.c: Likewise.
8785 * casefiddle.c: Likewise.
8786 * casetab.c: Likewise.
8787 * category.c: Likewise.
8788 * cmds.c: Likewise.
8789 * coding.c: Likewise.
8790 * composite.c: Likewise.
8791 * dired.c: Likewise.
8792 * dispnew.c: Likewise.
8793 * doc.c: Likewise.
8794 * dosfns.c: Likewise.
8795 * editfns.c: Likewise.
8796 * emacs.c: Likewise.
8797 * fileio.c: Likewise.
8798 * filelock.c: Likewise.
8799 * font.c: Likewise.
8800 * fontset.c: Likewise.
8801 * fringe.c: Likewise.
8802 * indent.c: Likewise.
8803 * insdel.c: Likewise.
8804 * intervals.c: Likewise.
8805 * keyboard.c: Likewise.
8806 * keymap.c: Likewise.
8807 * lread.c: Likewise.
8808 * macros.c: Likewise.
8809 * marker.c: Likewise.
8810 * minibuf.c: Likewise.
8811 * nsfns.m: Likewise.
8812 * nsmenu.m: Likewise.
8813 * print.c: Likewise.
8814 * process.c: Likewise.
8815 * regex.c: Likewise.
8816 * region-cache.c: Likewise.
8817 * search.c: Likewise.
8818 * syntax.c: Likewise.
8819 * term.c: Likewise.
8820 * textprop.c: Likewise.
8821 * undo.c: Likewise.
8822 * unexsol.c: Likewise.
8823 * w16select.c: Likewise.
8824 * w32fns.c: Likewise.
8825 * w32menu.c: Likewise.
8826 * window.c: Likewise.
8827 * xdisp.c: Likewise.
8828 * xfns.c: Likewise.
8829 * xmenu.c: Likewise.
8830 * xml.c: Likewise.
8831 * xselect.c: Likewise.
8832
8833 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8834
8835 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8836 If all the glyphs of the glyph row came from strings, and we have no
8837 cursor positioning clues, put the cursor on the first glyph of the
8838 row.
8839 (handle_face_prop): Use chunk-relative overlay string index when
8840 indexing into it->string_overlays array. (Bug#11653)
8841 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8842 the rightmost. (Bug#11720)
8843
8844 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8845
8846 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8847 (CATEGORY_MEMBER): Enforce 1/0 value.
8848 * category.c (_temp_category_set): Remove.
8849
8850 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8851
8852 * window.c (Fdelete_other_windows_internal)
8853 (Fdelete_window_internal): Don't access frame's mouse highlight
8854 info of the initial frame. (Bug#11677)
8855
8856 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8859 Assume USE_2_TAGS_FOR_INTS.
8860 (xreload): Adjust $tagmask width to match recent lisp.h change.
8861
8862 Simplify lisp.h in minor ways that should not affect code.
8863 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8864 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8865 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8866 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8867 (INTTYPEBITS): New macro, for clarity.
8868 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8869 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8870 Simplify now that USE_LSB_TAG is always defined.
8871 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8872 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8873
8874 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8875
8876 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8877
8878 2012-06-13 Glenn Morris <rgm@gnu.org>
8879
8880 * s/bsd-common.h (BSD4_3):
8881 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8882
8883 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8884
8885 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8886 instead of union.
8887 (XLI, XIL): Define.
8888 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8889 Use them.
8890 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8891 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8892 * alloc.c (widen_to_Lisp_Object): Remove.
8893 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8894 * frame.c (delete_frame): Remove outdated comment.
8895 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8896 USE_LISP_UNION_TYPE.
8897 (Fw32_unregister_hot_key): Likewise.
8898 (Fw32_toggle_lock_key): Likewise.
8899 * w32menu.c (add_menu_item): Likewise.
8900 (w32_menu_display_help): Use XIL instead of checking
8901 USE_LISP_UNION_TYPE.
8902 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8903 (init_heap): Likewise.
8904 * w32term.c (w32_read_socket): Update comment.
8905
8906 2012-06-13 Glenn Morris <rgm@gnu.org>
8907
8908 * s/usg5-4-common.h, src/s/unixware.h:
8909 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8910
8911 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8912
8913 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8916 * alloc.c (make_number) [!defined make_number]:
8917 Remove, as lisp.h always defines this now.
8918 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8919 (roundup_size): Verify that it is a power of 2.
8920 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8921 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8922 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8923 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8924 USE_LSB_TAG now is always defined to be either 0 or 1.
8925 All uses changed.
8926 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8927 code works fine either way, and efficiency is not a concern here,
8928 as the union type is for debugging, not for production.
8929 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8930 Use an inline function on all platforms when using the union type,
8931 since this is simpler and 'static inline' can be used portably
8932 within Emacs now.
8933 (LISP_INITIALLY_ZERO): New macro.
8934 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8935 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8936
8937 2012-06-12 Glenn Morris <rgm@gnu.org>
8938
8939 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8940
8941 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8942
8943 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8944 Move BROKEN_SIGIO to configure.
8945
8946 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8947 Move NO_TERMIO to configure.
8948
8949 2012-06-12 Chong Yidong <cyd@gnu.org>
8950
8951 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8952 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8953 MagickExportImagePixels is undefined.
8954
8955 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8956
8957 * image.c (imagemagick_load_image): Remove unused label.
8958
8959 2012-06-11 Glenn Morris <rgm@gnu.org>
8960
8961 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8962 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8963 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8964 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8965
8966 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8967
8968 * alloc.c (make_byte_code): New function.
8969 (Fmake_byte_code): Use it. Don't purify here.
8970 * lread.c (read1): Use it as well to avoid extra allocation.
8971
8972 2012-06-11 Chong Yidong <cyd@gnu.org>
8973
8974 * image.c (imagemagick_load_image): Implement transparency.
8975
8976 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8977
8978 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8979 account for preceding backslashes. (Bug#11663)
8980
8981 2012-06-09 Chong Yidong <cyd@gnu.org>
8982
8983 * term.c: Support italics in capable terminals (Bug#9652).
8984 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8985 (turn_on_face): Output using TS_enter_italic_mode if available.
8986 Don't handle unused blinking and alt-charset cases.
8987 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8988 and tty_alt_charset_p cases.
8989 (tty_capable_p, init_tty): Support italics.
8990
8991 * termchar.h (struct tty_display_info): Add field for italics.
8992 Remove unused blink field.
8993
8994 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8995 Handle slant.
8996
8997 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8998 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8999 tty_alt_charset_p. Add tty_italic_p.
9000
9001 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9002
9003 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9004 dbus_type_is_basic if available.
9005 (xd_extract_signed, xd_extract_unsigned): Rename from
9006 extract_signed and extract_unsigned, respectively. Adapt callers.
9007
9008 2012-06-09 Chong Yidong <cyd@gnu.org>
9009
9010 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9011
9012 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9013 case (Bug#9752).
9014
9015 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9016
9017 * xdisp.c (vmessage): Treat frame message as multibyte.
9018 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9019 would generate the diagnostic "Making \302\247 buffer-local while
9020 let-bound!".
9021
9022 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9023
9024 * dispnew.c (showing_window_margins_p): Undo last change, which
9025 was done due to an inadvertent commit.
9026 (adjust_frame_glyphs_for_frame_redisplay): Do call
9027 showing_window_margins_p.
9028
9029 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9030
9031 * eval.c (Fmake_var_non_special): New primitive.
9032 (syms_of_eval): Defsubr it.
9033 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9034
9035 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9036
9037 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9038 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9039
9040 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9041
9042 * alloc.c (allocate_vectorlike): Fix last change.
9043
9044 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9045
9046 Block-based vector allocation of small vectors.
9047 * lisp.h (struct vectorlike_header): New field `nbytes',
9048 adjust comment accordingly.
9049 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9050 to denote vector blocks. Adjust users (live_vector_p,
9051 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9052 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9053 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9054 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9055 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9056 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9057 (roundup_size): New constant.
9058 (struct vector_block): New data type.
9059 (vector_blocks, vector_free_lists, zero_vector): New variables.
9060 (all_vectors): Rename to `large_vectors'.
9061 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9062 (sweep_vectors): New functions.
9063 (allocate_vectorlike): Return `zero_vector' as the only vector of
9064 0 items. Allocate new vector from block if vector size is less than
9065 or equal to VBLOCK_BYTES_MAX.
9066 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9067 (init_alloc_once): Add call to init_vectors.
9068
9069 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9070
9071 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9072
9073 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 * doprnt.c (doprnt): Truncate multibyte char correctly.
9076 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9077 would mishandle a string argument "Xc" if X was a multibyte
9078 character of length 2: it would truncate after X's first byte
9079 rather than including all of X.
9080
9081 2012-06-06 Chong Yidong <cyd@gnu.org>
9082
9083 * buffer.c (word_wrap): Doc fix.
9084
9085 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9086
9087 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9088
9089 2012-06-03 Glenn Morris <rgm@gnu.org>
9090
9091 * xdisp.c (tool-bar-style): Doc fix.
9092
9093 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9094
9095 * Makefile.in (PAXCTL): Define.
9096 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9097 binary via PaX flags if the paxctl utility is available.
9098 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9099 Restore PaX flags to their default. (Bug#11398)
9100
9101 2012-06-03 Chong Yidong <cyd@gnu.org>
9102
9103 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9104 buffer (Bug#11226).
9105
9106 2012-06-03 Chong Yidong <cyd@gnu.org>
9107
9108 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9109 (note_mode_line_or_margin_highlight): If there is no help echo,
9110 use mode-line-default-help-echo. Handle the case where the mouse
9111 position is past the end of the mode line string.
9112
9113 * buffer.c (buffer_local_value_1): New function, split from
9114 Fbuffer_local_value; can return Qunbound.
9115 (Fbuffer_local_value): Use it.
9116 (Vmode_line_format): Docstring tweaks.
9117
9118 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9119
9120 * sysdep.c (system_process_attributes): Improve comment.
9121
9122 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9123
9124 * keyboard.c: Export real-this-command to Elisp.
9125 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9126 and DEFVAR it. Update all users.
9127
9128 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9129
9130 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9131
9132 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9133 Convert pctcpu and pctmem to Lisp float properly.
9134 Let the compiler fold better, as 100.0/0x8000 is exact.
9135
9136 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9137
9138 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9139 cons_block.
9140
9141 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9142
9143 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9144
9145 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9146
9147 For a 'struct window', replace some Lisp_Object fields to
9148 bitfields where appropriate, remove unused fields.
9149 * window.h (struct window): Remove unused 'last_mark_x' and
9150 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9151 change its type from Lisp_Object to bitfield.
9152 Change type of 'force_start', 'optional_new_start',
9153 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9154 fields from Lisp_Object to bitfield. Adjust users accordingly.
9155
9156 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9157
9158 Pacify gcc -Wdouble-precision when using Xaw.
9159 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9160 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9161 Use 'float' consistently, rather than 'float' in most places
9162 and 'double' in a couple of places.
9163
9164 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9165
9166 * xdisp.c (handle_stop): Detect whether we have overlay strings
9167 loaded by testing it->current.overlay_string_index to be
9168 non-negative, instead of checking whether n_overlay_strings is
9169 positive. (Bug#11587)
9170
9171 2012-05-31 Chong Yidong <cyd@gnu.org>
9172
9173 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9174
9175 * doc.c (Fsubstitute_command_keys): Doc fix.
9176
9177 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9178
9179 * search.c (search_buffer): Remove calls to
9180 r_alloc_inhibit_buffer_relocation, as it is now called by
9181 maybe_unify_char, which was the cause of relocation of buffer text
9182 in bug#11519.
9183
9184 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9185
9186 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9187 for the duration of call to load_charset, to avoid problems with
9188 callers of maybe_unify_char that access buffer text through C
9189 pointers.
9190
9191 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9192 decrement the inhibition flag, instead of just setting or
9193 resetting it.
9194
9195 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 Remove obsolete '#define static' cruft.
9198 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9199 This #undef was "temporary" in 2000; it is no longer needed
9200 now that '#define static' has gone away.
9201 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9202 (gray_bitmap_bits): Remove; no longer needed.
9203 All uses replaced with definiens.
9204 * xterm.c: Include "bitmaps/gray.xbm".
9205
9206 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9207
9208 Clean up __executable_start, monstartup when --enable-profiling.
9209 The following changes affect the code only when profiling.
9210 * dispnew.c (__executable_start): Rename from safe_bcopy.
9211 Define only on platforms that need it.
9212 * emacs.c: Include <sys/gmon.h> when profiling.
9213 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9214 (__executable_start): Remove decl, since lisp.h does it now.
9215 (safe_bcopy): Remove decl; no longer has that name.
9216 (main): Coalesce #if into single bit of code, for simplicity.
9217 Cast pointers to uintptr_t, since standard libraries want integers
9218 and not pointers.
9219 * lisp.h (__executable_start): New decl.
9220
9221 2012-05-31 Glenn Morris <rgm@gnu.org>
9222
9223 * image.c (Fimagemagick_types): Doc fix.
9224
9225 2012-05-30 Jim Meyering <meyering@redhat.com>
9226
9227 * callproc.c (Fcall_process_region): Include directory component
9228 in mkstemp error message (Bug#11586).
9229
9230 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9231
9232 * alloc.c, lisp.h (make_pure_vector): Now static.
9233
9234 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9235
9236 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9237 Move to byte-run.el.
9238 (Fautoload): Do the hash-doc more carefully.
9239 * data.c (Fdefalias): Purify definition, except for keymaps.
9240 (Qdefun): Move from eval.c.
9241 * lisp.h (Qdefun): Remove.
9242 * lread.c (read1): Tiny simplification.
9243
9244 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9245
9246 Do not create empty overlays with the evaporate property (Bug#9642).
9247 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9248 Bug#9642, but explicitly check that the buffer the overlay would
9249 be moved to is live and rearrange lines to make sure that errors
9250 will not put the overlay in an inconsistent state.
9251 (Fdelete_overlay): Cosmetics.
9252
9253 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9254
9255 * w32term.c (my_bring_window_to_top): New function.
9256 (x_raise_frame): Use handle returned by DeferWindowPos, which
9257 could be different from the original one.
9258 Call my_bring_window_to_top instead of my_set_foreground_window.
9259 (Bug#11513)
9260
9261 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9262 by calling BringWindowToTop.
9263
9264 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9265 (WM_EMACS_END): Increase by one.
9266
9267 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9268
9269 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9270 This avoids undefined behavior that might cause the eassert
9271 to not catch an out-of-range value.
9272
9273 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9274
9275 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9276 Update dependencies.
9277
9278 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9279
9280 * bidi.c (bidi_mirror_char): Fix last change.
9281
9282 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9283
9284 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9285 when referring to sectname field in printf format.
9286
9287 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9288
9289 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9290 Only r_alloc_inhibit_buffer_relocation needed to be added;
9291 the others were already declared.
9292
9293 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9294 before checking whether it's out of range. Put the check inside
9295 eassert. See
9296 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9297
9298 2012-05-27 Ken Brown <kbrown@cornell.edu>
9299
9300 * callproc.c (Fcall_process): Restore a line that was accidentally
9301 commented out in the 2011-02-13 change (bug#11547).
9302
9303 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9304
9305 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9306 defined on ralloc.c.
9307
9308 * buffer.c [REL_ALLOC]: Remove prototypes of
9309 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9310 they are now on lisp.h.
9311
9312 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9313
9314 * search.c (search_buffer): Use it to inhibit relocation of buffer
9315 text while re_search_2 is doing its job, because re_search_2 is
9316 passed C pointers to buffer text. (Bug#11519)
9317
9318 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9319 Update value to 24.
9320
9321 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9322 state after an additional call to move_it_in_display_line_to, keep
9323 the values of it->max_ascent and it->max_descent found for the
9324 entire line.
9325 (pos_visible_p): Revert the comparison against bottom_y to what it
9326 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9327 (Bug#11464)
9328
9329 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 Fix coding-related core dumps with gcc -ftrapv.
9332 The code was computing A - B, where A and B are pointers, and B is
9333 random garbage. This can lead to core dumps on platforms that
9334 have special pointer registers, and it also leads to core dumps on
9335 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9336 A - B only when B is initialized properly.
9337 * coding.c (coding_set_source, coding_set_destination): Return void.
9338 (coding_change_source, coding_change_destinations): New functions,
9339 with the old behaviors of coding_set_source and coding_set_destination.
9340 All callers that need an offset changed to use these new functions.
9341
9342 2012-05-26 Glenn Morris <rgm@gnu.org>
9343
9344 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9345
9346 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9347
9348 Extend mouse support on W32 text-mode console.
9349 * xdisp.c (draw_row_with_mouse_face):
9350 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9351
9352 * w32console.c: Include window.h.
9353 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9354 New functions.
9355 (initialize_w32_display): Initialize mouse-highlight data.
9356
9357 * w32inevt.c: Include termchar.h and window.h.
9358 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9359 moves, call note_mouse_highlight. If help_echo changed, call
9360 gen_help_event to produce help-echo message in the echo area.
9361 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9362 highlight info.
9363
9364 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 * lread.c (read1): Simplify slightly to avoid an overflow warning
9367 with GCC 4.7.0 on x86-64.
9368
9369 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9370
9371 * bidi.c (bidi_mirror_char): Revert last change: an int is
9372 definitely wide enough here.
9373
9374 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9375
9376 Fix integer width and related bugs (Bug#9874).
9377 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9378 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9379 (string_bytes, check_sblock, allocate_string_data):
9380 (compact_small_strings, Fmake_bool_vector, make_string)
9381 (make_unibyte_string, make_multibyte_string)
9382 (make_string_from_bytes, make_specified_string)
9383 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9384 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9385 (mark_vectorlike):
9386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9387 (allocate_pseudovector):
9388 Use int, not EMACS_INT, where int is wide enough.
9389 (inhibit_garbage_collection, Fgarbage_collect):
9390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9391 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9392 int might not be wide enough.
9393 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9394 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9395 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9396 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9397 (bidi_level_of_next_char, bidi_move_to_visually_next):
9398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9399 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9400 (Fkill_buffer, Fset_buffer_major_mode)
9401 (advance_to_char_boundary, Fbuffer_swap_text)
9402 (Fset_buffer_multibyte, overlays_at, overlays_in)
9403 (overlay_touches_p, struct sortvec, record_overlay_string)
9404 (overlay_strings, recenter_overlay_lists)
9405 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9406 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9407 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9408 (Foverlay_recenter, last_overlay_modification_hooks_used)
9409 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9411 (validate_region): Omit unnecessary test for b <= e,
9412 since that's guaranteed by the previous test.
9413 (adjust_overlays_for_delete): Avoid pos + length overflow.
9414 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9415 (report_overlay_modification):
9416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9417 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9418 Omit pointer cast, which isn't needed anyway, and doesn't work
9419 after the EMACS_INT -> ptrdiff_t change.
9420 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9421 * buffer.h: Adjust decls to match defn changes elsewhere.
9422 (struct buffer_text, struct buffer):
9423 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9424 Use EMACS_INT, not int, where int might not be wide enough.
9425 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9426 not int, to avoid needless 32-bit limit on 64-bit hosts.
9427 (exec_byte_code): Use tighter memory-full test, one that checks
9428 for alloca overflow. Don't compute the address of the object just
9429 before an array, as that's not portable. Use EMACS_INT, not
9430 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9431 * callint.c (Fcall_interactively):
9432 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9433 * callproc.c (call_process_kill, Fcall_process):
9434 Don't assume pid_t fits into an Emacs fixnum.
9435 (call_process_cleanup, Fcall_process, child_setup):
9436 Don't assume pid_t fits into int.
9437 (call_process_cleanup, Fcall_process, delete_temp_file)
9438 (Fcall_process_region):
9439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9440 (Fcall_process): Simplify handling of volatile integers.
9441 Use int, not EMACS_INT, where int will do.
9442 * casefiddle.c (casify_object, casify_region, operate_on_word)
9443 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9445 (casify_object): Avoid integer overflow when overallocating buffer.
9446 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9447 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9448 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9449 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9450 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9451 integers are now checked earlier. All uses replaced with XINT.
9452 (ccl_driver):
9453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9454 For CCL_MapSingle, check that content and value are in int range.
9455 (ccl_driver, Fregister_code_conversion_map):
9456 Check that Vcode_version_map_vector is a vector.
9457 (resolve_symbol_ccl_program): Check that vector header is in range.
9458 Always copy the vector, so that we can check its contents reliably
9459 now rather than having to recheck each instruction as it's being
9460 executed. Check that vector words fit in 'int'.
9461 (ccl_get_compiled_code, Fregister_ccl_program)
9462 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9463 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9464 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9465 contents are in range.
9466 (Fccl_execute_on_string): Check that status is in range.
9467 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9468 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9469 Accept and return EMACS_INT, not int, because callers can pass values
9470 out of 'int' range.
9471 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9472 (multibyte_chars_in_text, parse_str_as_multibyte)
9473 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9474 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9475 (string_escape_byte8, Fget_byte):
9476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9477 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9478 avoid mishandling large integers.
9479 * character.h: Adjust decls to match defn changes elsewhere.
9480 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9481 (Ffind_charset_region):
9482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9483 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9484 (load_charset_map_from_vector, Fdefine_charset_internal):
9485 Don't assume fixnum fits in int.
9486 (load_charset_map_from_vector, Fmap_charset_chars):
9487 Remove now-unnecessary CHECK_NATNUMs.
9488 (Fdefine_charset_internal): Check ranges here, more carefully.
9489 Don't rely on undefined behavior with signed left shift overflow.
9490 Don't assume unsigned int fits into fixnum, or that fixnum fits
9491 into unsigned int. Don't require max_code to be a valid fixnum;
9492 that's not true for gb10830 4-byte on a 32-bit host. Allow
9493 invalid_code to be a cons, for the same reason. Require code_offset
9494 to be a character. Avoid int overflow if max_char is close
9495 to INT_MAX.
9496 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9497 this is intended anyway and avoids some undefined behavior.
9498 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9499 INDEX_TO_CODE_POINT, as that's what it expects.
9500 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9501 * charset.h (DECODE_CHAR): Return int, not unsigned;
9502 this is what was intended anyway, and it avoids undefined behavior.
9503 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9504 integer-overflow issues.
9505 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9506 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9507 where the argument is EMACS_INT, and this behavior is not intended.
9508 * chartab.c (Fmake_char_table, Fset_char_table_range)
9509 (uniprop_get_decoder, uniprop_get_encoder):
9510 Don't assume fixnum fits in int.
9511 * cmds.c (move_point): New function, that does the gist of
9512 Fforward_char and Fbackward_char, but does so while checking
9513 for integer overflow more accurately.
9514 (Fforward_char, Fbackward_char): Use it.
9515 (Fforward_line, Fend_of_line, internal_self_insert)
9516 (internal_self_insert):
9517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9518 Fix a FIXME, by checking for integer overflow when calculating
9519 target_clm and actual_clm.
9520 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9521 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9522 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9523 (coding_alloc_by_making_gap, alloc_destination)
9524 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9525 (encode_coding_utf_16, detect_coding_emacs_mule)
9526 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9527 (detect_coding_iso_2022, decode_coding_iso_2022)
9528 (encode_invocation_designation, encode_designation_at_bol)
9529 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9530 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9531 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9532 (encode_coding_ccl, encode_coding_raw_text)
9533 (detect_coding_charset, decode_coding_charset)
9534 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9535 (produce_composition, produce_charset, produce_annotation)
9536 (decode_coding, handle_composition_annotation)
9537 (handle_charset_annotation, consume_chars, decode_coding_gap)
9538 (decode_coding_object, encode_coding_object, detect_coding_system)
9539 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9540 (code_convert_region, code_convert_string)
9541 (Fdefine_coding_system_internal)
9542 (coding_set_source, coding_set_destination):
9543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9544 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9545 (Fdefine_coding_system_internal):
9546 Don't assume fixnums fit in int.
9547 (decode_coding_gap, decode_coding_object, encode_coding_object)
9548 (Fread_coding_system, Fdetect_coding_region)
9549 (Funencodable_char_position, Fcheck_coding_systems_region)
9550 (get_translation, handle_composition_annotation, consume_chars):
9551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9552 (consume_chars): Rewrite to not calculate an address outside buffer.
9553 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9554 Don't access memory outside of the args array.
9555 (Fdefine_coding_system_internal): Check for charset-id overflow.
9556 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9557 result of ENCODE_CHAR.
9558 * coding.h: Adjust decls to match defn changes elsewhere.
9559 (struct coding_system):
9560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9561 * composite.c (get_composition_id, find_composition)
9562 (run_composition_function, update_compositions)
9563 (compose_text, composition_gstring_put_cache)
9564 (composition_gstring_p, composition_gstring_width)
9565 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9566 (composition_compute_stop_pos, composition_reseat_it)
9567 (composition_update_it, struct position_record)
9568 (find_automatic_composition, composition_adjust_point)
9569 (Fcomposition_get_gstring, Ffind_composition_internal):
9570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9571 (update_compositions):
9572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9573 * composite.h: Adjust decls to match defn changes elsewhere.
9574 (struct composition):
9575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9576 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9577 Do not attempt to compute the address of the object just before a
9578 buffer; this is not portable.
9579 (Faref, Faset):
9580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9581 (Faset): Use int, not EMACS_INT, where int is wide enough.
9582 (Fstring_to_number): Don't assume fixnums fit in int.
9583 (Frem): Don't assume arg is nonnegative.
9584 * dbusbind.c (xd_append_arg): Check for integers out of range.
9585 (Fdbus_call_method): Don't overflow the timeout int.
9586 (extract_signed, extract_unsigned): New functions.
9587 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9588 (xd_get_connection_references): Return ptrdiff_t, not int.
9589 All uses changed.
9590 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9591 (xd_read_message_1):
9592 Use int, not unsigned, where the dbus API uses int.
9593 (Fdbus_message_internal): Don't overflow mtype.
9594 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9595 * dired.c (directory_files_internal, file_name_completion, scmp)
9596 (file_name_completion_stat):
9597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9598 (file_name_completion): Don't overflow matchcount.
9599 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9600 * dispextern.h: Adjust decls to match defn changes elsewhere.
9601 (struct text_pos, struct glyph, struct bidi_saved_info)
9602 (struct bidi_string_data, struct bidi_it, struct composition_it)
9603 (struct it):
9604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9605 (struct display_pos, struct composition_it, struct it):
9606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9607 * dispnew.c (increment_matrix_positions)
9608 (increment_row_positions, mode_line_string)
9609 (marginal_area_string):
9610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9611 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9613 (duration_to_sec_usec): New function, to check for overflow better.
9614 (Fsleep_for, sit_for): Use it.
9615 * doc.c (get_doc_string, store_function_docstring):
9616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9617 (get_doc_string, Fsnarf_documentation):
9618 Use int, not EMACS_INT, where int is wide enough.
9619 (get_doc_string):
9620 Use SAFE_ALLOCA, not alloca.
9621 Check for overflow when converting EMACS_INT to off_t.
9622 * doprnt.c (doprnt):
9623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9624 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9625 Don't assume uid_t fits into fixnum.
9626 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9627 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9628 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9629 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9630 (general_insert_function)
9631 (Finsert_char, make_buffer_string, make_buffer_string_both)
9632 (update_buffer_properties, Fbuffer_substring)
9633 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9634 (Fsubst_char_in_region, check_translation)
9635 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9636 (transpose_markers, Ftranspose_regions):
9637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9638 (clip_to_bounds): Move to lisp.h as an inline function).
9639 (Fconstrain_to_field): Don't assume integers are nonnegative.
9640 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9641 (Fsubst_char_in_region, Fsave_restriction):
9642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9643 (Femacs_pid): Don't assume pid_t fits into fixnum.
9644 (lo_time): Use int, not EMACS_INT, when int suffices.
9645 (lisp_time_argument): Check for usec out of range.
9646 (Fencode_time): Don't assume fixnum fits in int.
9647 (Fuser_login_name, Fuser_full_name): Signal an error
9648 if a uid argument is out of range, rather than relying on
9649 undefined behavior.
9650 (Fformat_time_string): Remove now-unnecessary check.
9651 lisp_time_argument checks for out-of-range usec now.
9652 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9653 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9654 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9655 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9656 (init_cmdargs, Fdump_emacs):
9657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9658 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9659 the bottom (typically) 32 bits of the fixnum.
9660 * eval.c (specpdl_size, call_debugger):
9661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9662 (when_entered_debugger, Fbacktrace_debug):
9663 Don't assume fixnum can fit in int.
9664 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9665 the object just before a buffer; this is not portable.
9666 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9667 (grow_specpdl, unbind_to):
9668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9669 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9670 (grow_specpdl): Simplify allocation by using xpalloc.
9671 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9672 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9673 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9675 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9676 (a_write, e_write):
9677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9678 (Fcopy_file, non_regular_nbytes, read_non_regular)
9679 (Finsert_file_contents):
9680 Use int, not EMACS_INT, where int is wide enough.
9681 (READ_BUF_SIZE): Verify that it fits in int.
9682 (Finsert_file_contents): Check that counts are in proper range,
9683 rather than assuming fixnums fit into ptrdiff_t etc.
9684 Don't assume fixnums fit into int.
9685 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9686 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9687 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9688 (string_char_to_byte, string_byte_to_char)
9689 (string_make_multibyte, string_to_multibyte)
9690 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9691 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9692 (substring_both, Fdelete, internal_equal, Ffillarray)
9693 (Fclear_string, mapcar1)
9694 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9695 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9696 (larger_vector, make_hash_table, maybe_resize_hash_table)
9697 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9698 (Fmaphash, secure_hash):
9699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9700 (concat): Check for string index and length overflow.
9701 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9702 (Frequire):
9703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9704 (larger_vector): New API (vec, incr_min, size_max) replaces old
9705 one (vec, new_size, init). This catches size overflow.
9706 INIT was removed because it was always Qnil.
9707 All callers changed.
9708 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9709 the upper bound on a hash table index size.
9710 (make_hash_table, maybe_resize_hash_table): Use it.
9711 (secure_hash): Computer start_byte and end_byte only after
9712 they're known to be in ptrdiff_t range.
9713 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9714 (Ffont_get_glyphs, Ffont_at):
9715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9716 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9717 (Flist_fonts, Fopen_font):
9718 Don't assume fixnum can fit in int.
9719 (check_gstring): Don't assume index can fit in int.
9720 (font_match_p): Check that fixnum is a character, not a nonnegative
9721 fixnum, since the later code needs to stuff it into an int.
9722 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9723 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9724 conversion overflow issues.
9725 (Fopen_font): Check for integer out of range.
9726 (Ffont_get_glyphs): Don't assume index can fit in int.
9727 * font.h: Adjust decls to match defn changes elsewhere.
9728 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9729 integer overflow.
9730 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9731 printmax_t, where ptrdiff_t is wide enough.
9732 (Finternal_char_font):
9733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9734 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9735 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9736 (Fset_frame_position, x_set_frame_parameters)
9737 (x_set_line_spacing, x_set_border_width)
9738 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9739 Check that fixnums are in proper range for system types.
9740 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9742 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9743 Use SAFE_ALLOCA_LISP, not alloca.
9744 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9745 intptr_t is wide enough.
9746 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9747 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9748 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9749 Check for fixnum out of range.
9750 * ftfont.c (ftfont_list): Don't assume index fits in int.
9751 Check that fixnums are in proper range for system types.
9752 (ftfont_shape_by_flt):
9753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9754 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9756 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9757 Check that fixnums are in proper range for system types.
9758 * gnutls.h: Adjust decls to match defn changes elsewhere.
9759 * gtkutil.c (xg_dialog_run):
9760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9761 (update_frame_tool_bar):
9762 Check that fixnums are in proper range for system types.
9763 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9764 (lookup_image): Check that fixnums are in range for system types.
9765 * indent.c (last_known_column, last_known_column_point):
9766 (current_column_bol_cache):
9767 (skip_invisible, current_column, check_display_width):
9768 (check_display_width, scan_for_column, current_column_1)
9769 (Findent_to, Fcurrent_indentation, position_indentation)
9770 (indented_beyond_p, Fmove_to_column, compute_motion):
9771 (Fcompute_motion, Fvertical_motion):
9772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9773 (last_known_column_modified): Use EMACS_INT, not int.
9774 (check_display_width):
9775 (Fcompute_motion):
9776 Check that fixnums and floats are in proper range for system types.
9777 (compute_motion): Don't assume index or fixnum fits in int.
9778 (compute_motion, Fcompute_motion):
9779 Use int, not EMACS_INT, when it is wide enough.
9780 (vmotion): Omit local var start_hpos that is always 0; that way
9781 we don't need to worry about overflow in expressions involving it.
9782 * indent.h: Adjust decls to match defn changes elsewhere.
9783 (struct position):
9784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9785 Use int, not EMACS_INT, where int is wide enough.
9786 Remove unused members ovstring_chars_done and tab_offset;
9787 all uses removed.
9788 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9789 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9790 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9791 (make_gap, copy_text, insert, insert_and_inherit)
9792 (insert_before_markers, insert_before_markers_and_inherit)
9793 (insert_1, count_combining_before, count_combining_after)
9794 (insert_1_both, insert_from_string)
9795 (insert_from_string_before_markers, insert_from_string_1)
9796 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9797 (adjust_after_replace, adjust_after_insert, replace_range)
9798 (replace_range_2, del_range, del_range_1, del_range_byte)
9799 (del_range_both, del_range_2, modify_region)
9800 (prepare_to_modify_buffer, signal_before_change)
9801 (signal_after_change, Fcombine_after_change_execute):
9802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9803 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9804 (balance_an_interval, split_interval_right, split_interval_left)
9805 (find_interval, next_interval, update_interval)
9806 (adjust_intervals_for_insertion, delete_node, delete_interval)
9807 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9808 (static_offset_intervals, offset_intervals)
9809 (merge_interval_right, merge_interval_left, make_new_interval)
9810 (graft_intervals_into_buffer, temp_set_point_both)
9811 (temp_set_point, set_point, adjust_for_invis_intang)
9812 (set_point_both, move_if_not_intangible, get_property_and_range)
9813 (get_local_map, copy_intervals, copy_intervals_to_string)
9814 (compare_string_intervals, set_intervals_multibyte_1):
9815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9816 * intervals.h: Adjust decls to match defn changes elsewhere.
9817 (struct interval):
9818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9819 * keyboard.c (this_command_key_count, this_single_command_key_start)
9820 (before_command_key_count, before_command_echo_length, echo_now)
9821 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9822 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9823 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9824 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9826 (last_non_minibuf_size, last_point_position, echo_truncate)
9827 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9828 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9829 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9830 (stuff_buffered_input):
9831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9832 (last_auto_save, command_loop_1, read_char):
9833 Use EMACS_INT, not int, to avoid integer overflow.
9834 (record_char): Avoid overflow in total_keys computation.
9835 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9836 * keyboard.h: Adjust decls to match defn changes elsewhere.
9837 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9838 (Fkey_description, Fdescribe_vector, Flookup_key):
9839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9840 (click_position): New function, to check that positions are in range.
9841 (Fcurrent_active_maps):
9842 (describe_command):
9843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9844 (Faccessible_keymaps, Fkey_description):
9845 (preferred_sequence_p):
9846 Don't assume fixnum can fit into int.
9847 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9848 Check for integer overflow in size calculations.
9849 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9850 avoid mishandling large integers.
9851 * lisp.h: Adjust decls to match defn changes elsewhere.
9852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9853 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9854 (struct Lisp_Marker):
9855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9856 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9857 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9858 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9859 All callers changed.
9860 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9861 Assume the arg has valid form, since it always does.
9862 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9863 unsigned integer system type.
9864 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9865 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9867 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9868 (duration_to_sec_usec): New decl.
9869 * lread.c (read_from_string_index, read_from_string_index_byte)
9870 (read_from_string_limit, readchar, unreadchar, openp)
9871 (read_internal_start, read1, oblookup):
9872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9873 (Fload, readevalloop, Feval_buffer, Feval_region):
9874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9875 (openp): Check for out-of-range argument to 'access'.
9876 (read1): Use int, not EMACS_INT, where int is wide enough.
9877 Don't assume fixnum fits into int.
9878 Fix off-by-one error that can read outside a buffer.
9879 (read_filtered_event): Use duration_to_sec_usec
9880 to do proper overflow checking on durations.
9881 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9882 in size calculation.
9883 (Fexecute_kbd_macro):
9884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9885 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9886 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9887 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9888 (set_marker_both, set_marker_restricted_both, marker_position)
9889 (marker_byte_position, Fbuffer_has_markers_at):
9890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9891 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9892 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9893 It now merely ensures that the menu is large enough, without
9894 necessarily growing it, as this avoids some integer overflow issues.
9895 All callers changed.
9896 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9898 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9899 Use SAFE_ALLOCA_LISP, not alloca.
9900 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9901 to EMACS_INT. Check that fixnums are in proper range for system types.
9902 * minibuf.c (minibuf_prompt_width, string_to_object)
9903 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9904 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9906 (get_minibuffer, read_minibuf_unwind):
9907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9908 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9909 this simplifies overflow checking. All callers changed.
9910 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9911 (Ftest_completion):
9912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9913 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9914 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9915 Check that fixnums are in proper range for system types.
9916 (Fx_create_frame, Fx_show_tip):
9917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9918 * nsfont.m (ns_findfonts, nsfont_list_family):
9919 Don't assume fixnum fits in long.
9920 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9922 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9923 wide enough.
9924 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9926 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9927 (PRINTDECLARE, PRINTPREPARE):
9928 (strout, print_string):
9929 (print, print_preprocess, print_check_string_charset_prop)
9930 (print_object):
9931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9932 (PRINTDECLARE):
9933 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9935 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9936 (printchar, strout): Use xpalloc to catch size calculation overflow.
9937 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9938 (print_error_message): Use SAFE_ALLOCA, not alloca.
9939 (print_object): Use int, not EMACS_INT, where int is wide enough.
9940 (print_depth, new_backquote_output, print_number_index):
9941 Use ptrdiff_t, not int, where int might not be wide enough.
9942 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9943 (Fset_process_window_size, Fformat_network_address)
9944 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9945 (sigchld_handler):
9946 Check that fixnums are in proper range for system types.
9947 (Fsignal_process): Simplify by avoiding a goto.
9948 Check for process-ids out of pid_t range rather than relying on
9949 undefined behavior.
9950 (process_tick, update_tick): Use EMACS_INT, not int.
9951 (Fformat_network_address, read_process_output, send_process)
9952 (Fprocess_send_region, status_notify):
9953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9954 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9955 (wait_reading_process_output, read_process_output, exec_sentinel):
9956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9957 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9958 (Faccept_process_output): Use duration_to_sec_usec to do proper
9959 overflow checking on durations.
9960 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9961 Don't assume pid_t fits in int.
9962 * process.h (struct Lisp_Process): Members tick and update_tick
9963 are now of type EMACS_INT, not int.
9964 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9965 configured --with-wide-int.
9966 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9967 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9968 * search.c (looking_at_1, string_match_1):
9969 (fast_string_match, fast_c_string_match_ignore_case)
9970 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9971 (scan_newline, find_before_next_newline, search_command)
9972 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9973 (set_search_regs, wordify):
9974 (Freplace_match):
9975 (Fmatch_data):
9976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9977 (string_match_1, search_buffer, set_search_regs):
9978 (Fmatch_data):
9979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9980 (wordify): Check for overflow in size calculation.
9981 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9982 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9983 Check that fixnums are in proper range for system types.
9984 * sound.c (struct sound_device)
9985 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9987 (Fplay_sound_internal):
9988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9989 * syntax.c (struct lisp_parse_state, find_start_modiff)
9990 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9991 (Fparse_partial_sexp):
9992 Don't assume fixnums can fit in int.
9993 (struct lisp_parse_state, find_start_pos, find_start_value)
9994 (find_start_value_byte, find_start_begv)
9995 (update_syntax_table, char_quoted, dec_bytepos)
9996 (find_defun_start, prev_char_comend_first, back_comment):
9997 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9998 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10000 (Finternal_describe_syntax_value): Check that match_lisp is a
10001 character, not an integer, since the code stuffs it into int.
10002 (scan_words, scan_sexps_forward):
10003 Check that fixnums are in proper range for system types.
10004 (Fforward_word):
10005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10006 (scan_sexps_forward):
10007 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10008 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10009 * syntax.h: Adjust decls to match defn changes elsewhere.
10010 (struct gl_state_s):
10011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10012 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10013 MOST_POSITIVE_FIXNUM.
10014 * sysdep.c (wait_for_termination_1, wait_for_termination)
10015 (interruptible_wait_for_termination, mkdir):
10016 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10017 (emacs_read, emacs_write):
10018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10019 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10020 and double all fit in int.
10021 * term.c (set_tty_color_mode):
10022 Check that fixnums are in proper range for system types.
10023 * termhooks.h (struct input_event):
10024 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10025 * textprop.c (validate_interval_range, interval_of)
10026 (Fadd_text_properties, set_text_properties_1)
10027 (Fremove_text_properties, Fremove_list_of_text_properties)
10028 (Ftext_property_any, Ftext_property_not_all)
10029 (copy_text_properties, text_property_list, extend_property_ranges)
10030 (verify_interval_modification):
10031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10032 (Fnext_single_char_property_change)
10033 (Fprevious_single_char_property_change):
10034 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10035 (copy_text_properties):
10036 Check for integer overflow in index calculation.
10037 * undo.c (last_boundary_position, record_point, record_insert)
10038 (record_delete, record_marker_adjustment, record_change)
10039 (record_property_change):
10040 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10041 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10043 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10044 (Fx_hide_tip, Fx_file_dialog):
10045 * w32menu.c (set_frame_menubar):
10046 Use ptrdiff_t, not int, for consistency with rest of code.
10047 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10048 (select_window, Fdelete_other_windows_internal)
10049 (window_scroll_pixel_based, window_scroll_line_based)
10050 (Frecenter, Fset_window_configuration):
10051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10052 (Fset_window_hscroll, run_window_configuration_change_hook)
10053 (set_window_buffer, temp_output_buffer_show, scroll_command)
10054 (Fscroll_other_window, Frecenter):
10055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10056 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10057 Don't assume fixnum fits in int.
10058 (Fset_window_scroll_bars):
10059 Check that fixnums are in proper range for system types.
10060 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10061 (string_pos, c_string_pos, number_of_chars, init_iterator)
10062 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10063 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10064 (compute_display_string_end, handle_face_prop)
10065 (face_before_or_after_it_pos, handle_invisible_prop)
10066 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10067 (display_prop_intangible_p, string_buffer_position_lim)
10068 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10069 (get_overlay_strings_1, get_overlay_strings)
10070 (iterate_out_of_display_property, forward_to_next_line_start)
10071 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10072 (get_next_display_element, set_iterator_to_next)
10073 (get_visually_first_element, compute_stop_pos_backwards)
10074 (handle_stop_backwards, next_element_from_buffer)
10075 (move_it_in_display_line_to, move_it_in_display_line)
10076 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10077 (add_to_log, message_dolog, message_log_check_duplicate)
10078 (message2, message2_nolog, message3, message3_nolog
10079 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10080 (current_message_1, truncate_echo_area, truncate_message_1)
10081 (set_message, set_message_1, store_mode_line_noprop)
10082 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10083 (text_outside_line_unchanged_p, check_point_in_composition)
10084 (reconsider_clip_changes)
10085 (redisplay_internal, set_cursor_from_row, try_scrolling)
10086 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10087 (redisplay_window, find_last_unchanged_at_beg_row)
10088 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10089 (trailing_whitespace_p, find_row_edges, display_line)
10090 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10091 (display_mode_element, store_mode_line_string)
10092 (pint2str, pint2hrstr, decode_mode_spec)
10093 (display_count_lines, display_string, draw_glyphs)
10094 (x_produce_glyphs, x_insert_glyphs)
10095 (rows_from_pos_range, mouse_face_from_buffer_pos)
10096 (fast_find_string_pos, mouse_face_from_string_pos)
10097 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10099 (safe_call, init_from_display_pos, handle_fontified_prop)
10100 (handle_single_display_spec, load_overlay_strings)
10101 (with_echo_area_buffer, setup_echo_area_for_printing)
10102 (display_echo_area, echo_area_display)
10103 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10104 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10105 (redisplay_window, dump_glyph_row, display_mode_line)
10106 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10107 (handle_display_spec, display_prop_string_p):
10108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10109 (handle_single_display_spec, build_desired_tool_bar_string)
10110 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10111 (get_specified_cursor_type):
10112 Check that fixnums are in proper range for system types.
10113 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10114 (Flookup_image_map):
10115 Don't assume fixnums fit in int.
10116 (compare_overlay_entries):
10117 Avoid mishandling comparisons due to subtraction overflow.
10118 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10119 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10120 (handle_tool_bar_click):
10121 Use int, not unsigned, since we prefer signed and the signedness
10122 doesn't matter here.
10123 (get_next_display_element, next_element_from_display_vector):
10124 Use int, not EMACS_INT, when int is wide enough.
10125 (start_hourglass): Use duration_to_sec_usec to do proper
10126 overflow checking on durations.
10127 * xfaces.c (Fbitmap_spec_p):
10128 Check that fixnums are in proper range for system types.
10129 (compare_fonts_by_sort_order):
10130 Avoid mishandling comparisons due to subtraction overflow.
10131 (Fx_family_fonts, realize_basic_faces):
10132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10133 (Fx_family_fonts):
10134 Don't assume fixnum fits in int.
10135 Use SAFE_ALLOCA_LISP, not alloca.
10136 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10137 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10138 (face_at_buffer_position, face_for_overlay_string)
10139 (face_at_string_position):
10140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10141 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10142 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10143 (Fx_show_tip):
10144 Check that fixnums are in proper range for system types.
10145 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10146 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10148 (Fx_change_window_property): Don't assume fixnums fit in int.
10149 * xfont.c (xfont_chars_supported):
10150 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10151 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10152 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10154 * xml.c (parse_region):
10155 * xrdb.c (magic_file_p):
10156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10157 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10158 (x_get_local_selection, x_reply_selection_request)
10159 (x_handle_selection_request, wait_for_property_change):
10160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10161 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10162 short is wide enough.
10163 (x_send_client_event): Don't assume fixnum fits in int.
10164 * xterm.c (x_x_to_emacs_modifiers):
10165 Don't assume EMACS_INT overflows nicely into int.
10166 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10167 may come from Lisp.
10168 (handle_one_xevent): NATNUMP can eval its arg twice.
10169 (x_connection_closed):
10170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10171 * xterm.h: Adjust decls to match defn changes elsewhere.
10172 (struct scroll_bar): Use struct vectorlike_header
10173 rather than rolling our own approximation.
10174 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10175
10176 2012-05-25 Glenn Morris <rgm@gnu.org>
10177
10178 * lisp.mk (lisp): Update for more files being compiled now.
10179
10180 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10181
10182 * lread.c: Remove `read_pure' which makes no difference.
10183 (read_pure): Remove var.
10184 (unreadpure): Remove function.
10185 (readevalloop): Don't call read_list with -1 flag.
10186 (read1, read_vector): Don't test read_pure any more.
10187 (read_list): Simplify.
10188
10189 * fileio.c, character.h: Minor style tweaks.
10190
10191 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10192
10193 * window.h (clip_changed): Remove useless declaration.
10194
10195 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10196
10197 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10198 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10199
10200 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10201
10202 Remove src/m/*.
10203 This directory predates autoconf and is no longer needed nowadays.
10204 Move its few remaining bits of functionality to where they're needed.
10205 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10206 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10207 * m/template.h: Remove.
10208 * Makefile.in (M_FILE): Remove. All uses removed.
10209 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10210 * lisp.h (USE_LSB_TAG):
10211 * mem-limits.h (EXCEEDS_LISP_PTR):
10212 Use VAL_MAX, not VALBITS, in #if.
10213 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10214 (EMACS_UINT): Define unconditionally now.
10215 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10216 (BITS_PER_EMACS_INT): New constants, replacing
10217 what used to be in config.h, but not useful in #if.
10218 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10219 define them any more.
10220 (VAL_MAX): New macro.
10221 (VALMASK): Use it.
10222 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10223 BITS_PER_EMACS_INT, in #if.
10224 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10225 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10226 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10227 * s/ms-w32.h (DATA_START):
10228 Move here from removed file m/intel386.h.
10229 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10230 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10231
10232 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10233
10234 Assume C89 or later.
10235 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10236 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10237 (xrealloc):
10238 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10239 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10240 * textprop.c, tparam.c (NULL): Remove.
10241 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10242 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10243 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10244 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10245 * xterm.c (input_signal_count): Assume volatile works.
10246
10247 2012-05-21 Ken Brown <kbrown@cornell.edu>
10248
10249 * xgselect.c (xg_select): Fix first argument in call to 'select'
10250 (bug#11508).
10251
10252 2012-05-20 Ken Brown <kbrown@cornell.edu>
10253
10254 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10255 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10256
10257 2012-05-19 Ken Brown <kbrown@cornell.edu>
10258
10259 * xfns.c (x_in_use): Remove `static' qualifier.
10260 * xterm.h (x_in_use): Declare.
10261 * xgselect.c: Include xterm.h.
10262 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10263 and `display_arg' (bug#9754).
10264
10265 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10268
10269 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10270 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10271
10272 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10273
10274 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10275
10276 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10277 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10278
10279 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10280 reference to image_cache->refcount.
10281 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10282
10283 2012-05-17 Juri Linkov <juri@jurta.org>
10284
10285 * search.c (Fword_search_regexp, Fword_search_backward)
10286 (Fword_search_forward, Fword_search_backward_lax)
10287 (Fword_search_forward_lax): Move functions to isearch.el
10288 (bug#10145, bug#11381).
10289
10290 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10291
10292 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10293
10294 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10295
10296 * lread.c (init_obarray): Declare Qt and Qnil as special.
10297
10298 2012-05-14 Glenn Morris <rgm@gnu.org>
10299
10300 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10301 Put "libexec" before "bin", for the sake of init_callproc_1.
10302
10303 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10304
10305 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10306
10307 * unexaix.c: Port to more-recent AIX compilers.
10308 (report_error, report_error_1, make_hdr, copy_sym)
10309 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10310 Make arguments const char *, not char *, to avoid violations of C
10311 standard and to fix some AIX warnings reported by Gilles Pion.
10312
10313 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10314
10315 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10316 already have overlays loaded.
10317 (handle_single_display_spec): Before returning without displaying
10318 fringe bitmap, synchronize the bidi iterator with the main display
10319 iterator, by calling iterate_out_of_display_property.
10320 (iterate_out_of_display_property): Detect buffer iteration by
10321 testing that it->string is a Lisp string.
10322 (get_next_display_element): When the current object is exhausted,
10323 and there's something on it->stack, call set_iterator_to_next to
10324 proceed with what's on the stack, instead of returning zero.
10325 (set_iterator_to_next): If called at the end of a Lisp string,
10326 proceed to consider_string_end without incrementing string
10327 position. Don't increment display vector index past the end of
10328 the display vector. (Bug#11417)
10329 (pos_visible_p): Don't report a position visible when move_it_to
10330 stopped at the last line of window, which happens to be scanned
10331 backwards by the bidi iteration. (Bug#11464)
10332
10333 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10334
10335 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10336 and right-margin display specs even if the spec is invalid or we
10337 are on a TTY, and thus unable to display on the fringes.
10338 That's because the text with the property will not be displayed anyway,
10339 so we need to signal to the caller that this is a "replacing"
10340 display spec. This fixes display when the spec is invalid or we
10341 are on a TTY.
10342
10343 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10344
10345 * unexaix.c (make_hdr): Fix typo in prototype.
10346 This bug broke the build on AIX. Problem reported by Gilles Pion.
10347
10348 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10349
10350 * keyboard.c (kbd_buffer_get_event): Read special events also in
10351 batch mode. (Bug#11415)
10352
10353 2012-05-12 Glenn Morris <rgm@gnu.org>
10354
10355 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10356
10357 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10358
10359 * lisp.mk (lisp): Add newcomment.elc.
10360
10361 2012-05-12 Glenn Morris <rgm@gnu.org>
10362
10363 * Makefile.in (MKDIR_P): New, set by configure.
10364 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10365
10366 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10367
10368 Remove unused function hourglass_started.
10369 * dispextern.h (hourglass_started):
10370 * w32fns.c (hourglass_started):
10371 * xdisp.c (hourglass_started): Remove.
10372
10373 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10374
10375 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10376 Update dependencies.
10377
10378 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10379
10380 * xgselect.c (xg_select): Put maxfds+1 into a var.
10381 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10382
10383 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10384
10385 2012-05-10 Dave Abrahams <dave@boostpro.com>
10386
10387 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10388 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10389
10390 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10391
10392 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10393 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10394 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10395 Initialize xd_registered_buses.
10396
10397 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10398
10399 Untag more efficiently if USE_LSB_TAG.
10400 This is based on a proposal by YAMAMOTO Mitsuharu in
10401 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10402 For an admittedly artificial (nth 8000 longlist) benchmark on
10403 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10404 Emacs's overall text size by 1%.
10405 * lisp.h (XUNTAG): New macro.
10406 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10407 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10408 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10409 * eval.c (Fautoload):
10410 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10411 * frame.h (XFRAME): Use XUNTAG.
10412
10413 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10414 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10415 Remove unportable assumptions about print widths of types like
10416 dbus_uint32_t.
10417 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10418 intptr_t when converting between pointer and integer, to avoid GCC
10419 warnings about wrong width.
10420
10421 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10422
10423 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10424 stack for each reader_thread, instead of defaulting to 8MB
10425 determined by the linker. This avoids failures in creating
10426 subprocesses on Windows 7, see the discussion in this thread:
10427 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10428
10429 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10430
10431 Fix up display of the *Minibuf-0* buffer in the mini window.
10432 * keyboard.c (read_char): Don't clear the echo area if there's no
10433 message to clear.
10434 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10435 contents of *Minibuf-0*) if there's no message displayed in its stead.
10436
10437 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10438
10439 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10440 batch mode.
10441
10442 2012-05-06 Chong Yidong <cyd@gnu.org>
10443
10444 * lisp.mk (lisp): Update.
10445
10446 2012-05-05 Jim Meyering <meyering@redhat.com>
10447
10448 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10449
10450 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10451
10452 * data.c (PUT_ERROR): New macro.
10453 (syms_of_data): Use it. Add new error type `user-error'.
10454 * undo.c (user_error): New function.
10455 (Fprimitive_undo): Use it.
10456 * print.c (print_error_message): Adjust print style for `user-error'.
10457 * keyboard.c (user_error): New function.
10458 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10459
10460 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10461
10462 Do not limit current-time-string to years 1000..9999.
10463 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10464 (Fcurrent_time_string): Support any year that is supported by the
10465 underlying localtime representation. Don't use asctime, as it
10466 has undefined behavior for years outside the range -999..9999.
10467
10468 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10469
10470 Fix race conditions involving setenv, gmtime, localtime, asctime.
10471 Without this fix, interrupts could mess up code that uses these
10472 nonreentrant functions, since setting TZ invalidates existing
10473 tm_zone or tzname values, and since most of these functions return
10474 pointers to static storage.
10475 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10476 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10477 Grow the critical sections to include not just invoking
10478 localtime/gmtime, but also accessing these functions' results
10479 including their tm_zone values if any, and any related TZ setting.
10480 (format_time_string): Last arg is now struct tm *, not struct tm **,
10481 so that the struct tm is saved in the critical section.
10482 All callers changed. Simplify allocation of initial buffer, partly
10483 motivated by the fact that memory allocation needs to be outside
10484 the critical section.
10485
10486 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10487
10488 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10489 with RESET_INTERVAL.
10490
10491 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10492 Remove duplicated buffer name initialization.
10493
10494 2012-05-02 Jim Meyering <jim@meyering.net>
10495
10496 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10497
10498 * xfns.c (x_window): Use xstrdup (Bug#11375).
10499
10500 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10501
10502 * xdisp.c (pos_visible_p): If already at a newline from the
10503 display string before the 'while' loop, don't walk back the glyphs
10504 from it3.glyph_row. Solves assertion violation when the display
10505 string begins with a newline (egg.el). (Bug#11367)
10506
10507 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10508
10509 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10510 Move to simple.el.
10511
10512 2012-05-01 Glenn Morris <rgm@gnu.org>
10513
10514 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10515 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10516 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10517 All were removed before 23.1.
10518
10519 * dispnew.c: Remove HAVE_LIBNCURSES test;
10520 it is always true on relevant platforms.
10521
10522 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10523 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10524
10525 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10526
10527 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10528
10529 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10530 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10531 Remove.
10532
10533 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10534
10535 Do not avoid creating empty evaporating overlays (Bug#9642).
10536 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10537 That is, do not delete an evaporating overlay if it becomes
10538 empty after its bounds are adjusted to fit within its buffer.
10539 This fix caused other problems, and I'm reverting it until we get
10540 to the bottom of them.
10541
10542 2012-04-27 Chong Yidong <cyd@gnu.org>
10543
10544 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10545
10546 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10547
10548 * xdisp.c (pos_visible_p): If the window start position is beyond
10549 ZV, start the display from buffer beginning. Prevents assertion
10550 violation in init_iterator when the minibuffer window is scrolled
10551 via the scroll bar.
10552
10553 * window.c (window_scroll_pixel_based): Likewise.
10554
10555 2012-04-27 Chong Yidong <cyd@gnu.org>
10556
10557 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10558
10559 2012-04-27 Glenn Morris <rgm@gnu.org>
10560
10561 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10562 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10563
10564 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10565
10566 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10567 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10568
10569 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10570
10571 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10572 display element, check also the underlying string or buffer
10573 character. (Bug#11341)
10574
10575 * w32menu.c: Include w32heap.h.
10576 (add_menu_item): If the call to AppendMenuW (via
10577 unicode_append_menu) fails, disable Unicode menus only if we are
10578 running on Windows 9X/Me.
10579
10580 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10581
10582 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10583 (xgetint): Add missing shift for LSB tags.
10584
10585 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10586
10587 * keyboard.c (read_char): Don't wipe echo area for select window
10588 events: These might get delayed via `mouse-autoselect-window'
10589 (Bug#11304).
10590
10591 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10592
10593 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10594 manipulation of :loaded-from data.
10595
10596 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10597
10598 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10599 now a cons (bug#11311).
10600
10601 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10602
10603 Do not create empty overlays with the evaporate property (Bug#9642).
10604 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10605 if it becomes empty after its bounds are adjusted to fit within
10606 its buffer. Without this fix, in a nonempty buffer (let ((o
10607 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10608 yields an empty overlay that has the evaporate property, which is
10609 not supposed to happen.
10610
10611 Fix minor GTK3 problems found by static checking.
10612 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10613 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10614 (struct _EmacsFixedClass, emacs_fixed_get_type):
10615 Move decls here from emacsgtkfixed.h, since they needn't be public.
10616 (emacs_fixed_get_type): Now static.
10617 (emacs_fixed_class_init): Omit unused local.
10618 (emacs_fixed_child_type): Remove; unused.
10619 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10620 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10621 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10622 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10623 (EMACS_FIXED_GET_CLASS): Remove; unused.
10624 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10625
10626 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10627 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10628
10629 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10630
10631 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10632 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10633 (__malloc_size_t, __malloc_ptrdiff_t):
10634 Remove. All uses removed, replaced by the definiens if needed,
10635 since we can assume C89 or better now.
10636 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10637 (protect_malloc_state, align, get_contiguous_space)
10638 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10639 (malloc_atfork_handler_child, malloc_enable_thread)
10640 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10641 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10642 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10643 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10644 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10645 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10646 Define using prototypes, not old style.
10647 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10648 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10649 (align): Don't assume that signed integer overflow wraps around.
10650 Omit unused local var.
10651 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10652 (_free_internal_nolock, memalign, mallochook, reallochook):
10653 Omit no-longer-needed casts.
10654 (valloc): Use getpagesize, not __getpagesize.
10655 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10656 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10657
10658 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10659
10660 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10661
10662 Move functions from C to Lisp. Make non-blocking method calls
10663 the default. Implement further D-Bus standard interfaces.
10664
10665 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10666 (QCdbus_request_name_allow_replacement)
10667 (QCdbus_request_name_replace_existing)
10668 (QCdbus_request_name_do_not_queue)
10669 (QCdbus_request_name_reply_primary_owner)
10670 (QCdbus_request_name_reply_in_queue)
10671 (QCdbus_request_name_reply_exists)
10672 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10673 (QCdbus_registered_serial, QCdbus_registered_method)
10674 (QCdbus_registered_signal): New Lisp objects.
10675 (XD_DEBUG_MESSAGE): Use sizeof.
10676 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10677 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10678 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10679 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10680 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10681 (xd_signature, xd_append_arg): Allow float for integer types.
10682 (xd_get_connection_references): New function.
10683 (xd_get_connection_address): Rename from xd_initialize.
10684 Return cached address.
10685 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10686 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10687 level.
10688 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10689 Return number of refcounts.
10690 (Fdbus_get_unique_name): Make stronger parameter check.
10691 (Fdbus_message_internal): New defun.
10692 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10693 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10694 (Fdbus_send_signal, Fdbus_register_service)
10695 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10696 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10697 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10698 (Vdbus_compiled_version, Vdbus_runtime_version)
10699 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10700 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10701 (Vdbus_message_type_signal): New defvars.
10702 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10703 Adapt docstring.
10704
10705 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10706
10707 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10708 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10709 Do not assume ptrdiff_t is the same width as 'int'.
10710
10711 * alloc.c: Handle unusual debugging option combinations.
10712 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10713 since the two debugging options are incompatible.
10714 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10715 is defined.
10716 (mem_init, mem_insert, mem_insert_fixup):
10717 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10718 (NEED_MEM_INSERT): Remove; no longer needed.
10719
10720 2012-04-22 Leo Liu <sdl.web@gmail.com>
10721
10722 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10723
10724 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10725
10726 * sysdep.c [__FreeBSD__]: Minor cleanups.
10727 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10728 Use Emacs indenting style more consistently. Avoid some casts.
10729 Use 'double' consistently rather than mixing 'float' and 'double'.
10730
10731 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10732
10733 * sysdep.c (list_system_processes, system_process_attributes):
10734 Add implementation for FreeBSD (Bug#5243).
10735
10736 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10737
10738 * lisp.mk (lisp): Update.
10739
10740 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10741
10742 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10743 It is never used otherwise.
10744
10745 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10746
10747 * print.c (print_preprocess): Only check print_depth if print-circle
10748 is nil.
10749 (print_object): Check for cycles even when print-circle is nil and
10750 print-gensym is t, but only check print_depth if print-circle is nil.
10751
10752 2012-04-20 Chong Yidong <cyd@gnu.org>
10753
10754 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10755 set the status to "failed" and ensure that sentinel is run.
10756
10757 2012-04-20 Glenn Morris <rgm@gnu.org>
10758
10759 * process.c (Fset_process_inherit_coding_system_flag)
10760 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10761 (Fmake_network_process, Fmake_serial_process): Doc fix.
10762
10763 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10764
10765 * xdisp.c (string_buffer_position_lim): Limit starting position to
10766 BEGV.
10767 (set_cursor_from_row): If called for a mode-line or header-line
10768 row, return zero immediately.
10769 (try_cursor_movement): If inside continuation line, don't back up
10770 farther than the first row after the header line, if any.
10771 Don't consider the header-line row as "partially visible", even if
10772 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10773
10774 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10775
10776 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10777 (bug#11238).
10778
10779 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10780 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10781
10782 configure: new option --enable-gcc-warnings (Bug#11207)
10783 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10784 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10785 (ALL_CFLAGS): Use new macros rather than old.
10786 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10787 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10788 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10789 -Wunused-result, -Wunused-variable. This should go away once
10790 the Emacs and Gnulib regex code is merged.
10791 (xmalloc, xrealloc): Now static.
10792
10793 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10794
10795 * dired.c (Fsystem_groups): Remove unused local.
10796
10797 2012-04-17 Glenn Morris <rgm@gnu.org>
10798
10799 * dired.c (Fsystem_users): Doc fix.
10800
10801 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10802
10803 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10804 (syms_of_dired): Add them.
10805
10806 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10807
10808 Fix minor alloc.c problems found by static checking.
10809 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10810 New extern decls, to avoid calling undeclared functions.
10811 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10812 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10813 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10814 (NEED_MEM_INSERT): New macro.
10815 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10816 Remove one incorrect comment and fix another.
10817
10818 Fix minor ralloc.c problems found by static checking.
10819 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10820 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10821 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10822 (r_alloc_sbrk): Now static.
10823
10824 Improve ralloc.c interface checking.
10825 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10826 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10827 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10828 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10829 [REL_ALLOC]: ... to here, to check interface.
10830 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10831 Remove decls. This fixes an "It stinks!".
10832
10833 * alloc.c (which_symbols): Fix alignment issue / type clash.
10834
10835 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10836
10837 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10838 (struct Lisp_Misc_Any): Likewise.
10839 (struct Lisp_Free): Likewise.
10840 * alloc.c (union aligned_Lisp_Symbol): Define.
10841 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10842 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10843 (union aligned_Lisp_Misc): Define.
10844 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10845 aligned_Lisp_Misc instead of union Lisp_Misc.
10846 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10847
10848 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10851 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10852 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10853 * s/netbsd.h, s/sol2-6.h:
10854 Remove definition of GC_MARK_STACK, since the default now works.
10855 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10856 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10857 no longer the default.
10858 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10859
10860 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10861
10862 * lread.c (lisp_file_lexically_bound_p):
10863 Fix hang at ";-*-\n" (bug#11238).
10864
10865 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10866
10867 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10868 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10869
10870 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10871
10872 * nsterm.m (constrainFrameRect): Always constrain when there is only
10873 one screen (Bug#10962).
10874
10875 2012-04-13 Ken Brown <kbrown@cornell.edu>
10876
10877 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10878
10879 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10880
10881 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10882
10883 2012-04-11 Daniel Colascione <dancol@dancol.org>
10884
10885 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10886 against is gone. It's better to use vfork now so that when Cygwin
10887 gains a new, working vfork, we use it automatically (bug#10398).
10888
10889 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10890
10891 * window.c (save_window_save): Obey window-point-insertion-type.
10892
10893 2012-04-11 Glenn Morris <rgm@gnu.org>
10894
10895 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10896
10897 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10898
10899 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10900
10901 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10902
10903 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10904 (force_quit_count): New var.
10905 (handle_interrupt): Use it.
10906
10907 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10908
10909 * w32.c (w32_delayed_load): Record the full path of the library
10910 being loaded (bug#10424).
10911
10912 2012-04-09 Glenn Morris <rgm@gnu.org>
10913
10914 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10915 not just in the obarray, before snarfing them. (Bug#11036)
10916
10917 * Makefile.in ($(leimdir)/leim-list.el):
10918 Pass EMACS rather than BUILT_EMACS.
10919
10920 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10921
10922 * process.c (make_process):
10923 * process.h: Add integer `gnutls_handshakes_tried' member to
10924 process struct.
10925
10926 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10927 Add convenience `GNUTLS_LOG2i' macro.
10928
10929 * gnutls.c (gnutls_log_function2i): Convenience log function.
10930 (emacs_gnutls_read): Use new log functions,
10931 `gnutls_handshakes_tried' process member, and
10932 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10933 attempts per process (connection).
10934
10935 2012-04-09 Chong Yidong <cyd@gnu.org>
10936
10937 * eval.c (Fuser_variable_p, user_variable_p_eh)
10938 (lisp_indirect_variable): Functions deleted.
10939 (Fdefvar): Caller changed.
10940
10941 * callint.c (Finteractive, Fcall_interactively):
10942 * minibuf.c (Fread_variable): Callers changed.
10943
10944 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10945
10946 * xdisp.c (set_cursor_from_row): If the display string appears in
10947 the buffer at position that is closer to point than the position
10948 after the display string, display the cursor on the first glyph of
10949 the display string. Fixes cursor display when a 'display' text
10950 property immediately follows invisible text. (Bug#11094)
10951
10952 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10953
10954 composite.c: use 'double' consistently
10955 * composite.c (get_composition_id): Use 'double' consistently
10956 instead of converting 'float' to 'double' and vice versa; this is
10957 easier to understand and avoids a GCC warning.
10958
10959 2012-04-09 Glenn Morris <rgm@gnu.org>
10960
10961 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10962 preparation for dumping it with emacs. (Bug#4789)
10963 (leimdir): New variable.
10964 ($(leimdir)/leim-list.el): New rule.
10965 (emacs$(EXEEXT)): Depend on leim-list.el.
10966
10967 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10968 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10969 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10970
10971 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10972
10973 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10974 proper alignment.
10975
10976 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10977
10978 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10979 Remove unused local variable.
10980
10981 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10982
10983 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10984 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10985 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10986 objects, as mark_maybe_pointer will catch them otherwise.
10987 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10988 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10989
10990 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10991
10992 Fix typo that broke non-Windows builds.
10993 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10994
10995 2012-04-07 Eli Zaretskii <eliz@gnu.org>
10996
10997 Support building on MS-Windows with libxml2.
10998
10999 * makefile.w32-in (OBJ2): Add xml.$(O).
11000 (GLOBAL_SOURCES): Add xml.c.
11001 ($(BLD)/xml.$(O)): New dependency list.
11002
11003 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11004 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11005 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11006 [!WINDOWSNT]: New macros.
11007 (init_libxml2_functions, libxml2_loaded_p): New functions.
11008 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11009 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11010 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11011 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11012 linked in).
11013 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11014 Call init_libxml2_functions before calling libxml2 functions.
11015 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11016
11017 * emacs.c: Don't include libxml/parser.h.
11018 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11019 xmlCleanupParser directly.
11020
11021 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11022
11023 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11024
11025 * indent.c (Fvertical_motion): If there is a display string at
11026 point, use it.vpos to compute how many lines to backtrack after
11027 move_it_to point. (Bug#11133)
11028
11029 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11030
11031 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11032 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11033 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11034 macros related to unification of CJK characters. For the details,
11035 see the discussion following the message here:
11036 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11037
11038 2012-04-04 Chong Yidong <cyd@gnu.org>
11039
11040 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11041
11042 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11043
11044 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11045 instead of alloca. (Bug#11138)
11046
11047 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11048
11049 * w32menu.c (is_simple_dialog): Properly check lisp types.
11050 (Bug#11141)
11051
11052 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11053
11054 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11055 position we get to after a call to move_it_to fails the
11056 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11057 only if we wind up in a string from display property. (Bug#11063)
11058
11059 * window.c (Fdelete_other_windows_internal): Invalidate the row
11060 and column information about mouse highlight, so that redisplay
11061 restores it after reallocating the glyph matrices. (Bug#7464)
11062
11063 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11064 string comes from a `display' text property, use the buffer
11065 position of that property as if we actually saw that position in
11066 the row's glyphs.
11067 (move_it_by_lines): Remove the assertion that
11068 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11069 violated when there's a before-string at the beginning of a line.
11070 (Bug#11063)
11071
11072 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11073
11074 * xdisp.c (append_space_for_newline): If the default face was
11075 remapped, use the remapped face for the appended newline.
11076 (extend_face_to_end_of_line): Use the remapped default face for
11077 extending the face to the end of the line.
11078 (display_line): Call extend_face_to_end_of_line when the default
11079 face was remapped. (Bug#11068)
11080
11081 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11082
11083 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11084
11085 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11086
11087 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11088
11089 2012-03-27 Glenn Morris <rgm@gnu.org>
11090
11091 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11092 Doc fixes.
11093
11094 2012-03-26 Kenichi Handa <handa@m17n.org>
11095
11096 * dispextern.h (struct glyph): Fix previous change. Change the
11097 bit length of glyphless.ch to 25 (Bug#11082).
11098
11099 2012-03-26 Chong Yidong <cyd@gnu.org>
11100
11101 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11102 (command_loop_1): Use it; inhibit selection update for
11103 handle-select-window too (Bug#8996).
11104
11105 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11106
11107 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11108
11109 2012-03-25 Kenichi Handa <handa@m17n.org>
11110
11111 * dispextern.h (struct glyph): Change the bit length of
11112 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11113
11114 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11115
11116 * s/ms-w32.h (tzname): Include time.h before redirecting to
11117 _tzname. Fixes the MSVC build. (Bug#9960)
11118
11119 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11120
11121 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11122 characters.
11123
11124 * xterm.c (XTread_socket): Only modify handling_signal if
11125 !SYNC_INPUT. (Bug#11080)
11126
11127 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11128
11129 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11130 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11131 when fetching a multibyte character consumes more bytes than
11132 CHAR_BYTES returns, due to unification of CJK characters in
11133 string_char. (Bug#11073)
11134
11135 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11136
11137 * process.c (wait_reading_process_output): Handle pty disconnect
11138 by refraining from sending oneself a SIGCHLD (bug#10933).
11139
11140 2012-03-22 Chong Yidong <cyd@gnu.org>
11141
11142 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11143
11144 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11145 Mark string as coming from a prefix property.
11146 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11147 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11148
11149 2012-03-21 Chong Yidong <cyd@gnu.org>
11150
11151 * xfaces.c (Vface_remapping_alist): Doc fix.
11152
11153 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11154
11155 * w32proc.c (Fw32_set_console_codepage)
11156 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11157 Doc fixes.
11158
11159 2012-03-20 Chong Yidong <cyd@gnu.org>
11160
11161 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11162 to reflect default non-nil value of redisplay-dont-pause.
11163
11164 2012-03-19 Kenichi Handa <handa@m17n.org>
11165
11166 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11167 it fit in a valid range (Bug#11003).
11168
11169 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11170
11171 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11172 that is not from display property, accept the row as a "cursor
11173 row" if one of the string's character has a non-nil `cursor'
11174 property. Fixes cursor positioning when there are newlines in
11175 overlay strings, e.g. in icomplete.el. (Bug#11035)
11176
11177 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11180
11181 2012-03-12 Chong Yidong <cyd@gnu.org>
11182
11183 * eval.c (inhibit_lisp_code): Rename from
11184 inhibit_window_configuration_change_hook; move from window.c.
11185
11186 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11187 * window.c (run_window_configuration_change_hook)
11188 (syms_of_window): Callers changed.
11189
11190 2012-03-11 Chong Yidong <cyd@gnu.org>
11191
11192 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11193
11194 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11195
11196 2012-03-10 Chong Yidong <cyd@gnu.org>
11197
11198 * frame.c (other_visible_frames): Don't assume the selected frame
11199 is visible (Bug#10955).
11200
11201 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11202
11203 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11204
11205 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11206
11207 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11208 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11209 zero (Bug#10954).
11210
11211 2012-03-03 Glenn Morris <rgm@gnu.org>
11212
11213 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11214
11215 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11216
11217 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11218 position past the first glyph_row that ends at ZV. (Bug#10902)
11219 (redisplay_window, next_element_from_string): Fix typos in
11220 comments.
11221 (redisplay_window): Pass to move_it_vertically the margin in
11222 pixels, not in screen lines.
11223
11224 2012-03-02 Glenn Morris <rgm@gnu.org>
11225
11226 * buffer.c (buffer-list-update-hook): Doc fix.
11227
11228 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11229
11230 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11231 push_it before setting up the iterator for the first overlay
11232 string, even if we have an empty string loaded.
11233 (next_overlay_string): If there's an empty string on the iterator
11234 stack, pop the stack. (Bug#10903)
11235
11236 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11237
11238 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11239 Suggested by Stefan Monnier in
11240 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11241 * alloc.c (widen_to_Lisp_Object): New static function.
11242 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11243 and widening them to Lisp_Objects. This would work even if
11244 USE_LSB_TAG is defined and wide integers are used, which might
11245 happen in a future version of Emacs.
11246
11247 2012-02-25 Chong Yidong <cyd@gnu.org>
11248
11249 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11250 Doc fix.
11251
11252 * xselect.c (Fx_selection_exists_p): Doc fix.
11253 (x_clipboard_manager_save_all): Print an informative message
11254 before saving to clipboard manager.
11255
11256 2012-02-24 Chong Yidong <cyd@gnu.org>
11257
11258 * keyboard.c (process_special_events): Handle all X selection
11259 requests in kbd_buffer, not just the next one (Bug#8869).
11260
11261 2012-02-23 Chong Yidong <cyd@gnu.org>
11262
11263 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11264 call when setting menu-bar-lines and tool-bar-lines parameters.
11265 (unwind_create_frame_1): New helper function.
11266
11267 * window.c (inhibit_window_configuration_change_hook): New var.
11268 (run_window_configuration_change_hook): Obey it.
11269 (syms_of_window): Initialize it.
11270
11271 2012-02-22 Chong Yidong <cyd@gnu.org>
11272
11273 * xterm.c (x_draw_image_relief): Add missing type check for
11274 Vtool_bar_button_margin (Bug#10743).
11275
11276 2012-02-21 Chong Yidong <cyd@gnu.org>
11277
11278 * fileio.c (Vfile_name_handler_alist): Doc fix.
11279
11280 * buffer.c (Fget_file_buffer): Protect against invalid file
11281 handler return value.
11282
11283 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11284
11285 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11286 when computing $valmask.
11287
11288 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11289 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11290 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11291 It's useless in that case, and it can cause problems on hosts
11292 that allocate halves of EMACS_INT values separately.
11293 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11294 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11295 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11296 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11297 it avoids undefined behavior on hosts where shifting right by more
11298 than the word width has undefined behavior.
11299
11300 2012-02-19 Chong Yidong <cyd@gnu.org>
11301
11302 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11303 (Funhandled_file_name_directory, Ffile_name_as_directory)
11304 (Fdirectory_file_name, Fexpand_file_name)
11305 (Fsubstitute_in_file_name): Protect against invalid file handler
11306 return values (Bug#10845).
11307
11308 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11309
11310 * .gdbinit (pitx): Fix incorrect references to fields of the
11311 iterator stack.
11312
11313 2012-02-17 Chong Yidong <cyd@gnu.org>
11314
11315 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11316
11317 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11318
11319 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11320 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11321
11322 2012-02-15 Chong Yidong <cyd@gnu.org>
11323
11324 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11325 marked as special. Also, starting docstrings with * is obsolete.
11326
11327 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11328
11329 * gnutls.c (emacs_gnutls_write): Fix last change.
11330
11331 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11332
11333 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11334 send_process.
11335
11336 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11337
11338 * keymap.c (Fsingle_key_description): Handle char ranges.
11339
11340 2012-02-12 Chong Yidong <cyd@gnu.org>
11341
11342 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11343 as that creates a dangerous corner case.
11344
11345 * window.c (Fdelete_window_internal): Invalidate the mouse
11346 highlight (Bug#9904).
11347
11348 2012-02-12 Glenn Morris <rgm@gnu.org>
11349
11350 * xselect.c (Fx_own_selection_internal)
11351 (Fx_get_selection_internal, Fx_disown_selection_internal)
11352 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11353 * nsselect.m (Fx_own_selection_internal)
11354 (Fx_disown_selection_internal, Fx_selection_exists_p)
11355 (Fx_selection_owner_p, Fx_get_selection_internal):
11356 Sync docs and argument specs with the xselect.c versions.
11357
11358 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11359
11360 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11361
11362 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11363
11364 * w32select.c (Fx_selection_exists_p): Sync doc string and
11365 argument list with xselect.c. (Bug#10783)
11366
11367 * w16select.c (Fx_selection_exists_p): Sync doc string and
11368 argument list with xselect.c. (Bug#10783)
11369
11370 2012-02-10 Glenn Morris <rgm@gnu.org>
11371
11372 * fns.c (Fsecure_hash): Doc fix.
11373
11374 2012-02-09 Kenichi Handa <handa@m17n.org>
11375
11376 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11377
11378 2012-02-07 Chong Yidong <cyd@gnu.org>
11379
11380 * buffer.c (Fbuffer_local_variables)
11381 (buffer_lisp_local_variables): Handle unbound vars correctly;
11382 don't let Qunbound leak into Lisp.
11383
11384 2012-02-07 Glenn Morris <rgm@gnu.org>
11385
11386 * image.c (Fimagemagick_types): Doc fix.
11387
11388 * image.c (imagemagick-render-type): Change it from a lisp object
11389 to an integer. Move the doc here from the lisp manual.
11390 Treat all values not equal to 0 the same.
11391
11392 2012-02-06 Chong Yidong <cyd@gnu.org>
11393
11394 * doc.c (store_function_docstring): Avoid applying docstring of
11395 alias to base function (Bug#2603).
11396
11397 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11398
11399 * .gdbinit (pp1, pv1): Remove redundant defines.
11400 (pr): Use pp.
11401
11402 2012-02-04 Chong Yidong <cyd@gnu.org>
11403
11404 * nsterm.m: Declare a global (Bug#10694).
11405
11406 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11407
11408 * w32.c (get_emacs_configuration_options):
11409 Include --enable-checking, if specified, in the return value.
11410
11411 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11412
11413 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11414 after rounding frame sizes. (Bug#9723)
11415
11416 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11417
11418 * keyboard.c (adjust_point_for_property): Don't position point
11419 before BEGV. (Bug#10696)
11420
11421 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 Handle overflow when computing char display width (Bug#9496).
11424 * character.c (char_width): Return EMACS_INT, not int.
11425 (char_width, c_string_width): Check for overflow when
11426 computing the width; this is possible now that individual
11427 characters can have unbounded width. Problem introduced
11428 by merge from Emacs 23 on 2012-01-19.
11429
11430 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11431
11432 * dbusbind.c (Fdbus_register_method): Mention the return value
11433 :ignore in the docstring.
11434
11435 2012-02-02 Glenn Morris <rgm@gnu.org>
11436
11437 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11438
11439 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11440 Unconditionally set to t. (Bug#10673)
11441 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11442 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11443 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11444
11445 2012-02-02 Kenichi Handa <handa@m17n.org>
11446
11447 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11448 0, do not call append_composite_glyph.
11449
11450 2012-02-02 Kenichi Handa <handa@m17n.org>
11451
11452 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11453 NULL (Bug#6988).
11454 (x_produce_glyphs): If the component of a composition is a null
11455 string, set it->pixel_width to 1 to avoid zero-width glyph.
11456
11457 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11458
11459 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11460 first 2 arguments are identical. This makes inserting large
11461 output from a subprocess an order of magnitude faster on
11462 MS-Windows, where all sbrk'ed memory is always contiguous.
11463
11464 2012-01-31 Glenn Morris <rgm@gnu.org>
11465
11466 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11467 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11468 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11469
11470 2012-01-29 Glenn Morris <rgm@gnu.org>
11471
11472 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11473
11474 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11475
11476 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11477
11478 2012-01-28 Chong Yidong <cyd@gnu.org>
11479
11480 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11481
11482 2012-01-26 Chong Yidong <cyd@gnu.org>
11483
11484 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11485
11486 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11487 repeat counts (Bug#10507).
11488
11489 2012-01-26 Glenn Morris <rgm@gnu.org>
11490
11491 * lread.c (syms_of_lread): Doc fix.
11492
11493 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11494
11495 * coding.c (encode_designation_at_bol): Change return value to
11496 EMACS_INT.
11497
11498 2012-01-25 Chong Yidong <cyd@gnu.org>
11499
11500 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11501
11502 2012-01-21 Chong Yidong <cyd@gnu.org>
11503
11504 * floatfns.c (Fcopysign): Make the second argument non-optional,
11505 since nil is not allowed anyway.
11506
11507 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11508
11509 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11510 (send_process): Likewise.
11511
11512 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11513
11514 * window.c (save_window_save, Fcurrent_window_configuration)
11515 (Vwindow_persistent_parameters): Do not use Qstate.
11516 Rewrite doc-strings.
11517
11518 2012-01-19 Kenichi Handa <handa@m17n.org>
11519
11520 * character.c (char_width): New function.
11521 (Fchar_width, c_string_width, lisp_string_width):
11522 Use char_width (Bug#9496).
11523
11524 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11525
11526 * window.c (Vwindow_persistent_parameters): New variable.
11527 (Fset_window_configuration, save_window_save): Handle persistent
11528 window parameters.
11529
11530 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11531
11532 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11533 thrashing the stack of the thread. (Bug#9087)
11534
11535 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11536
11537 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11538
11539 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (rows_from_pos_range): Handle the case where the
11542 highlight ends on a newline. (Bug#10464)
11543 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11544 he end column for display of highlight that ends on a newline
11545 before a R2L line.
11546
11547 2012-01-11 Glenn Morris <rgm@gnu.org>
11548
11549 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11550 from load-path also when installation-directory is nil. (Bug#10208)
11551
11552 2012-01-10 Glenn Morris <rgm@gnu.org>
11553
11554 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11555
11556 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11557 Update template values to be closer to their typical values these days.
11558
11559 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11560
11561 * xdisp.c (rows_from_pos_range): Accept additional argument
11562 DISP_STRING, and accept any glyph in a row whose object is that
11563 string as eligible for mouse highlight. Fixes mouse highlight of
11564 display strings from overlays. (Bug#10464)
11565
11566 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 emacs: fix an auto-save permissions race condition (Bug#10400)
11569 * fileio.c (auto_saving_dir_umask): New static var.
11570 (Fmake_directory_internal): Use it.
11571 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11572 creating the directory. The old code temporarily assigns
11573 too-generous permissions to the directory.
11574 (do_auto_save_eh): Clear it.
11575 (Fdo_auto_save): Catch all errors, not just file errors, so
11576 that the var is always cleared.
11577
11578 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11579
11580 * search.c (scan_buffer): Pass character positions to
11581 know_region_cache, not byte positions. (Bug#6540)
11582
11583 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11584
11585 * w32.c (sys_rename): Report EXDEV when rename of a directory
11586 fails because the target is on another logical disk. (Bug#10284)
11587
11588 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11589
11590 * xterm.c (x_embed_request_focus): New function.
11591
11592 * xterm.h: Add prototype.
11593
11594 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11595
11596 2012-01-05 Glenn Morris <rgm@gnu.org>
11597
11598 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11599
11600 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11601
11602 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11603 Load gnutls_transport_set_lowat only if GnuTLS version is below
11604 2.11.1.
11605 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11606 GnuTLS versions below 2.11.1.
11607
11608 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11609
11610 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11611 to the doc string advising against its use for altering the way
11612 windows are scrolled.
11613
11614 2011-12-28 Kenichi Handa <handa@m17n.org>
11615
11616 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11617 coding-system ASCII compatible only when it does not produce BOM
11618 on encoding (Bug#10383).
11619
11620 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11621
11622 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11623 can scroll.
11624 (create_and_show_popup_menu): Always use menu_position_func for
11625 Gtk3 (Bug#10361).
11626
11627 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11628
11629 * callint.c (Fcall_interactively): Don't truncate prompt string.
11630
11631 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11632
11633 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11634 property that ends at ZV, so that the bidi iteration could be
11635 resumed from there (after widening). (Bug#10360)
11636
11637 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11638
11639 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11640
11641 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11642
11643 * nsterm.m (x_free_frame_resources):
11644 Release f->output_data.ns->miniimage.
11645 (ns_index_color): Fix indentation. Do not retain
11646 color_table->colors[i].
11647
11648 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11649 before returning.
11650
11651 * nsfns.m (x_set_background_color): Assign return value from
11652 ns_index_color to face-background instead of NSColor*.
11653 (ns_implicitly_set_icon_type): Fix indentation.
11654 Change assignment in for loop to comparison.
11655
11656 * emacs.c (ns_pool): New variable.
11657 (main): Assign ns_pool.
11658 (Fkill_emacs): Call ns_release_autorelease_pool.
11659
11660 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11661 autorelease fdesc, release fdAttrs and tdict.
11662 (ns_get_covering_families): Release charset.
11663 (ns_findfonts): Release NSFontDescriptor created with new.
11664 (ns_uni_to_glyphs): Fix indentation.
11665 (setString): Release attrStr before assigning new value.
11666
11667 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11668
11669 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11670 and NS_IMPL_COCOA.
11671 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11672 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11673
11674 2011-12-18 David Reitter <reitter@cmu.edu>
11675
11676 * nsterm.m (ns_term_init): Subscribe for notifications
11677 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11678 to method trackingNotification in EmacsMenu.
11679
11680 * nsmenu.m (trackingMenu): New variable.
11681 (trackingNotification): New method (from Aquamacs).
11682 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11683 from Aquamacs (Bug#7030).
11684
11685 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11686
11687 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11688 (symbol_to_nsstring): Fix indentation.
11689 (ns_symbol_to_pb): New function.
11690 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11691 (Fns_rotate_cut_buffers_internal): Remove.
11692 (Fns_store_selection_internal): Rename from
11693 Fns_store_cut_buffer_internal.
11694 (ns_get_foreign_selection, Fx_own_selection_internal)
11695 (Fx_disown_selection_internal, Fx_selection_exists_p)
11696 (Fns_get_selection_internal, Fns_store_selection_internal):
11697 Use ns_symbol_to_pb and check if return value is nil.
11698 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11699 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11700 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11701 renamed to Sns_store_selection_internal.
11702 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11703 and remove this function.
11704 (ns_handle_selection_clear): Remove, never used.
11705 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11706 here.
11707
11708 2011-12-17 Ken Brown <kbrown@cornell.edu>
11709
11710 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11711 GID is unknown (Bug#10257).
11712
11713 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11716 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11717 which caused a build failure on GNU/Linux IA-64. This problem was
11718 introduced by my 2011-10-07 patch.
11719
11720 2011-12-15 Juri Linkov <juri@jurta.org>
11721
11722 * image.c (imagemagick_error): New function. (Bug#10112)
11723 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11724 Use `imagemagick_error' where ImageMagick functions return
11725 `MagickFalse'.
11726 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11727 proper order.
11728
11729 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11730
11731 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11732 fill background (Bug#8992).
11733
11734 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11735
11736 * window.c (Vwindow_combination_resize)
11737 (Vwindow_combination_limit): Use t instead of non-nil in
11738 doc-strings.
11739 (Vrecenter_redisplay): Add first sentence of doc-string on
11740 separate line.
11741 (Frecenter): Fix doc-string typo.
11742
11743 2011-12-11 Kenichi Handa <handa@m17n.org>
11744
11745 * coding.c (Funencodable_char_position): Pay attention to the
11746 buffer text relocation (Bug#9389).
11747
11748 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11749
11750 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11751 gtk_init (Bug#10100).
11752
11753 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11754
11755 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11756 IT->string is nil. (Bug#10263)
11757
11758 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11759
11760 * nsterm.h (x_free_frame_resources): Declare.
11761
11762 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11763 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11764
11765 * nsterm.h (ns_get_defaults_value): Declare.
11766
11767 * nsterm.m (ns_default): Call ns_get_defaults_value.
11768
11769 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11770
11771 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11772 (Bug#10170)
11773
11774 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11775
11776 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11777 that where the value of an _OBJC_* symbol points to is in the .bss
11778 section (Bug#10240).
11779
11780 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11781
11782 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11783 after the loop to call ccl_driver at least once (Bug#8619).
11784
11785 2011-12-08 Kenichi Handa <handa@m17n.org>
11786
11787 * ftfont.c (get_adstyle_property): Fix previous change
11788 (Bug#10233).
11789
11790 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11791
11792 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11793 dirs from the default value of EMACSLOADPATH (bug#10208).
11794
11795 2011-12-07 Glenn Morris <rgm@gnu.org>
11796
11797 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11798 installation and source directories as well. (Bug#10208)
11799
11800 2011-12-06 Chong Yidong <cyd@gnu.org>
11801
11802 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11803
11804 2011-12-06 Glenn Morris <rgm@gnu.org>
11805
11806 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11807 as an error, not just -1. (Bug#10217)
11808
11809 2011-12-05 Chong Yidong <cyd@gnu.org>
11810
11811 * keyboard.c (process_special_events): New function.
11812 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11813
11814 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 * coding.c (encode_designation_at_bol): Don't use uninitialized
11817 local variable (Bug#9318).
11818
11819 2011-12-05 Kenichi Handa <handa@m17n.org>
11820
11821 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11822 return Qnil (Bug#8046, Bug#10193).
11823
11824 2011-12-05 Kenichi Handa <handa@m17n.org>
11825
11826 * coding.c (encode_designation_at_bol): New args charbuf_end and
11827 dst. Return the number of produced bytes. Callers changed.
11828 (coding_set_source): Return how many bytes coding->source was
11829 relocated.
11830 (coding_set_destination): Return how many bytes
11831 coding->destination was relocated.
11832 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11833 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11834
11835 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11836
11837 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11838 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11839 macro (Bug#9318).
11840
11841 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11842
11843 The following changes are to fix Bug#9318.
11844
11845 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11846 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11847 (encode_coding_iso_2022, encode_coding_sjis)
11848 (encode_coding_big5, encode_coding_charset): Use the above macros.
11849
11850 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11851
11852 * lisp.h (process_quit_flag): Fix external declaration.
11853
11854 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11855
11856 Don't macro-inline non-performance-critical code.
11857 * eval.c (process_quit_flag): New function.
11858 * lisp.h (QUIT): Use it.
11859
11860 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11861
11862 * nsfns.m (get_geometry_from_preferences): New function.
11863 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11864
11865 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11866
11867 * emacs.c (Qkill_emacs): Define.
11868 (syms_of_emacs): Initialize it.
11869 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11870 Qquit_flag to `kill-emacs' instead.
11871 (quit_throw_to_read_char): Add parameter `from_signal'.
11872 All callers changed. Call Fkill_emacs if requested and safe.
11873 * lisp.h (QUIT): Call Fkill_emacs if requested.
11874
11875 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11876
11877 * widget.c (update_wm_hints): Return if wmshell is null.
11878 (widget_update_wm_size_hints): New function.
11879
11880 * widget.h (widget_update_wm_size_hints): Declare.
11881
11882 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11883 widget_update_wm_size_hints (Bug#10104).
11884
11885 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11886
11887 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11888 before a newline, prepare the bidi iterator for consuming the
11889 newline, and keep the current paragraph direction. (Bug#10183)
11890 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11891
11892 2011-12-02 Juri Linkov <juri@jurta.org>
11893
11894 * search.c (Fword_search_regexp): New Lisp function created from
11895 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11896 (Fword_search_backward, Fword_search_forward)
11897 (Fword_search_backward_lax, Fword_search_forward_lax):
11898 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11899 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11900
11901 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11902
11903 * fileio.c (Finsert_file_contents): Move after-change-function call
11904 to before the "handled:" label, since all "goto handled" appear in
11905 cases where the *-change-functions have already been properly called
11906 (bug#10117).
11907
11908 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11909
11910 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11911 waiting for input. (Bug#10169)
11912
11913 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11914
11915 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11916 verifies glyph row's hash code--we have just reallocated the
11917 glyphs, so their contents can be complete garbage. (Bug#10164)
11918
11919 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11920
11921 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11922
11923 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11924
11925 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11926 attributes are tested _before_ calling verify_row_hash, to protect
11927 against GCC re-ordering of the tests. (Bug#10164)
11928
11929 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11930
11931 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11932
11933 * xterm.c (handle_one_xevent): Only set async_visible and friends
11934 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11935 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11936 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11937
11938 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11941 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11942 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11943 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11944 All uses changed to use GCPRO1 etc.
11945 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11946 Revert to old implementation (i.e., before 2011-03-11).
11947
11948 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11949
11950 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11951 of scroll runs so as to avoid assigning disabled bogus rows and
11952 unnecessary graphics copy operations.
11953
11954 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11955
11956 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11957 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11958 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11959 (malloc, free, realloc, calloc): Redirect to e_* only when
11960 compiling Emacs.
11961
11962 * lisp.h (GCTYPEBITS): Move before first use.
11963 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11964 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11965 this macro definition.
11966
11967 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11968 _MSC_VER.
11969
11970 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11971
11972 * gtkutil.c (xg_create_frame_widgets):
11973 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11974 present with Gtk+ 2.0.
11975
11976 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 * fileio.c (Finsert_file_contents): Undo previous change; see
11979 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11980
11981 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11982
11983 Rename locals to avoid shadowing.
11984 * fileio.c (Finsert_file_contents):
11985 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11986 * process.c (wait_reading_process_output):
11987 Rename inner 'proc' to 'p' to avoid shadowing.
11988 Indent for consistency with usual Emacs style.
11989
11990 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11991
11992 * xdisp.c (redisplay_window): If cursor row is not fully visible
11993 after recentering, and scroll-conservatively is set to a large
11994 number, scroll window by a few more lines to make the cursor fully
11995 visible and out of scroll-margin. (Bug#10105)
11996 (start_display): Don't move to the next line if the display should
11997 start at a newline that is part of a display vector or an overlay
11998 string. (Bug#10119)
11999
12000 2011-11-24 Juri Linkov <juri@jurta.org>
12001
12002 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12003 after the `MagickPingImage' call. (Bug#10112)
12004
12005 2011-11-23 Chong Yidong <cyd@gnu.org>
12006
12007 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12008
12009 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12010
12011 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12012 making another buffer current. (Bug#10114)
12013
12014 2011-11-23 Glenn Morris <rgm@gnu.org>
12015
12016 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12017
12018 2011-11-23 Chong Yidong <cyd@gnu.org>
12019
12020 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12021 using it (Bug#5984).
12022
12023 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12024
12025 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12026 and header-lines, as they don't have one computed for them.
12027 (Bug#10098)
12028
12029 * .gdbinit (prow): Make displayed values more self-explaining.
12030 Add row's hash code.
12031
12032 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12033
12034 * process.c (wait_reading_process_output): Fix asynchrounous
12035 GnuTLS socket handling on some versions of the GnuTLS library.
12036 (wait_reading_process_output): Add comment and URL.
12037
12038 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12039
12040 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12041
12042 2011-11-21 Chong Yidong <cyd@gnu.org>
12043
12044 * window.c (Fnext_window, Fprevious_window): Doc fix.
12045
12046 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12047
12048 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12049
12050 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12051
12052 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12053
12054 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12055
12056 * window.c (Fset_window_combination_limit): Rename argument
12057 STATUS to LIMIT.
12058 (Vwindow_combination_limit): Remove "status" from doc-string.
12059
12060 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12061
12062 * m/ibms390.h: Remove.
12063 * m/ibms390x.h: Don't include "ibms390.h".
12064
12065 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12066
12067 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12068 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12069
12070 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12071
12072 * casetab.c (Fset_case_table):
12073 * charset.c (Fcharset_after): Fix typos.
12074
12075 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12076
12077 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12078 Otherwise, valgrind does not work on some platforms.
12079 Problem reported by Andreas Schwab in
12080 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12081 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12082 is set, removing the need for VIRT_ADDRESS_VARIES.
12083 (PURE_P): Use a more-efficient implementation that needs just one
12084 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12085 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12086 to 4 (xorl, subq, cmpq, setbe).
12087 * alloc.c (pure): Always extern now, since that's the
12088 VIRT_ADDR_VARIES behavior.
12089 (PURE_POINTER_P): Use a single comparison, not two, for
12090 consistency with the new puresize.h.
12091 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12092 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12093 Remove VIRT_ADDR_VARIES no longer needed.
12094
12095 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12096
12097 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12098 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12099 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12100 behave as if the cursor position were at the window margin.
12101
12102 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12103 and the cursor position is out of bounds, behave as if the cursor
12104 position were at the window margin. (Bug#10075)
12105
12106 2011-11-18 Chong Yidong <cyd@gnu.org>
12107
12108 * window.c (Fwindow_combination_limit): Make first argument
12109 non-optional, since it is meaningless for live windows like the
12110 selected window.
12111
12112 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12113
12114 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12115
12116 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12117
12118 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12119 (graft_intervals_into_buffer): Simplify.
12120
12121 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12122
12123 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12124 hash values of the two rows.
12125 (copy_row_except_pointers): Preserve the used[] arrays and the
12126 hash values of the two rows. (Bug#10035)
12127 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12128
12129 * xdisp.c (row_hash): New function, body extracted from
12130 compute_line_metrics.
12131 (compute_line_metrics): Call row_hash, instead of computing the
12132 hash code inline.
12133
12134 * dispnew.c (verify_row_hash): Call row_hash for computing the
12135 hash code of a row, instead of duplicating code from xdisp.c.
12136
12137 * dispextern.h (row_hash): Add prototype.
12138
12139 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12140
12141 * frame.c (delete_frame): Don't delete the terminal when the last
12142 X frame is closed if emacs is built with GTK toolkit.
12143
12144 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12145
12146 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12147
12148 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12149
12150 * window.c (Vwindow_splits): Rename to
12151 Vwindow_combination_resize. Suggested by Juri Linkov.
12152 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12153 of Vwindow_splits.
12154
12155 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12156
12157 * nsfns.m (Fns_font_name):
12158 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12159
12160 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12161
12162 * window.h (window): Rename slot "nest" to "combination_limit".
12163 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12164 (Fset_window_nest): Rename to Fset_window_combination_limit.
12165 (Vwindow_nest): Rename to Vwindow_combination_limit.
12166 (recombine_windows, make_parent_window, make_window)
12167 (Fsplit_window_internal, saved_window)
12168 (Fset_window_configuration, save_window_save): Rename all
12169 occurrences of window_nest to window_combination_limit.
12170
12171 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12172
12173 * image.c (imagemagick_load_image): Fix typo.
12174
12175 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12176
12177 * xdisp.c (display_line): Move the call to
12178 highlight_trailing_whitespace before the call to
12179 compute_line_metrics, since the latter needs to see the final
12180 faces of all the glyphs to compute ROW's hash value.
12181 Fixes assertion violations in row_equal_p. (Bug#10035)
12182
12183 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12184
12185 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12186 just return (bug#10044).
12187
12188 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12189
12190 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12191 with user-defined heap size. Bump the default size of the temacs
12192 heap to 27MB, to avoid memory warning when running temacs.
12193 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12194
12195 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12196 current_matrix and desired_matrix. (Bug#9990)
12197 (verify_row_hash) [XASSERTS]: New function.
12198 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12199 that the hash value of glyph rows is correct.
12200
12201 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12202
12203 * window.h (window): Remove splits slot.
12204 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12205 (Fdelete_other_windows_internal, make_parent_window)
12206 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12207 (Fset_window_configuration, save_window_save): Don't deal with
12208 split status of windows.
12209 (saved_window): Remove splits slot.
12210 (Vwindow_splits): Rewrite doc-string.
12211
12212 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12213
12214 * xfns.c (unwind_create_frame):
12215 * nsfns.m (unwind_create_frame):
12216 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12217 Vframe_list (Bug#9999).
12218
12219 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12220
12221 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12222
12223 2011-11-11 Kenichi Handa <handa@m17n.org>
12224
12225 * callproc.c (Fcall_process): Set the member dst_multibyte of
12226 process_coding.
12227
12228 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12229
12230 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12231 avoid a crash (bug#9496).
12232
12233 2011-11-09 Chong Yidong <cyd@gnu.org>
12234
12235 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12236 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12237
12238 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12239
12240 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12241
12242 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12243
12244 Avoid some portability problems by eschewing 'extern inline' functions.
12245 The trivial performance wins aren't worth the portability hassles; see
12246 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12247 et seq.
12248 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12249 (window_box_width, window_box_left, window_box_left_offset)
12250 (window_box_right, window_box_right_offset): Undo previous change,
12251 by removing the "extern"s.
12252 * intervals.c (adjust_intervals_for_insertion)
12253 (adjust_intervals_for_deletion): Undo previous change,
12254 making these static again.
12255 (offset_intervals, temp_set_point_both, temp_set_point)
12256 (copy_intervals_to_string): No longer inline.
12257 * xdisp.c (window_text_bottom_y, window_box_width)
12258 (window_box_height, window_box_left_offset)
12259 (window_box_right_offset, window_box_left, window_box_right)
12260 (window_box): No longer inline.
12261
12262 2011-11-08 Chong Yidong <cyd@gnu.org>
12263
12264 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12265 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12266 Signal an error if not a live window.
12267 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12268 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12269
12270 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12271
12272 * lisp.h (syms_of_abbrev): Remove declaration.
12273 Reported by CHENG Gao <chenggao@royau.me>.
12274
12275 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12276
12277 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12278 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12279 of temacs in GUI mode.
12280
12281 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12282
12283 * window.h: Declare delete_all_child_windows instead of
12284 delete_all_subwindows.
12285 * window.c (Fwindow_nest, Fset_window_nest)
12286 (Fset_window_new_total, Fset_window_new_normal)
12287 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12288 (delete_all_subwindows): Rename to delete_all_child_windows.
12289 (Fdelete_other_windows_internal, Fset_window_configuration):
12290 Call delete_all_child_windows instead of delete_all_subwindows.
12291 * frame.c (delete_frame): Call delete_all_child_windows instead
12292 of delete_all_subwindows.
12293
12294 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12295
12296 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12297 This is also needed for porting to any host where GC_MARK_STACK is
12298 not GC_MAKE_GCPROS_NOOPS.
12299 (which_symbols): Use it.
12300
12301 2011-11-07 Kenichi Handa <handa@m17n.org>
12302
12303 * coding.c (coding_set_destination): Check coding->src_pos only
12304 when coding->src_object is a buffer (bug#9910).
12305
12306 * process.c (send_process): Set the member src_multibyte of coding
12307 to 0 (bug#9911) when sending a unibyte text.
12308
12309 * callproc.c (Fcall_process): Set the member src_multibyte of
12310 process_coding to 0 (bug#9912).
12311
12312 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12313
12314 * xmenu.c (cleanup_widget_value_tree): New function.
12315 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12316 calling free_menubar_widget_value_tree directly (Bug#9830).
12317
12318 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12319
12320 Fix some portability problems with 'inline'.
12321 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12322 (window_box_width, window_box_left, window_box_left_offset)
12323 (window_box_right, window_box_right_offset): Declare extern.
12324 Otherwise, these inline functions do not conform to C99 and
12325 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12326 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12327 * intervals.c (adjust_intervals_for_insertion)
12328 (adjust_intervals_for_deletion): Now extern, because otherwise the
12329 extern inline functions 'offset_intervals' couldn't refer to it.
12330 (static_offset_intervals): Remove.
12331 (offset_intervals): Rewrite using the old contents of
12332 static_offset_intervals. The old version didn't conform to C99
12333 because an extern inline function contained a reference to an
12334 identifier with static linkage.
12335
12336 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12337
12338 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12339 GC.
12340
12341 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12342
12343 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12344 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12345 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12346 return Qleft_to_right.
12347
12348 2011-11-06 Chong Yidong <cyd@gnu.org>
12349
12350 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12351 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12352 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12353 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12354 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12355 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12356 (Fwindow_vscroll): Doc fix.
12357 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12358 argument, since it makes no sense to pass a live window and for
12359 consistency with window-child.
12360
12361 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12362
12363 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12364 support MSVC.
12365
12366 2011-11-05 Jason Rumney <jasonr@gnu.org>
12367
12368 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12369 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12370 fonts (Bug#6029).
12371 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12372 bitwise arithmetic preventing use of unicode-sip and non-truetype
12373 opentype fonts.
12374
12375 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12376
12377 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12378 "emacs"-only part.
12379
12380 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12381 initialization code to keep similarity to xfns.c after changes
12382 from 2011-11-05.
12383
12384 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12385
12386 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12387 (unwind_create_frame): New function (Bug#9943).
12388 (Fx_create_frame): Restructure code to be more similar to the one in
12389 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12390 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12391 Move terminal->reference_count++ just before making the frame official
12392 (Bug#9943).
12393
12394 * nsterm.m (x_free_frame_resources): New function.
12395 (x_destroy_window): Move code to x_free_frame_resources.
12396
12397 * xfns.c (unwind_create_frame): Fix comment.
12398 (Fx_create_frame, x_create_tip_frame):
12399 Move terminal->reference_count++ just before making the frame
12400 official. Move initialization of image_cache_refcount and
12401 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12402
12403 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12404
12405 Support MSVC build with newer versions of Visual Studio.
12406 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12407 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12408 nt/gmake.defs.
12409
12410 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12411 which are not supported by MSVC.
12412 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12413 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12414 bitfields.
12415 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12416 types in bitfields.
12417 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12418
12419 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12420
12421 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12422
12423 Support MSVC build with newer versions of Visual Studio.
12424 * w32.c: Don't include w32api.h for MSVC.
12425 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12426
12427 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12428 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12429 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12430 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12431 e_* cousins.
12432 (alloca) [_MSC_VER]: Define to _alloca.
12433
12434 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12435
12436 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12437
12438 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12439
12440 * xdisp.c (note_mouse_highlight): If either of
12441 previous/next-single-property-change returns nil, treat that as
12442 the beginning or the end of the buffer. (Bug#9955)
12443
12444 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12445
12446 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12447 label is not null (Bug#9951).
12448 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12449 may be NULL.
12450
12451 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12452
12453 * window.c (Fwindow_body_size): Mention in the doc string that the
12454 return value is in frame's canonical units. (Bug#9949)
12455
12456 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12457
12458 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12459
12460 * w32fns.c (unwind_create_frame): If needed, free the glyph
12461 matrices of the partially constructed frame. (Bug#9943)
12462 * xfns.c (unwind_create_frame): Likewise.
12463
12464 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12465
12466 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12467 Don't stop backward scan on the continuation glyph, even though
12468 its CHARPOS is positive.
12469 (mouse_face_from_buffer_pos, note_mouse_highlight):
12470 Rename cover_string to disp_string.
12471
12472 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12473
12474 * window.c (temp_output_buffer_show): Don't use
12475 Vtemp_buffer_show_specifiers.
12476 (Vtemp_buffer_show_specifiers): Remove unused variable.
12477
12478 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12479
12480 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12481 past the beginning of the current glyph matrix.
12482
12483 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12484
12485 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12486 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12487 HAVE_GTK3 (Bug#9869).
12488
12489 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12490 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12491
12492 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12493
12494 * xterm.c: Declare x_handle_net_wm_state to return int.
12495 (handle_one_xevent): Check if we are iconified but don't have
12496 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12497 (get_current_wm_state): Return non-zero if not hidden,
12498 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12499 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12500 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12501 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12502
12503 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12504
12505 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12506 so that this new function doesn't get optimized away by a
12507 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12508
12509 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12510
12511 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12512
12513 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12514
12515 Fix the `xbytecode' command.
12516 * .gdbinit (xprintbytestr): New command.
12517 (xwhichsymbols): Rename from `which'; all callers changed.
12518 (xbytecode): Print the byte-code string as well.
12519
12520 2011-10-29 Kim Storm <storm@cua.dk>
12521
12522 * alloc.c (which_symbols): New function.
12523
12524 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12525
12526 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12527 line. (Bug#9903)
12528
12529 2011-10-29 Glenn Morris <rgm@gnu.org>
12530
12531 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12532 Not clear what it was for, and it causes various bugs. (Bug#9839)
12533
12534 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12535
12536 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12537 possible random value that matches one of those tested as
12538 condition to clear the mouse face.
12539
12540 2011-10-28 Chong Yidong <cyd@gnu.org>
12541
12542 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12543
12544 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12545
12546 * window.c (make_window): Initialize phys_cursor_on_p.
12547
12548 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12549
12550 * lisp.h (struct Lisp_Symbol): Update comments.
12551
12552 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12553
12554 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12555
12556 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12557
12558 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12559 <oslsachem@gmail.com> for helping to debug this.
12560
12561 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12562 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12563 (g_b_init_get_glyph_outline_w): New static variables.
12564 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12565 (GetGlyphOutlineW_Proc): New typedefs.
12566 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12567 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12568 New functions.
12569 (w32font_open_internal, compute_metrics):
12570 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12571 instead of calling the "wide" APIs directly.
12572
12573 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12574
12575 * w32.h (syms_of_w32font): Add prototype.
12576
12577 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12578
12579 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12580 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12581 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12582 (Fmove_to_window_line): Doc fix.
12583
12584 2011-10-27 Chong Yidong <cyd@gnu.org>
12585
12586 * process.c (make_process): Set gnutls_state to NULL.
12587
12588 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12589 non-NULL, regardless of GNUTLS_INITSTAGE.
12590 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12591 an error. Set process slots as soon as we allocate them.
12592
12593 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12594
12595 2011-10-27 Chong Yidong <cyd@gnu.org>
12596
12597 * gnutls.c (emacs_gnutls_deinit): New function.
12598 Deallocate credentials structures as well as calling gnutls_deinit.
12599 (Fgnutls_deinit, Fgnutls_boot): Use it.
12600
12601 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12602 (deactivate_process): Call emacs_gnutls_deinit.
12603
12604 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12605
12606 * image.c (x_create_x_image_and_pixmap):
12607 * w32.c (sys_rename, w32_delayed_load):
12608 * w32font.c (fill_in_logfont):
12609 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12610
12611 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12612
12613 * w32fns.c (w32_default_color_map): New function,
12614 extracted from Fw32_default_color_map.
12615 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12616
12617 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12618
12619 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12620
12621 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12622
12623 * keyboard.c (test_undefined): New function (bug#9751).
12624 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12625
12626 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12627
12628 * sysdep.c (init_sys_modes): Fix the check for the controlling
12629 terminal (Bug#6649).
12630
12631 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12632
12633 * dispextern.h (struct bidi_it): New member next_en_type.
12634
12635 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12636 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12637 current character, check also for next_en_type being WEAK_EN.
12638 (bidi_resolve_weak): Don't enter the expensive loop if the current
12639 position is before next_en_pos. Record the bidi type of the first
12640 non-ET, non-BN character we find, in addition to its position.
12641 (bidi_level_of_next_char): Invalidate next_en_type when
12642 next_en_pos is over-stepped.
12643
12644 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12645
12646 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12647 * editfns.c: Rewrite current-time-zone so that it invokes
12648 the equivalent of (format-time-string "%Z") to get the time zone name.
12649 This fixes a bug when the time zone name contains characters that
12650 need converting from the system time locale to Emacs internal format.
12651 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12652 that patch fixed format-time-string to do the conversion, but
12653 I forgot to fix current-time-zone.
12654 (format_time_string): New function, containing most of
12655 what Fformat_time_string used to contain.
12656 (Fformat_time_string): Rewrite in terms of format_time_string.
12657 This doesn't change this function's behavior.
12658 (current-time-zone): Rewrite to use format_time_string.
12659 This fixes the bug reported by Michael Schierl in
12660 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12661 Jason Rumney's 2007-06-07 change worked around this bug, but
12662 didn't fix it.
12663 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12664
12665 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12666
12667 * xdisp.c (start_display): If the character at POS is displayed
12668 via a display vector, reset IT->current.dpvec_index to zero.
12669 (try_window_reusing_current_matrix): If a line ends in a display
12670 vector or the next line starts in a display vector, continue
12671 redrawing the window even though the character position of
12672 start_row was reached.
12673 (Bug#9771, part 2)
12674
12675 2011-10-18 Chong Yidong <cyd@gnu.org>
12676
12677 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12678 with nobreak-char-display too.
12679
12680 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12681
12682 Fix part 3 of bug#9771.
12683 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12684 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12685 non-neutral characters if the current character is a paragraph
12686 separator (a.k.a. Newline). This avoids running the same
12687 expensive loop twice, once when we consume the preceding newline
12688 and the other time when the line actually needs to be displayed.
12689 Avoid the loop when we see neutrals on the base embedding level
12690 following a character whose directionality is the same as the
12691 paragraph's. This avoids running the expensive loop when a line
12692 ends in a long sequence of neutrals, like control characters.
12693 Add assertion against STRONG_AL type. Slightly rearrange code
12694 that determines the type of a neutral given the first non-neutral
12695 that follows it.
12696 (bidi_level_of_next_char): Set next_en_pos to zero when
12697 invalidating its info.
12698
12699 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12700
12701 * xdisp.c (push_display_prop): Determine whether to record string
12702 or buffer position by IT->string, not by IT->method. Allow
12703 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12704 (move_it_vertically_backward): Don't look for character position
12705 immediately after the newline when in a continuation line.
12706 (Bug#9771, part 1)
12707
12708 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12709
12710 * window.c (coordinates_in_window): Rewrite and delabelize
12711 vertical border check. (Bug#5357) (Bug#9618)
12712
12713 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12714
12715 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12716 errors in XSetWindowBorder (bug#9310).
12717
12718 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12719
12720 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12721 avoid crash when xmalloc overrun checking is enabled.
12722
12723 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12724
12725 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12726 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12727 cursor motion with <left> and <right> arrow keys.
12728
12729 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12730 some callers set that themselves.
12731
12732 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12733
12734 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12735 display string and the previous row comes from the same string and
12736 is empty. (Bug#9739) (Bug#9738)
12737
12738 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12739
12740 * doc.c (get_doc_string): Encode file name (bug#9735).
12741
12742 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12743
12744 * bidi.c (bidi_level_of_next_char):
12745 * xdisp.c (get_visually_first_element): Remove old incorrect
12746 comments regarding the Unicode Line Separator character.
12747
12748 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12749
12750 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12751
12752 * alloc.c (Fgc_status): Do not access beyond zombies array
12753 boundary if nzombies > MAX_ZOMBIES.
12754 * alloc.c (dump_zombies): Add missing format specifier.
12755
12756 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12757
12758 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12759 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12760
12761 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12762 Some packages use them to denote characters with modifiers.
12763
12764 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12765
12766 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12767 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12768 matching a pp-number. Rename parameter var to var1.
12769
12770 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12771
12772 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12773
12774 2011-10-08 Glenn Morris <rgm@gnu.org>
12775
12776 * callint.c (Fcall_interactively): Give a more explicit error for the
12777 'c' case with a non-character input. (Bug#8479)
12778
12779 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12780
12781 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12782 lines.
12783 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12784 lines that are hscrolled on the left.
12785
12786 * dispnew.c (buffer_posn_from_coords): Account for a possible
12787 presence of header-line. (Bug#4426)
12788
12789 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12790
12791 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12792 Don't advertise functionality which we discourage or doesn't work.
12793
12794 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12795
12796 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12797 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12798 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12799 this makes Emacs dump core during garbage collection on rare
12800 occasions. sizeof is obviously inferior to offsetof here, so
12801 stick with offsetof.
12802 (GC_POINTER_ALIGNMENT): New macro.
12803 (mark_memory): Omit 3rd (offset) arg; caller changed.
12804 Don't assume EMACS_INT alignment is the same as pointer alignment.
12805
12806 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12807
12808 * keyboard.c (read_key_sequence_remapped): New var.
12809 (read_key_sequence): Compute remapping in the right buffer.
12810 (command_loop_1): Use read_key_sequence's remapping directly.
12811
12812 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12813
12814 * dired.c (file_name_completion): Don't expand file name.
12815 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12816 before checking file name handler.
12817
12818 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12819 they've been requested explicitly (bug#9591).
12820
12821 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12822
12823 * keymap.c (Fsingle_key_description): Use make_specified_string
12824 instead of build_string to build string from push_key_description.
12825 (Bug#5193)
12826
12827 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12830 This fixes a Y2038 bug on 64-bit hosts.
12831 * buffer.c (reset_buffer):
12832 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12833 (Fclear_buffer_auto_save_failure):
12834 Use 0, not -1, to represent an unset failure time, since time_t
12835 might not be signed.
12836
12837 Remove dependency on glibc malloc internals.
12838 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12839 Move back here from lisp.h, but with their new implementations.
12840 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12841 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12842 * charset.c (charset_table_init): New static var.
12843 (syms_of_charset): Use it instead of xmalloc. This removes a
12844 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12845 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12846 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12847 Move back to alloc.c.
12848 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12849 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12850
12851 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12852
12853 * nsterm.m (windowDidResize): Call x_set_window_size only when
12854 ns_in_resize is true. Otherwise set pixelwidth/height and
12855 call change_frame_size (Bug#9628).
12856
12857 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12858
12859 Port --enable-checking=all to Fedora 14 x86-64.
12860 * charset.c (syms_of_charset): Also account for glibc malloc's
12861 internal overhead when calculating the initial malloc maximum.
12862
12863 Port --enable-checking=all to Fedora 14 x86.
12864 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12865 Move to lisp.h.
12866 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12867 (overrun_check_realloc, overrun_check_free):
12868 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12869 That way, xmalloc returns a properly-aligned pointer even if
12870 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12871 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12872 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12873 into account when calculating the initial malloc maximum.
12874 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12875 Move here from alloc.c, so that charset.c can use it too.
12876 Properly align; the old code wasn't right for common 32-bit hosts
12877 when configured with --enable-checking=all.
12878 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12879 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12880
12881 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12882
12883 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12884 use EDOM.
12885
12886 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12887
12888 * xdisp.c (compute_display_string_end): If there's no display
12889 string at CHARPOS, return -1.
12890
12891 * bidi.c (bidi_fetch_char): When compute_display_string_end
12892 returns a negative value, treat the character as a normal
12893 character not covered by a display string. (Bug#9624)
12894
12895 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12896
12897 * lread.c (Fread_from_string): Fix typo in docstring.
12898
12899 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12900
12901 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12902 newline, reseat the iterator instead of bidi-iterating there one
12903 character at a time. (Bug#9610)
12904 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12905 TO_CHARPOS if the bidi iterator is at base embedding level.
12906
12907 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12908
12909 * lread.c (readevalloop): Use correct code for NBSP.
12910 (read1): Likewise. (Bug#9608)
12911
12912 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12913
12914 * dbusbind.c (Fdbus_register_signal): When service is not
12915 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12916
12917 2011-09-25 Glenn Morris <rgm@gnu.org>
12918
12919 * buffer.c (truncate-lines): Doc fix.
12920
12921 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12922
12923 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12924 (Fset_window_next_buffers): Doc fix.
12925
12926 2011-09-24 Glenn Morris <rgm@gnu.org>
12927
12928 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12929
12930 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12931
12932 Fix minor problems found by static checking.
12933 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12934 * indent.c (Fvertical_motion): Fix == vs = typo.
12935
12936 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12937
12938 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12939 Default value is now t. Doc fix.
12940
12941 * indent.c (Fvertical_motion): Compute and apply the overshoot
12942 logic when moving up, not only when moving down. Fix the
12943 confusing name and values of the it_overshoot_expected variable;
12944 logic changes accordingly. (Bug#9254) (Bug#9549)
12945
12946 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12947 CHARPOS is covered by a display string which includes newlines.
12948 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12949 is covered by a display string with embedded newlines.
12950
12951 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12952
12953 * dbusbind.c (Fdbus_register_signal): Add match rule to
12954 Vdbus_registered_objects_table. (Bug#9581)
12955 (Fdbus_register_method, Vdbus_registered_objects_table):
12956 Fix docstring.
12957
12958 2011-09-24 Jim Meyering <meyering@redhat.com>
12959
12960 do not ignore write error for any output size
12961 The previous change was incomplete.
12962 While it makes emacs --batch detect the vast majority of stdout
12963 write failures, errors were still ignored whenever the output size is
12964 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12965 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12966 && echo FAIL: ignored write error
12967 FAIL: ignored write error
12968 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12969 && echo FAIL: ignored write error
12970 FAIL: ignored write error
12971 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12972
12973 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12974
12975 * emacs.c (Fkill_emacs): In noninteractive mode exit
12976 non-successfully if a write error occurred on stdout. (Bug#9574)
12977
12978 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12979
12980 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12981 the xassert test.
12982
12983 * dispextern.h (struct it): Update the comment documenting what
12984 can it->OBJECT be.
12985
12986 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12987
12988 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12989 a display string, extend search for cursor position to end of row.
12990 (find_row_edges): If the row ends in a newline from a display
12991 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12992 Handle the case of a display string with multiple newlines.
12993 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12994 non-empty line. Fixes confusing cursor motion with arrow keys at
12995 the beginning of a line that starts with whitespace.
12996
12997 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12998
12999 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13000 (bug#9493).
13001
13002 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13003
13004 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13005 boolean (Bug#9154).
13006
13007 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13008
13009 * xdisp.c (display_line): Record maximum and minimum buffer
13010 positions even if no glyphs were produced (e.g., by a zero-width
13011 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13012 buffer positions that will be removed from the glyph row because
13013 they don't fit.
13014 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13015 column is beyond frame width: don't subtract 1 "pixel" when
13016 computing width of the stretch.
13017 (reseat_at_next_visible_line_start): Undo the change made on
13018 2011-09-17 that saved paragraph information and restored it after
13019 the call to `reseat'. (Bug#9545)
13020
13021 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13022
13023 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13024 and turn window cursor on if cleared (Bug#9415).
13025
13026 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13027
13028 * search.c (boyer_moore): Take unibyte characters from pattern
13029 literally. (Bug#9458)
13030
13031 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13032
13033 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13034
13035 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13036
13037 Fix minor problem found by static checking.
13038 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13039 initialized, to pacify gcc -Wuninitialized.
13040
13041 * fileio.c: Report proper errno when syscall falls.
13042 (Finsert_file_contents): Save and restore errno,
13043 so that report_file_error outputs the correct diagnostic.
13044 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13045
13046 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13047
13048 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13049
13050 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13051
13052 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13053 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13054
13055 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13056
13057 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13058 about the current paragraph and restore it after the call to reseat.
13059
13060 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13061 (bidi_find_paragraph_start): Search back for paragraph beginning
13062 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13063 (bidi_move_to_visually_next): Only trigger paragraph-related
13064 computations when the last character is a newline or at EOB, not
13065 just any NEUTRAL_B. (Bug#9470)
13066
13067 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13068 truncated lines if point is covered by a display string. (Bug#9524)
13069
13070 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13071
13072 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13073 (cons_to_x_long): New function.
13074 (lisp_data_to_selection_data): Use it. Correct the test for
13075 short-versus-long data; it was negated. Break out of vector
13076 loop, for efficiency, when a long datum is discovered.
13077
13078 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13079
13080 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13081
13082 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13083
13084 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13085 GCC PR/17406) by declaring this function with external scope.
13086
13087 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13088
13089 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13090 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13091
13092 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13093
13094 * editfns.c (Fformat): Correctly handle text properties on "%%".
13095
13096 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13097
13098 * xterm.c (x_draw_composite_glyph_string_foreground):
13099 * w32term.c (x_draw_composite_glyph_string_foreground):
13100 * term.c (encode_terminal_code):
13101 * composite.c (composition_update_it, get_composition_id):
13102 * xdisp.c (get_next_display_element)
13103 (fill_composite_glyph_string): Add comments about special meaning
13104 of TAB characters in a composition.
13105
13106 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13107
13108 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13109 This occurs when processing a multibyte format.
13110 Problem reported by Wolfgang Jenker.
13111
13112 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13113
13114 * xdisp.c (try_cursor_movement): Only check for exact match if
13115 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13116
13117 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13118
13119 Remove unused external symbols.
13120 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13121 * xdisp.c (calc_pixel_width_or_height): Now static.
13122 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13123 * indent.c (check_display_width):
13124 * w32term.c: Fix comment to match code.
13125 * xterm.c, xterm.h (x_catching_errors): Remove.
13126
13127 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 * xselect.c: Use signed conversions more consistently (Bug#9498).
13130 (selection_data_to_lisp_data): Assume incoming selection data are
13131 signed integers, not unsigned. This is to be consistent with
13132 outgoing selection data, which was modified to use signed integers
13133 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13134 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13135 expects long, not unsigned long.
13136
13137 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13138
13139 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13140 computation of loop end. Reported by Johan Bockgård
13141 <bojohan@gnu.org>.
13142
13143 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13144
13145 * frame.c (Fother_visible_frames_p): Function deleted.
13146
13147 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13148
13149 * indent.c (compute_motion): Process display vector front to back
13150 rather than the other way around. (Bug#2496)
13151
13152 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13153
13154 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13155
13156 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13157
13158 * minibuf.c (Fread_from_minibuffer): Doc fix.
13159
13160 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13161
13162 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13163 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13164
13165 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13166
13167 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13168 value for non-existent files.
13169
13170 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13171
13172 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13173 set its "size" to -1. This will set the modtime_size field of
13174 the corresponding buffer to -1, which is what
13175 verify-visited-file-modtime expects for files that do not exist.
13176 (Bug#9139)
13177
13178 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13179
13180 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13181 here ...
13182 * lisp.h: ... from here. push_key_description is no longer
13183 defined in keyboard.c, so its declaration should not be in
13184 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13185 logically belongs with push_key_description.
13186
13187 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13188
13189 * buffer.h: Include <sys/types.h> instead of <time.h>.
13190 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13191 Problem reported by Herbert J. Skuhra.
13192
13193 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13194
13195 * xml.c (parse_region): Make the parsing work for
13196 non-comment-starting XML files again (bug#9144).
13197
13198 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13199
13200 * image.c (gif_load): Fix calculation of bottom and right corner.
13201 (Bug#9468)
13202
13203 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13204
13205 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13206 redisplay in small windows.
13207
13208 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13209
13210 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13211
13212 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13213
13214 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13215 Operate on live windows only.
13216
13217 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13218
13219 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13220
13221 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13222
13223 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13224 only under bidi iteration.
13225
13226 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13227
13228 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13229
13230 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13231
13232 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13233 Without this fix, the command to link temacs failed due to an
13234 undefined symbol __builtin_isnan. This is because
13235 /usr/include/iso/math_c99.h #defines isnan(x) to
13236 __builtin_isnan(x), but the bundled gcc, which identifies itself
13237 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13238 a __builtin_isnan.
13239 * floatfns.c (isnan): #undef, and then #define to a clone of
13240 what's in data.c.
13241 (Fisnan): Always define, since it's always available now.
13242 (syms_of_floatfns): Always define isnan at the Lisp level.
13243
13244 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13245
13246 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13247
13248 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13249
13250 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13251 The previous code assumed that file offsets (off_t values) fit in
13252 EMACS_INT variables, which is not true on typical 32-bit hosts.
13253 The code messed up by falsely reporting buffer overflow in cases
13254 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13255 when "big" contains more than 2**29 bytes, even though this
13256 inserts just one byte and does not overflow the buffer.
13257 (Finsert_file_contents): Store file offsets as off_t
13258 values, not as EMACS_INT values. Check for overflow when
13259 converting between EMACS_INT and off_t. When checking for
13260 buffer overflow or for overlap, take the offsets into account.
13261 Don't use EMACS_INT for small values where int suffices.
13262 When checking for overlap, fix a typo: ZV was used where
13263 ZV_BYTE was intended.
13264 (Fwrite_region): Don't assume off_t fits into 'long'.
13265 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13266
13267 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13268
13269 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13270
13271 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13272
13273 sprintf-related integer and memory overflow issues (Bug#9412).
13274
13275 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13276 (esprintf, exprintf, evxprintf): New functions.
13277 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13278 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13279 (modify_event_symbol): Do not assume that the length of
13280 name_alist_or_stem is safe to alloca and fits in int.
13281 (Fexecute_extended_command): Likewise for function name and binding.
13282 (Frecursion_depth): Wrap around reliably on integer overflow.
13283 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13284 since some callers pass EMACS_INT values.
13285 (Fsingle_key_description): Don't crash if symbol name contains more
13286 than MAX_ALLOCA bytes.
13287 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13288 (get_minibuffer): Arg is now EMACS_INT, not int.
13289 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13290 (esprintf, exprintf, evxprintf): New decls.
13291 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13292
13293 * dbusbind.c (signature_cat): New function.
13294 (xd_signature, Fdbus_register_signal):
13295 Do not overrun buffer; instead, report string overflow.
13296
13297 * dispnew.c (add_window_display_history): Don't overrun buffer.
13298 Truncate instead; this is OK since it's just a log.
13299
13300 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13301 even if the time zone offset is outlandishly large.
13302 Don't mishandle offset == INT_MIN.
13303
13304 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13305 when creating daemon; the previous buffer-overflow check was incorrect.
13306
13307 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13308 which has the guts of the old verror function.
13309
13310 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13311 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13312
13313 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13314 (font_unparse_xlfd): Don't blindly alloca long strings.
13315 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13316 fits in int, when using sprintf. Use single snprintf to count
13317 length of string rather than counting it via multiple sprintfs;
13318 that's simpler and more reliable.
13319 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13320 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13321 sprintf, in case result does not fit in int.
13322
13323 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13324 (fontset_from_font): Print it.
13325
13326 * frame.c (tty_frame_count): Now printmax_t, not int.
13327 (make_terminal_frame, set_term_frame_name): Print it.
13328 (x_report_frame_params): In X, window IDs are unsigned long,
13329 not signed long, so print them as unsigned.
13330 (validate_x_resource_name): Check for implausibly long names,
13331 and don't assume name length fits in 'int'.
13332 (x_get_resource_string): Don't blindly alloca invocation name;
13333 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13334 not fit in int.
13335
13336 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13337 (xg_check_special_colors, xg_set_geometry):
13338 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13339
13340 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13341 Use esprintf, not sprintf, in case result does not fit in int.
13342
13343 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13344 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13345 it as a large positive number.
13346 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13347 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13348
13349 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13350 in case result does not fit in int.
13351
13352 * print.c (float_to_string): Detect width overflow more reliably.
13353 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13354 buffer overrun. Don't assume list length fits in 'int'. Treat
13355 print length of 0 as 0, not as infinity; to be consistent with other
13356 uses of print length in this function. Don't overflow print length
13357 index. Don't assume hash table size fits in 'long', or that
13358 vectorlike size fits in 'unsigned long'.
13359
13360 * process.c (make_process): Use printmax_t, not int, to format
13361 process-name gensyms.
13362
13363 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13364
13365 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13366 to avoid potential buffer overrun.
13367
13368 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13369 if X resource line is longer than 512 bytes.
13370
13371 * xfns.c (x_window): Make sprintf buffer a bit bigger
13372 to avoid potential buffer overrun.
13373
13374 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13375
13376 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13377
13378 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13379
13380 Integer overflow fixes for scrolling, etc.
13381 Without these, Emacs silently mishandles large integers sometimes.
13382 For example, "C-u 4294967297 M-x recenter" was treated as if
13383 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13384
13385 * xdisp.c (try_window_id): Check Emacs fixnum range before
13386 converting to 'int'.
13387
13388 * window.c (window_scroll_line_based, Frecenter):
13389 Check that an Emacs fixnum is in range before assigning it to 'int'.
13390 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13391 values converted from Emacs fixnums.
13392 (Frecenter): Don't wrap around a line count if it is out of 'int'
13393 range; instead, treat it as an extreme value.
13394 (Fset_window_configuration, compare_window_configurations):
13395 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13396
13397 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13398 that can exceed INT_MAX. Check that EMACS_INT value is in range
13399 before assigning it to the (possibly-narrower) index.
13400 (match_limit): Don't assume that a fixnum can fit in 'int'.
13401
13402 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13403 exceed INT_MAX.
13404
13405 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13406 (Fvertical_motion): Don't wrap around LINES values that don't fit
13407 in 'int'. Instead, treat them as extreme values. This is good
13408 enough for windows, which can't have more than INT_MAX lines anyway.
13409
13410 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13411
13412 * Require libxml/parser.h to avoid compilation warning.
13413
13414 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13415
13416 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13417 since this reportedly can destroy thread storage.
13418
13419 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13420
13421 * syntax.c (find_defun_start): Update all cache variables if
13422 exiting early (Bug#9401).
13423
13424 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13425
13426 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13427
13428 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13429 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13430 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13431
13432 * term.c (tty_append_glyph): New function.
13433 (produce_stretch_glyph): Static function and its prototype deleted.
13434
13435 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13436 Add prototypes.
13437
13438 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13439
13440 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13441 when checking :margin (Bug#9390).
13442 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13443 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13444 so that the name doesn't mislead. All uses changed.
13445
13446 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13447
13448 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13449 set_tty_hooks.
13450
13451 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13452
13453 * xdisp.c (move_it_to): Don't bail out early when reaching
13454 position beyond to_charpos, if we are scanning backwards.
13455 (move_it_vertically_backward): When DY == 0, make sure we get to
13456 the first character in the line after the newline.
13457
13458 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13461 (ccl_driver): Do not generate an out-of-range pointer.
13462 (Fccl_execute_on_string): Remove unnecessary check for
13463 integer overflow, noted by Stefan Monnier in
13464 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13465 Remove a FIXME that didn't need fixing.
13466 Simplify the newly-introduced buffer reallocation code.
13467
13468 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13469
13470 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13471
13472 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13473
13474 Integer and memory overflow issues (Bug#9196).
13475
13476 * doc.c (get_doc_string): Rework so that
13477 get_doc_string_buffer_size is the actual buffer size, rather than
13478 being 1 less than the actual buffer size; this makes xpalloc more
13479 convenient.
13480
13481 * image.c (x_allocate_bitmap_record, cache_image):
13482 * xselect.c (Fx_register_dnd_atom):
13483 Simplify previous changes by using xpalloc.
13484
13485 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13486 since either will do and ptrdiff_t is convenient with xpalloc.
13487
13488 * charset.c (charset_table_size)
13489 (struct charset_sort_data.priority): Now ptrdiff_t.
13490 (charset_compare): Don't overflow if priorities differ greatly.
13491 (Fsort_charsets): Don't assume list length fits in int.
13492 Check for size-calculation overflow when allocating sort data.
13493 (syms_of_charset): Allocate an initial charset table that is
13494 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13495
13496 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13497
13498 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13499 The actual value is always <= INT_MAX, and leaving it unsigned made
13500 overflow checking harder.
13501
13502 * dispextern.h (struct glyph_matrix.rows_allocated)
13503 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13504 with xpalloc. The values are still always <= INT_MAX.
13505
13506 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13507
13508 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13509 (SAFE_NALLOCA): New macro.
13510
13511 * region-cache.c (struct boundary.pos, find_cache_boundary)
13512 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13513 (set_cache_region, invalidate_region_cache)
13514 (revalidate_region_cache, know_region_cache, region_cache_forward)
13515 (region_cache_backward, pp_cache):
13516 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13517 so that ptrdiff_t * can be passed to xpalloc.
13518 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13519 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13520 (pp_cache): Don't assume cache_len fits in int.
13521 * region-cache.h: Adjust extern decls to match.
13522
13523 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13524 EMACS_INT, since either will do, for xpalloc.
13525
13526 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13527 (xnmalloc, xnrealloc, xpalloc): New functions.
13528
13529 * bidi.c (bidi_shelve_header_size): New constant.
13530 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13531 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13532
13533 * bidi.c (bidi_cache_shrink):
13534 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13535 (overlay_strings):
13536 Don't update size of array until after memory allocation succeeds,
13537 because xmalloc/xrealloc may not return.
13538 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13539 now that we have proper integer overflow checking.
13540 (record_overlay_string, overlay_strings): Catch overflows when
13541 calculating size of overlay_str_buf.
13542
13543 * callproc.c (Fcall_process): Check for size overflow when
13544 calculating size of args2.
13545 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13546 Normally we prefer signed values, but sticking with ptrdiff_t would
13547 require adding more-complicated checks.
13548
13549 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13550 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13551 Redo buffer-overflow calculations to avoid integer overflow.
13552 Add a FIXME comment where memory seems to be over-allocated.
13553
13554 * character.c (Fstring): Check for size-calculation overflow.
13555
13556 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13557 unnecessary integer overflow. Check for size overflow.
13558 (encode_coding_object): Don't update size until xmalloc succeeds.
13559
13560 * composite.c (get_composition_id): Check for overflow in glyph
13561 length calculations.
13562
13563 Integer and memory overflow fixes for display code.
13564 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13565 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13566 (scrolling_window): Check for overflow in size calculations.
13567 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13568 Don't assume glyph table len fits in int.
13569 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13570 (row_table_size): Now ptrdiff_t, not int.
13571 (scrolling_window): Avoid overflow in size calculations.
13572 Don't update size until allocation succeeds.
13573 * fns.c (concat): Check for overflow in size calculations.
13574 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13575 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13576 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13577
13578 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13579 (get_doc_string): Check for size calculation overflow.
13580 Don't update size until allocation succeeds.
13581 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13582 EMACS_INT, where ptrdiff_t will do.
13583 (Fsubstitute_command_keys): Check for string overflow.
13584
13585 * editfns.c (set_time_zone_rule): Don't assume environment length
13586 fits in int.
13587 (message_length): Now ptrdiff_t, not int.
13588 (Fmessage_box): Don't update size until allocation succeeds.
13589 Don't assume message length fits in int.
13590 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13591
13592 * emacs.c (main): Do not reallocate argv, since there is a null at
13593 the end that can be overwritten, and this way there's no need to
13594 worry about size-calculation overflow.
13595 (sort_args): Check for size-calculation overflow.
13596
13597 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13598 alloc succeeds.
13599 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13600
13601 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13602 (x_set_scroll_bar_width, x_figure_window_size):
13603 Check for integer overflow.
13604 (x_set_alpha): Do not assume XINT fits in int.
13605
13606 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13607 This is for the members text_lines, text_cols, total_lines, total_cols,
13608 where the system imposes an 'int' limit.
13609
13610 * fringe.c (Fdefine_fringe_bitmap):
13611 Don't update size until alloc works.
13612
13613 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13614 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13615
13616 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13617 Check for size-calculation overflow.
13618 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13619 do, as we prefer signed integers.
13620 (id_to_widget.max_size, id_to_widget.used)
13621 (xg_store_widget_in_map, xg_remove_widget_from_map)
13622 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13623 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13624 Use and return ptrdiff_t, not int.
13625 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13626 * gtkutil.h: Change prototypes to match the above.
13627
13628 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13629 are duplicate now that they've been promoted to lisp.h.
13630 (x_allocate_bitmap_record, x_alloc_image_color)
13631 (make_image_cache, cache_image, xpm_load):
13632 Don't update size until alloc is done.
13633 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13634 (x_detect_edges):
13635 Check for size calculation overflow.
13636 (ct_colors_allocated_max): New constant.
13637 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13638 overflow.
13639
13640 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13641 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13642 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13643 Use ptrdiff_t, not int, to count maps.
13644 (read_char_minibuf_menu_prompt): Check for overflow in size
13645 calculations. Don't update size until allocation succeeds.
13646 Redo calculations to avoid overflow.
13647 * keyboard.h: Change prototypes to match the above.
13648
13649 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13650 to count maps.
13651 (current_minor_maps): Check for size calculation overflow.
13652 * keymap.h: Change prototypes to match the above.
13653
13654 * lread.c (read1, init_obarray): Don't update size until alloc done.
13655
13656 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13657 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13658
13659 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13660 Now ptrdiff_t, not int.
13661 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13662 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13663
13664 * process.c (Fnetwork_interface_list): Check for overflow
13665 in size calculation.
13666
13667 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13668
13669 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13670 overflow. Don't bother calling xmalloc when xrealloc will do.
13671
13672 * search.c (Freplace_match): Check for size calculation overflow.
13673 (Fset_match_data): Don't assume list lengths fit in 'int'.
13674
13675 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13676 for command line length. Do not attempt to address one before the
13677 beginning of an array, as that's not portable.
13678
13679 * term.c (max_frame_lines): Remove; unused.
13680 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13681 not int.
13682 (encode_terminal_code, calculate_costs): Check for size
13683 calculation overflow.
13684 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13685 table lengths and related sizes. Don't update size until alloc
13686 done. Redo calculations to avoid overflow.
13687 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13688
13689 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13690 subtracting pointers.
13691 (gobble_line): Check for overflow more carefully. Don't update size
13692 until alloc done.
13693
13694 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13695 Don't update size until alloc done.
13696 Redo size calculations to avoid overflow.
13697 Check for size calculation overflow.
13698 (main) [DEBUG]: Fix typo in invoking tparam1.
13699
13700 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13701 Use ptrdiff_t, not int, for sizes.
13702 (store_mode_line_noprop_char): Don't update size until alloc done.
13703
13704 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13705 Use ptrdiff_t, not int, for sizes.
13706 (Finternal_make_lisp_face, cache_face):
13707 Check for size calculation overflow.
13708 (cache_face): Treat size calculation overflows as if they were
13709 memory exhaustion (the usual treatment), rather than aborting.
13710
13711 * xfns.c (x_encode_text, x_set_name_internal)
13712 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13713 sizes, since they can exceed INT_MAX in size. Check for size
13714 calculation overflow.
13715
13716 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13717 (xg_select): Check for size calculation overflow.
13718 Don't update size until alloc done.
13719
13720 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13721 as sprintf is limited to int lengths.
13722
13723 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13724 (X_LONG_MIN): New macros.
13725 Use them to make the following changes clearer.
13726 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13727 This change doesn't affect the value now, but it may help remind
13728 future maintainers not to raise the value too much later.
13729 (SELECTION_QUANTUM): Remove, replacing with ...
13730 (selection_quantum): ... new function, which avoids overflow.
13731 All uses changed.
13732 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13733 assumption that selection length fits in 'int'.
13734 (x_reply_selection_request, x_handle_selection_request)
13735 (x_get_window_property, receive_incremental_selection)
13736 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13737 (lisp_data_to_selection_data, clean_local_selection_data):
13738 Use ptrdiff_t, not int, to record length of selection.
13739 (x_reply_selection_request, x_get_window_property)
13740 (receive_incremental_selection, x_property_data_to_lisp):
13741 Redo calculations to avoid overflow.
13742 (x_reply_selection_request): When sending hint, ceiling it at
13743 X_LONG_MAX rather than relying on wraparound overflow to send
13744 something.
13745 (x_get_window_property, receive_incremental_selection)
13746 (lisp_data_to_selection_data, x_property_data_to_lisp):
13747 Check for size-calculation overflow.
13748 (x_get_window_property, receive_incremental_selection)
13749 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13750 Don't store size until memory allocation succeeds.
13751 (x_get_window_property): Plug memory leak on memory exhaustion.
13752 Don't double-block input; malloc is safe here. Don't assume 2**34
13753 - 4 fits in unsigned long. Add an xassert to check
13754 XGetWindowProperty overflow. Be more careful about overflow
13755 calculations, and distinguish size from memory overflow better.
13756 (receive_incremental_selection): When tracing, don't assume
13757 unsigned int is less than INT_MAX.
13758 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13759 harmful) conversions of unsigned short to int.
13760 (lisp_data_to_selection_data): Don't assume that integers
13761 in the range -65535 through -1 fit in an X unsigned short.
13762 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13763 result parameters unless successful. Rely on cons_to_unsigned
13764 to report problems with elements; the old code wasn't right anyway.
13765 (x_check_property_data): Check for int overflow; we cannot use
13766 a wider type due to X limits.
13767 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13768
13769 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13770
13771 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13772 (x_term_init): Check for size calculation overflow.
13773 (x_color_cells): Don't store size until memory allocation succeeds.
13774 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13775 Don't assume alloca size is less than MAX_ALLOCA.
13776 (x_term_init): Don't assume length fits in int (sprintf is limited
13777 to int size).
13778
13779 Use ptrdiff_t for composition IDs.
13780 * character.c (lisp_string_width):
13781 * composite.c (composition_table_size, n_compositions)
13782 (get_composition_id, composition_gstring_from_id):
13783 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13784 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13785 * window.c (Frecenter):
13786 Use ptrdiff_t, not int, for composition IDs.
13787 * composite.c (get_composition_id): Check for integer overflow.
13788 * composite.h: Adjust prototypes to match the above changes.
13789
13790 Use ptrdiff_t for hash table indexes.
13791 * category.c (hash_get_category_set):
13792 * ccl.c (ccl_driver):
13793 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13794 * coding.c (coding_system_charset_list, detect_coding_system):
13795 * coding.h (struct coding_system.id):
13796 * composite.c (get_composition_id, gstring_lookup_cache):
13797 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13798 * image.c (xpm_get_color_table_h):
13799 * lisp.h (hash_lookup, hash_put):
13800 * minibuf.c (Ftest_completion):
13801 Use ptrdiff_t for hash table indexes, not int (which is too
13802 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13803 32-bit --with-wide-int hosts).
13804
13805 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13806 Add a FIXME comment about memory leaks.
13807 (syms_of_charset): Don't assume xmalloc returns.
13808
13809 Don't assume that stated character widths fit in int.
13810 * character.c (Fchar_width, c_string_width, lisp_string_width):
13811 * character.h (CHAR_WIDTH):
13812 * indent.c (MULTIBYTE_BYTES_WIDTH):
13813 Use sanitize_char_width to avoid undefined and/or bad behavior
13814 with outlandish widths.
13815 * character.h (sanitize_tab_width): Rename from sanitize_width,
13816 now that we have two such functions. All uses changed.
13817 (sanitize_char_width): New inline function.
13818
13819 Don't assume that tab-width fits in int.
13820 * character.h (sanitize_width): New inline function.
13821 (SANE_TAB_WIDTH): New macro.
13822 (ASCII_CHAR_WIDTH): Use it.
13823 * indent.c (sane_tab_width): Remove. All uses replaced by
13824 SANE_TAB_WIDTH (current_buffer).
13825 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13826
13827 * fileio.c: Integer overflow issues with file modes.
13828 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13829
13830 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13831 Remove unreachable code.
13832 (read_hex, load_charset_map_from_file): Check for integer overflow.
13833
13834 * xterm.c: Don't go over XClientMessageEvent limit.
13835 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13836 (x_send_scroll_bar_event): Likewise. Check that the size does not
13837 exceed limits imposed by XClientMessageEvent, as well as the usual
13838 ptrdiff_t and size_t limits.
13839
13840 * keyboard.c: Overflow, signedness and related fixes.
13841 (make_lispy_movement): Use same integer type in forward decl
13842 that is used in the definition.
13843 (read_key_sequence, keyremap_step):
13844 Change bufsize argument back to int, undoing my 2011-03-30 change.
13845 We prefer signed types, and int is wide enough here.
13846 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13847 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13848 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13849 length, not size_t. Use ptrdiff_t for index, not int.
13850 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13851 possibility of integer overflow.
13852
13853 Overflow, signedness and related fixes for images.
13854
13855 * dispextern.h (struct it.stack[0].u.image.image_id)
13856 (struct_it.image_id, struct image.id, struct image_cache.size)
13857 (struct image_cache.used, struct image_cache.ref_count):
13858 * gtkutil.c (update_frame_tool_bar):
13859 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13860 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13861 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13862 * nsmenu.m (update_frame_tool_bar):
13863 * xdisp.c (calc_pixel_width_or_height):
13864 * xfns.c (image_cache_refcount):
13865 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13866 on typical 64-bit hosts.
13867
13868 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13869 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13870 Omit unnecessary casts to int.
13871 (parse_image_spec): Check that integers fall into 'int' range
13872 when the callers expect that.
13873 (image_ascent): Redo ascent calculation to avoid int overflow.
13874 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13875 (lookup_image): Remove unnecessary tests.
13876 (xbm_image_p): Locals are now of int, not EMACS_INT,
13877 since parse_image_check makes sure they fit into int.
13878 (png_load, gif_load, svg_load_image):
13879 Prefer int to unsigned where either will do.
13880 (tiff_handler): New function, combining the cores of the
13881 old tiff_error_handler and tiff_warning_handler.
13882 This function is rewritten to use vsnprintf and thereby avoid
13883 stack buffer overflows. It uses only the features of vsnprintf
13884 that are common to both POSIX and native Microsoft.
13885 (tiff_error_handler, tiff_warning_handler): Use it.
13886 (tiff_load, gif_load, imagemagick_load_image):
13887 Don't assume :index value fits in 'int'.
13888 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13889 (imagemagick_load_image): Check that crop parameters fit into
13890 the integer types that MagickCropImage accepts. Don't assume
13891 Vimagemagick_render_type has a nonnegative value. Don't assume
13892 size_t fits in 'long'.
13893 (gs_load): Use printmax_t to print the widest integers possible.
13894 Check for integer overflow when computing image height and width.
13895
13896 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13897
13898 * xdisp.c (redisplay_window): Don't force window start if point
13899 will be invisible in the resulting window. (Bug#9324)
13900
13901 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13902
13903 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13904 the display spec is of the form `(space ...)'.
13905 (handle_display_spec): Return the value returned by
13906 handle_single_display_spec, not just 1 or zero.
13907 (handle_single_display_spec): If the display spec is of the form
13908 `(space ...)', and specifies display in the text area, return 2
13909 rather than 1.
13910 (try_cursor_movement): Check for the need to scroll more
13911 accurately, and prefer exact match for point under bidi.
13912 Don't advance `row' beyond the last row of the window.
13913
13914 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13915 into disp_prop; all users changed.
13916
13917 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13918 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13919 for the text covered by the display property.
13920
13921 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13922
13923 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13924 Change return value to nil.
13925 (Frecord_buffer): Delete unused function.
13926
13927 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13928
13929 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13930 buffers, return left-to-right.
13931 (set_cursor_from_row): Consider candidate row a win if its glyph
13932 represents a newline and point is on that newline. Fixes cursor
13933 positioning on the newline at EOL of R2L text within L2R
13934 paragraph, and vice versa.
13935 (try_cursor_movement): Check continued rows, in addition to
13936 continuation rows. Fixes unwarranted scroll when point enters a
13937 continued line of R2L text within an L2R paragraph, or vice versa.
13938 (cursor_row_p): Consider the case of point being equal to
13939 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13940 from the end of a short line to the beginning of a continued line
13941 of R2L text within L2R paragraph.
13942 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13943 composed characters.
13944
13945 * bidi.c (bidi_check_type): Use xassert.
13946 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13947 members.
13948
13949 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13950
13951 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13952 a character.
13953
13954 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13955
13956 * nsfont.m (ns_otf_to_script): Fix typo.
13957
13958 2011-08-22 Kenichi Handa <handa@m17n.org>
13959
13960 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13961 extra slot even if the purpose is char-code-property-table.
13962
13963 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13964
13965 * xdisp.c (redisplay_window): When computing centering_position,
13966 account for the height of the header line. (Bug#8874)
13967
13968 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13969 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13970 candidate is selected by the mouse, and that candidate has a
13971 composed character under the mouse.
13972
13973 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13974 coordinates reported by pos-visible-in-window-p for a composed
13975 character in column zero.
13976
13977 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13978
13979 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13980
13981 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13982
13983 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13984 consider it a hit if to_charpos is anywhere in the range of the
13985 composed buffer positions.
13986
13987 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13988
13989 * image.c (gif_load): Don't assume that each subimage has the same
13990 dimensions as the base image. Handle disposal method that is
13991 "undefined" by the gif spec (Bug#9335).
13992
13993 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13994
13995 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
13996 (Fcondition_case): Document `debug' symbol in error handler.
13997
13998 2011-08-19 Eli Zaretskii <eliz@gnu.org>
13999
14000 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14001 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14002 from an Org mode buffer to a Speedbar frame.
14003
14004 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14005 a composition, take its buffer position from IT->cmp_it.charpos.
14006 Fixes cursor positioning at the beginning of a line that begins
14007 with a composed character.
14008
14009 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14010
14011 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14012 character bidirectional type, use STRONG_L instead. Fixes crashes
14013 in a buffer produced by `describe-categories'.
14014
14015 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14016 members before the level stack, so they would be saved and
14017 restored when copying iterator state. Fixes incorrect reordering
14018 around TABs covered by display properties.
14019
14020 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14021
14022 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14023
14024 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14025
14026 * eval.c (internal_condition_case, internal_condition_case_1)
14027 (internal_condition_case_2, internal_condition_case_n):
14028 Remove unnecessary aborts (Bug#9081).
14029
14030 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14031
14032 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14033 has no `load' handler, try opening the file locally. (Bug#9311)
14034
14035 2011-08-16 Ken Brown <kbrown@cornell.edu>
14036
14037 * gmalloc.c: Expand comment.
14038
14039 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14040
14041 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14042 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14043
14044 2011-08-16 Ken Brown <kbrown@cornell.edu>
14045
14046 Fix memory allocation problems in Cygwin build (Bug#9273).
14047
14048 * unexcw.c ( __malloc_initialized): Declare external variable.
14049 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14050
14051 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14052 New variables.
14053 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14054 dumped emacs.
14055 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14056 in the static heap.
14057 [CYGWIN] (special_realloc): New function.
14058 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14059 requests to realloc storage in the static heap.
14060
14061 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14062
14063 * bidi.c (bidi_initialize): Remove unused local.
14064
14065 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14066
14067 * bidimirror.h:
14068 * biditype.h: Remove file.
14069 * makefile.w32-in ($(BLD)/bidi.$(O)):
14070 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14071
14072 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14073
14074 * chartab.c: Improve commentary for the uniprop_table API.
14075
14076 * bidi.c (bidi_paragraph_init): Support zero value of
14077 bidi_ignore_explicit_marks_for_paragraph_level.
14078 (bidi_initialize): Use uniprop_table instead of including
14079 biditype.h and bidimirror.h.
14080
14081 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14082 coordinates of the iterator when restoring from ppos_it.
14083 (Bug#9296)
14084
14085 2011-08-14 Kenichi Handa <handa@m17n.org>
14086
14087 * process.c (create_process): Call setup_process_coding_systems
14088 after the pid of the process is set to -1 (Bug#8162).
14089
14090 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14091
14092 * xdisp.c (move_it_in_display_line_to): Don't invoke
14093 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14094 ppos_it. Fixes vertical cursor motion when line beginning is
14095 covered by an image. (Bug#9296)
14096
14097 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14098
14099 * nsterm.h (ns_run_ascript): Declare.
14100 (NSAPP_DATA2_RUNASSCRIPT): Define.
14101
14102 * nsfns.m (as_script, as_result, as_status): New static variables.
14103 (ns_run_ascript): New function.
14104 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14105 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14106 the event loop. Get status from as_status (Bug#7276).
14107
14108 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14109 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14110 the event loop (Bug#7276).
14111
14112 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14113
14114 * gnutls.c (QCgnutls_bootprop_priority)
14115 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14116 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14117 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14118 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14119 (QCgnutls_bootprop_verify_hostname_error)
14120 (QCgnutls_bootprop_callbacks_verify): Rename from
14121 Qgnutls_bootprop_..., all uses changed.
14122
14123 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14124 uses changed.
14125
14126 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 * xfaces.c (Qframe_set_background_mode): Now static.
14129 * dispextern.h (Qframe_set_background_mode): Remove decl.
14130
14131 * process.c (Fnetwork_interface_info): Declare local only if needed.
14132
14133 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14134
14135 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14136 (Fnetwork_interface_list): Allocate in increments of bytes instead
14137 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14138 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14139 sockaddr.
14140 (struct ifflag_def): notrailers is smart on OSX.
14141 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14142 Get hardware address with getifaddrs if available.
14143
14144 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14145
14146 * xdisp.c (iterate_out_of_display_property): xassert that
14147 IT->position is set to within IT->object's boundaries. Break from
14148 the loop as soon as EOB is reached; avoids infloops in redisplay
14149 when IT->position is set up wrongly due to some bug.
14150 Set IT->current to match the bidi iterator unconditionally.
14151 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14152 entry. Force push_it to save on the stack the current
14153 buffer/string position, to be restored by pop_it. Fix flags in
14154 the iterator structure wrt the object coming from a display
14155 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14156 properties. (Bug#9284)
14157
14158 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14159
14160 * fontset.c (fontset_get_font_group): Add proper type checks.
14161 (Bug#9172)
14162
14163 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14164
14165 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14166 and LC_VERSION_MIN_MACOSX.
14167 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14168 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14169
14170 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14171
14172 * xdisp.c (forward_to_next_line_start): Allow to use the
14173 no-display-properties-and-no-overlays under bidi display.
14174 Set disp_pos in the bidi iterator to avoid searches for display
14175 properties and overlays.
14176
14177 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14178
14179 * editfns.c (Fset_time_zone_rule): Document relationship with the
14180 setenv function.
14181
14182 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14183 the font entity extracted from the cache (Bug#8109).
14184
14185 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14186
14187 * composite.c (autocmp_chars): Don't reset point. That is done by
14188 restore_point_unwind (Bug#5984).
14189
14190 2011-08-07 Juri Linkov <juri@jurta.org>
14191
14192 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14193 to show the arg `TIME' instead of `TIMEVAL'.
14194
14195 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14196
14197 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14198 display property strides EOL and includes a newline, as in
14199 longlines-mode. (Bug#9254)
14200 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14201 word-wrap under bidirectional display. (Bug#9224)
14202
14203 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14204 is non-zero, even if the data buffer is NULL. Fixes a crash in
14205 vertical-motion with longlines-mode. (Bug#9254)
14206
14207 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14208
14209 * bidi.c <bidi_cache_total_alloc>: Now static.
14210 (bidi_initialize): Initialize bidi_cache_total_alloc.
14211
14212 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14213 cache. (Bug#9221)
14214
14215 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14216 amount allocated this far in `bidi_cache_total_alloc'.
14217 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14218 non-zero, only free the data buffer without restoring the cache
14219 contents. All callers changed.
14220
14221 * dispextern.h (bidi_unshelve_cache): Update prototype.
14222
14223 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14224 (move_it_in_display_line, move_it_to)
14225 (move_it_vertically_backward, move_it_by_lines): Replace the call
14226 to xfree to an equivalent call to bidi_unshelve_cache.
14227 (move_it_in_display_line_to): Fix logic of returning
14228 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14229
14230 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14231
14232 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14233 came from a string character with a `cursor' property. (Bug#9229)
14234
14235 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14236
14237 * Makefile.in (LIB_PTHREAD): New variable.
14238 (LIBES): Add LIB_PTHREAD (Bug#9216).
14239
14240 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14241 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14242
14243 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14244
14245 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14246
14247 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14248
14249 * xterm.c (x_find_topmost_parent): New function.
14250 (x_set_frame_alpha): Find topmost parent window with
14251 x_find_topmost_parent and set the property there also (bug#9181).
14252 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14253
14254 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14255
14256 * callproc.c (Fcall_process): Avoid vfork clobbering
14257 the local vars buffer, coding_systems, current_dir.
14258
14259 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14260
14261 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14262
14263 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14264
14265 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14266 so that it is not optimized away.
14267
14268 * xdisp.c (compute_display_string_pos): Remove unused local.
14269
14270 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14271
14272 Fix slow cursor motion and scrolling in large buffers with
14273 selective display, like Org Mode buffers. (Bug#9218)
14274
14275 * dispextern.h (struct bidi_it): New member disp_prop_p.
14276
14277 * xdisp.c: Remove one-slot cache of display string positions.
14278 (compute_display_string_pos): Accept an additional argument
14279 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14280 for a display string or property. If found, set DISP_PROP_P
14281 non-zero.
14282
14283 * bidi.c (bidi_fetch_char): Accept an additional argument
14284 DISP_PROP_P, and pass it to compute_display_string_pos.
14285 Only handle text covered by a display string if DISP_PROP_P is returned
14286 non-zero. All callers of bidi_fetch_char changed.
14287
14288 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14289
14290 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14291
14292 2010-12-03 Don March <don@ohspite.net>
14293
14294 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14295 last character M-[char] is translated to ESC [char] (bug#7541).
14296
14297 2011-08-02 Kenichi Handa <handa@m17n.org>
14298
14299 * lisp.h (uniprop_table): Extern it.
14300
14301 * chartab.c (uniprop_table): Make it non-static.
14302
14303 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14304
14305 * xdisp.c (forward_to_next_line_start): Accept additional argument
14306 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14307 on the newline.
14308 (reseat_at_next_visible_line_start): Use the bidi iterator state
14309 returned by forward_to_next_line_start to restore the state of
14310 it->bidi_it after backing up to previous newline. (Bug#9212)
14311
14312 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14313
14314 * regex.c (re_comp): Protoize.
14315 (re_exec): Fix return type.
14316 (regexec): Fix type of `ret'. (Bug#9203)
14317
14318 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14319
14320 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14321 This is needed if max-image-size is a floating-point number.
14322
14323 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14324
14325 * print.c (print_object): Print empty symbol as ##.
14326
14327 * lread.c (read1): Read ## as empty symbol.
14328
14329 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14330
14331 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14332 setting frame foreground color (Bug#9175).
14333 (x_set_background_color): Likewise.
14334
14335 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14336 contents (Bug#9176).
14337 (EmacsTooltip -init): Remove bezels and add shadows to
14338 tooltip windows.
14339
14340 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14341 or scroll bar (Bug#8470).
14342
14343 * nsfont.m (nsfont_open): Remove assignment to voffset and
14344 unnecessary vars hshink, expand, hd, full_height, min_height.
14345 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14346
14347 * nsterm.h (nsfont_info): Remove voffset field.
14348
14349 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14350
14351 Implement strike-through and overline on NextStep (Bug#8863).
14352
14353 * nsfont.m (nsfont_open): Use underline position provided by font,
14354 instead of hard-coded value of 2.
14355 (nsfont_draw): Call ns_draw_text_decoration instead.
14356
14357 * nsterm.h: Add declaration for ns_draw_text_decoration.
14358
14359 * nsterm.m (ns_draw_text_decoration): New function for drawing
14360 underline, overline, and strike-through.
14361 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14362 ns_draw_text_decoration. Change treatment of cursor drawing to
14363 accommodate underlining, etc.
14364
14365 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14366
14367 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14368 default.
14369
14370 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14371
14372 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14373 Without this fix, if a signal arrives just after memory fills up,
14374 'malloc' might be invoked reentrantly.
14375
14376 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14377 In other words, assume that every image size is allowed, on non-X
14378 hosts. This assumption is probably wrong, but it lets Emacs compile.
14379
14380 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14381
14382 * regex.c (re_iswctype): Convert return values to boolean.
14383
14384 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14385
14386 * xdisp.c (compute_display_string_pos): Don't use cached display
14387 string position if the buffer had its restriction changed.
14388 (Bug#9184)
14389
14390 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14391
14392 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14393
14394 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14395
14396 Integer signedness and overflow and related fixes. (Bug#9079)
14397
14398 * bidi.c: Integer size and overflow fixes.
14399 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14400 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14401 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14402 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14403 (bidi_find_other_level_edge):
14404 Use ptrdiff_t instead of EMACS_INT where either will do.
14405 This works better on 32-bit hosts configured --with-wide-int.
14406 (bidi_cache_ensure_space): Check for size-calculation overflow.
14407 Use % rather than repeated addition, for better worst-case speed.
14408 Don't set bidi_cache_size until after xrealloc returns, because it
14409 might not return.
14410 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14411 (bidi_cache_ensure_space): Also check that the bidi cache size
14412 does not exceed that of the largest Lisp string or buffer. See Eli
14413 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14414
14415 * alloc.c (__malloc_size_t): Remove.
14416 All uses replaced by size_t. See Andreas Schwab's note
14417 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14418
14419 * image.c: Improve checking for integer overflow.
14420 (check_image_size): Assume that f is nonnull, since
14421 it is always nonnull in practice. This is one less thing to
14422 worry about when checking for integer overflow later.
14423 (x_check_image_size): New function, which checks for integer
14424 overflow issues inside X.
14425 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14426 This removes the need for a memory_full check.
14427 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14428 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14429 (xbm_read_bitmap_data): Change locals back to 'int', since
14430 their values must fit in 'int'.
14431 (xpm_load_image, png_load, tiff_load):
14432 Invoke x_create_x_image_and_pixmap earlier,
14433 to avoid much needless work if the image is too large.
14434 (tiff_load): Treat overly large images as if
14435 x_create_x_image_and_pixmap failed, not as malloc failures.
14436 (gs_load): Use x_check_image_size.
14437
14438 * gtkutil.c: Omit integer casts.
14439 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14440 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14441
14442 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14443
14444 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14445 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14446 would wrongly return t on a 64-bit host.
14447
14448 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14449 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14450 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14451 and therefore cause GCC to emit a bogus diagnostic in some cases.
14452
14453 * image.c: Integer signedness and overflow and related fixes.
14454 This is not an exhaustive set of fixes, but it's time to
14455 record what I've got.
14456 (lookup_pixel_color, check_image_size): Remove redundant decls.
14457 (check_image_size): Don't assume that arbitrary EMACS_INT values
14458 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14459 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14460 (tiff_load, imagemagick_load_image):
14461 Check for overflow in size calculations.
14462 (x_create_x_image_and_pixmap): Remove unnecessary test for
14463 xmalloc returning NULL; that can't happen.
14464 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14465 (xpm_color_bucket): Use better integer hashing function.
14466 (xpm_cache_color): Don't possibly over-allocate memory.
14467 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14468 (gif_memory_source):
14469 Use ptrdiff_t, not int or size_t, to record sizes.
14470 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14471 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14472 either works, as we prefer signed integers.
14473 (tiff_read_from_memory, tiff_write_from_memory):
14474 Return tsize_t, not size_t, since that's what the TIFF API wants.
14475 (tiff_read_from_memory): Don't fail simply because the read would
14476 go past EOF; instead, return a short read.
14477 (tiff_load): Omit no-longer-needed casts.
14478 (Fimagemagick_types): Don't assume size fits into 'int'.
14479
14480 Improve hashing quality when configured --with-wide-int.
14481 * fns.c (hash_string): New function, taken from sxhash_string.
14482 Do not discard information about ASCII character case; this
14483 discarding is no longer needed.
14484 (sxhash-string): Use it. Change sig to match it. Caller changed.
14485 * lisp.h: Declare it.
14486 * lread.c (hash_string): Remove, since we now use fns.c's version.
14487 The fns.c version returns a wider integer if --with-wide-int is
14488 specified, so this should help the quality of the hashing a bit.
14489
14490 * emacs.c: Integer overflow minor fix.
14491 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14492 Define only if GNU_LINUX.
14493 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14494
14495 * dispnew.c: Integer signedness and overflow fixes.
14496 Remove unnecessary forward decls, that were a maintenance hassle.
14497 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14498 All uses changed.
14499 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14500 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14501 (prepare_desired_row, line_draw_cost):
14502 Use int, not unsigned, where either works.
14503 (save_current_matrix, restore_current_matrix):
14504 Use ptrdiff_t, not size_t, where either works.
14505 (init_display): Check for overflow more accurately, and without
14506 relying on undefined behavior.
14507
14508 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14509 Remove, replacing with the new symbols in lisp.h. All uses changed.
14510 * fileio.c (make_temp_name):
14511 * filelock.c (lock_file_1, lock_file):
14512 * xdisp.c (message_dolog):
14513 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14514 Use pMd etc. instead.
14515 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14516 replacing the pWIDE etc. symbols removed from editfns.c.
14517
14518 * keyboard.h (num_input_events): Now uintmax_t.
14519 This is (very slightly) less likely to mess up due to wraparound.
14520 All uses changed.
14521
14522 * buffer.c: Integer signedness fixes.
14523 (alloc_buffer_text, enlarge_buffer_text):
14524 Use ptrdiff_t rather than size_t when either will do, as we prefer
14525 signed integers.
14526
14527 * alloc.c: Integer signedness and overflow fixes.
14528 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14529 (__malloc_size_t): Default to size_t, not to int.
14530 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14531 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14532 Prefer ptrdiff_t to size_t when either would do, as we prefer
14533 signed integers.
14534 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14535 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14536 Now const. Initialize with values that are in range even if char
14537 is signed.
14538 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14539 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14540 These functions do the right thing with sizes > 2**32.
14541 (check_depth): Now ptrdiff_t, not int.
14542 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14543 Adjust to new way of storing sizes. Check for size overflow bugs
14544 in rest of code.
14545 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14546 slightly wrong anyway, as it missed one instance of
14547 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14548 (refill_memory_reserve): Omit needless cast to size_t.
14549 (mark_object_loop_halt): Mark as externally visible.
14550
14551 * xselect.c: Integer signedness and overflow fixes.
14552 (Fx_register_dnd_atom, x_handle_dnd_message):
14553 Use ptrdiff_t, not size_t, since we prefer signed.
14554 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14555 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14556 x_dnd_atoms_size and x_dnd_atoms_length.
14557
14558 * doprnt.c: Prefer signed to unsigned when either works.
14559 * eval.c (verror):
14560 * doprnt.c (doprnt):
14561 * lisp.h (doprnt):
14562 * xdisp.c (vmessage):
14563 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14564 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14565 prefer signed arithmetic to avoid comparison confusion.
14566 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14567 but is a bit tricky.
14568
14569 Assume freestanding C89 headers, string.h, stdlib.h.
14570 * data.c, doprnt.c, floatfns.c, print.c:
14571 Include float.h unconditionally.
14572 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14573 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14574 * regex.c: Likewise for stddef.h, string.h.
14575 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14576 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14577 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14578 (STDC_HEADERS): Remove obsolete defines.
14579 * sysdep.c: Include limits.h unconditionally.
14580
14581 Assume support for memcmp, memcpy, memmove, memset.
14582 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14583 * regex.c (memcmp, memcpy):
14584 Remove; we assume C89 now.
14585
14586 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14587 (__malloc_safe_bcopy): Remove; no longer needed.
14588
14589 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14590 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14591 well either way, and we prefer signed to unsigned.
14592
14593 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14594
14595 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14596 closes the connection while we're reading (bug#9182).
14597
14598 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14599
14600 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14601 are specified (Bug#9168).
14602
14603 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14604
14605 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14606 Found by GCC static checking and --with-wide-int on a 32-bit host.
14607
14608 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14609
14610 * xdisp.c (compute_display_string_pos): Fix logic of caching
14611 previous display string position. Initialize cached_prev_pos to
14612 -1. Fixes slow-down at the beginning of a buffer.
14613
14614 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14615
14616 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14617 for attrs[LFACE_FONTSET_INDEX].
14618
14619 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14620
14621 * xml.c (parse_region): Remove unused local
14622 that was recently introduced.
14623
14624 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14625
14626 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14627 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14628
14629 * xdisp.c (move_it_in_display_line_to): Record the best matching
14630 position for TO_CHARPOS while scanning the line, and restore it on
14631 exit if none of the characters scanned was an exact match.
14632 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14633 when exact match is impossible due to invisible text, and the
14634 lines are truncated.
14635
14636 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14637
14638 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14639 for OSX >= 10.7.
14640
14641 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14642
14643 Fix a significant slow-down of cursor motion with C-n, C-p,
14644 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14645 auto-repeat under bidi redisplay in fontified buffers.
14646 * xdisp.c (compute_stop_pos_backwards): New function.
14647 (next_element_from_buffer): Call compute_stop_pos_backwards to
14648 find a suitable prev_stop when we find ourselves before
14649 base_level_stop.
14650 (reseat): Don't look for prev_stop, as that could mean a very long
14651 run.
14652 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14653 <cached_disp_overlay_modiff>: Cache for last found display string
14654 position.
14655 (compute_display_string_pos): Return the cached position if asked
14656 about the same buffer in the same area of character positions, and
14657 the buffer wasn't changed since the time the display string
14658 position was cached.
14659
14660 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14661
14662 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14663 is an integer, which is important for empty lines. (Bug#9149)
14664
14665 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14666
14667 * frame.c (Fmodify_frame_parameters): In tty case, update the
14668 default face if necessary (Bug#4238).
14669
14670 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14671
14672 * editfns.c (Fstring_to_char): No need to explain what a character
14673 is in the docstring (Bug#6576).
14674
14675 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14676
14677 * xml.c (parse_region): Make sure we always return a tree.
14678
14679 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14680
14681 * xml.c (parse_region): If a document contains only comments,
14682 return that, too.
14683
14684 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14685
14686 * xml.c (make_dom): Return comments, too.
14687
14688 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 Port to OpenBSD.
14691 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14692 and the surrounding thread.
14693 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14694 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14695 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14696 timer goes off.
14697 * s/openbsd.h (BROKEN_SIGIO): Define.
14698 * unexelf.c (unexec) [__OpenBSD__]:
14699 Don't update the .mdebug section of the Alpha COFF symbol table.
14700
14701 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14702
14703 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14704 (bug#8460).
14705
14706 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14707
14708 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14709 This fixes some race conditions on the permissions of any newly
14710 created file.
14711
14712 * alloc.c (valid_pointer_p): Use pipe, not open.
14713 This fixes some permissions issues when debugging.
14714
14715 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14716 If fchown fails to set both uid and gid, try to set just gid,
14717 as that is sometimes allowed. Adjust the file's mode to eliminate
14718 setuid or setgid bits that are inappropriate if fchown fails.
14719
14720 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14721
14722 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14723 to compare Lisp_Objects.
14724 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14725 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14726 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14727
14728 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14729
14730 * lread.c (read_integer): Unread even EOF character.
14731 (read1): Likewise. Properly record start position of symbol.
14732
14733 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14734 symbol character follows.
14735
14736 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14737
14738 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14739 This works around a problem with the previous change to Fcopy_file.
14740 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14741 and without this change, GCC might complain about discarding
14742 fchown's return value.
14743
14744 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14745
14746 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14747
14748 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14749
14750 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14751
14752 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14753
14754 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14755 it's used from the C level.
14756
14757 * process.c: Use the same condition for POLL_FOR_INPUT in both
14758 keyboard.c and process.c (bug#1858).
14759
14760 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14761
14762 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14763 (Fgnutls_boot): Use it.
14764
14765 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14766
14767 * doc.c (Fsubstitute_command_keys): Revert last change.
14768
14769 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14770
14771 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14772 quotes the next character, and doesn't affect other longer
14773 sequences (bug#8935).
14774
14775 * lread.c (syms_of_lread): Clarify that is isn't only
14776 `eval-buffer' and `eval-defun' that's affected by
14777 `lexical-binding' (bug#8460).
14778
14779 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14780
14781 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14782 bidi redisplay when a line includes both an image and is truncated.
14783
14784 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14785
14786 Fix minor problems found by static checking.
14787 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14788 (elsz): Now a signed constant, not a size_t var. We prefer signed
14789 types to unsigned, to avoid integer comparison confusion. Without
14790 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14791 "cannot optimize loop, the loop counter may overflow", a symptom
14792 of the confusion.
14793 * indent.c (Fvertical_motion): Mark locals as initialized.
14794 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14795
14796 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14797
14798 * search.c (Fre_search_backward): Mention `case-fold-search' in
14799 all the re_search_* functions (bug#8138).
14800
14801 * keyboard.c (Fopen_dribble_file): Document when the file is
14802 closed (bug#8056).
14803
14804 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14805
14806 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14807 bidi_cache_idx.
14808
14809 Support bidi reordering of display and overlay strings.
14810 * xdisp.c (compute_display_string_pos)
14811 (compute_display_string_end): Accept additional argument STRING.
14812 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14813 (reseat_to_string): Initialize bidi_it->string.s and
14814 bidi_it->string.schars.
14815 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14816 NULL (avoids a crash in bidi_paragraph_init).
14817 Initialize itb.string.lstring.
14818 (init_iterator): Call bidi_init_it only of a valid
14819 buffer position was specified. Initialize paragraph_embedding to
14820 L2R.
14821 (reseat_to_string): Initialize the bidi iterator.
14822 (display_string): If we need to ignore text properties of
14823 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14824 original value of -1 will not work with bidi.)
14825 (compute_display_string_pos): First arg is now struct
14826 `text_pos *'; all callers changed. Support display properties on
14827 Lisp strings.
14828 (compute_display_string_end): Support display properties on Lisp
14829 strings.
14830 (init_iterator, reseat_1, reseat_to_string): Initialize the
14831 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14832 when iterating on a string not from display properties).
14833 (compute_display_string_pos, compute_display_string_end):
14834 Fix calculation of the object to scan. Fixes an error when using
14835 arrow keys.
14836 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14837 base_level_stop; instead, set base_level_stop to BEGV.
14838 Fixes crashes in vertical-motion.
14839 (next_element_from_buffer): Improve commentary for when
14840 the iterator is before prev_stop.
14841 (init_iterator): Initialize bidi_p from the default value of
14842 bidi-display-reordering, not from buffer-local value. Use the
14843 buffer-local value only if initializing for buffer iteration.
14844 (handle_invisible_prop): Support invisible properties on strings
14845 that are being bidi-reordered.
14846 (set_iterator_to_next): Support bidi reordering of C strings and
14847 Lisp strings.
14848 (next_element_from_string): Support bidi reordering of Lisp
14849 strings.
14850 (handle_stop_backwards): Support Lisp strings as well.
14851 (display_string): Support display of R2L glyph rows.
14852 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14853 (init_iterator): Don't initialize it->bidi_p for strings
14854 here.
14855 (reseat_to_string): Initialize it->bidi_p for strings here.
14856 (next_element_from_string, next_element_from_c_string)
14857 (next_element_from_buffer): Add xassert's for correspondence
14858 between IT's object being iterated and it->bidi_it.string
14859 structure.
14860 (face_before_or_after_it_pos): Support bidi iteration.
14861 (next_element_from_c_string): Handle the case of the first string
14862 character that is not the first one in the visual order.
14863 (get_visually_first_element): New function, refactored from common
14864 parts of next_element_from_buffer, next_element_from_string, and
14865 next_element_from_c_string.
14866 (tool_bar_lines_needed, redisplay_tool_bar)
14867 (display_menu_bar): Force left-to-right direction. Add a FIXME
14868 comment for making that be controlled by a user option.
14869 (push_it, pop_it): Save and restore the state of the
14870 bidi iterator. Save and restore the bidi_p flag.
14871 (pop_it): Iterate out of display property for string iteration as
14872 well.
14873 (iterate_out_of_display_property): Support iteration over strings.
14874 (handle_single_display_spec): Set up it->bidi_it for iteration
14875 over a display string, and call bidi_init_it.
14876 (handle_single_display_spec, next_overlay_string)
14877 (get_overlay_strings_1, push_display_prop): Set up the bidi
14878 iterator for displaying display or overlay strings.
14879 (forward_to_next_line_start): Don't use the shortcut if
14880 bidi-iterating.
14881 (back_to_previous_visible_line_start): If handle_display_prop
14882 pushed the iterator stack, restore the internal state of the bidi
14883 iterator by calling bidi_pop_it same number of times.
14884 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14885 and we are bidi-iterating, don't decrement the iterator position;
14886 instead, set the first_elt flag in the bidi iterator, to produce
14887 the same effect.
14888 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14889 (push_display_prop): xassert that we are iterating a buffer.
14890 (push_it, pop_it): Save and restore paragraph_embedding member.
14891 (handle_single_display_spec, next_overlay_string)
14892 (get_overlay_strings_1, reseat_1, reseat_to_string)
14893 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14894 correctly. Don't assume unibyte strings are not bidi-reordered.
14895 (compute_display_string_pos)
14896 (compute_display_string_end): Fix handling the case of C string.
14897 (push_it, pop_it): Save and restore from_disp_prop_p.
14898 (handle_single_display_spec, push_display_prop): Set the
14899 from_disp_prop_p flag.
14900 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14901 (pop_it): Call iterate_out_of_display_property only if we are
14902 popping after iteration over a string that came from a display
14903 property. Fix a typo in popping stretch info. Add an assertion
14904 for verifying that the iterator position is in sync with the bidi
14905 iterator.
14906 (handle_single_display_spec, get_overlay_strings_1)
14907 (push_display_prop): Fix initialization of paragraph direction for
14908 string when that of the parent object is not yet determined.
14909 (reseat_1): Call bidi_init_it to resync the bidi
14910 iterator with IT's position. (Bug#7616)
14911 (find_row_edges): If ROW->start.pos gives position
14912 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14913 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14914 Reset the from_disp_prop_p flag.
14915 (SAVE_IT, RESTORE_IT): New macros.
14916 (pos_visible_p, face_before_or_after_it_pos)
14917 (back_to_previous_visible_line_start)
14918 (move_it_in_display_line_to, move_it_in_display_line)
14919 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14920 (try_scrolling, redisplay_window, display_line): Use them when
14921 saving a temporary copy of the iterator and restoring it back.
14922 (back_to_previous_visible_line_start, reseat_1)
14923 (init_iterator): Empty the bidi cache "stack".
14924 (move_it_in_display_line_to): If iterator ended up at
14925 EOL, but we never saw any buffer positions smaller than
14926 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14927 motion in bidi-reordered lines.
14928 (move_it_in_display_line_to): Record prev_method and prev_pos
14929 immediately before the call to set_iterator_to_next. Fixes cursor
14930 motion in bidi-reordered lines with stretch glyphs and strings
14931 displayed in margins. (Bug#8133) (Bug#8867)
14932 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14933 TO_CHARPOS.
14934 (pos_visible_p): Support positions in bidi-reordered lines.
14935 Save and restore bidi cache.
14936
14937 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14938 (bidi_paragraph_info): Delete unused struct.
14939 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14940 (bidi_cache_start): New variable.
14941 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14942 to zero.
14943 (bidi_cache_fetch_state, bidi_cache_search)
14944 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14945 (bidi_cache_find, bidi_peek_at_next_level)
14946 (bidi_level_of_next_char, bidi_find_other_level_edge)
14947 (bidi_move_to_visually_next): Compare cache index with
14948 bidi_cache_start rather than with zero.
14949 (bidi_fetch_char): Accept new argument STRING; all callers
14950 changed. Support iteration over a string. Support strings with
14951 display properties. Support unibyte strings. Fix the type of
14952 `len' according to what STRING_CHAR_AND_LENGTH expects.
14953 (bidi_paragraph_init, bidi_resolve_explicit_1)
14954 (bidi_resolve_explicit, bidi_resolve_weak)
14955 (bidi_level_of_next_char, bidi_move_to_visually_next):
14956 Support iteration over a string.
14957 (bidi_set_sor_type, bidi_resolve_explicit_1)
14958 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14959 can now be zero (for strings); special values 0 and -1 were
14960 changed to -1 and -2, respectively.
14961 (bidi_char_at_pos): New function.
14962 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14963 Call it instead of FETCH_MULTIBYTE_CHAR.
14964 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14965 initialized to valid values.
14966 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14967 values.
14968 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14969 the test for valid cached positions. Fix the logic for looking up
14970 the sentinel state in the cache. GCPRO the Lisp string we are
14971 iterating.
14972 (bidi_push_it, bidi_pop_it): New functions.
14973 (bidi_initialize): Initialize the bidi cache start stack pointer.
14974 (bidi_cache_ensure_space): New function, refactored from part of
14975 bidi_cache_iterator_state. Don't assume the required size is just
14976 one BIDI_CACHE_CHUNK away.
14977 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14978 (bidi_count_bytes, bidi_char_at_pos): New functions.
14979 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14980 always valid if bidi_cache_idx is valid.
14981 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14982 is valid if it's going to be used.
14983 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14984 (bidi_cache_fetch_state, bidi_cache_search)
14985 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14986 (bidi_cache_iterator_state, bidi_cache_find)
14987 (bidi_find_other_level_edge, bidi_cache_start_stack):
14988 All variables related to cache indices are now EMACS_INT.
14989
14990 * dispextern.h (struct bidi_string_data): New structure.
14991 (struct bidi_it): New member `string'. Make flag members be 1-bit
14992 fields, and put them last in the struct.
14993 (compute_display_string_pos, compute_display_string_end):
14994 Update prototypes.
14995 (bidi_push_it, bidi_pop_it): Add prototypes.
14996 (struct iterator_stack_entry): New members bidi_p,
14997 paragraph_embedding, and from_disp_prop_p.
14998 (struct it): Member bidi_p is now a bit field 1 bit wide.
14999 (bidi_shelve_cache, bidi_unshelve_cache):
15000 Declare prototypes.
15001
15002 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15003 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15004 and vector-like objects.
15005
15006 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15007 cache around display iteration.
15008
15009 * window.c (Fwindow_end, window_scroll_pixel_based)
15010 (displayed_window_lines, Frecenter): Save and restore the bidi
15011 cache around display iteration.
15012
15013 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15014
15015 * editfns.c (Fdelete_region): Clarify the use of the named
15016 parameters (bug#6788).
15017
15018 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15019
15020 * indent.c (Fvertical_motion): Set and restore w->pointm when
15021 saving and restoring the window's buffer (Bug#9006).
15022
15023 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15024
15025 * editfns.c (Fstring_to_char): Clarify just what is returned
15026 (bug#6576). Text by Eli Zaretskii.
15027
15028 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15029
15030 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15031
15032 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15033
15034 * buffer.c (mmap_find): Fix a typo.
15035
15036 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15037
15038 Fix execution of x selection hooks.
15039 * xselect.c (Qx_lost_selection_functions)
15040 (Qx_sent_selection_functions): New vars.
15041 (syms_of_xselect): DEFSYM them.
15042 (x_handle_selection_request): Pass Qx_sent_selection_functions
15043 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15044 (x_handle_selection_clear,x_clear_frame_selections):
15045 Pass Qx_lost_selection_functions rather than
15046 Vx_lost_selection_functions to Frun_hook_with_args.
15047
15048 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15049
15050 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15051 The old code sometimes used this field without initializing it.
15052
15053 * alloc.c (gc_sweep): Don't read past end of array.
15054 In theory, the old code could also have corrupted Emacs internals,
15055 though it'd be very unlikely.
15056
15057 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15058
15059 * character.c (Fcharacterp): Don't advertise optional ignored
15060 argument. (Bug#4026)
15061
15062 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15063
15064 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15065 key" (bug#4257).
15066
15067 * window.c (Fset_window_start): Doc fix (bug#4199).
15068 (Fset_window_hscroll): Ditto.
15069
15070 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15071
15072 Fix minor new problems caught by GCC 4.6.1.
15073 * term.c (init_tty): Remove unused local.
15074 * xsettings.c (store_monospaced_changed): Define this function only
15075 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15076 not used otherwise.
15077
15078 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15079
15080 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15081
15082 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15083
15084 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15085 are the mini-buffer and the echo area (bug#3320).
15086
15087 * term.c (init_tty): Remove support for supdup, c10 and perq
15088 terminals, which are no longer supported (bug#1482).
15089
15090 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15091
15092 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15093
15094 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15095
15096 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15097 for non-popups (Bug#3642).
15098
15099 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15100
15101 * alloc.c (reset_malloc_hooks): Protoize.
15102 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15103 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15104 * cm.c (losecursor): Likewise.
15105 * data.c (fmod): Likewise.
15106 * dispnew.c (swap_glyphs_in_rows): Likewise.
15107 * emacs.c (memory_warning_signal): Likewise.
15108 * floatfns.c (float_error): Likewise.
15109 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15110 (otf_open, font_otf_capability, generate_otf_features)
15111 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15112 Likewise.
15113 * image.c (pbm_read_file): Likewise.
15114 * indent.c (string_display_width): Likewise.
15115 * intervals.c (check_for_interval, search_for_interval)
15116 (inc_interval_count, count_intervals, root_interval)
15117 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15118 * lread.c (defalias): Likewise.
15119 * ralloc.c (r_alloc_check): Likewise.
15120 * regex.c (set_image_of_range_1, set_image_of_range)
15121 (regex_grow_registers): Likewise.
15122 * sysdep.c (strerror): Likewise.
15123 * termcap.c (valid_filename_p, tprint, main): Likewise.
15124 * tparam.c (main): Likewise.
15125 * unexhp9k800.c (run_time_remap, save_data_space)
15126 (update_file_ptrs, read_header, write_header, calculate_checksum)
15127 (copy_file, copy_rest, display_header): Likewise.
15128 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15129 Likewise.
15130 * xdisp.c (check_it): Likewise.
15131 * xfaces.c (register_color, unregister_color, unregister_colors):
15132 Likewise.
15133 * xfns.c (print_fontset_result): Likewise.
15134 * xrdb.c (member, fatal, main): Likewise.
15135
15136 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15137
15138 Fix minor problems found by static checking (Bug#9031).
15139 * chartab.c (char_table_set_range, map_sub_char_table):
15140 Remove unused locals.
15141 (uniprop_table): Now static.
15142 * composite.c (_work_char): Remove unused static var.
15143
15144 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15145
15146 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15147
15148 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15149
15150 * gtkutil.c (qttip_cb): Remove code without function.
15151
15152 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15153
15154 * w32.c (pthread_sigmask): New stub.
15155
15156 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15157
15158 Use pthread_sigmask, not sigprocmask (Bug#9010).
15159 sigprocmask is portable only for single-threaded applications, and
15160 Emacs can be multi-threaded when it uses GTK.
15161 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15162 (LIBES): Use it.
15163 * callproc.c (Fcall_process):
15164 * process.c (create_process):
15165 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15166 Use pthread_sigmask, not sigprocmask.
15167
15168 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15169
15170 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15171 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15172 wrong (Bug#8591).
15173
15174 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15175
15176 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15177 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15178 (xg_hide_tooltip): Fix comment.
15179
15180 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15181 in registerServicesMenuSendTypes.
15182 (validRequestorForSendType): Don't check ns_return_types.
15183
15184 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15185 ns_return_type.
15186
15187 2011-07-08 Jason Rumney <jasonr@gnu.org>
15188
15189 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15190 SH_SHOW for hidden windows (Bug#5482).
15191
15192 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15193 frame struct members of non-existent frames (Bug#6284).
15194
15195 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15196
15197 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15198 variable firstTime not needed on OSX >= 10.6.
15199 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15200 >= 10.5. Use setKnobProportion, setDoubleValue.
15201
15202 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15203 (MAC_OS_X_VERSION_10_5): Define if not defined.
15204 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15205 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15206 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15207
15208 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15209 cString and lossyCString on OSX >= 10.4.
15210
15211 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15212 sizeToFit on OSX >= 10.2.
15213
15214 * nsimage.m (allocInitFromFile): Don't use deprecated method
15215 bestRepresentationForDevice on OSX >= 10.6.
15216
15217 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15218 to avoid warning.
15219
15220 * emacs.c: Declare unexec_init_emacs_zone.
15221
15222 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15223
15224 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15225
15226 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15227 on svcsMenu (Bug#8842).
15228
15229 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15230 ns_return_types.
15231 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15232
15233 * nsterm.m (QUTF8_STRING): Declare.
15234 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15235 (validRequestorForSendType): Return type is (id).
15236 Change indexOfObjectIdenticalTo to indexOfObject.
15237 Check if we have local selection before returning self (Bug#8842).
15238 (writeSelectionToPasteboard): Put local selection into paste board
15239 if we have a local selection (Bug#8842).
15240 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15241
15242 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15243 (ns_get_local_selection): Declare.
15244
15245 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15246
15247 * keymap.c (describe_map_tree): Don't insert a double newline at
15248 the end of the buffer (bug#1169) and return whether we inserted
15249 something.
15250
15251 * callint.c (Fcall_interactively): Change "reading args" to
15252 "providing args" to try to clarify what it does (bug#1010).
15253
15254 2011-07-07 Kenichi Handa <handa@m17n.org>
15255
15256 * composite.c (composition_compute_stop_pos): Ignore a static
15257 composition starting before CHARPOS (Bug#8915).
15258
15259 * xdisp.c (handle_composition_prop): Likewise.
15260
15261 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15262
15263 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15264 (Bug#9015)
15265
15266 2011-07-07 Kenichi Handa <handa@m17n.org>
15267
15268 * character.h (unicode_category_t): New enum type.
15269
15270 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15271 (Qchar_code_property_table): New variable.
15272 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15273 (UNIPROP_COMPRESSED_FORM_P): New macros.
15274 (char_table_ascii): Uncompress the compressed values.
15275 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15276 Uncompress the compressed values.
15277 (sub_char_table_ref_and_range): Likewise.
15278 (char_table_ref_and_range): Uncompress the compressed values.
15279 (sub_char_table_set): New arg is_uniprop. Callers changed.
15280 Uncompress the compressed values.
15281 (sub_char_table_set_range): Args changed. Callers changed.
15282 (char_table_set_range): Adjuted for the above change.
15283 (map_sub_char_table): Delete args default_val and parent. Add arg
15284 top. Give decoded values to a Lisp function.
15285 (map_char_table): Adjust for the above change. Give decoded
15286 values to a Lisp function. Gcpro more variables.
15287 (uniprop_table_uncompress)
15288 (uniprop_decode_value_run_length): New functions.
15289 (uniprop_decoder, uniprop_decoder_count): New variables.
15290 (uniprop_get_decoder, uniprop_encode_value_character)
15291 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15292 New functions.
15293 (uniprop_encoder, uniprop_encoder_count): New variables.
15294 (uniprop_get_encoder, uniprop_table)
15295 (Funicode_property_table_internal, Fget_unicode_property_internal)
15296 (Fput_unicode_property_internal): New functions.
15297 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15298 Sunicode_property_table_internal, Sget_unicode_property_internal,
15299 and Sput_unicode_property_internal. Defvar_lisp
15300 char-code-property-alist.
15301
15302 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15303 Vunicode_category_table.
15304
15305 * font.c (font_range): Adjust for the change of
15306 Vunicode_category_table.
15307
15308 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15309
15310 * m/iris4d.h: Remove file, move contents ...
15311 * s/irix6-5.h: ... here.
15312
15313 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15314
15315 Remove unportable assumption about struct layout (Bug#8884).
15316 * alloc.c (mark_buffer):
15317 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15318 (clone_per_buffer_values): Don't assume that
15319 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15320 This isn't true in general, and it's particularly not true
15321 if Emacs is configured with --with-wide-int.
15322 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15323 New macros, used in the buffer.c change.
15324
15325 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15326
15327 * xsettings.c: Use both GConf and GSettings if both are available.
15328 (store_config_changed_event): Add comment.
15329 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15330 (store_tool_bar_style_changed): New functions.
15331 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15332 (struct xsettings): Move font inside HAVE_XFT.
15333 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15334 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15335 Move inside HAVE_XFT.
15336 (something_changed_gsettingsCB): Rename from something_changedCB.
15337 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15338 also.
15339 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15340 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15341 (something_changed_gconfCB): Rename from something_changedCB.
15342 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15343 (parse_settings): Move check for font inside HAVE_XFT.
15344 (read_settings, apply_xft_settings): Add comment.
15345 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15346 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15347 call store_font_name_changed.
15348 (xft_settings_event): Add comment.
15349 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15350 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15351 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15352 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15353 (xsettings_initialize): Call init_gsettings last.
15354 (xsettings_get_system_font, xsettings_get_system_normal_font):
15355 Add comment.
15356
15357 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15358
15359 Random fixes. E.g., (random) never returned negative values.
15360 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15361 subseconds part to the entropy, as that's a bit more random.
15362 Prefer signed to unsigned, since the signedness doesn't matter and
15363 in general we prefer signed. When given a limit, use a
15364 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15365 latter isn't right if USE_2_TAGS_FOR_INTS.
15366 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15367 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15368
15369 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15370
15371 * textprop.c (text_property_stickiness):
15372 Obey Vtext_property_default_nonsticky.
15373 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15374 * w32fns.c (syms_of_w32fns):
15375 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15376
15377 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15378
15379 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15380 This is more efficient than Ffile_directory_p and avoids a minor race.
15381
15382 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15383
15384 * buffer.c (Foverlay_put): Say what the return value is
15385 (bug#7835).
15386
15387 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15388 is a directory before asking whether to use the file name
15389 (bug#7564).
15390 (barf_or_query_if_file_exists): Make the "File is a directory"
15391 error be more correct.
15392
15393 * fns.c (Frequire): Remove the mention of the .gz files, since
15394 that's installation-specific, but keep the mention of
15395 `get-load-suffixes'.
15396
15397 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15398
15399 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15400 Report string overflow if the output is too long.
15401
15402 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15403
15404 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15405 (syms_of_gnutls): Remove duplicate DEFSYM for
15406 Qgnutls_bootprop_verify_hostname_error, an error for
15407 Qgnutls_bootprop_verify_error (which is no longer used).
15408
15409 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15410 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15411 Also (re)move comments that are misplaced or no longer relevant.
15412
15413 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15414
15415 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15416
15417 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15418
15419 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15420 and background color parameters if they have been changed.
15421
15422 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15423
15424 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15425
15426 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15427
15428 * xsettings.c (SYSTEM_FONT): Define only when used.
15429 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15430
15431 * keymap.c (access_keymap_1): Now static.
15432
15433 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15434
15435 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15436 leave any prefix arg for the up event (Bug#1586).
15437
15438 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15439
15440 * lread.c (syms_of_lread): Mention single symbols defined by
15441 `defvar' or `defconst' (bug#7154).
15442
15443 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15444 (Frequire): Mention get-load-suffixes.
15445
15446 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15447
15448 * window.h (window): Remove clone_number slot.
15449 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15450 Remove.
15451 (make_parent_window, make_window, saved_window)
15452 (Fset_window_configuration, save_window_save): Don't deal with
15453 clone numbers.
15454 * buffer.c (Qclone_number): Remove declaration.
15455 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15456
15457 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15458
15459 Add multiple inheritance to keymaps.
15460 * keymap.c (Fmake_composed_keymap): New function.
15461 (Fset_keymap_parent): Simplify.
15462 (fix_submap_inheritance): Remove.
15463 (access_keymap_1): New function extracted from access_keymap to handle
15464 embedded parents and handle lists of maps.
15465 (access_keymap): Use it.
15466 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15467 (Fcopy_keymap): Handle embedded parents.
15468 (Fcommand_remapping, define_as_prefix): Simplify.
15469 (Fkey_binding): Simplify.
15470 (syms_of_keymap): Move minibuffer-local-completion-map,
15471 minibuffer-local-filename-completion-map,
15472 minibuffer-local-must-match-map, and
15473 minibuffer-local-filename-must-match-map to Elisp.
15474 (syms_of_keymap): Defsubr make-composed-keymap.
15475 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15476 (parse_menu_item): Trivial simplification.
15477
15478 2011-07-01 Glenn Morris <rgm@gnu.org>
15479
15480 * Makefile.in (SETTINGS_LIBS): Fix typo.
15481
15482 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15483
15484 * coding.c (Fencode_coding_string): Record the last coding system
15485 used, as the function doc string says (bug#8738).
15486
15487 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15488
15489 * xsettings.c (store_monospaced_changed): Take new font as arg and
15490 check for change against current_mono_font.
15491 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15492 (emacs_settings_constructor, emacs_settings_get_property)
15493 (emacs_settings_set_property, emacs_settings_class_init)
15494 (emacs_settings_init, gsettings_obj): Remove.
15495 (something_changedCB): New function for HAVE_GSETTINGS.
15496 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15497 with value as argument.
15498 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15499 g_settings_new (Bug#8967). Do not create gsettings_obj.
15500 Remove calls to g_settings_bind. Connect something_changedCB to
15501 "changed".
15502
15503 * xgselect.c: Add defined (HAVE_GSETTINGS).
15504 (xgselect_initialize): Ditto.
15505
15506 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15507 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15508 xg_select.
15509
15510 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15511
15512 * eval.c (struct backtrace): Simplify and port the data structure.
15513 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15514 signed bit field, as this assumption is not portable and it makes
15515 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15516 "char debug_on_exit : 1" as this is not portable either; instead,
15517 use the portable "unsigned int debug_on_exit : 1". Remove unused
15518 member evalargs. Remove obsolete comments about cc bombing out.
15519
15520 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15521
15522 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15523 Let HAVE_GSETTINGS override HAVE_GCONF.
15524 (store_monospaced_changed): New function.
15525 (EMACS_SETTINGS): A new type derived from GObject to handle
15526 GSettings notifications.
15527 (emacs_settings_constructor, emacs_settings_get_property)
15528 (emacs_settings_set_property, emacs_settings_class_init):
15529 New functions.
15530 (gsettings_client, gsettings_obj): New variables.
15531 (GSETTINGS_SCHEMA): New define.
15532 (something_changedCB): Call store_monospaced_changed.
15533 (init_gsettings): New function.
15534 (xsettings_initialize): Call init_gsettings.
15535 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15536 to NULL.
15537
15538 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15539 GCONF_CFLAGS/LIBS.
15540
15541 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15542
15543 * window.c (resize_root_window, grow_mini_window)
15544 (shrink_mini_window): Rename Qresize_root_window to
15545 Qwindow_resize_root_window and Qresize_root_window_vertically to
15546 Qwindow_resize_root_window_vertically.
15547
15548 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15549
15550 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15551
15552 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15553
15554 * makefile.w32-in: Redesign dependencies so they reflect more
15555 clearly which files are directly included by each source file,
15556 and not through other includes.
15557
15558 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15559
15560 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15561 (sort_overlays, overlay_strings): When an overlay's clone number
15562 matches the window's clone number process the overlay even if
15563 the overlay's window property doesn't match the current window.
15564
15565 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15566 (Fwindow_hchild): Rename to Fwindow_left_child.
15567 (Fwindow_next): Rename to Fwindow_next_sibling.
15568 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15569 (resize_window_check): Rename to window_resize_check.
15570 (resize_window_apply): Rename to window_resize_apply.
15571 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15572 (Fdelete_other_windows_internal, resize_frame_windows)
15573 (Fsplit_window_internal, Fdelete_window_internal)
15574 (grow_mini_window, shrink_mini_window)
15575 (Fresize_mini_window_internal): Fix callers accordingly.
15576
15577 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15578
15579 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15580 (emacs_fixed_set_min_size): Remove.
15581 (emacs_fixed_new): Take frame as argument.
15582
15583 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15584 (_EmacsFixedPrivate): Remove minwidth/height.
15585 Add struct frame *f.
15586 (emacs_fixed_init): Initialize priv->f.
15587 (get_parent_class, emacs_fixed_set_min_size): Remove.
15588 (emacs_fixed_new): Set priv->f to argument.
15589 (emacs_fixed_get_preferred_width)
15590 (emacs_fixed_get_preferred_height): Use min_width/height from
15591 frames size_hint to set minimum and natural (Bug#8919).
15592 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15593 and use min_width/height from frames size_hint to set
15594 min_width/height (Bug#8919).
15595
15596 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15597 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15598 Fix indentation.
15599
15600 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15601
15602 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15603 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15604 called at ZV.
15605
15606 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15607
15608 * process.c (wait_reading_process_output): Bypass select if
15609 waiting for a cell while ignoring keyboard input, and input is
15610 pending. Suggested by Jan Djärv (Bug#8869).
15611
15612 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15613
15614 Use gnulib's dup2 module instead of rolling our own.
15615 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15616
15617 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15618
15619 * dispnew.c (scrolling_window): Before scrolling, turn off a
15620 mouse-highlight in the window being scrolled.
15621
15622 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15623
15624 Move DEFSYM to lisp.h and use everywhere.
15625
15626 * character.h (DEFSYM): Move declaration...
15627 * lisp.h (DEFSYM): ...here.
15628
15629 * gnutls.c:
15630 * minibuf.c:
15631 * w32menu.c:
15632 * w32proc.c:
15633 * w32select.c: Don't include character.h.
15634
15635 * alloc.c (syms_of_alloc):
15636 * buffer.c (syms_of_buffer):
15637 * bytecode.c (syms_of_bytecode):
15638 * callint.c (syms_of_callint):
15639 * casefiddle.c (syms_of_casefiddle):
15640 * casetab.c (init_casetab_once):
15641 * category.c (init_category_once, syms_of_category):
15642 * ccl.c (syms_of_ccl):
15643 * cmds.c (syms_of_cmds):
15644 * composite.c (syms_of_composite):
15645 * dbusbind.c (syms_of_dbusbind):
15646 * dired.c (syms_of_dired):
15647 * dispnew.c (syms_of_display):
15648 * doc.c (syms_of_doc):
15649 * editfns.c (syms_of_editfns):
15650 * emacs.c (syms_of_emacs):
15651 * eval.c (syms_of_eval):
15652 * fileio.c (syms_of_fileio):
15653 * fns.c (syms_of_fns):
15654 * frame.c (syms_of_frame):
15655 * fringe.c (syms_of_fringe):
15656 * insdel.c (syms_of_insdel):
15657 * keymap.c (syms_of_keymap):
15658 * lread.c (init_obarray, syms_of_lread):
15659 * macros.c (syms_of_macros):
15660 * msdos.c (syms_of_msdos):
15661 * print.c (syms_of_print):
15662 * process.c (syms_of_process):
15663 * search.c (syms_of_search):
15664 * sound.c (syms_of_sound):
15665 * syntax.c (init_syntax_once, syms_of_syntax):
15666 * terminal.c (syms_of_terminal):
15667 * textprop.c (syms_of_textprop):
15668 * undo.c (syms_of_undo):
15669 * w32.c (globals_of_w32):
15670 * window.c (syms_of_window):
15671 * xdisp.c (syms_of_xdisp):
15672 * xfaces.c (syms_of_xfaces):
15673 * xfns.c (syms_of_xfns):
15674 * xmenu.c (syms_of_xmenu):
15675 * xsettings.c (syms_of_xsettings):
15676 * xterm.c (syms_of_xterm): Use DEFSYM.
15677
15678 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15679
15680 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15681
15682 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15683
15684 Integer and buffer overflow fixes (Bug#8873).
15685
15686 * print.c (printchar, strout): Check for string overflow.
15687 (PRINTPREPARE, printchar, strout):
15688 Don't set size unless allocation succeeds.
15689
15690 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15691 for sizes. Check for string overflow more accurately.
15692 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15693
15694 * macros.c: Integer and buffer overflow fixes.
15695 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15696 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15697 Use ptrdiff_t, not int, for sizes.
15698 Don't increment bufsize until after realloc succeeds.
15699 Check for size-calculation overflow.
15700 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15701
15702 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15703
15704 * lread.c: Integer overflow fixes.
15705 (read_integer): Radix is now EMACS_INT, not int,
15706 to improve quality of diagnostics for out-of-range radices.
15707 Calculate buffer size correctly for out-of-range radices.
15708 (read1): Check for integer overflow in radices, and in
15709 read-circle numbers.
15710 (read_escape): Avoid int overflow.
15711 (Fload, openp, read_buffer_size, read1)
15712 (substitute_object_recurse, read_vector, read_list, map_obarray):
15713 Use ptrdiff_t, not int, for sizes.
15714 (read1): Use EMACS_INT, not int, for sizes.
15715 Check for size overflow.
15716
15717 * image.c (cache_image): Check for size arithmetic overflow.
15718
15719 * lread.c: Integer overflow issues.
15720 (saved_doc_string_size, saved_doc_string_length)
15721 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15722 Now ptrdiff_t, not int.
15723 (read1): Don't assume doc string length fits in int. Check for
15724 out-of-range doc string lengths.
15725 (read_list): Don't assume file position fits in int.
15726 (read_escape): Check for hex character overflow.
15727
15728 2011-06-22 Leo Liu <sdl.web@gmail.com>
15729
15730 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15731 Move to minibuffer.el.
15732
15733 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15734
15735 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15736 The following patches are for when GLYPH_DEBUG && !XASSERT.
15737 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15738 * dispnew.c (flush_stdout):
15739 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15740 Mark as externally visible.
15741 * dispnew.c (check_window_matrix_pointers): Now static.
15742 * dispnew.c (window_to_frame_vpos):
15743 * xfns.c (unwind_create_frame):
15744 * xterm.c (x_check_font): Remove unused local.
15745 * scroll.c (CHECK_BOUNDS):
15746 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15747 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15748 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15749 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15750 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15751 Now static.
15752 (debug_method_add): Use va_list and vsprintf rather than relying
15753 on undefined behavior with wrong number of arguments.
15754 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15755 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15756 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15757 since we're not interested in debugging glyphs with old libraries.
15758 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15759 GCC 4.6.0's static checking.
15760
15761 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15762
15763 Integer overflow and signedness fixes (Bug#8873).
15764 A few related buffer overrun fixes, too.
15765
15766 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15767
15768 * dispextern.h (struct face.stipple):
15769 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15770 (x_bitmap_mask, x_allocate_bitmap_record)
15771 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15772 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15773 (x_create_bitmap_from_xpm_data):
15774 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15775 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15776 (.bitmaps_last):
15777 * xfaces.c (load_pixmap):
15778 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15779 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15780 (.bitmaps_last, struct x_output.icon_bitmap):
15781 Use ptrdiff_t, not int, for bitmap indexes.
15782 (x_allocate_bitmap_record): Check for size overflow.
15783 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15784
15785 Use ptrdiff_t, not int, for overlay counts.
15786 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15787 * editfns.c (overlays_around, get_pos_property):
15788 * textprop.c (get_char_property_and_overlay):
15789 * xdisp.c (next_overlay_change, note_mouse_highlight):
15790 * xfaces.c (face_at_buffer_position):
15791 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15792 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15793 (Fnext_overlay_change, Fprevious_overlay_change)
15794 (mouse_face_overlay_overlaps, Foverlays_in):
15795 Use ptrdiff_t, not int, for sizes.
15796 (overlays_at, overlays_in): Check for size-calculation overflow.
15797
15798 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15799
15800 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15801 (x_session_initialize): Do not assume string length fits in int.
15802
15803 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15804 This is unlikely, but can occur if DPI is outlandish.
15805
15806 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15807 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15808
15809 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15810 * xrdb.c (magic_file_p, search_magic_path):
15811 Omit last arg SUFFIX; it was always 0. All callers changed.
15812 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15813
15814 * xfont.c (xfont_match): Avoid need for strlen.
15815
15816 * xfns.c: Don't assume strlen fits in int.
15817 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15818
15819 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15820 not unsigned long, as we prefer signed integers. All callers changed.
15821 Detect integer overflow in repeat count.
15822 (message_dolog): Don't assume print length fits in 39 bytes.
15823 (display_mode_element): Don't assume strlen fits in int.
15824
15825 * termcap.c: Don't assume sizes fit in int and never overflow.
15826 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15827 (gobble_line): Check for size-calculation overflow.
15828
15829 * minibuf.c (Fread_buffer):
15830 * lread.c (intern, intern_c_string):
15831 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15832 Don't assume string length fits in int.
15833
15834 * keyboard.c (parse_tool_bar_item):
15835 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15836
15837 * font.c: Don't assume string length fits in int.
15838 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15839 Use ptrdiff_t, not int.
15840 (font_intern_prop): Don't assume string length fits in int.
15841 Don't assume integer property fits in fixnum.
15842 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15843
15844 * filelock.c: Fix some buffer overrun and integer overflow issues.
15845 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15846 Reformulate so as not to need the command string.
15847 Invoke gzip -cd rather than gunzip, as it's more portable.
15848 (lock_info_type, lock_file_1, lock_file):
15849 Don't assume pid_t and time_t fit in unsigned long.
15850 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15851 (current_lock_owner): Prefer signed type for sizes.
15852 Use memcpy, not strncpy, where memcpy is what is really wanted.
15853 Don't assume (via atoi) that time_t and pid_t fit in int.
15854 Check for time_t and/or pid_t out of range, e.g., via a network share.
15855 Don't alloca where an auto var works fine.
15856
15857 * fileio.c: Fix some integer overflow issues.
15858 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15859 Don't assume string length fits in int.
15860 (directory_file_name): Don't assume string length fits in long.
15861 (make_temp_name): Don't assume pid fits in int, or that its print
15862 length is less than 20.
15863
15864 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15865
15866 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15867
15868 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15869
15870 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15871 We prefer signed integers, even for size calculations.
15872
15873 * emacs.c: Don't assume string length fits in 'int'.
15874 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15875 (main): Don't invoke strlen when not needed.
15876
15877 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15878 (XD_DEBUG_MESSAGE): Don't waste a byte.
15879
15880 * callproc.c (getenv_internal_1, getenv_internal)
15881 (Fgetenv_internal):
15882 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15883
15884 * lread.c (invalid_syntax): Omit length argument.
15885 All uses changed. This doesn't fix a bug, but it simplifies the
15886 code away from its former Hollerith-constant appearance, and it's
15887 one less 'int' to worry about when looking at integer-overflow issues.
15888 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15889
15890 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15891 This didn't break anything, but it didn't help either.
15892 It's confusing to put a bogus integer in a place where the actual
15893 value does not matter.
15894 (LIST_END_P): Remove unused macro and its bogus comment.
15895 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15896
15897 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15898 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15899 implementation.
15900 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15901 We prefer signed types, and the value cannot exceed the EMACS_INT
15902 range anyway (because otherwise the length would not be representable).
15903 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15904 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15905 This avoids a GCC warning when WIDE_EMACS_INT.
15906
15907 * indent.c (sane_tab_width): New function.
15908 (current_column, scan_for_column, Findent_to, position_indentation)
15909 (compute_motion): Use it. This is just for clarity.
15910 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15911
15912 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15913
15914 * lisp.h (lint_assume): New macro.
15915 * composite.c (composition_gstring_put_cache):
15916 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15917
15918 * editfns.c, insdel.c:
15919 Omit unnecessary forward decls, to simplify future changes.
15920
15921 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15922
15923 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15924
15925 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15926 Use much-faster test for byte-length change.
15927 Don't assume string byte-length fits in 'int'.
15928 Check that character arg fits in 'int'.
15929 (mapcar1): Declare byte as byte, for clarity.
15930
15931 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15932
15933 * fns.c (concat): Catch string overflow earlier.
15934 Do not rely on integer wraparound.
15935
15936 * dispextern.h (struct it.overlay_strings_charpos)
15937 (struct it.selective): Now EMACS_INT, not int.
15938 * xdisp.c (forward_to_next_line_start)
15939 (back_to_previous_visible_line_start)
15940 (reseat_at_next_visible_line_start, next_element_from_buffer):
15941 Don't arbitrarily truncate the value of 'selective' to int.
15942
15943 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15944
15945 * composite.c: Don't truncate sizes to 'int'.
15946 (composition_gstring_p, composition_reseat_it)
15947 (composition_adjust_point): Use EMACS_INT, not int.
15948 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15949 not EMACS_UINT, for indexes.
15950
15951 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15952
15953 * buffer.c: Include <verify.h>.
15954 (struct sortvec.priority, struct sortstr.priority):
15955 Now EMACS_INT, not int.
15956 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15957 (struct sortstr.size, record_overlay_string)
15958 (struct sortstrlist.size, struct sortlist.used):
15959 Don't truncate size to int.
15960 (record_overlay_string): Check for size-calculation overflow.
15961 (init_buffer_once): Check at compile-time, not run-time.
15962
15963 2011-06-22 Jim Meyering <meyering@redhat.com>
15964
15965 Don't leak an XBM-image-sized buffer
15966 * image.c (xbm_load): Free the image buffer after using it.
15967
15968 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15969
15970 Port to Sun C.
15971 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15972 that Sun C diagnosed.
15973 * fns.c (secure_hash): Fix pointer signedness issue.
15974 * intervals.c (static_offset_intervals): New function.
15975 (offset_intervals): Use it.
15976
15977 2011-06-21 Leo Liu <sdl.web@gmail.com>
15978
15979 * deps.mk (fns.o):
15980 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15981 sha512.h.
15982
15983 * fns.c (secure_hash): Rename from crypto_hash_function and change
15984 the first arg to accept symbols.
15985 (Fsecure_hash): New primitive.
15986 (syms_of_fns): New symbols.
15987
15988 2011-06-20 Deniz Dogan <deniz@dogan.se>
15989
15990 * process.c (Fset_process_buffer): Clarify return value in
15991 docstring.
15992
15993 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15994
15995 * dispnew.c (add_window_display_history): Use BVAR.
15996
15997 * xdisp.c (debug_method_add): Use BVAR.
15998 (check_window_end, dump_glyph_matrix, dump_glyph)
15999 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16000
16001 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16002 Likewise.
16003
16004 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16005 check till after the cache is created in init_frame_faces.
16006
16007 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16008
16009 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16010
16011 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16012
16013 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16014 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16015 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16016
16017 Improve buffer-overflow checking (Bug#8873).
16018 * fileio.c (Finsert_file_contents):
16019 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16020 Remove the old (too-loose) buffer overflow checks.
16021 They weren't needed, since make_gap checks for buffer overflow.
16022 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16023 The old code merely checked for Emacs fixnum overflow, and relied
16024 on undefined (wraparound) behavior. The new code avoids undefined
16025 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16026
16027 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16028 Tune. Don't use wider integers than needed. Don't use alloca.
16029 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16030
16031 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16032
16033 * insdel.c, lisp.h (buffer_overflow): New function.
16034 (insert_from_buffer_1, replace_range, replace_range_2):
16035 * insdel.c (make_gap_larger):
16036 * editfns.c (Finsert_char):
16037 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16038
16039 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16040
16041 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16042
16043 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16044
16045 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16046 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16047
16048 * fileio.c: Don't assume EMACS_INT fits in off_t.
16049 (emacs_lseek): New static function.
16050 (Finsert_file_contents, Fwrite_region): Use it.
16051 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16052
16053 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16054
16055 * fns.c: Don't overflow int when computing a list length.
16056 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16057 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16058 truncation on 64-bit hosts. Check for QUIT every
16059 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16060 faster and is responsive enough.
16061 (Flength): Report an error instead of overflowing an integer.
16062 (Fsafe_length): Return a float if the value is not representable
16063 as a fixnum. This shouldn't happen except in contrived situations.
16064 (Fnthcdr, Fsort): Don't assume list length fits in int.
16065 (Fcopy_sequence): Don't assume vector length fits in int.
16066
16067 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16068 (header_size, word_size): New constants.
16069 (allocate_vectorlike): Don't check size overflow here.
16070 (allocate_vector): Check it here instead, since this is the only
16071 caller of allocate_vectorlike that could cause overflow.
16072 Check that the new vector's length is representable as a fixnum.
16073
16074 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16075 The previous code was bogus. For example, next_almost_prime (32)
16076 returned 39, which is undesirable as it is a multiple of 3; and
16077 next_almost_prime (24) returned 25, which is a multiple of 5 so
16078 why was the code bothering to check for multiples of 7?
16079
16080 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16081
16082 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16083
16084 Variadic C functions now count arguments with ptrdiff_t.
16085 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16086 Back then I didn't know that the Emacs coding style prefers signed int.
16087 Also, in the meantime I found a few more instances where arguments
16088 were being counted with int, which may truncate counts on 64-bit
16089 machines, or EMACS_INT, which may be unnecessarily wide.
16090 * lisp.h (struct Lisp_Subr.function.aMANY)
16091 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16092 Arg counts are now ptrdiff_t, not size_t.
16093 All variadic functions and their callers changed accordingly.
16094 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16095 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16096 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16097 * callint.c (Fcall_interactively): Check arg count for overflow,
16098 to avoid potential buffer overrun. Use signed char, not 'int',
16099 for 'varies' array, so that we needn't bother to check its size
16100 calculation for overflow.
16101 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16102 * eval.c (apply_lambda):
16103 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16104 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16105 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16106
16107 * callint.c (Fcall_interactively): Don't use index var as event count.
16108
16109 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16110 * mem-limits.h (SIZE): Remove; no longer used.
16111
16112 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16113
16114 Remove unnecessary casts.
16115 * xterm.c (x_term_init):
16116 * xfns.c (x_set_border_pixel):
16117 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16118 These aren't needed now that we assume ANSI C.
16119
16120 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16121 It's more likely to cause problems (due to unsigned overflow)
16122 than to cure them.
16123
16124 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16125
16126 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16127
16128 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16129
16130 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16131
16132 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16133
16134 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16135
16136 GLYPH_CODE_FACE returns EMACS_INT, not int.
16137 * dispextern.h (merge_faces):
16138 * xfaces.c (merge_faces):
16139 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16140 Don't assume EMACS_INT fits in int.
16141
16142 * character.h (CHAR_VALID_P): Remove unused parameter.
16143 * fontset.c, lisp.h, xdisp.c: All uses changed.
16144
16145 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16146
16147 * fns.c (concat): Minor tuning based on overflow analysis.
16148 This doesn't fix any bugs. Use int to hold character, instead
16149 of constantly refetching from Emacs object. Use XFASTINT, not
16150 XINT, for value known to be a character. Don't bother comparing
16151 a single byte to 0400, as it's always less.
16152
16153 * floatfns.c (Fexpt):
16154 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16155
16156 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16157 for characters.
16158
16159 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16160
16161 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16162 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16163 incorrectly succeed when S was a string, because 4294967386 was
16164 truncated before it was used.
16165
16166 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16167 Otherwise, an out-of-range integer could cause undefined behavior
16168 on a 64-bit host.
16169
16170 * composite.c: Use int, not EMACS_INT, for characters.
16171 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16172 EMACS_INT, for values that are known to be in character range.
16173 This doesn't fix any bugs but is the usual style inside Emacs and
16174 may generate better code on 32-bit machines.
16175
16176 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16177 This is for reasons similar to the recent CHAR_STRING fix.
16178 * charset.c (Fencode_char): Check that character arg is actually
16179 a character. Pass an int to ENCODE_CHAR.
16180 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16181 wider than 'int', as a compile-time check to prevent future regressions
16182 in this area.
16183
16184 * character.c (char_string): Remove unnecessary casts.
16185
16186 Make sure a 64-bit char is never passed to CHAR_STRING.
16187 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16188 by silently ignoring the top 32 bits, allowing some values
16189 that were far too large to be valid characters.
16190 * character.h: Include <verify.h>.
16191 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16192 arguments are no wider than unsigned, as a compile-time check
16193 to prevent future regressions in this area.
16194 * data.c (Faset):
16195 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16196 (Fsubst_char_in_region):
16197 * fns.c (concat):
16198 * xdisp.c (decode_mode_spec_coding):
16199 Adjust to CHAR_STRING's new requirement.
16200 * editfns.c (Finsert_char, Fsubst_char_in_region):
16201 * fns.c (concat): Check that character args are actually
16202 characters. Without this test, these functions did the wrong
16203 thing with wildly out-of-range values on 64-bit hosts.
16204
16205 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16206 These casts should not be needed on 32-bit hosts, either.
16207 * keyboard.c (read_char):
16208 * lread.c (Fload): Remove casts to unsigned.
16209
16210 * lisp.h (UNSIGNED_CMP): New macro.
16211 This fixes comparison bugs on 64-bit hosts.
16212 (ASCII_CHAR_P): Use it.
16213 * casefiddle.c (casify_object):
16214 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16215 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16216 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16217 * dispextern.h (FACE_FROM_ID):
16218 * keyboard.c (read_char): Use UNSIGNED_CMP.
16219
16220 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16221 not to EMACS_INT, to avoid GCC warning.
16222
16223 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16224
16225 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16226 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16227 isn't needed on 32-bit machines.
16228
16229 * buffer.c (Fgenerate_new_buffer_name):
16230 Use EMACS_INT for count, not int.
16231 (advance_to_char_boundary): Return EMACS_INT, not int.
16232
16233 * data.c (Qcompiled_function): Now static.
16234
16235 * window.c (window_body_lines): Now static.
16236
16237 * image.c (gif_load): Rename local to avoid shadowing.
16238
16239 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16240 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16241 * alloc.c (make_save_value): Integer argument is now of type
16242 ptrdiff_t, not int.
16243 (mark_object): Use ptrdiff_t, not int.
16244 * lisp.h (pD): New macro.
16245 * print.c (print_object): Use it.
16246
16247 * alloc.c: Use EMACS_INT, not int, to count objects.
16248 (total_conses, total_markers, total_symbols, total_vector_size)
16249 (total_free_conses, total_free_markers, total_free_symbols)
16250 (total_free_floats, total_floats, total_free_intervals)
16251 (total_intervals, total_strings, total_free_strings):
16252 Now EMACS_INT, not int. All uses changed.
16253 (Fgarbage_collect): Compute overall total using a double, so that
16254 integer overflow is less likely to be a problem. Check for overflow
16255 when converting back to an integer.
16256 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16257 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16258 These were 'int' variables that could overflow on 64-bit hosts;
16259 they were never used, so remove them instead of repairing them.
16260 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16261 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16262 Previously, this ceilinged at INT_MAX, but that doesn't work on
16263 64-bit machines.
16264 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16265
16266 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16267 (allocate_vectorlike): Check for ptrdiff_t overflow.
16268 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16269 when a (possibly-narrower) signed value would do just as well.
16270 We prefer using signed arithmetic, to avoid comparison confusion.
16271
16272 * alloc.c: Catch some string size overflows that we were missing.
16273 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16274 for convenience in STRING_BYTES_MAX.
16275 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16276 The definition here is exact; the one in lisp.h was approximate.
16277 (allocate_string_data): Check for string overflow. This catches
16278 some instances we weren't catching before. Also, it catches
16279 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16280 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16281 and ptrdiff_t and EMACS_INT are both 64 bits.
16282
16283 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16284 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16285 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16286
16287 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16288
16289 * alloc.c (Fmake_string): Check for out-of-range init.
16290
16291 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16292
16293 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16294
16295 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16296
16297 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16298 xg_get_default_scrollbar_width.
16299
16300 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16301 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16302 (style_changed_cb): Call update_theme_scrollbar_width and call
16303 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16304 all frames (Bug#8505).
16305 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16306 Call gtk_window_set_resizable if HAVE_GTK3.
16307 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16308 and height if HAVE_GTK3 (Bug#8505).
16309 (scroll_bar_width_for_theme): New variable.
16310 (update_theme_scrollbar_width): New function.
16311 (xg_get_default_scrollbar_width): Move code to
16312 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16313 (xg_initialize): Call update_theme_scrollbar_width.
16314
16315 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16316
16317 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16318
16319 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16320
16321 * frame.c (make_frame): Call other_buffer_safely instead of
16322 other_buffer.
16323
16324 * window.c (temp_output_buffer_show): Call display_buffer with
16325 second argument Vtemp_buffer_show_specifiers and reset latter
16326 immediately after the call.
16327 (Vtemp_buffer_show_specifiers): New variable.
16328 (auto_window_vscroll_p, next_screen_context_lines)
16329 (Vscroll_preserve_screen_position): Remove leading asterisks from
16330 doc-strings.
16331
16332 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16333
16334 Fix minor problems found by GCC 4.6.0 static checking.
16335 * buffer.c (Qclone_number): Remove for now, as it's unused.
16336 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16337 (record_buffer): Remove unused local.
16338 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16339 (set_frame_buffer_list): Remove; unused.
16340 * frame.h (other_visible_frames): Remove decl.
16341 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16342 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16343 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16344 if HAVE_GPM.
16345 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16346 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16347 Define only if HAVE_GPM.
16348 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16349 (update_hints_inhibit): Remove; never set. All uses removed.
16350 * widgetprv.h (emacsFrameClassRec): Remove decl.
16351 * window.c (delete_deletable_window): Now returns void, since it
16352 wasn't returning anything.
16353 (compare_window_configurations): Remove unused locals.
16354 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16355 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16356 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16357 the same widths as pointers. This follows up on the 2011-05-06 patch.
16358 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16359 * xterm.h: Likewise.
16360 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16361
16362 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16363
16364 * makefile.w32-in: Update dependencies.
16365 (LISP_H): Add lib/intprops.h.
16366
16367 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16368
16369 * image.c (gif_load): Add animation frame delay to the metadata.
16370 (syms_of_image): Use DEFSYM. New symbol `delay'.
16371
16372 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16373
16374 * window.c (delete_deletable_window): Re-add.
16375 (Fset_window_configuration): Rewrite to handle dead buffers and
16376 consequently deletable windows.
16377 (window_tree, Fwindow_tree): Remove. Supply functionality in
16378 window.el.
16379 (compare_window_configurations): Simplify code.
16380
16381 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16382
16383 * image.c (imagemagick_load_image): Fix type mismatch.
16384 (Fimagemagick_types): Likewise.
16385
16386 * window.h (replace_buffer_in_windows): Declare.
16387
16388 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16389
16390 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16391 Qclone_number. Remove external declaration of Qdelete_window.
16392 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16393 code.
16394 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16395 Run Qbuffer_list_update_hook if allowed.
16396 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16397 buffer list implementation.
16398 (other_buffer_safely): New function.
16399 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16400 calls to replace_buffer_in_windows and
16401 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16402 if allowed.
16403 (record_buffer): Inhibit quitting and rewrite using quittable
16404 functions. Run Qbuffer_list_update_hook if allowed.
16405 (Frecord_buffer, Funrecord_buffer): New functions.
16406 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16407 Move switch-to-buffer to window.el.
16408 (bury-buffer): Move to window.el.
16409 (Vbuffer_list_update_hook): New variable.
16410
16411 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16412 section.
16413
16414 * window.h (resize_frame_windows): Move up in code.
16415 (Fwindow_frame): Remove EXFUN.
16416 (replace_buffer_in_all_windows): Remove prototype.
16417 (replace_buffer_in_windows_safely): Add prototype.
16418
16419 * window.c: Declare Qdelete_window static again. Move down
16420 declaration of select_count.
16421 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16422 (Fother_window): Move to window.el.
16423 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16424 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16425 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16426 window.el.
16427 (replace_buffer_in_windows): Implement by calling
16428 Qreplace_buffer_in_windows.
16429 (replace_buffer_in_all_windows): Remove with some functionality
16430 moved into replace_buffer_in_windows_safely.
16431 (replace_buffer_in_windows_safely): New function.
16432 (select_window_norecord, select_frame_norecord): Move in front
16433 of run_window_configuration_change_hook. Remove now obsolete
16434 declarations.
16435 (Fset_window_buffer): Rewrite doc-string.
16436 Call Qrecord_window_buffer.
16437 (keys_of_window): Move binding for other-window to window.el.
16438
16439 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16440
16441 * dispextern.h (struct image): Replace data member, whose int_val
16442 and ptr_val fields were not used by anything, with a single
16443 lisp_val object.
16444
16445 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16446 (gif_clear_image, gif_load, imagemagick_load_image)
16447 (gs_clear_image, gs_load): Callers changed.
16448
16449 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16450
16451 * buffer.h: Include <time.h>, for time_t.
16452 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16453
16454 Fix minor problems found by static checking.
16455
16456 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16457
16458 Make identifiers static if they are not used in other modules.
16459 * data.c (Qcompiled_function, Qframe, Qvector):
16460 * image.c (QimageMagick, Qsvg):
16461 * minibuf.c (Qmetadata):
16462 * window.c (resize_window_check, resize_root_window): Now static.
16463 * window.h (resize_window_check, resize_root_window): Remove decls.
16464
16465 * window.c (window_deletion_count, delete_deletable_window):
16466 Remove; unused.
16467 (window_body_lines): Now static.
16468 (Fdelete_other_windows_internal): Mark vars as initialized.
16469 Make sure 'resize_failed' is initialized.
16470 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16471 (resize_window_apply): Remove unused local.
16472 * window.h (delete_deletable_window): Remove decl.
16473
16474 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16475 (imagemagick_load_image): Fix pointer signedness problem by changing
16476 last arg from unsigned char * to char *. All uses changed.
16477 Also, fix a local for similar reasons.
16478 Remove unused locals. Remove locals to avoid shadowing.
16479 (fn_rsvg_handle_free): Remove; unused.
16480 (svg_load, svg_load_image): Fix pointer signedness problem.
16481 (imagemagick_load_image): Don't use garbage pointer image_wand.
16482
16483 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16484
16485 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16486
16487 * image.c (gif_load): Fix omitted cast error introduced by
16488 2011-06-06 change.
16489
16490 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16491
16492 * window.h (resize_proportionally, orig_total_lines)
16493 (orig_top_line): Remove from window structure.
16494 (set_window_height, set_window_width, change_window_heights)
16495 (Fdelete_window): Remove prototypes.
16496 (resize_frame_windows): Remove duplicate declaration.
16497
16498 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16499
16500 * window.h (resize_frame_windows, resize_window_check)
16501 (delete_deletable_window, resize_root_window)
16502 (resize_frame_windows): Declare prototypes.
16503
16504 * window.c (resize_window_apply): Make definition be "static" to
16505 match the prototype.
16506
16507 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16508
16509 * window.c: Remove declarations of Qwindow_size_fixed,
16510 window_min_size_1, window_min_size_2, window_min_size,
16511 size_window, window_fixed_size_p, enlarge_window, delete_window.
16512 Remove static from declaration of Qdelete_window, it's
16513 temporarily needed by Fbury_buffer.
16514 (replace_window): Don't assign orig_top_line and
16515 orig_total_lines.
16516 (Fdelete_window, delete_window): Remove. Window deletion is
16517 handled by window.el.
16518 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16519 Replace Fdelete_window calls with calls to Qdelete_window.
16520 (Fdelete_other_windows): Remove. Deleting other windows is
16521 handled by window.el.
16522 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16523 handled in window.el.
16524 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16525 Window minimum sizes are handled in window.el.
16526 (shrink_windows, size_window, set_window_height)
16527 (set_window_width, change_window_heights, window_height)
16528 (window_width, CURBEG, CURSIZE, enlarge_window)
16529 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16530 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16531 handled in window.el.
16532 (make_dummy_parent): Rename to make_parent_window and give it a
16533 second argument horflag.
16534 (make_window): Don't set resize_proportionally any more.
16535 (Fsplit_window): Remove. Windows are split in window.el.
16536 (save_restore_action, save_restore_orig_size)
16537 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16538 Resize mini windows in window.el.
16539 (grow_mini_window, shrink_mini_window): Implement by calling
16540 Qresize_root_window_vertically, resize_window_check and
16541 resize_window_apply.
16542 (saved_window, Fset_window_configuration, save_window_save):
16543 Do not handle orig_top_line, orig_total_lines, and
16544 resize_proportionally.
16545 (window_min_height, window_min_width): Move to window.el.
16546 (keys_of_window): Move bindings for delete-other-windows,
16547 split-window, delete-window and enlarge-window to window.el.
16548
16549 * buffer.c: Temporarily extern Qdelete_window.
16550 (Fbury_buffer): Temporarily call Qdelete_window instead of
16551 Fdelete_window (Fbury_buffer will move to window.el soon).
16552
16553 * frame.c (set_menu_bar_lines_1): Remove code handling
16554 orig_top_line and orig_total_lines.
16555
16556 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16557 set_window_height but set heights directly.
16558 (change_frame_size_1): Use resize_frame_windows.
16559
16560 * xdisp.c (init_xdisp): Don't use set_window_height but set
16561 heights directly.
16562
16563 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16564 Use resize_frame_windows instead of change_window_heights and run
16565 run_window_configuration_change_hook.
16566
16567 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16568 instead of change_window_heights and run
16569 run_window_configuration_change_hook.
16570
16571 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16572
16573 * window.c (replace_window): Rename second argument REPLACEMENT to
16574 NEW. New third argument SETFLAG. Rewrite.
16575 (delete_window, make_dummy_parent): Call replace_window with
16576 third argument 1.
16577 (window_list_1): Move down in code.
16578 (run_window_configuration_change_hook): Move set_buffer part
16579 before select_frame_norecord part in order to unwind correctly.
16580 Rename count1 to count.
16581 (recombine_windows, delete_deletable_window, resize_root_window)
16582 (Fdelete_other_windows_internal)
16583 (Frun_window_configuration_change_hook, make_parent_window)
16584 (resize_window_check, resize_window_apply, Fresize_window_apply)
16585 (resize_frame_windows, Fsplit_window_internal)
16586 (Fdelete_window_internal, Fresize_mini_window_internal):
16587 New functions.
16588 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16589
16590 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16591
16592 * window.h (window): Add some new members to window structure -
16593 normal_lines, normal_cols, new_total, new_normal, clone_number,
16594 splits, nest, prev_buffers, next_buffers.
16595 (WINDOW_TOTAL_SIZE): Move here from window.c.
16596 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16597
16598 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16599 Remove.
16600 (make_dummy_parent): Set new members of windows structure.
16601 (make_window): Move down in code. Handle new members of window
16602 structure.
16603 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16604 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16605 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16606 (Fset_window_prev_buffers, Fwindow_next_buffers)
16607 (Fset_window_next_buffers, Fset_window_clone_number):
16608 New functions.
16609 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16610 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16611 Doc-string fixes.
16612 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16613 Argument WINDOW can be now internal window too.
16614 (Fwindow_use_time): Move up in code.
16615 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16616 Rewrite doc-string.
16617 (Fset_window_configuration, saved_window)
16618 (Fcurrent_window_configuration, save_window_save): Handle new
16619 members of window structure.
16620 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16621 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16622 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16623 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16624 Qget_mru_window, Qresize_root_window,
16625 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16626 Qauto_buffer_name; staticpro them.
16627
16628 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16629
16630 * window.c (Fwindow_total_size, Fwindow_left_column)
16631 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16632 (Fwindow_list_1): New functions.
16633 (window_box_text_cols): Replace with window_body_cols.
16634 (Fwindow_width, Fscroll_left, Fscroll_right):
16635 Use window_body_cols instead of window_box_text_cols.
16636 (delete_window, Fset_window_configuration):
16637 Call delete_all_subwindows with window as argument.
16638 (delete_all_subwindows): Take a window as argument and not a
16639 structure. Rewrite.
16640 (window_loop): Remove handling of GET_LRU_WINDOW and
16641 GET_LARGEST_WINDOW.
16642 (Fget_lru_window, Fget_largest_window): Move to window.el.
16643
16644 * window.h: Extern window_body_cols instead of
16645 window_box_text_cols. delete_all_subwindows now takes a
16646 Lisp_Object as argument.
16647
16648 * indent.c (compute_motion, Fcompute_motion):
16649 Use window_body_cols instead of window_box_text_cols.
16650
16651 * frame.c (delete_frame): Call delete_all_subwindows with root
16652 window as argument.
16653
16654 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16655
16656 * fns.c (Fputhash): Document return value.
16657
16658 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16659
16660 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16661
16662 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16663
16664 Cons<->int and similar integer overflow fixes (Bug#8794).
16665
16666 Check for overflow when converting integer to cons and back.
16667 * charset.c (Fdefine_charset_internal, Fdecode_char):
16668 Use cons_to_unsigned to catch overflow.
16669 (Fencode_char): Use INTEGER_TO_CONS.
16670 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16671 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16672 * data.c (long_to_cons, cons_to_long): Remove.
16673 (cons_to_unsigned, cons_to_signed): New functions.
16674 These signal an error for invalid or out-of-range values.
16675 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16676 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16677 * font.c (Ffont_variation_glyphs):
16678 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16679 * lisp.h: Include <intprops.h>.
16680 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16681 (cons_to_signed, cons_to_unsigned): New decls.
16682 (long_to_cons, cons_to_long): Remove decls.
16683 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16684 (Fprimitive_undo): Use CONS_TO_INTEGER.
16685 * xfns.c (Fx_window_property): Likewise.
16686 * xselect.c: Include <limits.h>.
16687 (x_own_selection, selection_data_to_lisp_data):
16688 Use INTEGER_TO_CONS.
16689 (x_handle_selection_request, x_handle_selection_clear)
16690 (x_get_foreign_selection, Fx_disown_selection_internal)
16691 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16692 (lisp_data_to_selection_data): Use cons_to_unsigned.
16693 (x_fill_property_data): Use cons_to_signed.
16694 Report values out of range.
16695
16696 Check for buffer and string overflow more precisely.
16697 * buffer.h (BUF_BYTES_MAX): New macro.
16698 * lisp.h (STRING_BYTES_MAX): New macro.
16699 * alloc.c (Fmake_string):
16700 * character.c (string_escape_byte8):
16701 * coding.c (coding_alloc_by_realloc):
16702 * doprnt.c (doprnt):
16703 * editfns.c (Fformat):
16704 * eval.c (verror):
16705 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16706 since they may not be the same number.
16707 * editfns.c (Finsert_char):
16708 * fileio.c (Finsert_file_contents):
16709 Likewise for BUF_BYTES_MAX.
16710
16711 * image.c: Use ptrdiff_t, not int, for sizes.
16712 (slurp_file): Switch from int to ptrdiff_t.
16713 All uses changed.
16714 (slurp_file): Check that file size fits in both size_t (for
16715 malloc) and ptrdiff_t (for sanity and safety).
16716
16717 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16718 if b->modtime has its maximal value.
16719
16720 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16721
16722 Don't assume time_t can fit into int.
16723 * buffer.h (struct buffer.modtime): Now time_t, not int.
16724 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16725 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16726
16727 Minor fixes for signed vs unsigned integers.
16728 * character.h (MAYBE_UNIFY_CHAR):
16729 * charset.c (maybe_unify_char):
16730 * keyboard.c (read_char, reorder_modifiers):
16731 XINT -> XFASTINT, since the integer must be nonnegative.
16732 * ftfont.c (ftfont_spec_pattern):
16733 * keymap.c (access_keymap, silly_event_symbol_error):
16734 XUINT -> XFASTINT, since the integer must be nonnegative.
16735 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16736 since it makes no difference and we prefer signed.
16737 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16738 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16739 nonnegative.
16740
16741 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16742
16743 * window.h (Fwindow_frame): Declare.
16744
16745 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16746
16747 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16748 (SPARE_MEMORY): Always define.
16749 (LARGE_REQUEST): Remove.
16750 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16751
16752 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16753
16754 * lisp.h: Move EXFUNS for Fframe_root_window,
16755 Fframe_first_window and Fset_frame_selected_window to window.h.
16756
16757 * window.h: Move EXFUNS for Fframe_root_window,
16758 Fframe_first_window and Fset_frame_selected_window here from
16759 lisp.h.
16760
16761 * frame.c (Fwindow_frame, Fframe_first_window)
16762 (Fframe_root_window, Fframe_selected_window)
16763 (Fset_frame_selected_window): Move to window.c.
16764 (Factive_minibuffer_window): Move to minibuf.c.
16765 (Fother_visible_frames_p): New function.
16766
16767 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16768
16769 * window.c (decode_window, decode_any_window): Move up in code.
16770 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16771 (inhibit_frame_unsplittable): Remove unused variable.
16772 (Fwindow_buffer): Move up and rewrite doc-string.
16773 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16774 (Fwindow_prev): New functions.
16775 (Fwindow_frame): Move here from frame.c. Accept any window as
16776 argument.
16777 (Fframe_root_window, Fframe_first_window)
16778 (Fframe_selected_window): Move here from frame.c. Accept frame
16779 or arbitrary window as argument. Update doc-strings.
16780 (Fminibuffer_window): Move up in code.
16781 (Fwindow_minibuffer_p): Move up in code and simplify.
16782 (Fset_frame_selected_window): Move here from frame.c.
16783 Marginal rewrite.
16784 (Fselected_window, select_window, Fselect_window): Move up in
16785 code. Minor doc-string fixes.
16786
16787 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16788
16789 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16790 Do not assume that spare memory exists; that assumption is valid
16791 only if SYSTEM_MALLOC.
16792 (LARGE_REQUEST): New macro, so that the issue of large requests
16793 is separated from the issue of spare memory.
16794
16795 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16796
16797 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16798 format. (Bug#8806)
16799
16800 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16801
16802 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16803 before statements.
16804
16805 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16806
16807 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16808
16809 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16810
16811 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16812 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16813
16814 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16815
16816 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16817
16818 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16819
16820 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16821 (x_clipboard_manager_save): Add return value.
16822 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16823 New error handlers.
16824 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16825 Obey Vx_select_enable_clipboard_manager. Catch errors in
16826 x_clipboard_manager_save (Bug#8779).
16827 (Vx_select_enable_clipboard_manager): New variable.
16828 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16829
16830 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16831
16832 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16833
16834 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16835
16836 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16837 in the current matrix if keep_current_p is non-zero.
16838
16839 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16840
16841 * bidi.c (bidi_level_of_next_char): Fix last change.
16842
16843 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16844
16845 Support bidi reordering of text covered by display properties.
16846
16847 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16848 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16849 (bidi_cache_search, bidi_cache_iterator_state)
16850 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16851 (bidi_level_of_next_char, bidi_move_to_visually_next):
16852 Support character positions inside a run of characters covered by a
16853 display string.
16854 (bidi_paragraph_init, bidi_resolve_explicit_1)
16855 (bidi_level_of_next_char): Call bidi_fetch_char and
16856 bidi_fetch_char_advance instead of FETCH_CHAR and
16857 FETCH_CHAR_ADVANCE.
16858 (bidi_init_it): Initialize new members.
16859 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16860 definitions.
16861 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16862 instead of using explicit *_CHAR codes.
16863 (bidi_resolve_explicit, bidi_resolve_weak):
16864 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16865 bidirectional text is supported only in multibyte buffers.
16866 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16867 it to initialize the frame_window_p member of struct bidi_it.
16868 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16869 (bidi_resolve_explicit, bidi_resolve_weak)
16870 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16871 bidi_it->nchars is non-positive.
16872 (bidi_level_of_next_char): Don't try to lookup the cache for the
16873 next/previous character if nothing is cached there yet, or if we
16874 were just reseat()'ed to a new position.
16875
16876 * xdisp.c (set_cursor_from_row): Set start and stop points
16877 according to the row's direction when priming the loop that looks
16878 for the glyph on which to display cursor.
16879 (single_display_spec_intangible_p): Function deleted.
16880 (display_prop_intangible_p): Reimplement to call
16881 handle_display_spec instead of single_display_spec_intangible_p.
16882 Accept 3 additional arguments needed by handle_display_spec.
16883 This fixes incorrect cursor motion across display property with complex
16884 values: lists, `(when COND...)' forms, etc.
16885 (single_display_spec_string_p): Support property values that are
16886 lists with the argument STRING its top-level element.
16887 (display_prop_string_p): Fix the condition for processing a
16888 property that is a list to be consistent with handle_display_spec.
16889 (handle_display_spec): New function, refactored from the
16890 last portion of handle_display_prop.
16891 (compute_display_string_pos): Accept additional argument
16892 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16893 value of a `display' property is a "replacing spec".
16894 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16895 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16896 the display property, but just return a value indicating whether
16897 the display property will replace the characters it covers.
16898 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16899 frame_window_p members of struct bidi_it.
16900 (compute_display_string_pos, compute_display_string_end):
16901 New functions.
16902 (push_it): Accept second argument POSITION, where pop_it should
16903 jump to continue iteration.
16904 (reseat_1): Initialize bidi_it.disp_pos.
16905
16906 * keyboard.c (adjust_point_for_property): Adjust the call to
16907 display_prop_intangible_p to its new signature.
16908
16909 * dispextern.h (struct bidi_it): New member frame_window_p.
16910 (bidi_init_it): Update prototypes.
16911 (display_prop_intangible_p): Update prototype.
16912 (compute_display_string_pos, compute_display_string_end):
16913 Declare prototypes.
16914 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16915 EMACS_INT.
16916
16917 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16918
16919 Malloc failure behavior now depends on size of allocation.
16920 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16921 * lisp.h: Change signatures accordingly.
16922 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16923 All callers changed. (Bug#8762)
16924
16925 * gnutls.c: Use Emacs's memory allocators.
16926 Without this change, the gnutls library would invoke malloc etc.
16927 directly, which causes problems on non-SYNC_INPUT hosts, and which
16928 runs afoul of improving memory_full behavior. (Bug#8761)
16929 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16930 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16931 xfree instead of the default malloc, realloc, free.
16932 (Fgnutls_boot): No need to check for memory allocation failure,
16933 since xmalloc does that for us.
16934
16935 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16936 * category.c (hash_get_category_set):
16937 * ccl.c (ccl_driver):
16938 * charset.c (Fdefine_charset_internal):
16939 * charset.h (struct charset.hash_index):
16940 * composite.c (get_composition_id, gstring_lookup_cache)
16941 (composition_gstring_put_cache):
16942 * composite.h (struct composition.hash_index):
16943 * dispextern.h (struct image.hash):
16944 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16945 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16946 (hashfn_equal, hashfn_user_defined, make_hash_table)
16947 (maybe_resize_hash_table, hash_lookup, hash_put)
16948 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16949 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16950 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16951 * image.c (make_image, search_image_cache, lookup_image)
16952 (xpm_put_color_table_h):
16953 * lisp.h (struct Lisp_Hash_Table):
16954 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16955 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16956 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16957 * alloc.c (allocate_vectorlike):
16958 Check for overflow in vector size calculations.
16959 * ccl.c (ccl_driver):
16960 Check for overflow when converting EMACS_INT to int.
16961 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16962 need to be updated by these changes.
16963 * fns.c (make_hash_table, maybe_resize_hash_table):
16964 Check for integer overflow with large hash tables.
16965 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16966 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16967 (SXHASH_REDUCE): New macro.
16968 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16969 Use it instead of discarding useful hash info with large hash values.
16970 (sxhash_float): New function.
16971 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16972 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16973 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16974 Rewrite to use FIXNUM_BITS, as this simplifies things.
16975 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16976 Adjust signatures to match updated version of code.
16977 (consing_since_gc): Now EMACS_INT, since a single hash table can
16978 use more than INT_MAX bytes.
16979
16980 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16981
16982 Make it possible to build with GCC-4.6+ -O2 -flto.
16983
16984 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16985
16986 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16987
16988 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16989 Call minibuffer-inactive-mode.
16990
16991 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16992
16993 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16994 Update dependencies.
16995
16996 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16997
16998 * data.c (init_data): Remove code for UTS, this system is not
16999 supported anymore.
17000
17001 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17002
17003 Don't force ./temacs to start in terminal mode.
17004
17005 * frame.c (make_initial_frame): Initialize faces in all cases, not
17006 only when CANNOT_DUMP is defined.
17007 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17008
17009 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17010
17011 * dispnew.c (add_window_display_history): Use const for the string
17012 pointer. Remove declaration, not needed.
17013
17014 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17015
17016 Use 'inline', not 'INLINE'.
17017 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17018 * alloc.c, fontset.c (INLINE): Remove.
17019 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17020 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17021 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17022 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17023 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17024
17025 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17026
17027 Make it possible to run ./temacs.
17028
17029 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17030 syms_of_callproc does the same thing. Remove test for
17031 "initialized", do it in the caller.
17032 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17033
17034 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17035
17036 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17037 (read_minibuf): Use get_minibuffer.
17038 (syms_of_minibuf): Use DEFSYM.
17039 (Qmetadata): New var.
17040 * data.c (Qbuffer): Don't make it static.
17041 (syms_of_data): Use DEFSYM.
17042
17043 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17044
17045 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17046 (CCL_CODE_MIN): New macro.
17047
17048 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17049
17050 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17051
17052 * eval.c (Qdebug): Now static.
17053 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17054 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17055 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17056
17057 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17058
17059 * image.c: Various fixes to ImageMagick code comments.
17060 (Fimagemagick_types): Doc fix.
17061
17062 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17063
17064 Minor fixes prompted by GCC 4.6.0 warnings.
17065
17066 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17067
17068 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17069 (x_clipboard_manager_save_all): Move extern decl to ...
17070 * xterm.h: ... here, so that it can be checked for consistency.
17071
17072 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17073
17074 * xselect.c (x_clipboard_manager_save_frame)
17075 (x_clipboard_manager_save_all): New functions.
17076 (Fx_clipboard_manager_save): Lisp function deleted.
17077
17078 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17079 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17080
17081 * xterm.h: Update prototype.
17082
17083 2011-05-28 William Xu <william.xwl@gmail.com>
17084
17085 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17086 exiting (Bug#8239).
17087
17088 2011-05-28 Jim Meyering <meyering@redhat.com>
17089
17090 Avoid a sign-extension bug in crypto_hash_function.
17091 * fns.c (to_uchar): Define.
17092 (crypto_hash_function): Use it to convert some newly-signed
17093 variables to unsigned, to avoid sign-extension bugs. For example,
17094 without this change, (md5 "truc") would evaluate to
17095 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17096 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17097 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17098
17099 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17100
17101 Integer overflow fixes.
17102
17103 * dbusbind.c: Serial number integer overflow fixes.
17104 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17105 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17106 to hold a serial number that is too large for a fixnum.
17107 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17108 Check for serial numbers out of range. Decode any serial number
17109 that was so large that it became a float. (Bug#8722)
17110
17111 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17112 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17113 Use XFASTINT rather than XUINT when numbers are nonnegative.
17114 (xd_append_arg, Fdbus_method_return_internal):
17115 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17116 arguments, check that Lisp number is nonnegative, rather than
17117 silently wrapping negative numbers around. (Bug#8722)
17118 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17119 (Bug#8722)
17120
17121 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17122
17123 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17124
17125 ccl: Add integer overflow checks.
17126 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17127 (IN_INT_RANGE): New macros.
17128 (ccl_driver): Use them to check for integer overflow when
17129 decoding a CCL program. Many of the new checks are whether XINT (x)
17130 fits in int; it doesn't always, on 64-bit hosts. The new version
17131 doesn't catch all possible integer overflows, but it's an
17132 improvement. (Bug#8719)
17133
17134 * alloc.c (make_event_array): Use XINT, not XUINT.
17135 There's no need for unsigned here.
17136
17137 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17138 This follows up to the 2011-05-06 change that substituted uintptr_t
17139 for EMACS_INT. This case wasn't caught back then.
17140
17141 Rework Fformat to avoid integer overflow issues.
17142 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17143 now (part of C89). Include <verify.h>.
17144 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17145 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17146 (Fformat): Avoid the prepass trying to compute sizes; it was only
17147 approximate and thus did not catch overflow reliably. Instead, walk
17148 through the format just once, formatting and computing sizes as we go,
17149 checking for integer overflow at every step, and allocating a larger
17150 buffer as needed. Keep track separately whether the format is
17151 multibyte. Keep only the most-recently calculated precision, rather
17152 than them all. Record whether each argument has been converted to
17153 string. Use EMACS_INT, not int, for byte and char and arg counts.
17154 Support field widths and precisions larger than INT_MAX. Avoid
17155 sprintf's undefined behavior with conversion specifications such as %#d
17156 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17157 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17158 formatting out-of-range floating point numbers with int
17159 formats. (Bug#8668)
17160
17161 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17162
17163 * data.c: Avoid integer truncation in expressions involving floats.
17164 * data.c: Include <intprops.h>.
17165 (arith_driver): When there's an integer overflow in an expression
17166 involving floating point, convert the integers to floating point
17167 so that the resulting value does not suffer from catastrophic
17168 integer truncation. For example, on a 64-bit host (* 4
17169 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17170 Do not rely on undefined behavior after integer overflow.
17171
17172 merge count_size_as_multibyte, parse_str_to_multibyte
17173 * character.c, character.h (count_size_as_multibyte):
17174 Rename from parse_str_to_multibyte; all uses changed.
17175 Check for integer overflow.
17176 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17177 since it's now a duplicate of the other. This is more of
17178 a character than a buffer op, so better that it's in character.c.
17179 * fns.c, print.c: Adjust to above changes.
17180
17181 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17182
17183 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17184
17185 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17186
17187 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17188 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17189 (x_clipboard_manager_save): Now static.
17190 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17191
17192 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17193 (crypto_hash_function): Now static.
17194 Fix pointer signedness problems. Avoid unnecessary initializations.
17195
17196 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17197
17198 * termhooks.h (Vselection_alist): Make it terminal-local.
17199
17200 * terminal.c (create_terminal): Initialize it.
17201
17202 * xselect.c: Support for clipboard managers.
17203 (Vselection_alist): Move to termhooks.h as terminal-local var.
17204 (LOCAL_SELECTION): New macro.
17205 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17206 (symbol_to_x_atom): Remove gratuitous arg.
17207 (x_handle_selection_request, lisp_data_to_selection_data)
17208 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17209 (x_own_selection, x_get_local_selection, x_convert_selection):
17210 New arg, specifying work frame. Use terminal-local Vselection_alist.
17211 (some_frame_on_display): Delete unused function.
17212 (Fx_own_selection_internal, Fx_get_selection_internal)
17213 (Fx_disown_selection_internal, Fx_selection_owner_p)
17214 (Fx_selection_exists_p): New optional frame arg.
17215 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17216 (x_handle_selection_clear): Don't treat other terminals with the
17217 same keyboard specially. Use the terminal-local Vselection_alist.
17218 (x_clear_frame_selections): Use Frun_hook_with_args.
17219
17220 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17221
17222 * xterm.h: Add support for those atoms.
17223
17224 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17225
17226 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17227 (converted_selections, conversion_fail_tag): New global variables.
17228 (x_selection_request_lisp_error): Free the above.
17229 (x_get_local_selection): Remove unnecessary code.
17230 (x_reply_selection_request): Args changed; handle arbitrary array
17231 of converted selections stored in converted_selections.
17232 Separate the XChangeProperty and SelectionNotify steps.
17233 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17234 (x_convert_selection): New function.
17235 (x_handle_selection_event): Simplify.
17236 (x_get_foreign_selection): Don't ignore incoming requests while
17237 waiting for an answer; this will fail when we implement
17238 SAVE_TARGETS, and seems unnecessary anyway.
17239 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17240 (Vx_sent_selection_functions): Doc fix.
17241
17242 2011-05-26 Leo Liu <sdl.web@gmail.com>
17243
17244 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17245
17246 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17247
17248 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17249
17250 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17251 for fringe update if it has periodic bitmap.
17252 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17253 and fringe_bitmap_periodic_p.
17254
17255 * fringe.c (get_fringe_bitmap_data): New function.
17256 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17257 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17258 row. Mark glyph row for fringe update if periodicity changed.
17259
17260 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17261 for fringe update unless it has periodic bitmap.
17262
17263 2011-05-25 Kenichi Handa <handa@m17n.org>
17264
17265 * xdisp.c (get_next_display_element): Set correct it->face_id for
17266 a static composition.
17267
17268 2011-05-24 Leo Liu <sdl.web@gmail.com>
17269
17270 * deps.mk (fns.o):
17271 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17272
17273 * fns.c (crypto_hash_function, Fsha1): New function.
17274 (Fmd5): Use crypto_hash_function.
17275 (syms_of_fns): Add Ssha1.
17276
17277 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17278
17279 * gnutls.c: Remove unused macros.
17280 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17281 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17282 Remove macros that are defined and never used.
17283 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17284
17285 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17286
17287 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17288 (Fx_get_selection_internal): Minor cleanup.
17289 (Fx_own_selection_internal): Rename arguments for consistency with
17290 select.el.
17291
17292 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17293
17294 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17295
17296 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17297
17298 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17299
17300 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17301
17302 * dispnew.c (scrolling_window): Don't exclude the case that the
17303 last enabled row in the desired matrix touches the bottom boundary.
17304
17305 2011-05-21 Glenn Morris <rgm@gnu.org>
17306
17307 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17308 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17309 and add some more files.
17310
17311 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17312
17313 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17314 report_file_error introduced by the change from 2011-05-07.
17315
17316 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17317
17318 * systime.h (Time): Define only if emacs is defined.
17319 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17320 where the include path doesn't have X11/X.h by default. See
17321 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17322
17323 2011-05-20 Kenichi Handa <handa@m17n.org>
17324
17325 * composite.c (find_automatic_composition): Fix previous change.
17326
17327 2011-05-20 Glenn Morris <rgm@gnu.org>
17328
17329 * lisp.mk: New file, split from Makefile.in.
17330 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17331 (shortlisp): Remove.
17332 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17333
17334 2011-05-19 Glenn Morris <rgm@gnu.org>
17335
17336 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17337 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17338 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17339 (lisp): Set the order to that of loadup.el.
17340 (shortlisp): Make it a copy of $lisp.
17341 (SOME_MACHINE_LISP): Remove.
17342 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17343 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17344
17345 2011-05-18 Kenichi Handa <handa@m17n.org>
17346
17347 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17348 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17349 (find_automatic_composition): Mostly rewrite for efficiency.
17350
17351 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17352
17353 * makefile.w32-in: Update dependencies.
17354
17355 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17356
17357 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17358 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17359
17360 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17361
17362 Fix some integer overflow issues, such as string length overflow.
17363
17364 * insdel.c (count_size_as_multibyte): Check for string overflow.
17365
17366 * character.c (lisp_string_width): Check for string overflow.
17367 Use EMACS_INT, not int, for string indexes and lengths; in
17368 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17369 the resulting string length overflows an EMACS_INT; instead,
17370 report a string overflow if no precision given. When checking for
17371 precision exhaustion, use a check that cannot possibly have
17372 integer overflow. (Bug#8675)
17373 * character.h (lisp_string_width): Adjust to new signature.
17374
17375 * alloc.c (string_overflow): New function.
17376 (Fmake_string): Use it. This doesn't change behavior, but saves
17377 a few bytes and will simplify future changes.
17378 * character.c (string_escape_byte8): Likewise.
17379 * lisp.h (string_overflow): New decl.
17380
17381 Fixups, following up to the user-interface timestamp change.
17382 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17383 for UI timestamps, instead of unsigned long.
17384 * msdos.c (mouse_get_pos): Likewise.
17385 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17386 * w32gui.h (Time): Define by including "systime.h" rather than by
17387 declaring it ourselves. (Bug#8664)
17388
17389 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17390 * image.c (clear_image_cache): Likewise.
17391
17392 * term.c (term_mouse_position): Don't assume time_t wraparound.
17393
17394 Be more systematic about user-interface timestamps.
17395 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17396 and sometimes 'EMACS_UINT', to represent these timestamps.
17397 This change causes it to use 'Time' uniformly, as that's what X uses.
17398 This makes the code easier to follow, and makes it easier to catch
17399 integer overflow bugs such as Bug#8664.
17400 * frame.c (Fmouse_position, Fmouse_pixel_position):
17401 Use Time, not unsigned long, for user-interface timestamps.
17402 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17403 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17404 * keyboard.h (last_event_timestamp): Likewise.
17405 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17406 * menu.h (xmenu_show): Likewise.
17407 * term.c (term_mouse_position): Likewise.
17408 * termhooks.h (struct input_event.timestamp): Likewise.
17409 (struct terminal.mouse_position_hook): Likewise.
17410 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17411 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17412 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17413 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17414 what it was before.
17415 * menu.h, termhooks.h: Include "systime.h", for Time.
17416
17417 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17418 Don't assume that the difference between two unsigned long values
17419 can fit into an integer. At this point, we know button_down_time
17420 <= event->timestamp, so the difference must be nonnegative, so
17421 there's no need to cast the result if double-click-time is
17422 nonnegative, as it should be; check that it's nonnegative, just in
17423 case. This bug is triggered when events are more than 2**31 ms
17424 apart (about 25 days). (Bug#8664)
17425
17426 * xselect.c (last_event_timestamp): Remove duplicate decl.
17427 (x_own_selection): Remove needless cast to unsigned long.
17428
17429 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17430 that always fit in int. Use a sentinel instead of a counter, to
17431 avoid a temp and to allay GCC's concerns about possible int overflow.
17432 * frame.h (struct frame): Use int for menu_bar_items_used
17433 instead of EMACS_INT, since it always fits in int.
17434
17435 * menu.c (grow_menu_items): Check for int overflow.
17436
17437 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17438
17439 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17440 Before, the code was not consistent. These values cannot exceed
17441 2**31 - 1 so there's no need to make them unsigned.
17442 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17443 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17444 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17445 as modifiers.
17446 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17447
17448 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17449 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17450 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17451 presumably because the widths might not match.
17452
17453 * window.c (size_window): Avoid needless test at loop start.
17454
17455 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17456
17457 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17458
17459 2011-05-12 Drew Adams <drew.adams@oracle.com>
17460
17461 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17462
17463 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17464
17465 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17466 `width' to `bar_area_x' and `bar_area_width', respectively.
17467 (x_scroll_run): Take account of fringe background extension.
17468
17469 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17470 Rename local vars `left' and `width' to `bar_area_x' and
17471 `bar_area_width', respectively.
17472 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17473 background extension.
17474
17475 2011-05-10 Jim Meyering <meyering@redhat.com>
17476
17477 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17478
17479 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17480
17481 * image.c (Finit_image_library): Return t for built-in image types,
17482 like pbm and xbm. (Bug#8640)
17483
17484 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17485
17486 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17487
17488 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17489
17490 * w32console.c (Fset_screen_color): Doc fix.
17491 (Fget_screen_color): New function.
17492 (syms_of_ntterm): Defsubr it.
17493
17494 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17495 unlink the temporary file if Fcall_process didn't create it in the
17496 first place.
17497 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17498 child process will be redirected to a file specified with `:file'.
17499 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17500 cue to call_process_cleanup not to close that handle.
17501
17502 2011-05-07 Ben Key <bkey76@gmail.com>
17503
17504 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17505 one of two shell specific rules, either bootstrap-temacs-CMD or
17506 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17507 to the previous implementation of the bootstrap-temacs rule.
17508 The bootstrap-temacs-CMD rule is similar to the previous
17509 implementation of the bootstrap-temacs rule except that it
17510 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17511 variable.
17512
17513 These changes, along with some changes to nt/configure.bat,
17514 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17515 earlier fix to add support for --cflags and --ldflags options
17516 that include quotes so that it works whether make uses cmd or
17517 sh as the shell.
17518
17519 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17520
17521 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17522 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17523 is a constant.
17524 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17525 a string. Handle both cases.
17526 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17527 (Fdbus_register_method): Use Qinvalid_function.
17528
17529 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17530
17531 * makefile.w32-in: Update dependencies.
17532 (LISP_H): Add inttypes.h and stdin.h.
17533 (PROCESS_H): Add unistd.h.
17534
17535 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17536
17537 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17538 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17539
17540 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17541
17542 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17543
17544 * term.c (vfatal): Remove stray call to va_end.
17545 It's not needed and the C Standard doesn't allow it here anyway.
17546
17547 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17548 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17549
17550 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17551 bytes.
17552
17553 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17554
17555 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17556
17557 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17558
17559 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17560
17561 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17562
17563 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17564 * charset.c (Fdefine_charset_internal): Don't initialize
17565 charset.code_space[15]. The value was garbage, on hosts with
17566 32-bit int (Bug#8600).
17567
17568 * lread.c (read_integer): Be more consistent with string-to-number.
17569 Use string_to_number to do the actual conversion; this avoids
17570 rounding errors and fixes some other screwups. Without this fix,
17571 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17572 (digit_to_number): Move earlier, for benefit of read_integer.
17573 Return -1 if the digit is out of range for the base, -2 if it is
17574 not a digit in any supported base. (Bug#8602)
17575
17576 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17577
17578 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17579 to match comment at start of function. This also removes a
17580 GCC warning about overflow in a 32+64-bit port.
17581
17582 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17583
17584 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17585 Reported by Stefan Monnier in
17586 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17587 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17588 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17589
17590 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17591 (EMACS_UINTPTR): Likewise, with uintptr_t.
17592
17593 * lisp.h: Prefer 64-bit EMACS_INT if available.
17594 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17595 on 32-bit hosts that have 64-bit int, so that they can access
17596 large files.
17597 However, temporarily disable this change unless the temporary
17598 symbol WIDE_EMACS_INT is defined.
17599
17600 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17601
17602 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17603 This removes an assumption that EMACS_INT and long are the same
17604 width as pointers. The assumption is true for Emacs porting targets
17605 now, but we want to make other targets possible.
17606 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17607 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17608 In the rest of the code, change types of integers that hold casted
17609 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17610 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17611 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17612 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17613 No need to cast type when ORing.
17614 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17615 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17616 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17617 assume EMACS_INT is the same width as char *.
17618 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17619 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17620 Remove no-longer-needed casts.
17621 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17622 (xg_tool_bar_help_callback, xg_make_tool_item):
17623 Use EMACS_INTPTR to hold an integer
17624 that will be cast to void *; this can avoid a GCC warning
17625 if EMACS_INT is not the same width as void *.
17626 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17627 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17628 (current_message_1, set_message_1):
17629 Use a local to convert to proper width without a cast.
17630 * xmenu.c (dialog_selection_callback): Likewise.
17631
17632 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17633 Also, don't assume VALBITS / RAND_BITS is less than 5,
17634 and don't rely on undefined behavior when shifting a 1 left into
17635 the sign bit.
17636 * lisp.h (get_random): Change signature to match.
17637
17638 * lread.c (hash_string): Use size_t, not int, for hash computation.
17639 Normally we prefer signed values; but hashing is special, because
17640 it's better to use unsigned division on hash table sizes so that
17641 the remainder is nonnegative. Also, size_t is the natural width
17642 for hashing into memory. The previous code used 'int', which doesn't
17643 retain enough info to hash well into very large tables.
17644 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17645
17646 * dbusbind.c: Don't possibly lose pointer info when converting.
17647 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17648 Use XPNTR rather than XHASH, so that the high-order bits of
17649 the pointer aren't lost when converting through void *.
17650
17651 * eval.c (Fautoload): Don't double-shift a pointer.
17652
17653 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17654
17655 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17656
17657 * gnutls.c (DEF_GNUTLS_FN):
17658 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17659
17660 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17661
17662 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17663 marker. (Bug#8610)
17664
17665 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17666
17667 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17668 New version that can reserve upto 2GB of heap space.
17669
17670 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17671
17672 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17673
17674 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17675
17676 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17677 `gnutls_certificate_set_x509_key_file'.
17678
17679 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17680
17681 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17682 Update dependencies.
17683
17684 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17685
17686 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17687 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17688 Remove unused parameter `fildes'.
17689 * process.c (read_process_output, send_process): Don't pass it.
17690
17691 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17692
17693 Fix previous change: the library cache is defined in w32.c.
17694 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17695 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17696
17697 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17698
17699 Implement dynamic loading of GnuTLS on Windows.
17700
17701 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17702 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17703 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17704 Declare.
17705
17706 * gnutls.c (Qgnutls_dll): Define.
17707 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17708 (gnutls_*): Declare function pointers.
17709 (init_gnutls_functions): New function to initialize function pointers.
17710 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17711 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17712 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17713 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17714 (emacs_gnutls_write, emacs_gnutls_read)
17715 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17716 (Fgnutls_available_p): New function.
17717 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17718 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17719 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17720
17721 * image.c: Include w32.h.
17722 (Vimage_type_cache): Delete.
17723 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17724 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17725 (w32_delayed_load): Move to w32.c.
17726
17727 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17728
17729 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17730 (w32_delayed_load): Move from image.c. When loading a library, record
17731 its filename in the :loaded-from property of the library id.
17732 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17733 Initialize and staticpro them.
17734 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17735
17736 * process.c: Include lisp.h before w32.h, not after.
17737 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17738 instead of gnutls_record_check_pending.
17739
17740 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17741
17742 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17743
17744 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17745 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17746 as passed in.
17747
17748 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17749
17750 * xterm.c (x_set_frame_alpha): Do not set property on anything
17751 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17752
17753 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17754
17755 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17756
17757 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17758
17759 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17760 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17761 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17762 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17763 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17764 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17765 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17766 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17767 (Qgnutls_bootprop_callbacks_verify): Make static.
17768
17769 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17770
17771 * callproc.c: Indentation fixup.
17772
17773 * sysdep.c (wait_for_termination_1): Make static.
17774 (wait_for_termination, interruptible_wait_for_termination):
17775 Move after wait_for_termination_1.
17776
17777 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17778
17779 * sysdep.c (interruptible_wait_for_termination): New function
17780 which is like wait_for_termination, but allows keyboard
17781 interruptions.
17782
17783 * callproc.c (Fcall_process): Add (:file "file") as an option for
17784 the STDOUT buffer.
17785 (Fcall_process_region): Ditto.
17786
17787 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17788
17789 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17790 rather than `XVECTOR (FOO)->size'.
17791
17792 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17793 inttypes.h, as a gnulib replacement is used if it not available in
17794 system headers.
17795
17796 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17797
17798 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17799 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17800 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17801
17802 * coding.c (coding_alloc_by_realloc): Error out if destination
17803 will grow beyond MOST_POSITIVE_FIXNUM.
17804 (decode_coding_emacs_mule): Abort if there isn't enough place in
17805 charbuf for the composition carryover bytes. Reserve an extra
17806 space for up to 2 characters produced in a loop.
17807 (decode_coding_iso_2022): Abort if there isn't enough place in
17808 charbuf for the composition carryover bytes.
17809
17810 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17811
17812 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17813 aborting when %lld or %lll format is passed.
17814 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17815 %llo or %llx format is passed. (Bug#8545)
17816
17817 * window.c (window_scroll_line_based): Use a marker instead of
17818 simple variables to record original value of point. (Bug#7952)
17819
17820 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17821 produced by %s or %c overflows available buffer space. (Bug#8545)
17822
17823 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17824
17825 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17826 (SIZE_MAX): Move defn after all includes, as they might #define it.
17827
17828 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17829
17830 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17831
17832 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17833
17834 * keyboard.c (Qdelayed_warnings_hook): Define.
17835 (command_loop_1): Run `delayed-warnings-hook'
17836 if Vdelayed_warnings_list is non-nil.
17837 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17838 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17839
17840 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17841
17842 * doprnt.c (doprnt): Don't return value smaller than the buffer
17843 size if the message was truncated. (Bug#8545).
17844
17845 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17846
17847 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17848 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17849
17850 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17851
17852 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17853
17854 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17855
17856 * makefile.w32-in: Update dependencies.
17857
17858 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17859
17860 Improve `doprnt' and its usage. (Bug#8545)
17861 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17862 `format_end'. Remove support for %l as a conversion specifier.
17863 Don't use xrealloc. Improve diagnostics when the %l size modifier
17864 is used. Update the commentary.
17865
17866 * eval.c (verror): Simplify calculation of size_t.
17867
17868 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17869 messages.
17870
17871 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17872
17873 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17874 change.
17875
17876 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17877
17878 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17879 This makes this file independent of the recent pseudovector change.
17880
17881 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17882
17883 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17884
17885 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17886 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17887 Remove unused local.
17888 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17889
17890 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17891 GCC 4.6.0 optimizes based on type-based alias analysis.
17892 For example, if b is of type struct buffer * and v of type struct
17893 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17894 != &v->size, and therefore "v->size = 1; b->size = 2; return
17895 v->size;" must therefore return 1. This assumption is incorrect
17896 for Emacs, since it type-puns struct Lisp_Vector * with many other
17897 types. To fix this problem, this patch adds a new type struct
17898 vectorlike_header that documents the constraints on layout of vectors
17899 and pseudovectors, and helps optimizing compilers not get fooled
17900 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17901 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17902 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17903 the size member.
17904 (XSETPVECTYPE): Rewrite in terms of new macro.
17905 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17906 This is a bit clearer, and further avoids the possibility of
17907 undesirable aliasing.
17908 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17909 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17910 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17911 since Lisp_Subr is a special case (no "next" field).
17912 (ASIZE): Now uses header.size rather than size.
17913 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17914 to avoid the hassle of writing XVECTOR (foo)->header.size.
17915 (struct vectorlike_header): New type.
17916 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17917 object, to help avoid aliasing.
17918 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17919 (SUBRP): Likewise, since Lisp_Subr is a special case.
17920 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17921 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17922 (struct Lisp_Hash_Table): Combine first two members into a single
17923 struct vectorlike_header member. All uses of "size" and "next" members
17924 changed to be "header.size" and "header.next".
17925 * buffer.h (struct buffer): Likewise.
17926 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17927 * frame.h (struct frame): Likewise.
17928 * process.h (struct Lisp_Process): Likewise.
17929 * termhooks.h (struct terminal): Likewise.
17930 * window.c (struct save_window_data, struct saved_window): Likewise.
17931 * window.h (struct window): Likewise.
17932 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17933 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17934 * buffer.c (init_buffer_once): Likewise.
17935 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17936 special case.
17937 * process.c (Fformat_network_address): Use local var for size,
17938 for brevity.
17939
17940 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17941
17942 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17943 * data.c (atof): Remove decl; no longer used or needed.
17944 (digit_to_number): Move to lread.c.
17945 (Fstring_to_number): Use new string_to_number function, to be
17946 consistent with how the Lisp reader treats infinities and NaNs.
17947 Do not assume that floating-point numbers represent EMACS_INT
17948 without losing information; this is not true on most 64-bit hosts.
17949 Avoid double-rounding errors, by insisting on integers when
17950 parsing non-base-10 numbers, as the documentation specifies.
17951 * lisp.h (string_to_number): New decl, replacing ...
17952 (isfloat_string): Remove.
17953 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17954 (read1): Do not accept +. and -. as integers; this
17955 appears to have been a coding error. Similarly, do not accept
17956 strings like +-1e0 as floating point numbers. Do not report
17957 overflow for integer overflows unless the base is not 10 which
17958 means we have no simple and reliable way to continue.
17959 Break out the floating-point parsing into a new
17960 function string_to_number, so that Fstring_to_number parses
17961 floating point numbers consistently with the Lisp reader.
17962 (digit_to_number): Move here from data.c. Make it static inline.
17963 (E_CHAR, EXP_INT): Remove, replacing with ...
17964 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17965 (string_to_number): New function, replacing isfloat_string.
17966 This function checks for valid syntax and produces the resulting
17967 Lisp float number too. Rework it so that string-to-number
17968 no longer mishandles examples like "1.0e+". Use strtoumax,
17969 so that overflow for non-base-10 numbers is reported only when
17970 there's no portable and simple way to convert to floating point.
17971
17972 * textprop.c (set_text_properties_1): Rewrite for clarity,
17973 and to avoid GCC warning about integer overflow.
17974
17975 * intervals.h (struct interval): Use EMACS_INT for members
17976 where EMACS_UINT might cause problems. See
17977 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17978 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17979 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17980 All uses changed.
17981 (offset_intervals): Tell GCC not to worry about length overflow
17982 when negating a negative length.
17983
17984 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17985 (overrun_check_free): Likewise.
17986
17987 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17988 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17989 word size.
17990
17991 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17992 (gnutls_make_error): Rename local to avoid shadowing.
17993 (gnutls_emacs_global_deinit): ifdef out; not used.
17994 (Fgnutls_boot): Use const for pointer to readonly storage.
17995 Comment out unused local. Fix pointer signedness problems.
17996
17997 * lread.c (openp): Don't stuff size_t into an 'int'.
17998 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17999 about possible signed overflow.
18000
18001 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18002 (GDK_KEY_g): Don't define if already defined.
18003 (xg_prepare_tooltip): Avoid pointer signedness problem.
18004 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18005
18006 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18007 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18008
18009 * xfns.c (Fx_window_property): Simplify a bit,
18010 to make a bit faster and to avoid GCC 4.6.0 warning.
18011 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18012
18013 * fns.c (internal_equal): Don't assume size_t fits in int.
18014
18015 * alloc.c (compact_small_strings): Tighten assertion a little.
18016
18017 Replace pEd with more-general pI, and fix some printf arg casts.
18018 * lisp.h (pI): New macro, generalizing old pEd macro to other
18019 conversion specifiers. For example, use "...%"pI"d..." rather
18020 than "...%"pEd"...".
18021 (pEd): Remove. All uses replaced with similar uses of pI.
18022 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18023 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18024 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18025 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18026 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18027 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18028 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18029 64-bit hosts.
18030 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18031 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18032 * print.c (safe_debug_print, print_object): Likewise.
18033 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18034 to int.
18035 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18036 avoiding the 0 flag, which is not portable.
18037 * process.c (Fmake_network_process): Use pI to avoid cast.
18038 * region-cache.c (pp_cache): Likewise.
18039 * xdisp.c (decode_mode_spec): Likewise.
18040 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18041 behavior on 64-bit hosts with printf arg.
18042 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18043 (x_stop_queuing_selection_requests): Likewise.
18044 (x_get_window_property): Don't truncate byte count to an 'int'
18045 when tracing.
18046
18047 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18048 here, since it parses constructs like leading '-' and spaces,
18049 which are not wanted; and it overflows with large numbers.
18050 Instead, simply match F[0-9]+, which is what is wanted anyway.
18051
18052 * alloc.c: Remove unportable assumptions about struct layout.
18053 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18054 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18055 (allocate_vectorlike, make_pure_vector): Use the new macros,
18056 plus offsetof, to remove unportable assumptions about struct layout.
18057 These assumptions hold on all porting targets that I know of, but
18058 they are not guaranteed, they're easy to remove, and removing them
18059 makes further changes easier.
18060
18061 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18062 This doesn't fix a bug but makes the code clearer.
18063 (string_overrun_cookie): Now const. Use initializers that
18064 don't formally overflow signed char, to avoid warnings.
18065 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18066 can cause Emacs to crash when string overrun checking is enabled.
18067 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18068 multiple of sizeof (EMACS_INT); it need not be, if
18069 alignof(EMACS_INT) < sizeof (EMACS_INT).
18070 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18071
18072 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18073
18074 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18075
18076 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18077
18078 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18079 supposed to be handshaking. (Bug#8556)
18080 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18081
18082 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18083
18084 * lisp.h (Qdebug): List symbol.
18085 * eval.c (Qdebug): Restore global linkage.
18086 * keyboard.c (debug-on-event): New variable.
18087 (handle_user_signal): Break into debugger when debug-on-event
18088 matches the current signal symbol.
18089
18090 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18091
18092 * alloc.c (check_sblock, check_string_bytes)
18093 (check_string_free_list): Convert to standard C.
18094
18095 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18096
18097 * w32.c (emacs_gnutls_push): Fix typo.
18098
18099 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18100
18101 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18102 "cast to pointer from integer of different size".
18103
18104 Improve doprnt and its use in verror. (Bug#8545)
18105 * doprnt.c (doprnt): Document the set of format control sequences
18106 supported by the function. Use SAFE_ALLOCA instead of always
18107 using `alloca'.
18108
18109 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18110 is one byte too soon. Don't use xrealloc; instead xfree and
18111 xmalloc anew.
18112
18113 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18114
18115 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18116 callbacks stage.
18117
18118 * gnutls.c: Renamed global_initialized to
18119 gnutls_global_initialized. Added internals for the
18120 :verify-hostname-error, :verify-error, and :verify-flags
18121 parameters of `gnutls-boot' and documented those parameters in the
18122 docstring. Start callback support.
18123 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18124 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18125 on error. Return error code.
18126 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18127 (emacs_gnutls_read): Likewise.
18128 (Fgnutls_boot): Return handshake error code.
18129 (emacs_gnutls_handle_error): New function.
18130 (wsaerror_to_errno): Likewise.
18131
18132 * w32.h (emacs_gnutls_pull): Add prototype.
18133 (emacs_gnutls_push): Likewise.
18134
18135 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18136 (emacs_gnutls_push): Likewise.
18137
18138 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18139
18140 * process.c (wait_reading_process_output): Check if GnuTLS
18141 buffered some data internally if no FDs are set for TLS
18142 connections.
18143
18144 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18145 (LIBS): Link to USER_LIBS.
18146 ($(BLD)/gnutls.$(0)): New target.
18147
18148 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18149
18150 * xdisp.c (handle_single_display_spec): Rename the
18151 display_replaced_before_p argument into display_replaced_p, to
18152 make it consistent with the commentary. Fix typos in the
18153 commentary.
18154
18155 * textprop.c (syms_of_textprop): Remove dead code.
18156 (copy_text_properties): Delete obsolete commentary about an
18157 interface that was deleted long ago. Fix typos in the description
18158 of arguments.
18159
18160 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18161 to changes in oldXMenu/XMenu.h from 2011-04-16.
18162 <menu_help_message, prev_menu_help_message>: Constify.
18163 (IT_menu_make_room): menu->help_text is now `const char **';
18164 adjust.
18165
18166 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18167 to changes in oldXMenu/XMenu.h from 2011-04-16.
18168 (struct XMenu): Declare `help_text' `const char **'.
18169
18170 * xfaces.c <Qunspecified>: Make extern again.
18171
18172 * syntax.c: Include sys/types.h before including regex.h, as
18173 required by POSIX.
18174
18175 * doc.c (get_doc_string): Improve the format passed to `error'.
18176
18177 * doprnt.c (doprnt): Improve commentary.
18178
18179 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18180
18181 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18182 them with etags.
18183
18184 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18185 changes in globals.h immediately force recompilation.
18186 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18187 $(CURDIR)/s/ms-w32.h.
18188 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18189
18190 * character.c (Fchar_direction): Function deleted.
18191 (syms_of_character): Don't defsubr it.
18192 <char-direction-table>: Deleted.
18193
18194 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18195
18196 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18197 * doprnt.c: Include limits.h.
18198 (SIZE_MAX): New macro.
18199 (doprnt): Return a size_t value. 2nd arg is now size_t.
18200 Many local variables are now size_t instead of int or unsigned.
18201 Improve overflow protection. Support `l' modifier for integer
18202 conversions. Support %l conversion. Don't assume an EMACS_INT
18203 argument for integer conversions and for %c.
18204
18205 * lisp.h (doprnt): Restore prototype.
18206
18207 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18208 $(SRC)/character.h.
18209
18210 * Makefile.in (base_obj): Add back doprnt.o.
18211
18212 * deps.mk (doprnt.o): Add back prerequisites.
18213 (callint.o): Depend on character.h.
18214
18215 * eval.c (internal_lisp_condition_case): Include the handler
18216 representation in the error message.
18217 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18218 when breaking from the loop.
18219
18220 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18221
18222 * callint.c (Fcall_interactively): When displaying error message
18223 about invalid control letter, pass the character's codepoint, not
18224 a pointer to its multibyte form. Improve display of the character
18225 in octal and display also its hex code.
18226
18227 * character.c (char_string): Use %x to display the (unsigned)
18228 codepoint of an invalid character, to avoid displaying a bogus
18229 negative value.
18230
18231 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18232 `error', not SYMBOL_NAME itself.
18233
18234 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18235 character arguments to `error'.
18236
18237 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18238 to `error' in error message about FINAL_CHAR argument. Make sure
18239 FINAL_CHAR is a character, and use %c when it is passed as
18240 argument to `error'.
18241
18242 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18243
18244 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18245
18246 * w32.c: Include <time.h>.
18247 (sys_localtime): New function.
18248
18249 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18250
18251 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18252
18253 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18254
18255 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18256
18257 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18258 zombies (Bug#8467).
18259
18260 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18261
18262 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18263 gl_state.e_property when gl_state.object is Qt.
18264
18265 * insdel.c (make_gap_larger): Remove limitation of buffer size
18266 to <= INT_MAX.
18267
18268 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18269
18270 * xdisp.c (lookup_glyphless_char_display)
18271 (produce_glyphless_glyph): Handle cons cell entry in
18272 glyphless-char-display.
18273 (Vglyphless_char_display): Document it.
18274
18275 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18276 glyphless-char-display.
18277
18278 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18279
18280 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18281
18282 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18283
18284 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18285 definition for no-X builds.
18286
18287 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18288
18289 Static checks with GCC 4.6.0 and non-default toolkits.
18290
18291 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18292
18293 * process.c (keyboard_bit_set): Define only if SIGIO.
18294 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18295 (send_process): Repair possible setjmp clobbering.
18296
18297 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18298
18299 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18300
18301 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18302
18303 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18304 Define only if needed.
18305
18306 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18307 by pacifying GCC about it. Maybe it's time to retire it?
18308 * xfaces.c (USG, __TIMEVAL__): Likewise.
18309
18310 * dispextern.h (struct redisplay_interface): Rename param
18311 to avoid shadowing.
18312 * termhooks.h (struct terminal): Likewise.
18313 * xterm.c (xembed_send_message): Likewise.
18314
18315 * insdel.c (make_gap_smaller): Define only if
18316 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18317
18318 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18319 it.
18320
18321 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18322 so that we aren't warned about unused symbols.
18323
18324 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18325
18326 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18327
18328 * xfns.c (x_real_positions): Mark locals as initialized.
18329
18330 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18331
18332 * xterm.c: Fix problems found by static analysis with other toolkits.
18333 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18334 (x_dispatch_event): Declare static if USE_GTK, and
18335 define if USE_GTK || USE_X_TOOLKIT.
18336 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18337 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18338 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18339 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18340
18341 * xmenu.c (menu_help_callback): Pointer type fixes.
18342 Use const pointers when pointing at readonly data. Avoid pointer
18343 signedness clashes.
18344 (FALSE): Remove unused macro.
18345 (update_frame_menubar): Remove unused decl.
18346
18347 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18348
18349 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18350 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18351 (single_menu_item): Rename local to avoid shadowing.
18352
18353 * keyboard.c (make_lispy_event): Remove unused local var.
18354
18355 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18356 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18357
18358 * bitmaps: Change bitmaps from unsigned char back to the X11
18359 compatible char. Avoid the old compiler warnings about
18360 out-of-range initializers by using, for example, '\xab' rather
18361 than 0xab.
18362
18363 * xgselect.c (xgselect_initialize): Check vs interface
18364 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18365
18366 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18367
18368 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18369 to read-only memory.
18370
18371 * fns.c (vector): Remove; this old hack is no longer needed.
18372
18373 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18374 Remove unused var.
18375 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18376
18377 * xrdb.c (x_load_resources): Omit unused local.
18378
18379 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18380 (x_window): Rename locals to avoid shadowing.
18381 (USG): Use the kludged USG macro, to pacify gcc.
18382
18383 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18384 (x_term_init): Remove local to avoid shadowing.
18385
18386 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18387
18388 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18389 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18390
18391 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18392
18393 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18394
18395 Fix regex.c, syntax.c and friends for buffers > 2GB.
18396 * syntax.h (struct gl_state_s): Declare character position members
18397 EMACS_INT.
18398
18399 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18400
18401 * textprop.c (verify_interval_modification, interval_of):
18402 Declare arguments EMACS_INT.
18403
18404 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18405 EMACS_INT.
18406
18407 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18408
18409 * indent.c (Fvertical_motion): Local variable it_start is now
18410 EMACS_INT.
18411
18412 * regex.c (re_match, re_match_2, re_match_2_internal)
18413 (bcmp_translate, regcomp, regexec, print_double_string)
18414 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18415 (re_compile_pattern, re_exec): Declare arguments and local
18416 variables `size_t' and `ssize_t' and return values `regoff_t', as
18417 appropriate.
18418 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18419 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18420 <compile_stack_type>: `size' and `avail' are now `size_t'.
18421
18422 * regex.h <regoff_t>: Use ssize_t, not int.
18423 (re_search, re_search_2, re_match, re_match_2): Arguments that
18424 specify buffer/string position and length are now ssize_t and
18425 size_t. Return type is regoff_t.
18426
18427 2011-04-16 Ben Key <bkey76@gmail.com>
18428
18429 * nsfont.m: Fixed bugs in ns_get_family and
18430 ns_descriptor_to_entity that were caused by using free to
18431 deallocate memory blocks that were allocated by xmalloc (via
18432 xstrdup). This caused Emacs to crash when compiled with
18433 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18434 --enable-checking=xmallocoverrun). xfree is now used to
18435 deallocate these memory blocks.
18436
18437 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18438
18439 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18440
18441 emacs_write: Accept and return EMACS_INT for sizes.
18442 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18443 et seq.
18444 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18445 Accept and return EMACS_INT.
18446 (emacs_gnutls_write): Return the number of bytes written on
18447 partial writes.
18448 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18449 (emacs_read, emacs_write): Remove check for negative size, as the
18450 Emacs source code has been audited now.
18451 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18452 (emacs_read, emacs_write): Use it.
18453 * process.c (send_process): Adjust to the new signatures of
18454 emacs_write and emacs_gnutls_write. Do not attempt to store
18455 a byte offset into an 'int'; it might overflow.
18456 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18457
18458 * sound.c: Don't assume sizes fit in 'int'.
18459 (struct sound_device.period_size, alsa_period_size):
18460 Return EMACS_INT, not int.
18461 (struct sound_device.write, vox_write, alsa_write):
18462 Accept EMACS_INT, not int.
18463 (wav_play, au_play): Use EMACS_INT to store sizes and to
18464 record read return values.
18465
18466 2011-04-15 Ben Key <bkey76@gmail.com>
18467
18468 * keyboard.c (Qundefined): Don't declare static since it is used
18469 in nsfns.m.
18470 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18471 static since they are used in nsfont.m.
18472
18473 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18474
18475 * process.c (Qprocessp): Don't declare static.
18476 * lisp.h (Qprocessp): Declare again.
18477
18478 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18479
18480 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18481
18482 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18483
18484 Improve C-level modularity by making more things 'static'.
18485
18486 Don't publish debugger-only interfaces to other modules.
18487 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18488 (verify_bytepos, count_markers): Move decls to the only modules
18489 that need them.
18490 * region-cache.h (pp_cache): Likewise.
18491 * window.h (check_all_windows): Likewise.
18492 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18493
18494 * sysdep.c (croak): Now static, if
18495 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18496 * syssignal.h (croak): Declare only if not static.
18497
18498 * alloc.c (refill_memory_reserve): Now static if
18499 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18500 * lisp.h (refill_memory_reserve): Declare only if not static.
18501
18502 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18503 Define only if USE_LUCID.
18504
18505 * xrdb.c (x_customization_string, x_rm_string): Now static.
18506
18507 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18508 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18509
18510 * xdisp.c (draw_row_with_mouse_face): Now static.
18511 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18512
18513 * window.h (check_all_windows): Mark externally visible.
18514
18515 * window.c (window_deletion_count): Now static.
18516
18517 * undo.c: Make symbols static if they're not exported.
18518 (last_undo_buffer, last_boundary_position, pending_boundary):
18519 Now static.
18520
18521 * textprop.c (interval_insert_behind_hooks): Now static.
18522 (interval_insert_in_front_hooks): Likewise.
18523
18524 * term.c: Make symbols static if they're not exported.
18525 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18526 (max_frame_lines, tty_set_terminal_modes):
18527 (tty_reset_terminal_modes, tty_turn_off_highlight):
18528 (get_tty_terminal): Now static.
18529 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18530 * termhooks.h (term_mouse_moveto): Do not declare if
18531 HAVE_WINDOW_SYSTEM.
18532 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18533 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18534
18535 * sysdep.c: Make symbols static if they're not exported.
18536 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18537 Now static.
18538 (sigprocmask_set, full_mask): Remove; unused.
18539 (wait_debugging): Mark as visible.
18540 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18541 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18542
18543 * syntax.c (syntax_temp): Define only if !__GNUC__.
18544
18545 * sound.c (current_sound_device, current_sound): Now static.
18546
18547 * search.c (searchbufs, searchbuf_head): Now static.
18548
18549 * scroll.c (scroll_cost): Remove; unused.
18550 * dispextern.h (scroll_cost): Remove decl.
18551
18552 * region-cache.h (pp_cache): Mark as externally visible.
18553
18554 * process.c: Make symbols static if they're not exported.
18555 (process_tick, update_tick, create_process, chan_process):
18556 (Vprocess_alist, proc_buffered_char, datagram_access):
18557 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18558 (deactivate_process): Mark defn as static, as well as decl.
18559 * lisp.h (create_process): Remove decl.
18560 * process.h (chan_process, Vprocess_alist): Remove decls.
18561
18562 * print.c: Make symbols static if they're not exported.
18563 (print_depth, new_backquote_output, being_printed, print_buffer):
18564 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18565 (print_interval, print_number_index, initial_stderr_stream):
18566 Now static.
18567 * lisp.h (Fprinc): Remove decl.
18568 (debug_output_compilation_hack): Mark as externally visible.
18569
18570 * sysdep.c (croak): Move decl from here to syssignal.h.
18571 * syssignal.h (croak): Put it here, so the API can be checked when
18572 'croak' is called from dissociate_if_controlling_tty.
18573
18574 * minibuf.c: Make symbols static if they're not exported.
18575 (minibuf_save_list, choose_minibuf_frame): Now static.
18576 * lisp.h (choose_minibuf_frame): Remove decl.
18577
18578 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18579
18580 * lread.c: Make symbols static if they're not exported.
18581 (read_objects, initial_obarray, oblookup_last_bucket_number):
18582 Now static.
18583 (make_symbol): Remove; unused.
18584 * lisp.h (initial_obarray, make_symbol): Remove decls.
18585
18586 * keyboard.c: Make symbols static if they're not exported.
18587 (single_kboard, recent_keys_index, total_keys, recent_keys):
18588 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18589 (this_single_command_key_start, echoing, last_auto_save):
18590 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18591 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18592 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18593 (Vlispy_mouse_stem, double_click_count):
18594 Now static.
18595 (force_auto_save_soon): Define only if SIGDANGER.
18596 (ignore_mouse_drag_p): Now static if
18597 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18598 (print_help): Remove; unused.
18599 (stop_character, last_timer_event): Mark as externally visible.
18600 * keyboard.h (ignore_mouse_drag_p): Declare only if
18601 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18602 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18603 * lisp.h (echoing): Remove decl.
18604 (force_auto_save_soon): Declare only if SIGDANGER.
18605 * xdisp.c (redisplay_window): Simplify code, to make it more
18606 obvious that ignore_mouse_drag_p is not accessed if !defined
18607 USE_GTK && !defined HAVE_NS.
18608
18609 * intervals.c: Make symbols static if they're not exported.
18610 (merge_properties_sticky, merge_interval_right, delete_interval):
18611 Now static.
18612 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18613
18614 * insdel.c: Make symbols static if they're not exported.
18615 However, leave prepare_to_modify_buffer alone. It's never
18616 called from outside this function, but that appears to be a bug.
18617 (combine_after_change_list, combine_after_change_buffer):
18618 (adjust_after_replace, signal_before_change): Now static.
18619 (adjust_after_replace_noundo): Remove; unused.
18620 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18621 (signal_before_change): Remove decls.
18622
18623 * indent.c (val_compute_motion, val_vmotion): Now static.
18624
18625 * image.c: Make symbols static if they're not exported.
18626 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18627 if USE_GTK.
18628 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18629 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18630
18631 * fringe.c (standard_bitmaps): Now static.
18632 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18633
18634 * frame.c: Make symbols static if they're not exported.
18635 (x_report_frame_params, make_terminal_frame): Now static.
18636 (get_frame_param): Now static, unless HAVE_NS.
18637 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18638 (x_get_resource_string): Remove; not used.
18639 * frame.h (make_terminal_frame, x_report_frame_params):
18640 (x_get_resource_string); Remove decls.
18641 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18642 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18643
18644 * font.c, fontset.c: Make symbols static if they're not exported.
18645 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18646 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18647 * font.c (font_close_object): Now static.
18648 * font.h (font_close_object): Remove.
18649 * fontset.c (FONTSET_OBJLIST): Remove.
18650 (free_realized_fontset) #if-0 the body, which does nothing.
18651 (face_suitable_for_char_p): #if-0, as it's never called.
18652 * fontset.h (face_suitable_for_char_p): Remove decl.
18653 * xfaces.c (face_at_string_position):
18654 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18655 since 0 is always ASCII.
18656
18657 * fns.c (weak_hash_tables): Now static.
18658
18659 * fileio.c: Make symbols static if they're not exported.
18660 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18661 (Vwrite_region_annotation_buffers): Now static.
18662
18663 * eval.c: Make symbols static if they're not exported.
18664 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18665 * lisp.h (backtrace_list): Remove decl.
18666
18667 * emacs.c: Make symbols static if they're not exported.
18668 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18669 (fatal_error_code, fatal_error_signal_hook, standard_args):
18670 Now static.
18671 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18672 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18673 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18674 * lisp.h (fatal_error_signal_hook): Remove decl.
18675 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18676
18677 * editfns.c: Move a (normally-unused) function to its only use.
18678 * editfns.c, lisp.h (get_operating_system_release): Remove.
18679 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18680 worth the hassle of breaking this out.
18681
18682 * xterm.c: Make symbols static if they're not exported.
18683 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18684 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18685 (x_destroy_window, x_delete_display):
18686 Now static.
18687 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18688 (x_mouse_leave): Remove; unused.
18689 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18690 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18691 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18692 Remove decls.
18693 (x_mouse_leave): Declare only if WINDOWSNT.
18694 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18695 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18696 USE_X_TOOLKIT.
18697
18698 * ftxfont.c: Make symbols static if they're not exported.
18699 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18700 HAVE_FREETYPE.
18701 * font.h (ftxfont_driver): Likewise.
18702
18703 * xfns.c: Make symbols static if they're not exported.
18704 (x_last_font_name, x_display_info_for_name):
18705 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18706 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18707 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18708 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18709 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18710 (last_show_tip_args): Now static.
18711 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18712 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18713 (x_screen_planes): Remove; unused.
18714 * dispextern.h (x_screen_planes): Remove decl.
18715
18716 * dispnew.c: Make symbols static if they're not exported.
18717 * dispextern.h (redraw_garbaged_frames, scrolling):
18718 (increment_row_positions): Remove.
18719 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18720 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18721 Now static.
18722 (redraw_garbaged_frames): Remove; unused.
18723
18724 * xfaces.c: Make symbols static if they're not exported.
18725 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18726 Remove decls.
18727 * xterm.h (defined_color): Remove decls.
18728 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18729 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18730 (menu_face_changed_default, defined_color, free_realized_face):
18731 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18732 (ascii_face_of_lisp_face): Remove; unused.
18733
18734 * xdisp.c: Make symbols static if they're not exported.
18735 * dispextern.h (scratch_glyph_row, window_box_edges):
18736 (glyph_to_pixel_coords, set_cursor_from_row):
18737 (get_next_display_element, set_iterator_to_next):
18738 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18739 (show_mouse_face): Remove decls
18740 * frame.h (message_buf_print): Likewise.
18741 * lisp.h (pop_message, set_message, check_point_in_composition):
18742 Likewise.
18743 * xterm.h (set_vertical_scroll_bar): Likewise.
18744 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18745 (message_buf_print, scratch_glyph_row, displayed_buffer):
18746 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18747 (get_next_display_element, show_mouse_face, window_box_edges):
18748 (frame_to_window_pixel_xy, check_point_in_composition):
18749 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18750 (glyph_to_pixel_coords): Remove; unused.
18751
18752 * dired.c (file_name_completion): Now static.
18753
18754 * dbusbind.c (xd_in_read_queued_messages): Now static.
18755
18756 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18757 * data.c (circular_list_error): Remove.
18758
18759 * commands.h (last_point_position, last_point_position_buffer):
18760 (last_point_position_window): Remove decls.
18761 * keyboard.c: Make these variables static.
18762
18763 * coding.h (coding, code_convert_region, encode_coding_gap):
18764 Remove decls.
18765 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18766 (iso_code_class, detect_coding, code_convert_region): Now static.
18767 (encode_coding_gap): Remove; unused.
18768
18769 * chartab.c (chartab_chars, chartab_bits): Now static.
18770
18771 * charset.h (charset_iso_8859_1): Remove decl.
18772 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18773 Now static.
18774
18775 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18776 * ccl.c (Vccl_program_table): Now static.
18777 (check_ccl_update): Remove; unused.
18778
18779 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18780 * category.h: ... from here.
18781 * category.c (check_category_table, set_category_set): Now static.
18782
18783 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18784 * lisp.h: Remove these decls.
18785
18786 * buffer.c (buffer_count): Remove unused var.
18787
18788 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18789 so that it's not optimized away.
18790 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18791 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18792 exported only to the debugger.
18793
18794 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18795 * atimer.h (run_all_atimers): Remove; not exported.
18796
18797 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18798 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18799 was inaccessible from Lisp.
18800 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18801 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18802
18803 alloc.c: Import and export fewer symbols, and remove unused items.
18804 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18805 is defined.
18806 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18807 it's not optimized away by whole-program optimization.
18808 (message_enable_multibyte, free_misc): Remove.
18809 (catchlist, handlerlist, mark_backtrace):
18810 Declare only if BYTE_MARK_STACK.
18811 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18812 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18813 (message_enable_multibyte): Remove decl.
18814 (free_misc, interval_free_list, float_block, float_block_index):
18815 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18816 (cons_free_list, last_marked_index):
18817 Now static.
18818 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18819 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18820 (mark_backtrace): Define only if BYTE_MARK_STACK.
18821 * xdisp.c (message_enable_multibyte): Now static.
18822
18823 Declare Lisp_Object Q* variables to be 'static' if not exported.
18824 This makes it easier for human readers (and static analyzers)
18825 to see whether these variables are used from other modules.
18826 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18827 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18828 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18829 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18830 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18831 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18832 * xmenu.c, xselect.c:
18833 Declare Q* vars static if they are not used in other modules.
18834 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18835 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18836 Remove decls of unexported vars.
18837 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18838
18839 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18840
18841 Make Emacs functions such as Fatom 'static' by default.
18842 This makes it easier for human readers (and static analyzers)
18843 to see whether these functions can be called from other modules.
18844 DEFUN now defines a static function. To make the function external
18845 so that it can be used in other C modules, use the new macro DEFUE.
18846 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18847 (Finit_image_library):
18848 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18849 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18850 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18851 Remove decls, since these functions are now static.
18852 (Funintern, Fget_internal_run_time): New decls, since these functions
18853 were already external.
18854
18855 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18856 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18857 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18858 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18859 * keyboard.c, keymap.c, lread.c:
18860 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18861 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18862 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18863 Mark functions with DEFUE instead of DEFUN,
18864 if they are used in other modules.
18865 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18866 decls for now-static functions.
18867 * buffer.h (Fdelete_overlay): Remove decl.
18868 * callproc.c (Fgetenv_internal): Mark as internal.
18869 * composite.c (Fremove_list_of_text_properties): Remove decl.
18870 (Fcomposition_get_gstring): New forward static decl.
18871 * composite.h (Fcomposite_get_gstring): Remove decl.
18872 * dired.c (Ffile_attributes): New forward static decl.
18873 * doc.c (Fdocumntation_property): New forward static decl.
18874 * eval.c (Ffetch_bytecode): New forward static decl.
18875 (Funintern): Remove extern decl; now in .h file where it belongs.
18876 * fileio.c (Fmake_symbolic_link): New forward static decl.
18877 * image.c (Finit_image_library): New forward static decl.
18878 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18879 * intervals.h (Fprevious_property_change):
18880 (Fremove_list_of_text_properties): Remove decls.
18881 * keyboard.c (Fthis_command_keys): Remove decl.
18882 (Fcommand_execute): New forward static decl.
18883 * keymap.c (Flookup_key): New forward static decl.
18884 (Fcopy_keymap): Now static.
18885 * keymap.h (Flookup_key): Remove decl.
18886 * process.c (Fget_process): New forward static decl.
18887 (Fprocess_datagram_address): Mark as internal.
18888 * syntax.c (Fsyntax_table_p): New forward static decl.
18889 (skip_chars): Remove duplicate decl.
18890 * textprop.c (Fprevious_property_change): New forward static decl.
18891 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18892 Now internal.
18893 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18894 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18895
18896 * editfns.c (Fformat): Remove unreachable code.
18897
18898 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18899
18900 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18901 change. (Bug#8496)
18902
18903 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18904
18905 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18906 when at ZV. (Bug#8487)
18907
18908 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18909
18910 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18911 (Bug#8437)
18912 * keyboard.c (parse_tool_bar_item): Likewise.
18913 * sound.c (sound_cleanup, alsa_close): Likewise.
18914 * termcap.c (tgetent): Likewise.
18915 * xfns.c (x_default_font_parameter): Likewise.
18916 * xsettings.c (read_and_apply_settings): Likewise.
18917
18918 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18919 (overrun_check_free): Protoize.
18920
18921 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18922
18923 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18924 since callers should never pass a negative size.
18925 Change the signature to match that of plain 'read' and 'write'; see
18926 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18927 * lisp.h: Update prototypes of emacs_write and emacs_read.
18928
18929 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18930
18931 * xdisp.c (redisplay_window): Don't try to determine the character
18932 position of the scroll margin if the window start point w->startp
18933 is outside the buffer's accessible region. (Bug#8468)
18934
18935 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18936
18937 Fix write-region and its subroutines for buffers > 2GB.
18938 * fileio.c (a_write, e_write): Modify declaration of arguments and
18939 local variables to support buffers larger than 2GB.
18940 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18941
18942 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18943 argument, local variables, and return value.
18944
18945 * lisp.h: Update prototypes of emacs_write and emacs_read.
18946
18947 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18948
18949 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18950
18951 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18952
18953 Fix more problems found by GCC 4.6.0's static checks.
18954
18955 * xdisp.c (vmessage): Use a better test for character truncation.
18956
18957 * charset.c (load_charset_map): <, not <=, for optimization,
18958 and to avoid potential problems with integer overflow.
18959 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18960 * casetab.c (set_identity, shuffle): Likewise.
18961 * editfns.c (Fformat): Likewise.
18962 * syntax.c (skip_chars): Likewise.
18963
18964 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18965 This also lets GCC 4.6.0 generate slightly better loop code.
18966
18967 * callint.c (Fcall_interactively): <, not <=, for optimization.
18968 (Fcall_interactively): Count the number of arguments produced,
18969 not the number of arguments given. This is simpler and lets GCC
18970 4.6.0 generate slightly better code.
18971
18972 * ftfont.c: Distingish more carefully between FcChar8 and char.
18973 The previous code passed unsigned char * to a functions like
18974 strlen and xstrcasecmp that expect char *, which does not
18975 conform to the C standard.
18976 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18977 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18978 char * when the C standard requires it.
18979
18980 * keyboard.c (read_char): Remove unused var.
18981
18982 * eval.c: Port to Windows vsnprintf (Bug#8435).
18983 Include <limits.h>.
18984 (SIZE_MAX): Define if the headers do not.
18985 (verror): Do not give up if vsnprintf returns a negative count.
18986 Instead, grow the buffer. This ports to Windows vsnprintf, which
18987 does not conform to C99. Problem reported by Eli Zaretskii.
18988 Also, simplify the allocation scheme, by avoiding the need for
18989 calling realloc, and removing the ALLOCATED variable.
18990
18991 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18992
18993 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18994 But keep the doprint source code for now, as we might revamp it
18995 and use it again (Bug#8435).
18996 * lisp.h (doprnt): Remove.
18997 * Makefile.in (base_obj): Remove doprnt.o.
18998 * deps.mk (doprnt.o): Remove.
18999
19000 error: Print 32- and 64-bit integers portably (Bug#8435).
19001 Without this change, on typical 64-bit hosts error ("...%d...", N)
19002 was used to print both 32- and 64-bit integers N, which relied on
19003 undefined behavior.
19004 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19005 * lisp.h (error, verror): Mark as printf-like functions.
19006 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19007 Report overflow in size calculations when allocating printf buffer.
19008 Do not truncate output string at its first null byte.
19009 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19010 Truncate the output at a character boundary, since vsnprintf does not
19011 do that.
19012 * charset.c (check_iso_charset_parameter): Convert internal
19013 character to string before calling 'error', since %c now has the
19014 printf meaning.
19015 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19016 overflow when computing char to be passed to 'error'. Do not
19017 pass Lisp_Object to 'error'; pass the integer instead.
19018 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19019 formatted with plain %d.
19020
19021 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19022
19023 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19024
19025 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19026
19027 * xterm.c (x_catch_errors): Remove duplicate declaration.
19028
19029 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19030
19031 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19032
19033 2011-04-10 Jim Meyering <meyering@redhat.com>
19034
19035 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19036 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19037 return ssize_t not "int", and use size_t as the buffer length.
19038 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19039 * gnutls.h: Update declarations.
19040 * process.c (read_process_output): Use ssize_t, to match.
19041 (send_process): Likewise.
19042
19043 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19044
19045 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19046
19047 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19048
19049 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19050 Use unsigned char, to match FcChar8 type definition.
19051
19052 * xterm.c (handle_one_xevent):
19053 * xmenu.c (create_and_show_popup_menu):
19054 * xselect.c (x_decline_selection_request)
19055 (x_reply_selection_request): Avoid type-punned deref of X events.
19056
19057 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19058
19059 Fix some uses of `int' instead of EMACS_INT.
19060 * search.c (string_match_1, fast_string_match)
19061 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19062 (scan_buffer, find_next_newline_no_quit)
19063 (find_before_next_newline, search_command, Freplace_match)
19064 (Fmatch_data): Make some `int' variables be EMACS_INT.
19065
19066 * xdisp.c (display_count_lines): 3rd argument and return value now
19067 EMACS_INT. All callers changed.
19068 (pint2hrstr): Last argument is now EMACS_INT.
19069
19070 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19071 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19072 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19073 (decode_coding_utf_16, decode_coding_emacs_mule)
19074 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19075 (decode_coding_ccl, decode_coding_charset)
19076 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19077 (decode_coding_iso_2022, decode_coding_emacs_mule)
19078 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19079 <char_offset, last_offset>: Declare EMACS_INT.
19080 (encode_coding_utf_8, encode_coding_utf_16)
19081 (encode_coding_emacs_mule, encode_invocation_designation)
19082 (encode_designation_at_bol, encode_coding_iso_2022)
19083 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19084 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19085 Declare EMACS_INT.
19086 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19087 (encode_invocation_designation): Last argument P_NCHARS is now
19088 EMACS_INT.
19089 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19090 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19091
19092 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19093 All users changed.
19094
19095 * ccl.c (Fccl_execute_on_string): Declare some variables
19096 EMACS_INT.
19097
19098 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19099
19100 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19101
19102 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19103
19104 * process.c (Fformat_network_address): Doc fix.
19105
19106 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19107
19108 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19109
19110 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19111
19112 * keyboard.c (read_char): Call Lisp function help-form-show,
19113 instead of using internal_with_output_to_temp_buffer.
19114 (Qhelp_form_show): New var.
19115 (syms_of_keyboard): Use DEFSYM macro.
19116
19117 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19118
19119 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19120
19121 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19122
19123 * process.c (Flist_processes): Remove to Lisp.
19124 (list_processes_1): Delete.
19125
19126 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19127
19128 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19129
19130 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19131
19132 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19133
19134 Fix more problems found by GCC 4.6.0's static checks.
19135
19136 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19137
19138 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19139
19140 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19141
19142 * xdisp.c (vmessage): Mark as a printf-like function.
19143
19144 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19145
19146 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19147
19148 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19149 printf-like functions.
19150 (tiff_load): Add casts to remove these marks before passing them
19151 to system-supplied API.
19152
19153 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19154
19155 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19156 This avoids several warnings with gcc -Wstrict-overflow.
19157 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19158 directly, rather than having caller test rule sign. This avoids
19159 some unnecessary tests.
19160 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19161 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19162 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19163
19164 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19165 (xfont_open): Avoid unnecessary tests.
19166
19167 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19168
19169 * composite.h, composite.c (composition_gstring_put_cache):
19170 Use EMACS_INT, not int, for length.
19171
19172 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19173 breaking out part of COMPOSITION_DECODE_RULE.
19174 (COMPOSITION_DECODE_RULE): Use it.
19175 * composite.c (get_composition_id): Remove unused local vars,
19176 by using the new macro.
19177
19178 * textprop.c (set_text_properties_1): Change while to do-while,
19179 since the condition is always true at first.
19180
19181 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19182 (interval_deletion_adjustment): Return unsigned value.
19183 All uses changed.
19184
19185 * process.c (list_processes_1, create_pty, read_process_output):
19186 (exec_sentinel): Remove vars that were set but not used.
19187 (create_pty): Remove unnecessary "volatile"s.
19188 (Fnetwork_interface_info): Avoid possibility of int overflow.
19189 (read_process_output): Do adaptive read buffering even if carryover.
19190 (read_process_output): Simplify nbytes computation if buffered.
19191
19192 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19193
19194 * syntax.c (scan_words): Remove var that was set but not used.
19195 (update_syntax_table): Use unsigned instead of int.
19196
19197 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19198 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19199 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19200
19201 * print.c (print_error_message): Avoid int overflow.
19202
19203 * font.c (font_list_entities): Redo for clarity,
19204 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19205
19206 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19207 (font_score): Avoid potential overflow in diff calculation.
19208
19209 * fns.c (substring_both): Remove var that is set but not used.
19210 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19211
19212 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19213
19214 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19215 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19216 can always succeed if overflow has undefined behavior.
19217
19218 * search.c (boyer_moore, wordify): Remove vars set but not used.
19219 (wordify): Omit three unnecessary tests.
19220
19221 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19222 All callers changed. This avoids the need for an unused var.
19223
19224 * casefiddle.c (casify_region): Remove var that is set but not used.
19225
19226 * dired.c (file_name_completion): Remove var that is set but not used.
19227
19228 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19229
19230 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19231 (Finsert_file_contents): Remove unnecessary code checking fd.
19232
19233 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19234 Check for integer overflow on size calculations.
19235
19236 * buffer.c (Fprevious_overlay_change): Remove var that is set
19237 but not used.
19238
19239 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19240 Remove vars that are set but not used.
19241 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19242 (timer_check_2): Mark vars as initialized.
19243
19244 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19245
19246 * image.c (lookup_image): Remove var that is set but not used.
19247 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19248
19249 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19250 that are set but not used.
19251
19252 * xfns.c (make_invisible_cursor): Don't return garbage
19253 if XCreateBitmapFromData fails (Bug#8410).
19254
19255 * xselect.c (x_get_local_selection, x_handle_property_notify):
19256 Remove vars that are set but not used.
19257
19258 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19259 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19260
19261 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19262 Remove var that is set but not used.
19263 (scroll_bar_windows_size): Now size_t, not int.
19264 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19265 Check for overflow.
19266
19267 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19268 (map_tty_color) [!defined MSDOS]: Likewise.
19269
19270 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19271
19272 * coding.c: Remove vars that are set but not used.
19273 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19274 All callers changed.
19275 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19276 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19277 (decode_coding_charset): Remove vars that are set but not used.
19278
19279 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19280 that is set but not used.
19281
19282 * print.c (print_object): Remove var that is set but not used.
19283
19284 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19285 The gnulib version avoids calling malloc in the usual case,
19286 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19287 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19288 * filelock.c (current_lock_owner): Likewise.
19289 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19290 * sysdep.c: Include allocator.h, careadlinkat.h.
19291 (emacs_no_realloc_allocator): New static constant.
19292 (emacs_readlink): New function.
19293 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19294 ../lib/careadlinkat.h.
19295
19296 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19297
19298 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19299 first non-nil return value).
19300
19301 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19302
19303 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19304 if not defined (Bug#8403).
19305
19306 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19307
19308 * xdisp.c (display_count_lines): Remove parameter `start',
19309 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19310 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19311 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19312 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19313 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19314 and thereabouts. All callers changed.
19315 (get_per_char_metric): Remove parameter `f', unused since
19316 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19317
19318 2011-04-02 Jim Meyering <meyering@redhat.com>
19319
19320 do not dereference NULL upon failed strdup
19321 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19322 (ns_get_family): Likewise.
19323
19324 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19325
19326 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19327
19328 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19329
19330 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19331 later (Bug#8403).
19332
19333 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19334
19335 Add lexical binding.
19336
19337 * window.c (Ftemp_output_buffer_show): New fun.
19338 (Fsave_window_excursion):
19339 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19340
19341 * lread.c (lisp_file_lexically_bound_p): New function.
19342 (Fload): Bind Qlexical_binding.
19343 (readevalloop): Remove `evalfun' arg.
19344 Bind Qinternal_interpreter_environment.
19345 (Feval_buffer): Bind Qlexical_binding.
19346 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19347 Mark as dynamic.
19348 (syms_of_lread): Declare `lexical-binding'.
19349
19350 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19351
19352 * keyboard.c (eval_dyn): New fun.
19353 (menu_item_eval_property): Use it.
19354
19355 * image.c (parse_image_spec): Use Ffunctionp.
19356
19357 * fns.c (concat, mapcar1): Accept byte-code-functions.
19358
19359 * eval.c (Fsetq): Handle lexical vars.
19360 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19361 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19362 (FletX, Flet): Obey lexical binding.
19363 (Fcommandp): Handle closures.
19364 (Feval): New `lexical' arg.
19365 (eval_sub): New function extracted from Feval. Use it almost
19366 everywhere where Feval was used. Look up vars in lexical env.
19367 Handle closures.
19368 (Ffunctionp): Move from subr.el.
19369 (Ffuncall): Handle closures.
19370 (apply_lambda): Remove `eval_flags'.
19371 (funcall_lambda): Handle closures and new byte-code-functions.
19372 (Fspecial_variable_p): New function.
19373 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19374 but without exporting it to Lisp.
19375
19376 * doc.c (Fdocumentation, store_function_docstring):
19377 * data.c (Finteractive_form): Handle closures.
19378
19379 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19380 interactive spec.
19381
19382 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19383 New byte-codes.
19384 (exec_byte_code): New function extracted from Fbyte_code to handle new
19385 calling convention for byte-code-functions. Add new byte-codes.
19386
19387 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19388
19389 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19390
19391 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19392
19393 * xdisp.c (redisplay_internal): Fix prototype.
19394
19395 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19396
19397 * xdisp.c (SCROLL_LIMIT): New macro.
19398 (try_scrolling): Use it when setting scroll_limit.
19399 Limit scrolling to 100 screen lines.
19400 (redisplay_window): Even when falling back on "recentering",
19401 position point in the window according to scroll-conservatively,
19402 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19403
19404 (try_scrolling): When point is above the window, allow searching
19405 as far as scroll_max, or one screenful, to compute vertical
19406 distance from PT to the scroll margin position. This prevents
19407 try_scrolling from unnecessarily failing when
19408 scroll-conservatively is set to a value slightly larger than the
19409 window height. Clean up the case of PT below the margin at bottom
19410 of window: scroll_max can no longer be INT_MAX. When aggressive
19411 scrolling is in use, don't let point enter the opposite scroll
19412 margin as result of the scroll.
19413 (syms_of_xdisp) <scroll-conservatively>: Document the
19414 threshold of 100 lines for never-recentering scrolling.
19415
19416 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19417
19418 * dispextern.h (move_it_by_lines):
19419 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19420 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19421 (message_log_check_duplicate): Remove parameters `prev_bol' and
19422 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19423 (redisplay_internal): Remove parameter `preserve_echo_area',
19424 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19425
19426 * indent.c (Fvertical_motion):
19427 * window.c (window_scroll_pixel_based, Frecenter):
19428 Don't pass `need_y_p' to `move_it_by_lines'.
19429
19430 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19431
19432 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19433 steal a few bits to be more compact.
19434 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19435 Remove unneeded casts.
19436
19437 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19438
19439 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19440
19441 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19442 binding" message (bug#7967).
19443
19444 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19445
19446 Fix more problems found by GCC 4.6.0's static checks.
19447
19448 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19449 Remove unused local var.
19450
19451 * editfns.c (Fmessage_box): Remove unused local var.
19452
19453 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19454 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19455 Omit unused local vars.
19456 * window.c (shrink_windows): Omit unused local var.
19457 * menu.c (digest_single_submenu): Omit unused local var.
19458 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19459 Omit unused local var.
19460
19461 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19462 Don't assume string length fits in int.
19463 (keyremap_step, read_key_sequence): Use size_t for sizes.
19464 (read_key_sequence): Don't check last_real_key_start redundantly.
19465
19466 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19467 instead of alloca (Bug#8344).
19468
19469 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19470 (Fbacktrace_frame): Don't assume nframes fits in int.
19471
19472 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19473
19474 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19475 concerns.
19476
19477 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19478
19479 * cm.c (calccost): Turn while-do into do-while, for clarity.
19480
19481 * keyboard.c (syms_of_keyboard): Use the same style as later
19482 in this function when indexing through an array. This also
19483 works around GCC bug 48267.
19484
19485 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19486
19487 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19488
19489 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19490 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19491
19492 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19493 This avoids undefined behavior on integer overflow, and is a bit
19494 more convenient anyway since it is compared to a size_t variable.
19495
19496 Variadic C functions now count arguments with size_t, not int.
19497 This avoids an unnecessary limitation on 64-bit machines, which
19498 caused (substring ...) to crash on large vectors (Bug#8344).
19499 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19500 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19501 All variadic functions and their callers changed accordingly.
19502 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19503 * data.c (arith_driver, float_arith_driver): Likewise.
19504 * editfns.c (general_insert_function): Likewise.
19505 * eval.c (struct backtrace.nargs, interactive_p)
19506 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19507 (funcall_lambda, mark_backtrace): Likewise.
19508 * fns.c (concat): Likewise.
19509 * frame.c (x_set_frame_parameters): Likewise.
19510 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19511 0 if not found, not -1. All callers changed.
19512
19513 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19514 (stack_copy_size): Now size_t, not int.
19515 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19516
19517 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19518
19519 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19520 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19521 All callers changed.
19522
19523 * lisp.h (multibyte_char_to_unibyte):
19524 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19525 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19526 * character.h (CHAR_TO_BYTE8):
19527 * cmds.c (internal_self_insert):
19528 * editfns.c (general_insert_function):
19529 * keymap.c (push_key_description):
19530 * search.c (Freplace_match):
19531 * xdisp.c (message_dolog, set_message_1): All callers changed.
19532
19533 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19534
19535 * keyboard.c (safe_run_hook_funcall): New function.
19536 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19537 don't set the hook to nil, but remove the offending function instead.
19538 (Qcommand_hook_internal): Remove, unused.
19539 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19540 Vcommand_hook_internal.
19541
19542 * eval.c (enum run_hooks_condition): Remove.
19543 (funcall_nil, funcall_not): New functions.
19544 (run_hook_with_args): Call each function through a `funcall' argument.
19545 Remove `cond' argument, now redundant.
19546 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19547 (Frun_hook_with_args_until_failure): Adjust accordingly.
19548 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19549
19550 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19551
19552 * dispextern.h (string_buffer_position): Remove declaration.
19553
19554 * print.c (strout): Remove parameter `multibyte', unused since
19555 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19556
19557 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19558 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19559 All callers changed.
19560
19561 * w32.c (_wsa_errlist): Use braces for struct initializers.
19562
19563 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19564 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19565 All callers changed.
19566 (string_buffer_position): Likewise. Also, make static (it's never
19567 used outside xdisp.c).
19568 (cursor_row_p): Remove parameter `w', unused since
19569 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19570 (decode_mode_spec): Remove parameter `precision', introduced during
19571 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19572 All callers changed.
19573
19574 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19575
19576 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19577
19578 2011-03-27 Anders Lindgren <andlind@gmail.com>
19579
19580 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19581 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19582 (ns_update_auto_hide_menu_bar): New functions.
19583 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19584 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19585 ns_constrain_all_frames.
19586 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19587 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19588
19589 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19590
19591 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19592
19593 2011-03-27 Glenn Morris <rgm@gnu.org>
19594
19595 * syssignal.h: Replace RETSIGTYPE with void.
19596 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19597 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19598 Replace SIGTYPE with void everywhere.
19599 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19600 * s/template.h (SIGTYPE): Remove commented out definition.
19601
19602 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19603
19604 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19605 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19606
19607 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19608
19609 * w32.c (read_unc_volume): Use parameter `henum', instead of
19610 global variable `wget_enum_handle'.
19611
19612 * keymap.c (describe_vector): Remove parameters `indices' and
19613 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19614 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19615
19616 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19617
19618 * keyboard.c (timer_check): Remove parameter `do_it_now',
19619 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19620 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19621 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19622
19623 * keyboard.c (read_char):
19624 * w32menu.c (w32_menu_display_help):
19625 * xmenu.c (show_help_event, menu_help_callback):
19626 Adjust calls to `show_help_echo'.
19627
19628 * gtkutil.c (xg_maybe_add_timer):
19629 * keyboard.c (readable_events):
19630 * process.c (wait_reading_process_output):
19631 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19632
19633 * insdel.c (adjust_markers_gap_motion):
19634 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19635 (gap_left, gap_right): Don't call it.
19636
19637 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19638
19639 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19640 incurred during fontification.
19641
19642 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19643
19644 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19645 (DEFVAR_PER_BUFFER): Don't pass it.
19646
19647 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19648 (scrolling_window): Don't pass it.
19649
19650 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19651
19652 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19653
19654 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19655 and `suffix'.
19656 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19657 of variables specific to SELinux and computation of `encoded_absname'.
19658
19659 * image.c (XPutPixel): Remove unused variable `height'.
19660
19661 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19662
19663 * unexw32.c (get_section_info): Remove unused variable `section'.
19664
19665 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19666 (system_process_attributes): Remove unused variable `sess'.
19667 (sys_read): Remove unused variable `err'.
19668
19669 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19670 (w32_wnd_proc): Remove unused variable `isdead'.
19671 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19672 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19673 (x_create_tip_frame): Remove unused variable `tem'.
19674
19675 * w32inevt.c (w32_console_read_socket):
19676 Remove unused variable `no_events'.
19677
19678 * w32term.c (x_draw_composite_glyph_string_foreground):
19679 Remove unused variable `width'.
19680
19681 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19682
19683 * w32term.c (x_set_glyph_string_clipping):
19684 Don't pass uninitialized region to CombineRgn.
19685
19686 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19687
19688 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19689 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19690 (Fx_close_connection): Remove unused variable `i'.
19691
19692 * w32font.c (w32font_draw): Return number of glyphs.
19693 (w32font_open_internal): Remove unused variable `i'.
19694 (w32font_driver): Add missing initializer.
19695
19696 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19697 (fill_in_menu): Remove unused variable `items_added'.
19698
19699 * w32term.c (last_mouse_press_frame): Remove static global variable.
19700 (w32_clip_to_row): Remove unused variable `f'.
19701 (x_delete_terminal): Remove unused variable `i'.
19702
19703 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19704 (NOTHING): Remove unused static global variable.
19705 (uniscribe_check_otf): Remove unused variable `table'.
19706 (uniscribe_font_driver): Add missing initializers.
19707
19708 2011-03-23 Julien Danjou <julien@danjou.info>
19709
19710 * term.c (Fsuspend_tty, Fresume_tty):
19711 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19712 * window.c (temp_output_buffer_show):
19713 * insdel.c (signal_before_change):
19714 * frame.c (Fhandle_switch_frame):
19715 * fileio.c (Fdo_auto_save):
19716 * emacs.c (Fkill_emacs):
19717 * editfns.c (save_excursion_restore):
19718 * cmds.c (internal_self_insert):
19719 * callint.c (Fcall_interactively):
19720 * buffer.c (Fkill_all_local_variables):
19721 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19722 Use Frun_hooks.
19723 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19724 unconditionally since it does the check itself.
19725
19726 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19727
19728 Fix more problems found by GCC 4.5.2's static checks.
19729
19730 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19731 the first time through the loop, since we know p0 < p1 then.
19732 This also avoids a gcc -Wstrict-overflow warning.
19733
19734 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19735 leading to a memory leak, possible in functions like
19736 load_charset_map_from_file that can allocate an unbounded number
19737 of objects (Bug#8318).
19738
19739 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19740 that could (at least in theory) be that large.
19741
19742 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19743 This is less likely to overflow, and avoids undefined behavior if
19744 overflow does occur. All callers changed. Use strtoul to scan
19745 for the unsigned long integer.
19746 (pint2hrstr): Simplify and tune code slightly.
19747 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19748
19749 * scroll.c (do_scrolling): Work around GCC bug 48228.
19750 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19751
19752 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19753 This also avoids a warning with gcc -Wstrict-overflow.
19754 (validate_x_resource_name): Simplify count usage.
19755 This also avoids a warning with gcc -Wstrict-overflow.
19756
19757 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19758 fail (Bug#8306).
19759
19760 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19761
19762 * process.c (Fmake_network_process): Use socklen_t, not int,
19763 where POSIX says socklen_t is required in portable programs.
19764 This fixes a porting bug on hosts like 64-bit HP-UX, where
19765 socklen_t is wider than int (Bug#8277).
19766 (Fmake_network_process, server_accept_connection):
19767 (wait_reading_process_output, read_process_output):
19768 Likewise.
19769
19770 * process.c: Rename or move locals to avoid shadowing.
19771 (list_processes_1, Fmake_network_process):
19772 (read_process_output_error_handler, exec_sentinel_error_handler):
19773 Rename or move locals.
19774 (Fmake_network_process): Define label "retry_connect" only if needed.
19775 (Fnetwork_interface_info): Fix pointer signedness.
19776 (process_send_signal): Add cast to avoid pointer signedness problem.
19777 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19778 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19779
19780 Make tparam.h and terminfo.c consistent.
19781 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19782 Include tparam.h instead, since it declares them.
19783 * cm.h (PC): Remove extern decl; tparam.h now does this.
19784 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19785 * terminfo.c: Include tparam.h, to check interfaces.
19786 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19787 (tparam): Adjust signature to match interface in tparam.h;
19788 this removes some undefined behavior. Check that outstring and len
19789 are zero, which they always are with Emacs.
19790 * tparam.h (PC, BC, UP): New extern decls.
19791
19792 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19793 (xftfont_open): Rename locals to avoid shadowing.
19794
19795 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19796 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19797 (OTF_TAG_SYM): Omit macro if not needed.
19798 (ftfont_list): Remove unused local.
19799 (get_adstyle_property, ftfont_pattern_entity):
19800 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19801 Rename locals to avoid shadowing.
19802
19803 * xfont.c (xfont_list_family): Mark var as initialized.
19804
19805 * xml.c (make_dom): Now static.
19806
19807 * composite.c (composition_compute_stop_pos): Rename local to
19808 avoid shadowing.
19809 (composition_reseat_it): Remove unused locals.
19810 (find_automatic_composition, composition_adjust_point): Likewise.
19811 (composition_update_it): Mark var as initialized.
19812 (find_automatic_composition): Mark vars as initialized,
19813 with a FIXME (Bug#8290).
19814
19815 character.h: Rename locals to avoid shadowing.
19816 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19817 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19818 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19819 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19820 to avoid shadowing.
19821
19822 * textprop.c (property_change_between_p): Remove; unused.
19823
19824 * intervals.c (interval_start_pos): Now static.
19825
19826 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19827
19828 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19829 Rename locals to avoid shadowing.
19830
19831 * sound.c (wav_play, au_play, Fplay_sound_internal):
19832 Fix pointer signedness.
19833 (alsa_choose_format): Remove unused local var.
19834 (wav_play): Initialize a variable to 0, to prevent undefined
19835 behavior (Bug#8278).
19836
19837 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19838
19839 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19840
19841 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19842 clobbering (Bug#8298).
19843 * sysdep.c (sys_subshell): Likewise.
19844 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19845
19846 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19847 This should get cleaned up, so that child_setup has the
19848 same signature on all platforms.
19849
19850 * callproc.c (call_process_cleanup): Now static.
19851 (relocate_fd): Rename locals to avoid shadowing.
19852
19853 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19854
19855 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19856 not to be necessary, and produces flickering.
19857
19858 2011-03-20 Glenn Morris <rgm@gnu.org>
19859
19860 * config.in: Remove file.
19861
19862 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19863
19864 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19865 are now in src/globals.h.
19866 (syms_of_minibuf): Remove spurious & from previous change.
19867
19868 2011-03-20 Leo Liu <sdl.web@gmail.com>
19869
19870 * minibuf.c (completing-read-function): New variable.
19871 (completing-read-default): Rename from completing-read.
19872 (completing-read): Call completing-read-function.
19873
19874 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19875
19876 * xfaces.c (Fx_load_color_file):
19877 Read color file from absolute filename (bug#8250).
19878
19879 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19880
19881 * makefile.w32-in: Update dependencies.
19882
19883 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19884
19885 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19886
19887 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19888
19889 Fix more problems found by GCC 4.5.2's static checks.
19890
19891 * process.c (make_serial_process_unwind, send_process_trap):
19892 (sigchld_handler): Now static.
19893
19894 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19895 That way, the code declares only the vars that it needs.
19896 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19897 * s/cygwin.h (PTY_ITERATION): Likewise.
19898 * s/darwin.h (PTY_ITERATION): Likewise.
19899 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19900
19901 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19902 * process.c (allocate_pty): Don't declare stb unless it's needed.
19903
19904 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19905 (CONSTANTLIM): Remove; unused.
19906 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19907 Define only if needed.
19908
19909 * unexelf.c (unexec): Name an expression,
19910 to avoid gcc -Wbad-function-cast warning.
19911 Use a different way to cause a compilation error if anyone uses
19912 n rather than nn, a way that does not involve shadowing.
19913 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19914
19915 * deps.mk (unexalpha.o): Remove; unused.
19916
19917 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19918 * unexec.h: New file.
19919 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19920 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19921 Depend on unexec.h.
19922 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19923 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19924 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19925 Change as necessary to match prototype in unexec.h.
19926
19927 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19928 shadowing.
19929 (back_comment, skip_chars): Mark vars as initialized.
19930
19931 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19932 Rename locals to avoid shadowing.
19933
19934 * lread.c (read1): Rewrite so as not to use empty "else".
19935 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19936
19937 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19938
19939 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19940 warning when compiling print.c.
19941
19942 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19943 instead of using an uninitialized var.
19944 (font_sort_entities): Mark var as initialized.
19945
19946 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19947
19948 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19949 pointers to constants.
19950 (font_parse_fcname): Remove unused vars.
19951 (font_delete_unmatched): Now static.
19952 (font_get_spec): Remove; unused.
19953 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19954 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19955 Rename or move locals to avoid shadowing.
19956
19957 * fns.c (require_nesting_list, require_unwind): Now static.
19958 (Ffillarray): Rename locals to avoid shadowing.
19959
19960 * floatfns.c (domain_error2): Define only if needed.
19961 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19962
19963 * alloc.c (mark_backtrace): Move decl from here ...
19964 * lisp.h: ... to here, so that it can be checked.
19965
19966 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19967 (Fdefvar): Rewrite so as not to use empty "else".
19968 (lisp_indirect_variable): Name an expression,
19969 to avoid gcc -Wbad-function-cast warning.
19970 (Fdefvar): Rename locals to avoid shadowing.
19971
19972 * callint.c (quotify_arg, quotify_args): Now static.
19973 (Fcall_interactively): Rename locals to avoid shadowing.
19974 Use const pointer when appropriate.
19975
19976 * lisp.h (get_system_name, get_operating_system_release):
19977 Move decls here, to check interfaces.
19978 * process.c (get_operating_system_release): Move decl to lisp.h.
19979 * xrdb.c (get_system_name): Likewise.
19980 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19981 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19982 some of which prompt warnings from gcc -Wbad-function-cast.
19983 (Fformat_time_string, Fencode_time, Finsert_char):
19984 (Ftranslate_region_internal, Fformat):
19985 Rename or remove local vars to avoid shadowing.
19986 (Ftranslate_region_internal): Mark var as initialized.
19987
19988 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19989 avoid shadowing.
19990
19991 * lisp.h (eassert): Check that the argument compiles, even if
19992 ENABLE_CHECKING is not defined.
19993
19994 * data.c (Findirect_variable): Name an expression, to avoid
19995 gcc -Wbad-function-cast warning.
19996 (default_value, arithcompare, arith_driver, arith_error): Now static.
19997 (store_symval_forwarding): Rename local to avoid shadowing.
19998 (Fmake_variable_buffer_local, Fmake_local_variable):
19999 Mark variables as initialized.
20000 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20001
20002 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20003 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20004 Rename locals to avoid shadowing.
20005 (mark_stack): Move local variables into the #ifdef region where
20006 they're used.
20007 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20008 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20009 needed otherwise.
20010 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20011 (GC_STRING_CHARS): Remove; not used.
20012 (Fmemory_limit): Cast sbrk's returned value to char *.
20013
20014 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20015 avoids undefined behavior in theory.
20016
20017 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20018
20019 Use functions, not macros, for up- and down-casing (Bug#8254).
20020 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20021 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20022 to use the following functions instead of these macros.
20023 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20024 EMACS_INT, since callers assume the returned value fits in int.
20025 (upcase1): Likewise, for UPCASE_TABLE.
20026 (uppercasep, lowercasep, upcase): New static inline functions.
20027 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20028 the race-condition problem in the old DOWNCASE.
20029
20030 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20031 Rename locals to avoid shadowing.
20032 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20033 (regex_compile, re_search_2, re_match_2_internal):
20034 Remove unused local vars.
20035 (FREE_VAR): Rewrite so as not to use empty "else",
20036 which gcc can warn about.
20037 (regex_compile, re_match_2_internal): Mark locals as initialized.
20038 (RETALLOC_IF): Define only if needed.
20039 (WORDCHAR_P): Likewise. This one is never needed, but is used
20040 only in a comment talking about a compiler bug, so put inside
20041 the #if 0 of that comment.
20042 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20043 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20044 Remove; unused.
20045
20046 * search.c (boyer_moore): Rename locals to avoid shadowing.
20047 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20048 (PREV_CHAR_BOUNDARY): Likewise.
20049
20050 * search.c (simple_search): Remove unused var.
20051
20052 * dired.c (compile_pattern): Move decl from here ...
20053 * lisp.h: ... to here, so that it can be checked.
20054 (struct re_registers): New forward decl.
20055
20056 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20057
20058 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20059 All uses changed.
20060 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20061 Rename locals to avoid shadowing.
20062 (Fvertical_motion): Mark locals as initialized.
20063
20064 * casefiddle.c (casify_object, casify_region): Now static.
20065 (casify_region): Mark local as initialized.
20066
20067 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20068
20069 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20070 New macros, so that the caller can use some names other than
20071 gcpro1, gcpro2, etc.
20072 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20073 of the new macros.
20074 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20075 argument, for consistency with GCPRO2_VAR, etc: it is now the
20076 prefix of the variable, not the variable itself. All uses
20077 changed.
20078 * dired.c (directory_files_internal, file_name_completion):
20079 Rename locals to avoid shadowing.
20080
20081 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20082 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20083 dired.c's scmp function, had undefined behavior.
20084 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20085 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20086 * buffer.h: ... to here, because these macros use current_buffer,
20087 and the new implementation with inline functions needs to have
20088 current_buffer in scope now, rather than later when the macros
20089 are used.
20090 (downcase, upcase1): New static inline functions.
20091 (DOWNCASE, UPCASE1): Reimplement using these functions.
20092 This avoids undefined behavior in expressions like
20093 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20094 from race conditions in accessing the global variables
20095 case_temp1 and case_temp2.
20096 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20097 * lisp.h (case_temp1, case_temp2): Remove their decls.
20098 * character.h (ASCII_CHAR_P): Move from here ...
20099 * lisp.h: ... to here, so that the inline functions mentioned
20100 above can use them.
20101
20102 * dired.c (directory_files_internal_unwind): Now static.
20103
20104 * fileio.c (file_name_as_directory, directory_file_name):
20105 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20106 Now static.
20107 (file_name_as_directory): Use const pointers when appropriate.
20108 (Fexpand_file_name): Likewise. In particular, newdir might
20109 point at constant storage, so make it a const pointer.
20110 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20111 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20112 signedness issues.
20113 (Fset_file_times, Finsert_file_contents, auto_save_error):
20114 Rename locals to avoid shadowing.
20115
20116 * minibuf.c (choose_minibuf_frame_1): Now static.
20117 (Ftry_completion, Fall_completions): Rename or remove locals
20118 to avoid shadowing.
20119
20120 * marker.c (bytepos_to_charpos): Remove; unused.
20121
20122 * lisp.h (verify_bytepos, count_markers): New decls,
20123 so that gcc does not warn that these functions aren't declared.
20124
20125 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20126 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20127 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20128 (copy_text): Remove unused local var.
20129
20130 * filelock.c (within_one_second): Now static.
20131 (lock_file_1): Rename local to avoid shadowing.
20132
20133 * buffer.c (fix_overlays_before): Mark locals as initialized.
20134 (fix_start_end_in_overlays): Likewise. This function should be
20135 simplified by using pointers-to-pointers, but that's a different
20136 matter.
20137 (switch_to_buffer_1): Now static.
20138 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20139 (report_overlay_modification): Rename locals to avoid shadowing.
20140
20141 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20142 Fix pointer signedness issue.
20143 (sys_subshell): Mark local as volatile if checking for lint,
20144 to suppress a gcc -Wclobbered warning that does not seem to be right.
20145 (MAXPATHLEN): Define only if needed.
20146
20147 * process.c (serial_open, serial_configure): Move decls from here ...
20148 * systty.h: ... to here, so that they can be checked.
20149
20150 * fns.c (get_random, seed_random): Move extern decls from here ...
20151 * lisp.h: ... to here, so that they can be checked.
20152
20153 * sysdep.c (reset_io): Now static.
20154 (wait_for_termination_signal): Remove; unused.
20155
20156 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20157 (copy_keymap_item, append_key, push_text_char_description):
20158 Now static.
20159 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20160 (DENSE_TABLE_SIZE): Remove; unused.
20161 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20162 (describe_map_tree):
20163 Rename locals to avoid shadowing.
20164
20165 * keyboard.c: Declare functions static if they are not used elsewhere.
20166 (echo_char, echo_dash, cmd_error, top_level_2):
20167 (poll_for_input, handle_async_input): Now static.
20168 (read_char, kbd_buffer_get_event, make_lispy_position):
20169 (make_lispy_event, make_lispy_movement, apply_modifiers):
20170 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20171 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20172 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20173 (read_key_sequence, read_char): Mark locals as initialized.
20174 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20175
20176 * keyboard.h (make_ctrl_char): New decl.
20177 (mark_kboards): Move decl here ...
20178 * alloc.c (mark_kboards): ... from here.
20179
20180 * lisp.h (force_auto_save_soon): New decl.
20181
20182 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20183 (DEFINE_DUMMY_FUNCTION): New macro.
20184 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20185 Use it.
20186 (main): Add casts to avoid warnings
20187 if GCC considers string literals to be constants.
20188
20189 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20190
20191 * dbusbind.c: Pointer signedness fixes.
20192 (xd_signature, xd_append_arg, xd_initialize):
20193 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20194 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20195 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20196 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20197
20198 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20199 if GCC considers string literals to be constants.
20200 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20201
20202 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20203
20204 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20205 (print_preprocess, print_object): New macro to fix last change.
20206
20207 * print.c (print_preprocess): Don't forget font objects.
20208
20209 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20210
20211 * emacs.c (USAGE3): Doc fixes.
20212
20213 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20214
20215 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20216 structure.
20217
20218 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20219
20220 * lisp.h (VWindow_system, Qfile_name_history):
20221 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20222 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20223 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20224
20225 * w32select.c: Don't #include "keyboard.h".
20226 (run_protected): Add extern declaration for waiting_for_input.
20227
20228 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20229 * w32console.c (detect_input_pending, read_input_pending)
20230 (encode_terminal_code):
20231 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20232 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20233 (w32_system_caret_y, Qfile_name_history):
20234 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20235 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20236 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20237 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20238 * w32proc.c (Qlocal, report_file_error):
20239 * w32term.c (Vwindow_system, updating_frame):
20240 * w32uniscribe.c (initialized, uniscribe_font_driver):
20241 Remove unneeded extern declarations.
20242
20243 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20244
20245 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20246
20247 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20248
20249 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20250 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20251 These macros can no longer be used for assignment.
20252
20253 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20254 Assign struct members directly, instead of using BUF_BEGV etc.
20255 (record_buffer_markers, fetch_buffer_markers): New functions for
20256 recording and fetching special buffer markers.
20257 (set_buffer_internal_1, set_buffer_temp): Use them.
20258
20259 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20260
20261 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20262
20263 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20264 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20265
20266 * xdisp.c (hscroll_window_tree):
20267 (reconsider_clip_changes): Use PT instead of BUF_PT.
20268
20269 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20270
20271 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20272 $(EMACS_ROOT)/lib/intprops.h.
20273
20274 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20275
20276 Fix more problems found by GCC 4.5.2's static checks.
20277
20278 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20279 to unsigned char * to avoid compiler diagnostic.
20280 (xg_free_frame_widgets): Make it clear that a local variable is
20281 needed only if USE_GTK_TOOLTIP.
20282 (gdk_window_get_screen): Make it clear that this macro is needed
20283 only if USE_GTK_TOOLTIP.
20284 (int_gtk_range_get_value): New function, which avoids a diagnostic
20285 from gcc -Wbad-function-cast.
20286 (xg_set_toolkit_scroll_bar_thumb): Use it.
20287 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20288 diagnostic from gcc -Wbad-function-cast.
20289 (get_utf8_string, xg_get_file_with_chooser):
20290 Rename locals to avoid shadowing.
20291 (create_dialog): Move locals to avoid shadowing.
20292
20293 * xgselect.c (xg_select): Remove unused var.
20294
20295 * image.c (four_corners_best): Mark locals as initialized.
20296 (gif_load): Initialize transparent_p to zero (Bug#8238).
20297 Mark another local as initialized.
20298 (my_png_error, my_error_exit): Mark with NO_RETURN.
20299
20300 * image.c (clear_image_cache): Now static.
20301 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20302 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20303 (x_edge_detection): Remove unnecessary cast that
20304 gcc -Wbad-function-cast diagnoses.
20305 (gif_load): Fix pointer signedness.
20306 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20307 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20308
20309 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20310
20311 Improve quality of tests for time stamp overflow.
20312 For example, without this patch (encode-time 0 0 0 1 1
20313 1152921504606846976) returns the obviously-bogus value (-948597
20314 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20315 reports time overflow. See
20316 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20317 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20318 * editfns.c: Include limits.h and intprops.h.
20319 (TIME_T_MIN, TIME_T_MAX): New macros.
20320 (time_overflow): Move earlier, to before first use.
20321 (hi_time, lo_time): New functions, for an accurate test for
20322 out-of-range times.
20323 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20324 (Fget_internal_run_time): Don't assume time_t fits in int.
20325 (make_time): Use list2 instead of Fcons twice.
20326 (Fdecode_time): More accurate test for out-of-range times.
20327 (check_tm_member): New function.
20328 (Fencode_time): Use it, to test for out-of-range times.
20329 (lisp_time_argument): Don't rely on undefined left-shift and
20330 right-shift behavior when checking for time stamp overflow.
20331
20332 * editfns.c (time_overflow): New function, refactoring common code.
20333 (Fformat_time_string, Fdecode_time, Fencode_time):
20334 (Fcurrent_time_string): Use it.
20335
20336 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20337 * dired.c (make_time): Move to ...
20338 * editfns.c (make_time): ... here.
20339 * systime.h: Note the move.
20340
20341 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20342
20343 * fringe.c (update_window_fringes): Remove unused variables.
20344
20345 * unexmacosx.c (copy_data_segment): Also copy __got section.
20346 (Bug#8223)
20347
20348 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20349
20350 * termcap.c [MSDOS]: Include "msdos.h".
20351 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20352 Constify `char *' arguments and their references according to
20353 prototypes in tparam.h.
20354
20355 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20356
20357 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20358 Adapt all references accordingly.
20359
20360 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20361
20362 2011-03-11 Tom Tromey <tromey@redhat.com>
20363
20364 * buffer.c (syms_of_buffer): Remove obsolete comment.
20365
20366 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20367
20368 * termhooks.h (encode_terminal_code): Declare prototype.
20369
20370 * msdos.c (encode_terminal_code): Don't declare prototype.
20371
20372 * term.c (encode_terminal_code): Now external again, used by
20373 w32console.c and msdos.c.
20374
20375 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20376 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20377
20378 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20379
20380 Fix some minor problems found by GCC 4.5.2's static checks.
20381
20382 * fringe.c (update_window_fringes): Mark locals as initialized
20383 (Bug#8227).
20384 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20385
20386 * alloc.c (mark_fringe_data): Move decl from here ...
20387 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20388 to check its interface.
20389 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20390
20391 * fontset.c (free_realized_fontset): Now static.
20392 (Fset_fontset_font): Rename local to avoid shadowing.
20393 (fontset_font): Mark local as initialized.
20394 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20395
20396 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20397
20398 * xselect.c (x_disown_buffer_selections): Remove; not used.
20399 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20400 (x_own_selection, Fx_disown_selection_internal): Rename locals
20401 to avoid shadowing.
20402 (x_handle_dnd_message): Remove local to avoid shadowing.
20403
20404 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20405 so that the caller can use some name other than gcpro1.
20406 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20407 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20408 (Fx_backspace_delete_keys_p):
20409 Use them to avoid shadowing, and rename vars to avoid shadowing.
20410 (x_decode_color, x_set_name, x_window): Now static.
20411 (Fx_create_frame): Add braces to silence GCC warning.
20412 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20413 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20414 Remove unused locals.
20415 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20416 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20417 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20418 macros.
20419
20420 * xterm.h (x_mouse_leave): New decl.
20421
20422 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20423 Remove unused functions.
20424 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20425 (x_calc_absolute_position): Now static.
20426 (XTread_socket): Don't define label "out" unless it's used.
20427 Don't declare local "event" unless it's used.
20428 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20429 unless they are used.
20430 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20431 (x_fatal_error_signal): Remove; not used.
20432 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20433 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20434 (x_error_catcher, x_connection_closed, x_error_handler):
20435 (x_error_quitter, xembed_send_message, x_iconify_frame):
20436 (my_log_handler): Rename locals to avoid shadowing.
20437 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20438 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20439
20440 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20441 Rename or move locals to avoid shadowing.
20442 (tty_defined_color, merge_face_heights): Now static.
20443 (free_realized_faces_for_fontset): Remove; not used.
20444 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20445 does not deduce is never used uninitialized.
20446 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20447 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20448
20449 * terminal.c (store_terminal_param): Now static.
20450
20451 * xmenu.c (menu_highlight_callback): Now static.
20452 (set_frame_menubar): Remove unused local.
20453 (xmenu_show): Rename parameter to avoid shadowing.
20454 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20455 since they might point to immutable storage.
20456 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20457 since it's unused otherwise.
20458
20459 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20460 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20461 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20462 avoids a gcc -Wuninitialized diagnostic.
20463 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20464 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20465 does not deduce are never used uninitialized.
20466
20467 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20468
20469 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20470 * window.c (window_loop, size_window):
20471 (run_window_configuration_change_hook, enlarge_window): Likewise.
20472
20473 * window.c (display_buffer): Now static.
20474 (size_window): Mark variables that gcc -Wuninitialized
20475 does not deduce are never used uninitialized.
20476 * window.h (check_all_windows): New decl, to forestall
20477 gcc -Wmissing-prototypes diagnostic.
20478 * dispextern.h (bidi_dump_cached_states): Likewise.
20479
20480 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20481 shadowing.
20482 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20483 Include <limits.h>.
20484 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20485 and to avoid gcc -Wuninitialized warning.
20486 (load_charset_map): Mark variables that gcc -Wuninitialized
20487 does not deduce are never used uninitialized.
20488 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20489
20490 * coding.c (coding_set_source, coding_set_destination):
20491 Use "else { /* comment */ }" rather than "else /* comment */;"
20492 for clarity, and to avoid gcc -Wempty-body warning.
20493 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20494 a block, when the outer 'i' will do.
20495 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20496 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20497 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20498 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20499 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20500 Rename locals to avoid shadowing.
20501 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20502 * coding.c (emacs_mule_char, encode_invocation_designation):
20503 Now static, since they're not used elsewhere.
20504 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20505 (decode_coding_object, encode_coding_object, detect_coding_system):
20506 (decode_coding_emacs_mule): Mark variables that gcc
20507 -Wuninitialized does not deduce are never used uninitialized.
20508 (detect_coding_iso_2022): Initialize a local variable that might
20509 be used uninitialized. Leave a FIXME because it's not clear that
20510 this initialization is needed. (Bug#8211)
20511 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20512 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20513 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20514 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20515 Remove unused macros.
20516
20517 * category.c (hash_get_category_set): Remove unused local var.
20518 (copy_category_table): Now static, since it's not used elsewhere.
20519 * character.c (string_count_byte8): Likewise.
20520
20521 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20522 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20523
20524 * chartab.c (copy_sub_char_table): Now static, since it's not used
20525 elsewhere.
20526 (sub_char_table_ref_and_range, char_table_ref_and_range):
20527 Rename locals to avoid shadowing.
20528 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20529
20530 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20531 (BIDI_BOB): Remove unused macro.
20532
20533 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20534 deduce are never used uninitialized.
20535 * term.c (encode_terminal_code): Likewise.
20536
20537 * term.c (encode_terminal_code): Now static. Remove unused local.
20538
20539 * tparam.h: New file.
20540 * term.c, tparam.h: Include it.
20541 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20542 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20543 Move these decls to tparam.h, and make them agree with what
20544 is actually in tparam.c. The previous trick of using incompatible
20545 decls in different modules does not conform to the C standard.
20546 All callers of tparam changed to use tparam's actual API.
20547 * tparam.c (tparam1, tparam, tgoto):
20548 Use const pointers where appropriate.
20549
20550 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20551 * cm.h (struct cm): Likewise.
20552 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20553 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20554 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20555 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20556 (turn_on_face, init_tty): Likewise.
20557 * termchar.h (struct tty_display_info): Likewise.
20558
20559 * term.c (term_mouse_position): Rename local to avoid shadowing.
20560
20561 * alloc.c (mark_ttys): Move decl from here ...
20562 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20563
20564 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20565
20566 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20567
20568 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20569
20570 * search.c (compile_pattern_1): Remove argument regp, unused since
20571 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20572 (compile_pattern): Don't pass it.
20573
20574 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20575
20576 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20577 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20578 for ! HAVE_GTK3.
20579 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20580
20581 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20582
20583 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20584 gdk_window_get_screen, gdk_window_get_geometry,
20585 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20586 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20587 (xg_get_pixbuf_from_pixmap): New function.
20588 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20589 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20590 Call xg_get_pixbuf_from_pixmap instead of
20591 gdk_pixbuf_get_from_drawable.
20592 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20593 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20594 (xg_check_special_colors): Use GtkStyleContext and its functions
20595 for HAVE_GTK3.
20596 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20597 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20598 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20599 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20600 Call gtk_widget_get_preferred_size.
20601 (xg_frame_resized): gdk_window_get_geometry only takes 5
20602 parameters.
20603 (xg_win_to_widget, xg_event_is_for_menubar):
20604 Call gdk_x11_window_lookup_for_display.
20605 (xg_set_widget_bg): New function.
20606 (delete_cb): New function.
20607 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20608 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20609 (xg_set_background_color): Call xg_set_widget_bg.
20610 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20611 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20612 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20613 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20614 if ! HAVE_GTK3.
20615 (update_frame_tool_bar): Call gtk_widget_hide.
20616 (xg_initialize): Use GDK_KEY_g.
20617
20618 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20619 if ! HAVE_GTK3
20620 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20621
20622 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20623 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20624 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20625
20626 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20627
20628 * w32xfns.c (select_palette): Check success of RealizePalette against
20629 GDI_ERROR, not zero.
20630
20631 See ChangeLog.11 for earlier changes.
20632
20633 ;; Local Variables:
20634 ;; coding: utf-8
20635 ;; End:
20636
20637 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20638
20639 This file is part of GNU Emacs.
20640
20641 GNU Emacs is free software: you can redistribute it and/or modify
20642 it under the terms of the GNU General Public License as published by
20643 the Free Software Foundation, either version 3 of the License, or
20644 (at your option) any later version.
20645
20646 GNU Emacs is distributed in the hope that it will be useful,
20647 but WITHOUT ANY WARRANTY; without even the implied warranty of
20648 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20649 GNU General Public License for more details.
20650
20651 You should have received a copy of the GNU General Public License
20652 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.