* fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
[bpt/emacs.git] / src / ChangeLog
1 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2
3 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
4 for string length.
5
6 2012-12-08 Eli Zaretskii <eliz@gnu.org>
7
8 * w32.c (unsetenv): Return 0 if the input string is too long.
9
10 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
11
12 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
13 * alloc.c (xputenv): New function.
14 * dbusbind.c (Fdbus_init_bus):
15 * emacs.c (main):
16 * xterm.c (x_term_init):
17 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
18 * editfns.c (initial_tz): Move static var decl up.
19 (tzvalbuf_in_environ): New static var.
20 (init_editfns): Initialize these two static vars.
21 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
22 Save old TZ value on stack, if it's small.
23 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
24 instead, use xputenv+unsetenv to set and restore TZ.
25 (environbuf): Remove static var. All uses removed.
26 (Fset_time_zone_rule): Do not save TZ and environ;
27 no longer needed here.
28 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
29 Move to inside set_time_zone_rule; they don't need file scope any more.
30 (set_time_zone_rule): Maintain the TZ=value string separately.
31 (syms_of_editfns): Don't initialize initial_tz;
32 init_editfns now does it.
33 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
34 * lisp.h (xputenv): New decl.
35
36 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
37
38 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
39
40 2012-12-08 Eli Zaretskii <eliz@gnu.org>
41
42 * w32.c (unsetenv, sys_putenv): New functions.
43
44 2012-12-08 Chong Yidong <cyd@gnu.org>
45
46 * editfns.c (Finsert_char): Make the error message more
47 informative (Bug#12992).
48
49 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
50
51 Simplify get_lim_data.
52 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
53 Remove USG and vlimit methods; no longer used these days.
54 Add #error catchall just in case.
55
56 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
57 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
58 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
59 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
60 (deleted_pid_list, Fdelete_process, create_process)
61 (record_child_status_change, handle_child_signal, deliver_child_signal)
62 (init_process_emacs, syms_of_process):
63 Assume SIGCHLD is defined.
64 (parse_signal): Remove. All uses removed.
65 (abbr_to_signal): New static function.
66 (Fsignal_process): Use it to convert signal names to ints.
67 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
68 kill (getpgrp (), ...).
69 (emacs_sigaction_init): Assume SIGCHLD is defined.
70 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
71 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
72 * syssignal.h (EMACS_KILLPG): Remove.
73 All uses replaced by 'kill' with a negative pid.
74 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
75 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
76
77 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
78
79 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
80 This will cause a production Emacs to dump core instead of
81 infinite-looping.
82
83 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
84
85 * frame.c (make_frame): Do not set window's buffer to t.
86 * window.c (Fsplit_window_internal): Likewise. Previously it was
87 used to indicate that the window is being set up. Now we use
88 set_window_buffer for all new windows, so the condition in ...
89 (Fset_window_buffer): ... is always true and can be removed.
90
91 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
92
93 Convenient macro to check whether the buffer is hidden.
94 * buffer.h (BUFFER_HIDDEN_P): New macro.
95 * frame.c (make_frame): Use it. Adjust comment.
96 * buffer.c (candidate_buffer): New function.
97 (Fother_buffer, other_buffer_safely): Use it.
98
99 2012-12-06 Eli Zaretskii <eliz@gnu.org>
100
101 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
102 if the child process is still running. Instead, exit the wait
103 loop and return zero. (Bug#13086)
104
105 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
106
107 * frame.h (x_char_width, x_char_height): Remove prototypes.
108 * w32term.h (x_char_width, x_char_height): Likewise.
109 * xfns.c (x_char_width, x_char_height): Remove.
110 * w32fns.c (x_char_width, x_char_height): Likewise.
111 * nsfns.c (x_char_width, x_char_height): Likewise.
112 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
113 all window frames.
114 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
115 * keyboard.c (command_loop_1): Remove prototype.
116 (command_loop_2, top_level_1): Add static to match prototype.
117
118 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
119
120 Fix a recently-introduced delete-process race condition.
121 * callproc.c, process.h (record_kill_process):
122 New function, containing part of the old call_process_kill.
123 (call_process_kill): Use it.
124 This does not change call_process_kill's behavior.
125 * process.c (Fdelete_process): Use record_kill_process to fix a
126 race condition that could cause Emacs to lose track of a child.
127
128 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
129
130 Avoid code duplication between prev_frame and next_frame.
131 * frame.c (candidate_frame): New function. Add comment.
132 (prev_frame, next_frame): Use it. Adjust comment.
133
134 2012-12-06 Eli Zaretskii <eliz@gnu.org>
135
136 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
137 fails, signal an error instead of continuing with an empty
138 string. (Bug#13079)
139 Encode expanded temp file pattern before passing it to mkstemp or
140 mktemp.
141
142 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
143 Encode the file name before passing it to dostounix_filename, in
144 case it will downcase it (under w32-downcase-file-names).
145 (Bug#12933)
146
147 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
148
149 Minor call-process cleanups.
150 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
151 at the same time as other platforms, to simplify analysis.
152 No need for fd0_volatile since we have synch_process_fd.
153 Avoid needless emacs_close; arg is always negative.
154
155 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
156
157 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
158 processes.
159
160 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
161
162 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
163 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
164 and mouse_face_hidden members to a bitfields.
165 * frame.h (struct frame): Remove set-but-not-used space_width member.
166 (FRAME_SPACE_WIDTH): Remove.
167 * nsterm.m, w32term.c, xterm.c: Adjust users.
168 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
169 member. Adjust users. Convert term_initted, delete_in_insert_mode,
170 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
171 members to a bitfields.
172
173 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
174
175 Don't let call-process be a zombie factory (Bug#12980).
176 Fixing this bug required some cleanup of the signal-handling code.
177 As a side effect, this change also fixes a longstanding rare race
178 condition whereby Emacs could mistakenly kill unrelated processes,
179 and it fixes a bug where a second C-g does not kill a recalcitrant
180 synchronous process in GNU/Linux and similar platforms.
181 The patch should also fix the last vestiges of Bug#9488,
182 a bug which has mostly been fixed on the trunk by other changes.
183 * callproc.c, process.h (synch_process_alive, synch_process_death)
184 (synch_process_termsig, sync_process_retcode):
185 Remove. All uses removed, to simplify analysis and so that
186 less consing is done inside critical sections.
187 * callproc.c (call_process_exited): Remove. All uses replaced
188 with !synch_process_pid.
189 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
190 These take the role of what used to be in unwind-protect arg.
191 All uses changed.
192 (block_child_signal, unblock_child_signal):
193 New functions, to avoid races that could kill innocent-victim processes.
194 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
195 (call_process_kill): Record killed processes as deleted, so that
196 zombies do not clutter up the system. Do this inside a critical
197 section, to avoid a race that would allow the clutter.
198 (call_process_cleanup): Fix code so that the second C-g works again
199 on common platforms such as GNU/Linux.
200 (Fcall_process): Create the child process in a critical section,
201 to fix a race condition. If creating an asynchronous process,
202 record it as deleted so that zombies do not clutter up the system.
203 Do unwind-protect for WINDOWSNT too, as that's simpler in the
204 light of these changes. Omit unnecessary call to emacs_close
205 before failure, as the unwind-protect code does that.
206 * callproc.c (call_process_cleanup):
207 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
208 * process.c (record_deleted_pid): New function, containing
209 code refactored out of Fdelete_process.
210 (Fdelete_process): Use it.
211 (process_status_retrieved): Remove. All callers changed to use
212 child_status_change.
213 (record_child_status_change): Remove, folding its contents into ...
214 (handle_child_signal): ... this signal handler. Now, this
215 function is purely a handler for SIGCHLD, and is not called after
216 a synchronous waitpid returns; the synchronous code is moved to
217 wait_for_termination. There is no need to worry about reaping
218 more than one child now.
219 * sysdep.c (get_child_status, child_status_changed): New functions.
220 (wait_for_termination): Now takes int * status and bool
221 interruptible arguments, too. Do not record child status change;
222 that's now the caller's responsibility. All callers changed.
223 Reimplement in terms of get_child_status.
224 (wait_for_termination_1, interruptible_wait_for_termination):
225 Remove. All callers changed to use wait_for_termination.
226 * syswait.h: Include <stdbool.h>, for bool.
227 (record_child_status_change, interruptible_wait_for_termination):
228 Remove decls.
229 (record_deleted_pid, child_status_changed): New decls.
230 (wait_for_termination): Adjust to API changes noted above.
231
232 * bytecode.c, lisp.h (Qbytecode): Remove.
233 No longer needed after 2012-11-20 interactive-p changes.
234
235 2012-12-03 Eli Zaretskii <eliz@gnu.org>
236
237 * xdisp.c (redisplay_window): If the cursor is visible, but inside
238 the scroll margin, move point outside the margin. (Bug#13055)
239
240 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
241
242 * gtkutil.c (my_log_handler): New function.
243 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
244
245 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
246
247 * lisp.h (modify_region): Rename to...
248 (modify_region_1): ...new prototype.
249 * textprop.c (modify_region): Now static. Adjust users.
250 * insdel.c (modify_region): Rename to...
251 (modify_region_1): ...new function to work with current buffer.
252 Adjust comment and users. Use true and false for booleans.
253
254 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
255
256 * alloc.c (free_save_value): New function.
257 (safe_alloca_unwind): Use it.
258 * lisp.h (free_save_value): New prototype.
259 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
260 Add comment.
261 (save_excursion_restore): Adjust to match saved data structure.
262 Use free_save_value to offload some work from GC. Drop obsolete
263 #if 0 code.
264
265 2012-12-03 Chong Yidong <cyd@gnu.org>
266
267 * fileio.c (Vauto_save_list_file_name): Doc fix.
268
269 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
270
271 * w32fns.c: Remove prototype of atof.
272 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
273 builds.
274 (file_dialog_callback): Declared UINT_PTR.
275
276 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
277 with 64-bit builds.
278
279 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
280 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
281 defined.
282
283 2012-12-03 Glenn Morris <rgm@gnu.org>
284
285 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
286
287 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
288
289 Fix xpalloc confusion after memory is exhausted.
290 * alloc.c (xpalloc): Comment fix.
291 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
292 and signals an error, do not clear charset_table_size, as
293 charset_table is still valid.
294 * doprnt.c (evxprintf): Clear *BUF after freeing it.
295
296 Use execve to avoid need to munge environ (Bug#13054).
297 * callproc.c (Fcall_process):
298 * process.c (create_process):
299 Don't save and restore environ; no longer needed.
300 * callproc.c (child_setup):
301 Use execve, not execvp, to preserve environ.
302
303 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
304
305 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
306
307 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
308
309 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
310 display for sliced images (Bug#10500).
311
312 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
313
314 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
315
316 * doc.c (Fdocumentation): Re-add handling of function-documentation,
317 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
318
319 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
320
321 * xdisp.c (window_outdated): Remove eassert since it hits
322 some suspicious corner cases (see Bug#13007 and Bug#13012).
323 (mode_line_update_needed): New function.
324 (redisplay_internal, redisplay_window): Use it.
325 (ensure_selected_frame): New function.
326 (redisplay_internal, unwind_redisplay): Use it.
327 (redisplay_internal): Move comment about buffer_shared...
328 (buffer_shared_and_changed): ...near to its real use.
329
330 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
331
332 * callproc.c (Fcall_process): Don't misreport vfork failure.
333
334 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
335
336 * callproc.c (Fcall_process): Fix vfork portability problems.
337 Do not assume that fd[0], count, filefd, and save_environ survive
338 vfork. Fix bug whereby wrong errno value could be reported for
339 pipe failure. Some minor cleanups, too, as follows. Move buf and
340 bufsize to the context where they're needed. Change new_argv to
341 be of type char **, as this is more convenient and avoids casts.
342 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
343 Now local constants, not macros.
344
345 2012-11-18 Kenichi Handa <handa@gnu.org>
346
347 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
348 for the variable "f".
349
350 2012-11-13 Kenichi Handa <handa@gnu.org>
351
352 * font.c (font_unparse_xlfd): Exclude special characters from the
353 generating XLFD name.
354
355 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
356
357 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
358 * dired.c (stat_uname, stat_gname):
359 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
360
361 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
362 * dired.c (directory_files_internal, file_name_completion):
363 Assume EAGAIN and EINTR are defined.
364
365 * fileio.c (Fcopy_file): Assume EISDIR is defined.
366 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
367 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
368 * lread.c (readbyte_from_file): Assume EINTR is defined.
369 * process.c (wait_reading_process_output, send_process) [subprocesses]:
370 Assume EIO and EAGAIN are defined.
371 * unexcoff.c (write_segment): Assume EFAULT is defined.
372
373 2012-11-27 Eli Zaretskii <eliz@gnu.org>
374
375 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
376 (Bug#11964)
377
378 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
379 highlighting on the frame was cleared. Prevents assertion
380 violations when repeatedly clicking on the "Top" link of the
381 "bread-crumbs" in Info buffers.
382
383 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
384
385 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
386
387 2012-11-24 Ken Brown <kbrown@cornell.edu>
388
389 * keyboard.c (HAVE_MOUSE):
390 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
391 were always defined.
392
393 2012-11-24 Eli Zaretskii <eliz@gnu.org>
394
395 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
396 between bpos_covered and bpos_max. This fixes cursor display when
397 several display strings follow each other.
398
399 * .gdbinit (pgx): If the glyph's object is a string, display the
400 pointer to string data, rather than the value of the string object
401 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
402
403 * indent.c (Fvertical_motion): If the starting position is covered
404 by a display string, return to one position before that, to avoid
405 overshooting it inside move_it_to. (Bug#12930)
406
407 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
408
409 * frame.h (struct frame): Remove display_preempted member
410 since all users are dead long ago.
411 * nsterm.h (struct x_output): Use the only dummy member.
412 * w32menu.c (pending_menu_activation): Remove since not
413 really used.
414 (set_frame_menubar): Adjust user.
415 * w32term.h (struct x_output): Drop outdated #if 0 code.
416 (struct w32_output): Use bitfields for explicit_parent,
417 asked_for_visible and menubar_active members. Drop
418 unused pending_menu_activation member.
419 * xterm.h (struct x_output): Drop outdated #if 0 code.
420 Use bitfields for explicit_parent, asked_for_visible,
421 has_been_visible and net_wm_state_hidden_seen members.
422
423 2012-11-23 Eli Zaretskii <eliz@gnu.org>
424
425 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
426 of a literal "/". (Bug#12955)
427 (gl-stamp): Invoke fc.exe directly, not through cmd.
428
429 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
430
431 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
432 * dired.c: Assume HAVE_DIRENT_H.
433 (NAMLEN): Remove, replacing with ...
434 (dirent_namelen): New function. All uses changed. Use the GNU macro
435 _D_EXACT_NAMELEN if available, as it's faster than strlen.
436 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
437 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
438 * makefile.w32-in (DIR_H): Remove. All uses replaced with
439 $(NT_INC)/dirent.h.
440 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
441 * ndir.h: Rename to ../nt/inc/dirent.h.
442 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
443 Do not include <dirent.h>; no longer needed.
444 * w32.c: Include <dirent.h> rather than "ndir.h".
445
446 2012-11-23 Chong Yidong <cyd@gnu.org>
447
448 * xftfont.c (xftfont_open): Remove duplicate assignment.
449
450 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
451
452 * alloc.c (Fgarbage_collect): Unblock input after clearing
453 gc_in_progress to avoid note_mouse_highlight glitch with GC.
454 * frame.h (FRAME_MOUSE_UPDATE): New macro.
455 * msdos.c (IT_frame_up_to_date): Use it here...
456 * w32term.c (w32_frame_up_to_date): ...here...
457 * xterm.c (XTframe_up_to_date): ...and here...
458 * nsterm.m (ns_frame_up_to_date): ...but not here.
459 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
460 Adjust users.
461 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
462 Do not check whether GC is in progress.
463
464 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
465
466 * xdisp.c (window_buffer_changed): New function.
467 (update_menu_bar, update_tool_bar): Use it to
468 simplify large 'if' statements.
469 (redisplay_internal): Generalize commonly used
470 'tail' and 'frame' local variables.
471
472 2012-11-22 Eli Zaretskii <eliz@gnu.org>
473
474 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
475 with Windows system header.
476
477 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
478
479 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
480 * alloc.c: Assume unistd.h exists.
481 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
482 * sysdep.c (get_current_dir_name): Assume getcwd exists.
483 (getwd) [USG]: Remove; no longer needed.
484 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
485 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
486 * w32.h (getcwd): Remove decl.
487
488 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
489
490 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
491 Make it set selected_window as well.
492 (update_tool_bar): Use it.
493
494 2012-11-21 Ken Brown <kbrown@cornell.edu>
495
496 * emacs.c (main): Set the G_SLICE environment variable for all
497 Cygwin builds, not just GTK builds. See
498 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
499
500 2012-11-21 Eli Zaretskii <eliz@gnu.org>
501
502 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
503 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
504 Define for the MSVC compiler.
505
506 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
507
508 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
509 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
510 dostounix_filename. Prevents crashes down the road, because
511 dostounix_filename assumes it gets a unibyte string. Reported by
512 Michel de Ruiter <michel@sentient.nl>, see
513 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
514
515 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
516
517 Conflate Qnil and Qunbound for `symbol-function'.
518 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
519 * lread.c (init_obarray): Set `function' fields to Qnil.
520 * eval.c (Fcommandp): Ignore Qunbound.
521 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
522 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
523 Test NILP rather than Qunbound.
524 (Ffmakunbound): Set to Qnil.
525 (Fsymbol_function): Never signal an error.
526 (Finteractive_form): Ignore Qunbound.
527
528 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
529
530 * eval.c (interactive_p): Remove no-longer-used decl.
531
532 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
533
534 * xdisp.c (buffer_shared): Adjust comment.
535 (buffer_shared_and_changed): New function.
536 (prepare_menu_bars, redisplay_internal): Use it to
537 decide whether all windows or frames should be updated.
538 (window_outdated): New function.
539 (text_outside_line_unchanged_p, redisplay_window): Use it.
540 (redisplay_internal): Likewise. Fix indentation.
541
542 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
543
544 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
545 (syms_of_eval): Remove corresponding defsubr.
546 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
547
548 2012-11-19 Daniel Colascione <dancol@dancol.org>
549
550 * w32fns.c (Fx_file_dialog):
551 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
552 cygwin_convert_file_name*.
553
554 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
555 Rename cygwin_convert_path* to cygwin_convert_file_name*.
556
557 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
558
559 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
560
561 2012-11-18 Eli Zaretskii <eliz@gnu.org>
562
563 * w32select.c: Include w32common.h before w32term.h, so that
564 windows.h gets included before w32term.h uses some of its
565 features, see below.
566
567 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
568 New typedefs.
569 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
570 New prototypes.
571 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
572
573 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
574
575 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
576 (ns_select): Return at once if events are held (Bug#12834).
577
578 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
579
580 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
581 Needed following 2012-10-20 change. (Bug#12902)
582
583 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
584
585 * w32proc.c (waitpid): Remove unused label get_result.
586
587 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
588
589 * makefile.w32-in (SYSWAIT_H): New macro.
590 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
591 ($(BLD)/sysdep.$(O)): Update dependencies.
592
593 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
594
595 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
596 * callproc.c (relocate_fd): Assume F_DUPFD.
597 * emacs.c, term.c (O_RDWR): Remove.
598 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
599 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
600 * nsterm.m: Assume <fcntl.h> exists.
601 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
602 (create_pty, Fmake_network_process, server_accept_connection)
603 (wait_reading_process_output, init_process_emacs):
604 Assume O_NONBLOCK.
605 (wait_reading_process_output): Put in a special case for WINDOWSNT
606 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
607 It's not clear this is needed, but it's a more-conservative change.
608 (create_process): Assume FD_CLOEXEC.
609 (create_process, create_pty): Assume O_NOCTTY.
610 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
611 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
612 Omit if not DOS_NT, since F_GETFL is not defined there.
613 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
614 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
615 (O_NOCTTY): Remove.
616 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
617 lack it, since gnulib guarantees this.
618 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
619
620 2012-11-17 Eli Zaretskii <eliz@gnu.org>
621
622 * w32.c (faccessat): Pretend that directories have the execute bit
623 set. Emacs expects that, e.g., in files.el:cd-absolute.
624
625 * w32proc.c (create_child): Don't clip the PID of the child
626 process to fit into an Emacs integer, as this is no longer a
627 restriction.
628 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
629 reaping only the process specified by PID argument, if that is
630 positive. Use PID instead of dead_child to know which process to
631 reap. Wait for the child to die only if WNOHANG is not in
632 OPTIONS.
633 (sys_select): Don't set dead_child.
634
635 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
636 as it is no longer needed.
637
638 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
639 no longer needed.
640 (record_child_status_change): Remove the setting of
641 record_at_most_one_child for the !WNOHANG case.
642
643 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
644
645 Fix problems in ns port found by static checking.
646 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
647 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
648 not to process group.
649 (ns_select): Use emacs_write, not write, as that's more robust
650 in the presence of signals.
651 (fd_handler:): Check for read errors.
652
653 2012-11-16 Glenn Morris <rgm@gnu.org>
654
655 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
656
657 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
658
659 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
660
661 2012-11-16 Eli Zaretskii <eliz@gnu.org>
662
663 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
664 use the same value of thread handle.
665 (start_timer_thread): If the timer thread exited (due to error),
666 clean up by closing the two handles it used. Duplicate the caller
667 thread's handle here, so it gets duplicated only once, when
668 launching the timer thread. Set priority of the timer thread, not
669 the caller thread.
670 (getitimer): Don't duplicate the caller thread's handle here.
671 (Bug#12832)
672
673 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
674
675 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
676 called (Bug#12834).
677
678 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
679
680 Remove no-longer-used pty_max_bytes variable.
681 * process.c (pty_max_bytes): Remove; unused.
682 (send_process): Do not set it.
683
684 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
685
686 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
687 Update dependencies.
688
689 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
690
691 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
692 This follows up on the 2012-09-29 patch that removed indirection
693 for the 'function' field. Reported by Sergey Vinokurov in
694 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
695
696 2012-11-14 Eli Zaretskii <eliz@gnu.org>
697
698 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
699 different name, as the MS runtime does not have such a function,
700 and probably never will.) All callers changed. Ignore DIRFD
701 value if PATH is an absolute file name, to match Posix spec
702 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
703 symlinks.
704
705 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
706
707 * xdisp.c (echo_area_display, redisplay_internal):
708 Omit redundant check whether frame_garbaged is set.
709
710 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
711
712 Use faccessat, not access, when checking file permissions (Bug#12632).
713 This fixes a bug that has been present in Emacs since its creation.
714 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
715 which must set some sort of record. (Torek's bug report was against
716 a predecessor of GNU Emacs, but GNU Emacs happened to have the
717 same common flaw.) See Torek's Usenet posting
718 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
719 Posted: Fri Apr 8 14:18:56 1983.
720 * Makefile.in (LIB_EACCESS): New macro.
721 (LIBES): Use it.
722 * callproc.c (init_callproc):
723 * charset.c (init_charset):
724 * fileio.c (check_existing, check_executable, check_writable)
725 (Ffile_readable_p):
726 * lread.c (openp, load_path_check):
727 * process.c (allocate_pty):
728 * xrdb.c (file_p):
729 Use effective UID when checking permissions, not real UID.
730 * callproc.c (init_callproc):
731 * charset.c (init_charset):
732 * lread.c (load_path_check, init_lread):
733 Test whether directories are accessible, not merely whether they exist.
734 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
735 * fileio.c (check_existing, check_executable, check_writable)
736 (Ffile_readable_p):
737 Use symbolic names instead of integers for the flags, as they're
738 portable now.
739 (check_writable): New arg AMODE. All uses changed.
740 Set errno on failure.
741 (Ffile_readable_p): Use faccessat, not stat + open + close.
742 (Ffile_writable_p): No need to call check_existing + check_writable.
743 Just call check_writable and then look at errno. This saves a syscall.
744 dir should never be nil; replace an unnecessary runtime check
745 with an eassert. When checking the parent directory of a nonexistent
746 file, check that the directory is searchable as well as writable, as
747 we can't create files in unsearchable directories.
748 (file_directory_p): New function, which uses 'stat' on most platforms
749 but faccessat with D_OK (for efficiency) if WINDOWSNT.
750 (Ffile_directory_p, Fset_file_times): Use it.
751 (file_accessible_directory_p): New function, which uses a single
752 syscall for efficiency.
753 (Ffile_accessible_directory_p): Use it.
754 * xrdb.c (file_p): Use file_directory_p.
755 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
756 * lread.c (openp): When opening a file, use fstat rather than
757 stat, as that avoids a permissions race. When not opening a file,
758 use file_directory_p rather than stat.
759 (dir_warning): First arg is now a usage string, not a format.
760 Use errno. All uses changed.
761 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
762 that merely introduced a race.
763 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
764 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
765 and similarly for the other O_* flags.
766 * w32.c (sys_faccessat): Rename from sys_access and switch to
767 faccessat's API. All uses changed.
768 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
769 (magic_db): Rename from magic_file_p.
770 (magic_db, search_magic_path): Return an XrmDatabase rather than a
771 char *, so that we don't have to test for file existence
772 separately from opening the file for reading. This removes a race
773 fixes a permission-checking problem, and simplifies the code.
774 All uses changed.
775 (file_p): Remove; no longer needed.
776
777 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
778
779 Omit glyphs initialization at startup.
780 * dispnew.c (glyphs_initialized_initially_p): Remove.
781 (adjust_frame_glyphs_initially): Likewise. Adjust users.
782 (Fredraw_frame): Move actual code from here...
783 (redraw_frame): ...to here. Add eassert. Adjust comment.
784 (Fredraw_display): Use redraw_frame.
785 * xdisp.c (clear_garbaged_frames): Likewise.
786
787 2012-11-13 Eli Zaretskii <eliz@gnu.org>
788
789 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
790 passed to pint2str and pint2hrstr to be at most the size of the
791 frame's decode_mode_spec_buffer. This avoids crashes with very
792 large values of FIELD_WIDTH argument to decode_mode_spec.
793 (Bug#12867)
794
795 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
796
797 Fix a race with verify-visited-file-modtime (Bug#12863).
798 Since at least 1991 Emacs has ignored an mtime difference of no
799 more than one second, but my guess is that this was to work around
800 file system bugs that were fixed long ago. Since the race is
801 causing problems now, let's remove that code.
802 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
803 whose time stamp is off by no more than a second. Insist that the
804 file time stamps match exactly.
805
806 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
807
808 * frame.h (struct frame): Convert external_tool_bar member to
809 1-bit unsigned bitfield.
810 * termhooks.h (struct terminal): Remove mouse_moved member since
811 all users are long dead. Adjust comment on mouse_position_hook.
812
813 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
814
815 Simplify by using FOR_EACH_FRAME here and there.
816 * frame.c (next_frame, prev_frame, other_visible_frames)
817 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
818 * w32term.c (x_window_to_scroll_bar): Likewise.
819 * window.c (window_list): Likewise.
820 * xdisp.c (x_consider_frame_title): Likewise.
821 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
822 * xfns.c (x_window_to_frame, x_any_window_to_frame)
823 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
824 * xmenu.c (menubar_id_to_frame): Likewise.
825 * xselect.c (frame_for_x_selection): Likewise.
826 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
827 (x_window_to_menu_bar): Likewise.
828 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
829
830 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
831
832 * data.c (Qdefalias_fset_function): Now static.
833
834 Another tweak to vectorlike_header change.
835 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
836 Remove, and replace all uses with ...
837 (next_in_free_list, set_next_in_free_list):
838 New functions, which respect C's aliasing rules better.
839
840 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
841
842 * window.c (list4i): Rename from 'quad'. All uses changed.
843 Needed because <sys/types.h> defines 'quad' on Solaris 10.
844
845 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
846
847 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
848 warning about mixing declarations and code in ISO C90.
849
850 2012-11-10 Martin Rudalics <rudalics@gmx.at>
851
852 * window.c (Fsplit_window_internal): Set combination limit of
853 new parent window to t iff Vwindow_combination_limit is t;
854 fixing a regression introduced with the change from 2012-09-22.
855 (Fset_window_combination_limit): Fix doc-string.
856
857 2012-11-10 Eli Zaretskii <eliz@gnu.org>
858
859 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
860 amount when the scroll margins are too large. When scrolling
861 backwards in the buffer, give up if cannot reach point or the
862 scroll margin within a reasonable number of screen lines.
863 Fixes point position in window under scroll-up/down-aggressively when
864 point is positioned many lines beyond the window top/bottom.
865 (Bug#12811)
866
867 * ralloc.c (relinquish): If real_morecore fails to return memory
868 to the system, don't crash; instead, leave the last heap
869 unchanged and return. (Bug#12774)
870
871 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
872
873 * lisp.h (AUTOLOADP): New macro.
874 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
875 * data.c (Ffset): Remove special ad-advice-info handling.
876 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
877 (Fsubr_arity): CSE.
878 (Finteractive_form): Simplify.
879 (Fquo): Don't insist on having at least 2 arguments.
880 (Qdefalias_fset_function): New var.
881
882 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
883
884 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
885
886 * nsfont.m (Qcondensed, Qexpanded): New variables.
887 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
888 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
889
890 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
891
892 Fix recently introduced crash on MS-Windows (Bug#12839).
893 * w32term.h (struct scroll_bar): Use convenient header.
894 (SCROLL_BAR_VEC_SIZE): Remove.
895 * w32term.c (x_scroll_bar_create): Use VECSIZE.
896
897 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
898
899 Tweak last vectorlike_header change.
900 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
901 vectorlike object on the free list. This is introduced to avoid
902 some (but not all) pointer casting and aliasing problems, see
903 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
904 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
905 objects.
906 (xvectype, xvecsize): Use them to examine Lisp_Object values.
907
908 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
909
910 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
911 been removed, so remove them here also.
912
913 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
914
915 * doc.c (Fdocumentation): Handle new property
916 dynamic-docstring-function to replace the old ad-advice-info.
917
918 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
919
920 * fns.c (Qeql, hashtest_eq): Now static.
921
922 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
923
924 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
925 * fns.c (hashfn_eq, hashfn_eql, sxhash):
926 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
927 * buffer.c (compare_overlays): Use XLI rather than XHASH.
928
929 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
930
931 Use same hash function for hashfn_profiler as for hash_string etc.
932 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
933 * lisp.h (sxhash_combine): New inline function, with the contents
934 of the old SXHASH_COMBINE.
935 * profiler.c (hashfn_profiler): Use it, instead of having a
936 special hash function containing a comparison that always yields 1.
937
938 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
939
940 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
941 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
942 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
943 Remove unused vars.
944
945 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
946
947 * image.c (xpm_make_color_table_h): Fix compiler error because
948 make_hash_table changed.
949
950 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
951
952 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
953
954 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
955
956 Use ad-hoc comparison function for the profiler's hash-tables.
957 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
958 (make_log): Use them.
959 (handle_profiler_signal): Don't inhibit quit any longer since we don't
960 call Fequal any more.
961 (Ffunction_equal): New function.
962 (cmpfn_profiler, hashfn_profiler): New functions.
963 (syms_of_profiler): Initialize them.
964 * lisp.h (struct hash_table_test): New struct.
965 (struct Lisp_Hash_Table): Use it.
966 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
967 * fns.c (make_hash_table): Take a struct to describe the test.
968 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
969 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
970 (hash_lookup, hash_remove_from_table): Move assertion checking of
971 hashfn result here. Check hash-equality before calling cmpfn.
972 (Fmake_hash_table): Adjust call to make_hash_table.
973 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
974 (syms_of_fns): Initialize them.
975 * emacs.c (main): Move syms_of_fns earlier.
976 * xterm.c (syms_of_xterm):
977 * category.c (hash_get_category_set): Adjust call to make_hash_table.
978 * print.c (print_object): Adjust to new hash-table struct.
979 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
980
981 2012-11-08 Eli Zaretskii <eliz@gnu.org>
982
983 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
984 value of w32-scroll-lock-modifier is neither nil nor one of the
985 known key modifiers. (Bug#12806)
986
987 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
988
989 Shrink struct vectorlike_header to the only size field.
990 * lisp.h (enum pvec_type): Avoid explicit enum member values.
991 Adjust comment.
992 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
993 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
994 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
995 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
996 information from the vector header. Adjust comment.
997 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
998 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
999 layout.
1000 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1001 (struct vectorlike_header): Remove next member. Adjust comment.
1002 (struct Lisp_Subr): Add convenient header. Adjust comment.
1003 (allocate_pseudovector): Adjust prototype.
1004 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1005 (sweep_string, lisp_malloc): Remove useless prototypes.
1006 (enum mem_type): Adjust comment.
1007 (NEXT_IN_FREE_LIST): New macro.
1008 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1009 (Fmake_bool_vector): Likewise.
1010 (struct large_vector): New type to represent allocation unit for
1011 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1012 (large_vectors): Change type to struct large_vector.
1013 (allocate_vector_from_block): Simplify.
1014 (PSEUDOVECTOR_NBYTES): Replace with...
1015 (vector_nbytes): ...new function. Adjust users.
1016 (sweep_vectors): Adjust processing of large vectors.
1017 (allocate_vectorlike): Likewise.
1018 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1019 Add easserts. Adjust XSETPVECTYPESIZE usage.
1020 (allocate_buffer): Use BUFFER_PVEC_INIT.
1021 (live_vector_p): Adjust to match large vector.
1022 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1023 * buffer.h (struct buffer): Add next member.
1024 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1025 New macros.
1026 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1027 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1028 (copy_hash_table): Adjust to match vector header change.
1029 * lread.c (defsubr): Use XSETPVECTYPE.
1030 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1031 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1032 (xvecsize): New command.
1033
1034 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1035
1036 * keyboard.c (event_to_kboard): Do not dereference
1037 frame_or_window field of SELECTION_REQUEST_EVENT
1038 and SELECTION_CLEAR_EVENT events (Bug#12814).
1039 * xterm.h (struct selection_input_event): Adjust comment.
1040
1041 2012-11-07 Eli Zaretskii <eliz@gnu.org>
1042
1043 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1044 such as Scroll Lock, if the respective keys are treated as
1045 function keys, not as modifiers. This avoids destroying non-ASCII
1046 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
1047
1048 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1049
1050 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1051
1052 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 Restore some duplicate definitions (Bug#12814).
1055 This undoes part of the 2012-11-03 changes. Some people build
1056 with plain -g rather than with -g3, and they need the duplicate
1057 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1058 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1059 Define as macros, as well as as enums or as constants.
1060
1061 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1062
1063 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1064 to keypad keys (Bug#12816).
1065
1066 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1067
1068 Minor adjustments of recently-changed frame functions.
1069 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1070 known to be a frame (we're in the FRAMEP branch).
1071 * lisp.h (Qframep): Remove decl. frame.h declares this.
1072 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1073 since they're meant for Lisp fixnum values.
1074
1075 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1076
1077 * window.c (Fwindow_combination_limit): Revert to the only
1078 required argument and adjust docstring as suggested in
1079 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1080 by Martin Rudalics <rudalics@gmx.at>.
1081
1082 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1083
1084 Widely used frame validity and checking functions.
1085 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1086 * frame.c (decode_live_frame, decode_any_frame): New functions.
1087 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1088 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1089 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1090 (Fframe_pointer_visible_p): Use decode_any_frame.
1091 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1092 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1093 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1094 (Fframe_focus): Likewise. Allow zero number of arguments.
1095 Adjust docstring.
1096 (frame_buffer_list, frame_buffer_predicate): Remove.
1097 * lisp.h (frame_buffer_predicate): Remove prototype.
1098 * buffer.c (Fother_buffer): Use decode_any_frame.
1099 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1100 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1101 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1102 (Fclose_font, Ffont_info): Use decode_live_frame.
1103 * fontset.c (check_fontset_name): Likewise.
1104 * terminal.c (Fframe_terminal): Likewise.
1105 * w32fns.c (check_x_frame): Likewise.
1106 * window.c (Fminibuffer_window, Fwindow_at)
1107 (Fcurrent_window_configuration): Likewise.
1108 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1109 Likewise. Allow zero number of arguments. Adjust docstring.
1110 * dispnew.c (Fredraw_frame): Likewise.
1111 * xfaces.c (frame_or_selected_frame): Remove.
1112 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1113 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1114 (Fframe_face_alist): Use decode_live_frame.
1115 * xfns.c (check_x_frame): Likewise.
1116
1117 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1118
1119 * window.c (quad): New function.
1120 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1121 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1122 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1123 (Fwindow_line_height): Use it.
1124 (Fwindow_fringes): Use list3.
1125 (Fwindow_scroll_bars): Use list4.
1126 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1127 (Fwindow_combination_limit): Allow zero number of arguments.
1128
1129 2012-11-05 Eli Zaretskii <eliz@gnu.org>
1130
1131 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1132
1133 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
1134 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
1135 file descriptor 2 for standard error. (Bug#12805)
1136
1137 2012-11-05 Chong Yidong <cyd@gnu.org>
1138
1139 * process.c (wait_reading_process_output): Revert previous change.
1140
1141 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1142
1143 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1144 This removes code that has been obsolete since around 1990.
1145 * callproc.c (Fcall_process):
1146 * emacs.c (main):
1147 * process.c (create_process):
1148 * term.c (dissociate_if_controlling_tty):
1149 Assume setsid exists.
1150 * callproc.c (child_setup): Assume setpgid exists and behaves as
1151 per POSIX.1-1988 or later.
1152 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1153 * emacs.c (shut_down_emacs):
1154 * sysdep.c (sys_suspend, init_foreground_group):
1155 Assume getpgrp behaves as per POSIX.1-1998 or later.
1156 * msdos.c (setpgrp): Remove.
1157 (tcgetpgrp, setpgid, setsid): New functions.
1158 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1159 * term.c (no_controlling_tty): Remove; unused.
1160 * w32proc.c (setpgrp): Remove.
1161 (setsid, tcgetpgrp): New functions.
1162
1163 Simplify by assuming __fpending.
1164 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1165 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1166 Do not assume that __fpending's result fits in int.
1167
1168 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1169
1170 Remove EMACS_OUTQSIZE+sleep hack.
1171 * dispnew.c (update_frame_1): Remove hack for terminals slower
1172 than 2400 bps, which throttled Emacs by having it sleep.
1173 This code hasn't worked since at least 2007, when the multi-tty stuff
1174 was added, and anyway those old terminals are long dead.
1175 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1176 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1177
1178 Fix data-loss with --version (Bug#9574).
1179 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1180 as we can't assume that emacs_strerror is initialized, and strerror
1181 is good enough here.
1182 (main): Invoke atexit earlier, to catch earlier instances of
1183 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1184
1185 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1186
1187 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1188 (keyDown): Remap keypad keys to X11 virtual key codes.
1189
1190 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1191
1192 Fix data-loss with --batch (Bug#9574).
1193 * emacs.c: Include <close-stream.h>.
1194 (close_output_streams): New function.
1195 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1196 and handles errors appropriately.
1197 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1198 does that now.
1199
1200 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1201 The symptom is a diagnostic "GLib-WARNING **: In call to
1202 g_spawn_sync(), exit status of a child process was requested but
1203 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1204 waitpid(), so exit status can't be returned." The diagnostic
1205 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1206 The real bug is a race condition between Emacs and glib: Emacs
1207 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1208 so that glib can't find it. Work around the bug by invoking
1209 waitpid only on subprocesses that Emacs itself creates.
1210 * process.c (create_process, record_child_status_change):
1211 Don't use special value -1 in pid field, as the caller now must
1212 know the pid rather than having the callee infer it.
1213 The inference was sometimes incorrect anyway, due to another race.
1214 (create_process): Set new 'alive' member if child is created.
1215 (process_status_retrieved): New function.
1216 (record_child_status_change): Use it.
1217 Accept negative 1st argument, which means to wait for the
1218 processes that Emacs already knows about. Move special-case code
1219 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1220 processes that have already been waited for, by testing and
1221 clearing new 'alive' member.
1222 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1223 now does this internally.
1224 (handle_child_signal): Let record_child_status_change do all
1225 the work, since we do not want to reap all exited child processes,
1226 only the child processes that Emacs itself created.
1227 * process.h (Lisp_Process): New boolean member 'alive'.
1228
1229 Omit duplicate definitions no longer needed with gcc -g3.
1230 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1231 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1232 Define only as macros. There's no longer any need to also define
1233 these symbols as enums or as constants, since we now assume
1234 gcc -g3 when debugging.
1235
1236 2012-11-03 Eli Zaretskii <eliz@gnu.org>
1237
1238 * lisp.mk: Adjust comments to the fact that term/internal is now
1239 loaded from loadup.el.
1240
1241 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1242 (msdos_fatal_signal): New function.
1243 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1244 its argument list.
1245
1246 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1247 for GCC versions before 4.
1248 (emacs_raise): Define to call msdos_fatal_signal.
1249
1250 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1251 iterator when starting in the middle of a display or overlay
1252 string. (Bug#12745)
1253
1254 2012-11-03 Chong Yidong <cyd@gnu.org>
1255
1256 * process.c (wait_reading_process_output): Clean up the last
1257 change.
1258
1259 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1260
1261 * process.c (wait_reading_process_output): Avoid a race condition
1262 with SIGIO delivery (Bug#11536).
1263
1264 2012-11-03 Chong Yidong <cyd@gnu.org>
1265
1266 * buffer.c (cursor_type): Untabify docstring.
1267
1268 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1269
1270 * frame.h (struct frame): Drop can_have_scroll_bars member
1271 which is meaningless for a long time. Adjust comments.
1272 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1273 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1274
1275 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1276
1277 * window.c (decode_next_window_args): Update window arg after
1278 calling decode_live_window and so fix crash reported at
1279 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1280 by Juanma Barranquero <lekktu@gmail.com>.
1281 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1282 * font.c (Ffont_at): Likewise.
1283
1284 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1285
1286 * widget.c (resize_cb): New function.
1287 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1288 (EmacsFrameResize): Check if all is up to date before changing frame
1289 size.
1290
1291 2012-11-02 Eli Zaretskii <eliz@gnu.org>
1292
1293 Implement backtrace output for fatal errors on MS-Windows.
1294 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1295 (BACKTRACE_LIMIT_MAX): New macro.
1296 (w32_backtrace): New function.
1297 (emacs_abort): Use w32_backtrace when the user chooses not to
1298 attach a debugger. Update the text of the abort dialog.
1299
1300 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1301
1302 Window-related stuff cleanup here and there.
1303 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1304 Use decode_any_window.
1305 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1306 * xdisp.c (Fformat_mode_line): Likewise.
1307 * font.c (Ffont_at): Use decode_live_window.
1308 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1309 * window.c (decode_next_window_args): Likewise.
1310 (decode_any_window): Remove static.
1311 * window.h (decode_any_window): Add prototype.
1312 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1313 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1314 respectively.
1315
1316 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1317
1318 Remove pad from struct input_event.
1319 * termhooks.h (struct input_event): Remove padding field.
1320 Adjust comment.
1321 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1322 member is never cons for a long time. Adjust comment.
1323 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1324 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1325 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1326 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1327
1328 2012-11-01 Eli Zaretskii <eliz@gnu.org>
1329
1330 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1331
1332 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 Fix crash when using Emacs as commit editor for git (Bug#12697).
1335 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1336 and it is configured in conf_post.h.
1337 (Fcall_process): Don't invoke both setsid and setpgid; the former
1338 is enough, if it exists.
1339 * callproc.c (Fcall_process, child_setup):
1340 * process.c (create_process): Use setpgid.
1341 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1342 for the real thing.
1343 * dispnew.c (init_display): Initialize the foreground group
1344 if we are running a tty display.
1345 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1346 * lisp.h (init_foreground_group): New decl.
1347 * sysdep.c (inherited_pgroup): New static var.
1348 (init_foreground_group, tcsetpgrp_without_stopping)
1349 (narrow_foreground_group, widen_foreground_group): New functions.
1350 (init_sys_modes): Narrow foreground group.
1351 (reset_sys_modes): Widen foreground group.
1352
1353 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
1354
1355 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1356
1357 2012-10-31 Martin Rudalics <rudalics@gmx.at>
1358
1359 * minibuf.c (read_minibuf): Restore current buffer since
1360 choose_minibuf_frame calling Fset_frame_selected_window may
1361 change it (Bug#12766).
1362
1363 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1364
1365 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1366
1367 2012-10-30 Kenichi Handa <handa@gnu.org>
1368
1369 * font.c (Ffont_at): If WINDOW is specified and it is not
1370 displaying the current buffer, signal an error.
1371
1372 2012-10-29 Daniel Colascione <dancol@dancol.org>
1373
1374 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1375 In preparation for fixing bug#12739, move these functions from
1376 here...
1377
1378 * coding.h, coding.c: ... to here, and compile them only when
1379 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1380 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
1381
1382 2012-10-28 Eli Zaretskii <eliz@gnu.org>
1383
1384 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1385 (timer_loop, getitimer, setitimer): Use it instead of
1386 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1387 'clock'.
1388 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1389 literal 10000.
1390
1391 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1392
1393 * nsterm.m (NO_APPDEFINED_DATA): New define.
1394 (last_appdefined_event_data): New variable
1395 (last_appdefined_event): Remove.
1396 (ns_select): Initialize t from last_appdefined_event_data instead
1397 of [last_appdefined_event data1].
1398 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1399 remove last_appdefined_event (Bug#12698).
1400
1401 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1402
1403 * frame.c (x_set_font): Catch internal error.
1404
1405 2012-10-27 Eli Zaretskii <eliz@gnu.org>
1406
1407 Avoid overflow in w32 implementation of interval timers.
1408 When possible, for ITIMER_PROF count only times the main thread
1409 actually executes.
1410 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
1411 'volatile ULONGLONG' types. All the other data which was
1412 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
1413 (GetThreadTimes_Proc): New typedef.
1414 (w32_get_timer_time): New function, returns a suitable time value
1415 for the timer.
1416 (timer_loop): Enter critical section when accessing ULONGLONG
1417 values of the itimer_data struct, as these accesses are no longer
1418 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1419 Remove unused variable.
1420 (init_timers): Initialize s_pfn_Get_Thread_Times.
1421 (start_timer_thread): Don't assign itimer->caller_thread here.
1422 (getitimer): Assign itimer->caller_thread here.
1423 (setitimer): Always call getitimer to get the value of ticks_now.
1424 (sys_spawnve): Avoid compiler warning about format mismatch.
1425
1426 2012-10-26 Eli Zaretskii <eliz@gnu.org>
1427
1428 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1429 mouse movement events if the menu bar is active. This avoids
1430 producing a busy "hour-glass" cursor by Windows if the mouse
1431 pointer is positioned over a tooltip shown for some menu item.
1432
1433 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1434
1435 Don't assume process IDs fit in int.
1436 * emacs.c (shut_down_emacs) [!DOS_NT]:
1437 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1438 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1439 Use pid_t, not int, to store process IDs, as 'int'
1440 is not wide enough on a few platforms (e.g., AIX and IRIX).
1441
1442 2012-10-23 Kenichi Handa <handa@gnu.org>
1443
1444 The following change is to make face-font-rescale-alist work
1445 correctly for non-ASCII fonts.
1446
1447 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1448 (font_open_for_lface): Handle Vface_font_rescale_alist.
1449
1450 2012-10-23 Chong Yidong <cyd@gnu.org>
1451
1452 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1453
1454 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1455
1456 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1457 for screen font.
1458 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1459
1460 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1461 event (Bug#12681).
1462
1463 2012-10-21 Glenn Morris <rgm@gnu.org>
1464
1465 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1466
1467 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 Port to OpenBSD 5.1.
1470 * frame.c (Fmouse_position, Fmouse_pixel_position):
1471 * xdisp.c (produce_stretch_glyph):
1472 Declare local vars only when they're needed.
1473 This is clearer and avoids a warning on OpenBSD about unused vars.
1474 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1475 This is safer, and avoids OpenBSD warnings about unused vars.
1476 * keyboard.c (record_menu_key): Remove unnecessary decl.
1477 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1478 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1479 as our definition clashes with OpenBSD's.
1480 * xfaces.c (load_face_colors, check_lface_attrs)
1481 (get_lface_attributes_no_remap, get_lface_attributes)
1482 (lface_fully_specified_p, x_supports_face_attributes_p)
1483 (tty_supports_face_attributes_p, face_fontset, realize_face)
1484 (realize_x_face, realize_tty_face):
1485 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1486 merely Lisp_Object *. This is more informative and avoids
1487 a warning on OpenBSD about accessing beyond an object's size.
1488
1489 2012-10-20 Chong Yidong <cyd@gnu.org>
1490
1491 * lread.c (Fload): Doc fix (Bug#12592).
1492
1493 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1494
1495 * font.c (Ffont_at): Fix previous change.
1496
1497 2012-10-19 Eli Zaretskii <eliz@gnu.org>
1498
1499 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1500 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
1501 for the reasons.
1502
1503 * alloc.c (NSTATICS): Decrease to 0x800.
1504
1505 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1506
1507 * fns.c (Fnreverse): Include the problem element when signalling an
1508 error (bug#12677).
1509
1510 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1511
1512 * nsterm.m (ns_select): Check writefds before call to
1513 FD_ISSET (Bug#12668).
1514
1515 2012-10-18 Daniel Colascione <dancol@dancol.org>
1516
1517 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1518 (staticpro): If we run out of staticpro slots, die with an
1519 informative error instead of just calling emacs_abort.
1520
1521 2012-10-18 Martin Rudalics <rudalics@gmx.at>
1522
1523 Fix two flaws reported by Dmitry Antipov.
1524 * window.c (Ftemp_output_buffer_show): Remove.
1525 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1526 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1527
1528 2012-10-17 Eli Zaretskii <eliz@gnu.org>
1529
1530 * makefile.w32-in ($(BLD)/w32.$(O)):
1531 ($(BLD)/vm-limit.$(O)):
1532 ($(BLD)/term.$(O)):
1533 ($(BLD)/unexw32.$(O)):
1534 ($(BLD)/fileio.$(O)):
1535 ($(BLD)/dispnew.$(O)): Update dependencies.
1536
1537 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1538 Add prototypes.
1539
1540 * w32proc.c: Include ctype.h.
1541
1542 * w32.h (init_environment, check_windows_init_file)
1543 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1544 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1545 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1546 (sys_link): Add prototypes.
1547
1548 * w32.c: Include w32select.h.
1549 (sys_access, e_malloc, sys_select): Add prototypes.
1550 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1551
1552 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1553
1554 * unexw32.c: Include lisp.h and w32.h.
1555
1556 * term.c [WINDOWSNT]: Include w32term.h.
1557
1558 * process.c [WINDOWSNT]: Add prototype of sys_select.
1559
1560 * fileio.c [WINDOWSNT]: Include w32.h.
1561
1562 * dispnew.c [WINDOWSNT]: Include w32.h.
1563
1564 * cygw32.c (Fcygwin_convert_path_to_windows)
1565 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1566 Lisp_Object values. (Bug#12661)
1567
1568 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1569 to Lisp_Object. (Bug#12661)
1570
1571 2012-10-17 Kenichi Handa <handa@gnu.org>
1572
1573 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1574 invalidate.
1575
1576 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1577
1578 * buffer.c (Fkill_buffer): When unchaining the marker,
1579 reset its buffer pointer to NULL (Bug#12652).
1580
1581 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1582
1583 Do not verify indirection counters of killed buffers (Bug#12579).
1584 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1585 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1586
1587 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1588
1589 * alloc.c (Fmake_byte_code): Fix typo in comment.
1590 * print.c (print_interval): Define as static to match prototype.
1591 * indent.c (disptab_matches_widthtab, recompute_width_table):
1592 Convert to eassert.
1593
1594 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1595
1596 * editfns.c (get_system_name): Remove.
1597 * lisp.h (get_system_name): Remove prototype.
1598 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1599 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1600
1601 2012-10-15 Daniel Colascione <dancol@dancol.org>
1602
1603 * dbusbind.c: Add comment explaining reason for previous change.
1604
1605 2012-10-15 Martin Rudalics <rudalics@gmx.at>
1606
1607 * window.c (Fwindow_end): Rewrite check whether cached position
1608 can be used (Bug#12600).
1609 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1610 Set windows_or_buffers_changed.
1611
1612 2012-10-15 Daniel Colascione <dancol@dancol.org>
1613
1614 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1615 enabled by undefining the symbol "interface", which the platform
1616 headers define to something incompatible.
1617
1618 2012-10-14 Daniel Colascione <dancol@dancol.org>
1619
1620 * image.c (init_tiff_functions, init_imagemagick_functions)
1621 (init_svg_functions): Fix cygw32 build break by using these
1622 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1623
1624 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1625
1626 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1627
1628 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1629
1630 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1631
1632 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1633
1634 * coding.c (detect_coding): Set coding->id before calling
1635 this->detector.
1636
1637 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1638
1639 * fileio.c: Formatting fixes.
1640
1641 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1642
1643 Fix some stat-related races.
1644 * fileio.c (Fwrite_region): Avoid race condition if a file is
1645 removed or renamed by some other process immediately after Emacs
1646 writes it but before Emacs stats it. Do not assume that stat (or
1647 fstat) succeeds.
1648 * image.c (slurp_file): Resolve the file name with fopen + fstat
1649 rather than stat + fopen.
1650 (pbm_read_file) [0]: Remove unused code with stat race.
1651 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1652 Remove ineffective code with stat race.
1653
1654 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1655
1656 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1657
1658 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1659
1660 * nsterm.m (hold_event_q): New static variable.
1661 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1662 ! q_event_ptr.
1663 (hold_event): New function.
1664 (ns_read_socket): If hold_event_q have events, store them and
1665 return (Bug#12384).
1666 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1667 is zero (Bug#12384).
1668
1669 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
1670
1671 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1672
1673 2012-10-12 Eli Zaretskii <eliz@gnu.org>
1674
1675 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1676
1677 * fileio.c (check_existing): New function.
1678 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1679 instead of calling 'stat', when what's needed is to check whether
1680 a file exists. This avoids expensive system calls on MS-Windows.
1681 (Bug#12587)
1682
1683 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
1684
1685 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1686 determine whether a file exists and is not a directory.
1687
1688 * lisp.h (check_existing): Add prototype.
1689
1690 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1691
1692 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1693
1694 2012-10-12 Glenn Morris <rgm@gnu.org>
1695
1696 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1697
1698 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1699
1700 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1701
1702 * eval.c (Fautoload): Remember previous autoload status in load-history.
1703
1704 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1707 * lread.c (load_each_byte, new_backquote_flag, readchar)
1708 (read_filtered_event, lisp_file_lexically_bound_p)
1709 (safe_to_load_version, Fload, complete_filename_p, openp)
1710 (build_load_history, readevalloop, read_escape, read1)
1711 (string_to_number, read_vector, read_list):
1712 * macros.c (Fstart_kbd_macro):
1713 * marker.c (CONSIDER):
1714 * menu.c (parse_single_submenu, digest_single_submenu)
1715 (find_and_return_menu_selection, Fx_popup_menu):
1716 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1717 (Ftry_completion):
1718 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1719 (ns_menu_show):
1720 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1721 (xmenu_show, xdialog_show):
1722 Use bool for booleans.
1723 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1724 as it's not a predicate. All uses changed. Omit unnecessary
1725 buffer termination.
1726
1727 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1728
1729 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1730 (save_excursion_restore): Do not restore mark if it was not saved.
1731
1732 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 * marker.c (cached_modiff): EMACS_INT, not int.
1735
1736 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1737 instead of having a wrong decl.
1738 * nsmenu.m (waiting_for_input): Remove wrong decl.
1739
1740 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 keyboard.c, keymap.c: Use bool for booleans.
1743 * dispnew.c (sit_for): Distinguish between 3-way display_option
1744 and boolean do_display.
1745 * keyboard.c (single_kboard, this_command_key_count_reset)
1746 (waiting_for_input, echoing, immediate_quit, input_pending)
1747 (interrupt_input, interrupts_deferred, pop_kboard)
1748 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1749 (command_loop_1, adjust_point_for_property)
1750 (safe_run_hooks_error, input_polling_used, read_char):
1751 (help_char_p, readable_events, kbd_buffer_events_waiting)
1752 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1753 (lucid_event_type_list_p, get_input_pending):
1754 (gobble_input, menu_separator_name_p, menu_bar_item)
1755 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1756 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1757 (keyremap_step, test_undefined, read_key_sequence)
1758 (detect_input_pending, detect_input_pending_ignore_squeezables)
1759 (detect_input_pending_run_timers, requeued_events_pending_p)
1760 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1761 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1762 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1763 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1764 (accessible_keymaps_1, Fkey_description, push_key_description):
1765 (shadow_lookup, struct where_is_internal_data)
1766 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1767 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1768 (describe_map, describe_vector):
1769 * menu.c (single_menu_item):
1770 * nsmenu.m (ns_update_menubar):
1771 * process.c (wait_reading_process_output):
1772 * search.c (scan_buffer, scan_newline):
1773 Use bool for boolean.
1774 * keyboard.c (timers_run, swallow_events)
1775 (detect_input_pending_run_timers):
1776 * process.c (wait_reading_process_output):
1777 Use unsigned for counter where wraparound-on-overflow is desired,
1778 since unsigned is guaranteed to have that behavior and signed is not.
1779 (read_char): Use ptrdiff_t for string length.
1780 (get_input_pending): Remove first argument, since it was always
1781 the same pointer-to-int (now pointer-to-boolean) &input_pending,
1782 and behave as if it had that value. Return new value of
1783 input_pending. All callers changed.
1784 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
1785 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
1786 a string length.
1787 * keymap.c (push_key_description): Omit last arg, which was always 1.
1788 All callers changed.
1789
1790 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
1791
1792 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
1793
1794 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
1795 ($(BLD)/term.$(O)): Update dependencies.
1796
1797 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1798
1799 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
1800 * lisp.h (enum pvec_type): Adjust comments and omit explicit
1801 initializer for PVEC_NORMAL_VECTOR.
1802
1803 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1804
1805 Clean out old termopts cruft.
1806 * termopts.h (flow_control, meta_key): Remove unused decls.
1807 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
1808 Don't include termopts.h.
1809
1810 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
1811
1812 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
1813
1814 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 * commands.h (immediate_quit): Remove duplicate decl.
1817
1818 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
1819
1820 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
1821 caching.
1822 (nsfont_open): Remove setting of Vfonts_in_cache.
1823 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
1824
1825 2012-10-09 Eli Zaretskii <eliz@gnu.org>
1826
1827 * w32fns.c (w32_last_error): Change the return value to DWORD, to
1828 match what GetLastError returns. Explain why the function is
1829 needed.
1830
1831 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
1832 'is_tooltip_frame', to avoid confusion with its global namesake.
1833
1834 2012-10-08 Daniel Colascione <dancol@dancol.org>
1835
1836 * xdisp.c (start_hourglass): Call w32_note_current_window when
1837 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
1838 build that caused Emacs to display the hourglass cursor forever.
1839
1840 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
1841 which is broken under remote desktop, calculate the number of
1842 colors available for a display based on the display's number of
1843 planes and number of bits per pixel per plane. (bug#10397).
1844
1845 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
1846
1847 * nsfont.m (Vfonts_in_cache): New variable.
1848 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
1849 are used. Add cached fonts to Vfonts_in_cache.
1850 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
1851
1852 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
1853
1854 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
1855 in nt/config.nt.
1856 (FONT_H): Define after FRAME_H.
1857 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
1858 Update dependencies.
1859
1860 * w32term.c: Remove leftover declaration of keyboard_codepage.
1861
1862 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1863
1864 * makefile.w32-in (FONT_H): Add $(FRAME_H).
1865 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
1866 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
1867 (GLOBAL_SOURCES): Add cygw32.c.
1868 ($(BLD)/unexw32.$(O)):
1869 ($(BLD)/w32.$(O)):
1870 ($(BLD)/w32console.$(O)):
1871 ($(BLD)/w32fns.$(O)):
1872 ($(BLD)/w32heap.$(O)):
1873 ($(BLD)/w32menu.$(O)):
1874 ($(BLD)/w32proc.$(O)): Add w32common.h.
1875
1876 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
1877 'const char *'.
1878 (x_to_w32_color): Don't modify the argument, modify a copy instead.
1879
1880 2012-10-08 Daniel Colascione <dancol@dancol.org>
1881
1882 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
1883 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
1884 accidental message numbering hole. Change other messages to
1885 match.
1886
1887 * w32select.h (HAVE_W32SELECT): Remove.
1888
1889 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1890 w32common.h instead of w32heap.h.
1891
1892 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
1893 (get_allocation_unit, get_processor_type, get_w32_major_version)
1894 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1895 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1896 (OS_NT, os_subtype, cache_system_info): Move declarations to
1897 w32common.
1898
1899 * w32heap.c: Include w32common.h.
1900 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
1901 (w32_minor_version, w32_build_number, w32_subtype):
1902 Remove duplicate definitions.
1903
1904 * w32fns.c: Include w32common.h; include w32heap.h only in
1905 WINDOWSNT.
1906
1907 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
1908 Use `report_file_error' instead of `error' in order to better
1909 inform users of what went wrong. Increase NTGUI_UNICODE file
1910 dialog box file name length to 32k, the maximum allowed by the NT
1911 kernel.
1912
1913 * w32common.h: New file.
1914 (ROUND_UP, ROUND_DOWN, get_page_size)
1915 (get_allocation_unit, get_processor_type, get_w32_major_version)
1916 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1917 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1918 (OS_NT, os_subtype, cache_system_info): Move here.
1919
1920 * unexw32.c, unexcw.c: Include w32common.h.
1921
1922 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1923 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1924 to call syms_of_w32select.
1925
1926 * cygw32.h: Remove obsolete EXFUN declarations.
1927
1928 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1929
1930 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1931 of w32inevt.o from SOME_MACHINE_OBJECTS.
1932
1933 2012-10-08 Daniel Colascione <dancol@dancol.org>
1934
1935 * image.c: Permanent fix for JPEG compilation issue --- limit
1936 jpeglib `boolean' redefinition to Cygwin builds.
1937
1938 2012-10-08 Eli Zaretskii <eliz@gnu.org>
1939
1940 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1941
1942 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1943 Cygwin.
1944
1945 2012-10-08 Daniel Colascione <dancol@dancol.org>
1946
1947 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1948 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1949 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1950 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1951 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1952 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1953 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1954 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1955 now a supported configuration.
1956
1957 * Makefile.in: consolidate image variables into LIBIMAGE; add
1958 W32_OBJ and W32_LIBS. Compile new files.
1959
1960 * conf_post.h:
1961 (_DebPrint) declare tracing facility for W32 debugging. We need
1962 to unify tracing later.
1963
1964 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1965 unconditional use of W32 Unicode functions. Cygwin runs only on
1966 100% Unicode operating systems.
1967
1968 * cygw32.c: New file. Define Cygwin-specific facilities.
1969 (Fcygwin_convert_path_to_windows)
1970 (Fcygwin_convert_path_from_windows): New user functions for
1971 accessing Cygwin path-munging routines.
1972
1973 * cygw32.h: New file.
1974 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1975 UTF-16LE strings temporarily inside non-Lisp-visible string
1976 objects.
1977
1978 (w32_strerror): Just what it says on the tin.
1979
1980 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1981 also run for Cygwin; both systems have the same problem with using
1982 GUI facilities in a forked child. Also call syms_of_cygw32,
1983 syms_of_w32select in correct places.
1984
1985 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1986 needs fork-then-exec for daemon launching.
1987
1988 * font.h: Include frame.h.
1989
1990 * image.c: Use the image library cache machinery only when we're
1991 compiling for native WINDOWSNT; Cygwin can use shared libraries
1992 like any other Unixlike system.
1993
1994 * keyboard.c: Clarify a comment regarding the input loop.
1995
1996 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1997 functions directly instead of trying to detect at runtime that our
1998 host operating system supports them. We make this change for two
1999 reasons: Cygwin lacks support for the multibyte character
2000 conversion functions used by the legacy menu code, and Cygwin
2001 never needs to rely on non-Unicode APIs.
2002
2003 * unexw32.c (hinst): Declare extern.
2004
2005 * w32.c: Change header order;
2006 (w32_strerror): Move to w32fns.c because we need it for
2007 non-WINDOWSNT builds.
2008
2009 * w32.h: Add #error macro to make sure we don't include w32.h for
2010 Cygwin builds. Remove w32select declarations.
2011
2012 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
2013 w32fns.c. w32console.c is WINDOWSNT-only.
2014
2015 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2016 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2017 POSIXy alternative.
2018 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2019 (w32_major_version, w32_minor_version, w32_build_number)
2020 (os_subtype, sound_type): Define here
2021 (w32_defined_color): Make color parameter const for consistency
2022 with other _defined_color functions.
2023 (w32_createwindow): Unconditionally call w32_init_class instead of
2024 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2025 through the code is complex and unnecessary because class
2026 registration is practically free.
2027 (w32_name_of_message): New EMACSDEBUG-only function.
2028 (Fset_message_beep): Move here
2029 (Fx_open_connection): Require that the display name for Windows be
2030 "w32" for consistency, emacsclient disambiguation, and maybe, one
2031 day, multi-window-system support.
2032 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2033 Cygwin files for W32 GUI facilities, since these clearly don't
2034 expect Cygwin names.
2035 (_DebPrint): Define.
2036 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2037 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2038 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2039 (w32_last_error): Remove.
2040
2041 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2042
2043 * w32heap.c (syspage_mask): Declare here.
2044 (cache_system_info): Remove.
2045
2046 * w32inevt.c (faked_key): Define globally, not statically.
2047 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2048 (w32_console_toggle_lock_key): Move to w32fns.c.
2049
2050 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2051
2052 * w32proc.c (_DebPrint): Move to w32fns.c.
2053 * w32select.c: Include string.h, stdio.h for Cygwin.
2054 * w32select.h: New File.
2055
2056 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2057 get_osfhandle.
2058 (w32_message_fd): New variable. Under Cygwin, holds the file
2059 descriptor the system used to tell us about pending thread
2060 messages.
2061
2062 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2063 that prevented compilation under non-WINDOWSNT systems.
2064
2065 (w32_initialize): Open /dev/windows and assign it to
2066 w32_message_fd. Provide w32 feature.
2067
2068 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2069 (WM_EMACS_INPUT_READY): add.
2070 (prepend_msg, w32_message_fd): Declare globally.
2071
2072 * w32xfns.c:
2073 (keyboard_handle): Use only when WINDOWSNT.
2074 (notify_msg_ready): New function. Posts a message to the main
2075 thread's message queue under CYGWIN, which wakes up the main
2076 thread from select(2) by making the /dev/windows file descriptor
2077 ready. Under WINDOWSNT, it sets an event the same way the old
2078 code did.
2079
2080 (post, prepend_msg): Actually call notify_msg_ready instead of
2081 setting the input event directly.
2082
2083 2012-10-07 Eli Zaretskii <eliz@gnu.org>
2084
2085 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2086 but it still has blocs in it, don't return it to the system,
2087 instead of aborting. (Bug#12402)
2088
2089 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2090
2091 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
2092
2093 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2094 MAC_OS_X_VERSION_10_6.
2095 (syms_of_nsterm): Remove comment about Panther and above for
2096 ns-antialias-text.
2097 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2098 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2099 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2100
2101 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2102 MAC_OS_X_VERSION_10_4.
2103
2104 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2105 MAC_OS_X_VERSION_10_2.
2106
2107 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2108
2109 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2110 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2111
2112 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2113 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
2114 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2115 Remove ns_in_resize check.
2116 (ns_clear_frame_area): Remove resize handle code.
2117
2118 * nsfns.m (ns_in_resize): Remove.
2119 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2120 Remove ns_in_resize check.
2121
2122 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2123
2124 Improve sys_siglist detection.
2125 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2126 defined as a macro, as is done in Solaris.
2127 (sys_siglist_entries): New macro.
2128 (save_strsignal): Use it.
2129 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2130 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2131
2132 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2133
2134 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2135 fullscreen/Fullscreen.
2136
2137 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2138 tobar_height is new.
2139
2140 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2141 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2142 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2143 (windowDidResize:): Check for correct window if old style fullscreen.
2144 Capitalize word in comment. Remove incorrect comment.
2145 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2146 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2147 error in drawing background.
2148 (toggleFullScreen:): Remove comment. Rearrange calls.
2149 Set toolbar values to zero, save old height in tobar_height.
2150 Restore tool bar height when leaving fullscreen.
2151 (canBecomeMainWindow): New function.
2152
2153 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2154
2155 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2156
2157 2012-10-05 Eli Zaretskii <eliz@gnu.org>
2158
2159 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2160
2161 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
2162 that time stamps of directories could also be changed.
2163 Don't request the too broad GENERIC_WRITE, only the more restrictive
2164 FILE_WRITE_ATTRIBUTES access rights.
2165
2166 * fileio.c (Fset_file_times): Special-case ignoring errors for
2167 directories only on MSDOS, not on MS-Windows.
2168
2169 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
2170
2171 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2172
2173 2012-10-04 Eli Zaretskii <eliz@gnu.org>
2174
2175 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2176 see whether CreateFile failed.
2177
2178 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2179
2180 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2181 to avoid similar races.
2182 * keyboard.c (pending_signals): Now bool, not int.
2183
2184 Port timers to OpenBSD, plus check for timer failures.
2185 OpenBSD problem reported by Han Boetes.
2186 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2187 and/or setitimer.
2188 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2189 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2190 like OpenBSD, which has timer_settime but does not declare it.
2191 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2192 whether to use itimerspec-related primitives. All uses of
2193 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2194
2195 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2196
2197 * profiler.c (handle_profiler_signal): Fix a malloc race
2198 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2199
2200 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2201
2202 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2203
2204 2012-10-02 Eli Zaretskii <eliz@gnu.org>
2205
2206 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2207 consistent with the change in return value of 'safe_strsignal'.
2208
2209 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2210
2211 Prefer plain 'static' to 'static inline' (Bug#12541).
2212 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2213 (bidi_set_sor_type, bidi_push_embedding_level)
2214 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2215 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2216 (bidi_cache_search, bidi_cache_ensure_space)
2217 (bidi_cache_iterator_state, bidi_cache_find)
2218 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2219 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2220 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2221 Now 'static', not 'static inline'.
2222
2223 Count overruns when profiling; change units to ns.
2224 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2225 Give extra weight to samples after overruns, to attempt to count
2226 the time more accurately.
2227 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2228 the underlying primitives nominally do ns.
2229 (Fprofiler_cpu_start): Document the change. Mention that
2230 the sampling intervals are only approximate.
2231
2232 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2233
2234 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2235
2236 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2237 case for the special 0 coding-system.
2238
2239 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2240 (Fmake_overlay): Remove redundant tests.
2241 (fix_start_end_in_overlays): Remove redundant recentering.
2242
2243 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
2244
2245 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2246 Update dependencies.
2247
2248 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2249
2250 Fix a malloc race condition involving strsignal.
2251 A signal can arrive in the middle of a malloc, and Emacs's signal
2252 handler can invoke strsignal, which can invoke malloc, which is
2253 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2254 Fix it by altering the signal handler so that it does not invoke
2255 strsignal.
2256 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2257 * process.c (status_message): Use const pointer, in case strsignal
2258 is #defined to safe_strsignal.
2259 * sysdep.c (sys_siglist, init_signals): Always define and
2260 initialize a substitute sys_siglist if the system does not define
2261 one, even if HAVE_STRSIGNAL.
2262 (safe_strsignal): Rename from strsignal. Always define,
2263 using sys_siglist. Return a const pointer.
2264 * syssignal.h (safe_strsignal): New decl.
2265 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2266
2267 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2268
2269 * w32proc.c (timer_loop): Fix code that waits for timer
2270 expiration, to avoid high CPU usage.
2271
2272 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2273
2274 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2275 (sweep_weak_table): Remove redundant prototypes.
2276
2277 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2278
2279 * emacs.c: Move the inclusion of TERM_HEADER after including
2280 windows.h on WINDOWSNT. This avoids compilation problems with
2281 MSVC.
2282
2283 2012-10-01 Eli Zaretskii <eliz@gnu.org>
2284
2285 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2286 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2287 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2288 as the previous version used 'void *'.
2289
2290 * ralloc.c (ROUNDUP): Fix last change.
2291 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2292 'size_t'.
2293
2294 * w32proc.c <disable_itimers>: New static flag.
2295 (init_timers): Initialize it to zero, after creating the critical
2296 sections used by the timer threads.
2297 (term_timers): Set to 1 before deleting the critical sections.
2298 (getitimer, setitimer): If disable_itimers is non-zero, return an
2299 error indication without doing anything. Reported by Fabrice
2300 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
2301 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2302 return results.
2303 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2304 support timers.
2305
2306 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2307 term_ntproc after all the other bookkeeping, to get timers working
2308 as long as possible.
2309
2310 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2313 Suggested by Juri Linkov in
2314 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2315
2316 Prefer plain 'static' to 'static inline' (Bug#12541).
2317 With static functions, modern compilers inline pretty well by
2318 themselves; advice from programmers often hurts as much as it helps.
2319 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2320 this change shrinks the text size of the Emacs executable by 1.1%
2321 without affecting CPU significantly in my benchmark.
2322 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2323 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2324 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2325 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2326 (bset_auto_fill_function, bset_auto_save_file_format)
2327 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2328 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2329 (bset_cache_long_line_scans, bset_case_fold_search)
2330 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2331 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2332 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2333 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2334 (bset_header_line_format, bset_indicate_buffer_boundaries)
2335 (bset_indicate_empty_lines, bset_invisibility_spec)
2336 (bset_left_fringe_width, bset_major_mode, bset_mark)
2337 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2338 (bset_name, bset_overwrite_mode, bset_pt_marker)
2339 (bset_right_fringe_width, bset_save_length)
2340 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2341 (bset_scroll_up_aggressively, bset_selective_display)
2342 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2343 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2344 (set_buffer_overlays_after):
2345 * category.c (bset_category_table):
2346 * charset.c (read_hex):
2347 * coding.c (produce_composition, produce_charset)
2348 (handle_composition_annotation, handle_charset_annotation)
2349 (char_encodable_p):
2350 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2351 (assign_row, set_frame_matrix_frame, make_current)
2352 (add_row_entry):
2353 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2354 * fns.c (maybe_resize_hash_table):
2355 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2356 * gmalloc.c (register_heapinfo):
2357 * image.c (lookup_image_type):
2358 * intervals.c (set_interval_object, set_interval_left)
2359 (set_interval_right, copy_interval_parent, rotate_right)
2360 (rotate_left, balance_possible_root_interval):
2361 * keyboard.c (kset_echo_string, kset_kbd_queue)
2362 (kset_keyboard_translate_table, kset_last_prefix_arg)
2363 (kset_last_repeatable_command, kset_local_function_key_map)
2364 (kset_overriding_terminal_local_map, kset_real_last_command)
2365 (kset_system_key_syms, clear_event, set_prop):
2366 * lread.c (digit_to_number):
2367 * marker.c (attach_marker, live_buffer, set_marker_internal):
2368 * nsterm.m (ns_compute_glyph_string_overhangs):
2369 * process.c (pset_buffer, pset_command)
2370 (pset_decode_coding_system, pset_decoding_buf)
2371 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2372 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2373 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2374 * syntax.c (bset_syntax_table, dec_bytepos):
2375 * terminal.c (tset_param_alist):
2376 * textprop.c (interval_has_some_properties)
2377 (interval_has_some_properties_list):
2378 * window.c (wset_combination_limit, wset_dedicated)
2379 (wset_display_table, wset_hchild, wset_left_fringe_width)
2380 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2381 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2382 (wset_right_fringe_width, wset_right_margin_cols)
2383 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2384 (wset_vertical_scroll_bar_type, wset_window_parameters):
2385 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2386 (wset_column_number_displayed, wset_region_showing)
2387 (window_box_edges, run_window_scroll_functions)
2388 (append_glyph_string_lists, prepend_glyph_string_lists)
2389 (append_glyph_string, set_glyph_string_background_width)
2390 (append_glyph, append_composite_glyph)
2391 (take_vertical_position_into_account):
2392 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2393 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2394 (lface_hash, lface_same_font_attributes_p, lookup_face):
2395 * xml.c (libxml2_loaded_p):
2396 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2397 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2398 Now 'static', not 'static inline'.
2399
2400 * bidi.c: Tune.
2401 (bidi_copy_it): Do the whole copy with a single memcpy.
2402 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2403
2404 Revert the FOLLOW-SYMLINKS change for file-attributes.
2405 Doing it right would require several changes to Tramp, and there's
2406 not enough time to get that tested before the freeze today.
2407 * dired.c (directory_files_internal, Ffile_attributes):
2408 Undo last change.
2409
2410 * frame.c (x_report_frame_params): Port better to wider ints.
2411 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2412 or that pointers can be printed in 15 decimal digits.
2413 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2414
2415 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2416
2417 Support x64 build on MS-Windows.
2418 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2419 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2420 compatibility with x64.
2421 (x_get_focus_frame): Add prototype.
2422
2423 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2424 defining an XRectangle structure.
2425
2426 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2427 arithmetics for compatibility with x64.
2428
2429 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2430 compatibility with x64.
2431
2432 * w32heap.h: Adjust prototypes and declarations.
2433
2434 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2435 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2436 DWORD, long, and unsigned long, for compatibility with x64.
2437 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2438 (sbrk): Argument is now of type ptrdiff_t.
2439
2440 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2441 less than 0x0500.
2442 (w32_msg_pump): Use WPARAM type for 'result'.
2443
2444 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2445 architecture.
2446 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2447 compatibility with x64.
2448
2449 * vm-limit.c (lim_data): Now size_t.
2450 (check_memory_limits): Adjust prototypes of real_morecore and
2451 __morecore to receive argument of type ptrdiff_t. Use size_t for
2452 five_percent and data_size.
2453
2454 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2455 variables, for compatibility with x64.
2456 (rva_to_section, offset_to_section, relocate_offset)
2457 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2458 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2459 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2460 for compatibility with x64.
2461
2462 * sysdep.c (STDERR_FILENO): Define if not already defined.
2463
2464 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2465 (__morecore): Argument type is now ptrdiff_t.
2466 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2467 (relinquish): Use ptrdiff_t type for 'excess'.
2468 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2469
2470 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2471 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2472 instead of a literal number.
2473
2474 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2475 (min): Define only if not already defined.
2476
2477 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2478 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2479 hosts.
2480
2481 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2482 'bitmaps' is a pointer.
2483
2484 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2485
2486 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2487
2488 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2491 * dired.c (directory_files_internal, Ffile_attributes):
2492 New arg follow_symlinks. All uses changed.
2493
2494 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2495
2496 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2497
2498 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2499
2500 Support atimers and CPU profiler via profile.c on MS-Windows.
2501 * w32proc.c (sig_mask, crit_sig): New static variables.
2502 (sys_signal): Support SIGALRM and SIGPROF.
2503 (sigemptyset, sigaddset, sigfillset, sigprocmask)
2504 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
2505 sigfillset, and sigprocmask are no longer no-ops.
2506 (sigismember): New function.
2507 (struct itimer_data): New definition.
2508 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2509 (crit_prof): New static variables.
2510 (MAX_SINGLE_SLEEP): New definition.
2511 (timer_loop, stop_timer_thread, term_timers, init_timers)
2512 (start_timer_thread, getitimer, setitimer): New functions.
2513 (alarm): No longer a no-op, calls setitimer.
2514
2515 * w32.c (term_ntproc): Call term_timers.
2516 (init_ntproc): Make sure all signals are unblocked at startup, to
2517 erase any traces of dumping. Call init_timers.
2518
2519 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2520 Windows-specific code to display the hourglass mouse pointer is no
2521 longer used.
2522 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2523 to hourglass timer expiration.
2524 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2525 Remove, no longer used.
2526 (w32_note_current_window, show_hourglass, hide_hourglass):
2527 New functions, in support of hourglass cursor display similar to other
2528 window systems.
2529 (syms_of_w32fns): Don't initialize hourglass_timer.
2530
2531 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2532 WINDOWSNT as well.
2533 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2534
2535 * w32.h (init_timers, term_timers): Add prototypes.
2536
2537 2012-09-30 Kenichi Handa <handa@gnu.org>
2538
2539 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2540 to the buffer relocation which may be caused by ccl_driver.
2541
2542 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2543
2544 * xfns.c (Fx_file_dialog): Update comment.
2545
2546 * w32fns.c (Fx_file_dialog): Update comment.
2547
2548 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2549 Initialize panel name field if OSX >= 10.6.
2550
2551 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2552
2553 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2554
2555 * nsterm.m (NEW_STYLE_FS): New define.
2556 (ns_fullscreen_hook, windowWillEnterFullScreen)
2557 (windowDidEnterFullScreen, windowWillExitFullScreen)
2558 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2559 (setFSValue): New functions.
2560 (EmacsFSWindow): New implementation.
2561 (canBecomeKeyWindow): New function for EmacsFSWindow.
2562 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2563 (dealloc): Release nonfs_window if in fullscreen.
2564 (updateFrameSize:): Call windowDidMove to update top/left.
2565 (windowWillResize:toSize:): Check if frame is still maximized.
2566 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2567 next_maximized, maximized_width, maximized_height and nonfs_window.
2568 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2569 tbar_height.
2570 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
2571 fullscreen. Set maximized_width/height. Act on next_maximized.
2572
2573 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2574 (EmacsView): Add variables for fullscreen.
2575 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2576 (EmacsFSWindow): New interface for fullscreen.
2577
2578 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
2579
2580 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2581
2582 2012-09-30 Chong Yidong <cyd@gnu.org>
2583
2584 * fns.c (Frandom): Doc fix.
2585
2586 2012-09-30 Martin Rudalics <rudalics@gmx.at>
2587
2588 * window.c (Vwindow_combination_limit): New default value.
2589 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2590
2591 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2592
2593 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2594 Suggested by Eli Zaretskii in
2595 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2596
2597 2012-09-30 Eli Zaretskii <eliz@gnu.org>
2598
2599 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2600 HAVE_TIMER_SETTIME is defined.
2601
2602 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 Profiler improvements: more-accurate timers, overflow checks.
2605 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2606 signal.h, setjmp.h. Include systime.h instead.
2607 (saturated_add): New function.
2608 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2609 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2610 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2611 New static vars.
2612 (enum profiler_cpu_running): New enum.
2613 (profiler_cpu_running): Now of that enum type, not bool.
2614 All uses changed to store the new value.
2615 (handle_profiler_signal): Rename from sigprof_handler_1,
2616 for consistency with other handlers. Do not check whether
2617 cpu_log is a hash-table if garbage collecting, since it
2618 doesn't matter in that case.
2619 (deliver_profiler_signal): Rename from sigprof_handler,
2620 for consistency with other handlers.
2621 (setup_cpu_timer): New function, with much of what used to be in
2622 Fprofiler_cpu_start. Check for out-of-range argument.
2623 Prefer timer_settime if available, and prefer
2624 thread cputime clocks, then process cputime clocks, then
2625 monotonic clocks, to the old realtime clock. Use make_timeval
2626 to round more-correctly when falling back to setitimer.
2627 (Fprofiler_cpu_start): Use it.
2628 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2629 Don't assume that passing NULL as the 2nd argument of setitimer
2630 is the same as passing a pointer to all-zero storage.
2631 Ignore SIGPROF afterwards.
2632 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2633 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2634 non-fatal signal handlers. Ignore SIGPROF on startup.
2635 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2636 in profiler.c, since sysdep.c now uses it.
2637
2638 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2639 Suggested by Eli Zaretskii in
2640 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2641
2642 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
2643
2644 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2645
2646 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2647
2648 * lisp.h (struct backtrace): Remove indirection for `function' field.
2649 * xdisp.c (redisplay_internal):
2650 * profiler.c (record_backtrace, sigprof_handler_1):
2651 * alloc.c (Fgarbage_collect):
2652 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2653 (Fbacktrace_frame): Adjust accordingly.
2654
2655 2012-09-28 Glenn Morris <rgm@gnu.org>
2656
2657 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2658 (Frun_hook_with_args_until_failure): Doc fixes.
2659
2660 2012-09-28 Eli Zaretskii <eliz@gnu.org>
2661
2662 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2663 Qautomatic_redisplay and change the symbol name. All users changed.
2664
2665 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2666
2667 * profiler.c (sigprof_handler): Fix race condition.
2668
2669 2012-09-28 Glenn Morris <rgm@gnu.org>
2670
2671 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2672
2673 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 Check more robustly for timer_settime.
2676 * Makefile.in (LIB_TIMER_TIME): New macro.
2677 (LIBES): Add it.
2678 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2679 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2680 call timer_settime.
2681
2682 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2683
2684 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2685
2686 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
2687
2688 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2689
2690 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2691
2692 * character.h (MAYBE_UNIFY_CHAR): Remove.
2693 * charset.c, charset.h (maybe_unify_char): Now static.
2694 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2695 Since this stuff is now private to charset.c, there's no need for
2696 a public macro and no need to inline by hand.
2697
2698 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2699 Stefan Monnier <monnier@iro.umontreal.ca>
2700 Juanma Barranquero <lekktu@gmail.com>
2701
2702 * profiler.c: New file.
2703 * Makefile.in (base_obj): Add profiler.o.
2704 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2705 ($(BLD)/profiler.$(O)): New target.
2706 * emacs.c (main): Call syms_of_profiler.
2707 * alloc.c (Qautomatic_gc): New constant.
2708 (MALLOC_PROBE): New macro.
2709 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2710 (total_bytes_of_live_objects): New function.
2711 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2712 Call malloc_probe for the memory profiler.
2713 (syms_of_alloc): Define Qautomatic_gc.
2714 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2715 race condition.
2716 (struct backtrace): Move definition...
2717 * lisp.h (struct backtrace): ..here.
2718 (Qautomatic_gc, profiler_memory_running): Declare vars.
2719 (malloc_probe, syms_of_profiler): Declare functions.
2720 * xdisp.c (Qautomatic_redisplay): New constant.
2721 (redisplay_internal): Record itself in backtrace_list.
2722 (syms_of_xdisp): Define Qautomatic_redisplay.
2723
2724 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2725 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2726
2727 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2728
2729 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 Prefer POSIX timers if available.
2732 They avoid a race if the timer is too close to the current time.
2733 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2734 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
2735 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
2736
2737 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2738
2739 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2740 CHAR_STRING_ADVANCE.
2741 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2742 STRING_CHAR_ADVANCE.
2743
2744 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
2745
2746 Move Vlibrary_cache to emacs.c and reset before dumping.
2747
2748 * lisp.h (reset_image_types): Declare.
2749 [WINDOWSNT] (Vlibrary_cache): Declare.
2750
2751 * image.c (reset_image_types): New function.
2752
2753 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2754 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2755 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2756
2757 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2758 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2759
2760 * w32.h (Vlibrary_cache): Do not declare.
2761
2762 2012-09-25 Eli Zaretskii <eliz@gnu.org>
2763
2764 * w32proc.c (sys_signal): Handle all signals defined by the
2765 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2766 handlers for signals supported by Windows. Don't override
2767 term_ntproc as the handler for SIGABRT.
2768 (sigaction): Rewrite to call sys_signal instead of duplicating its
2769 code.
2770 (sys_kill): Improve commentary.
2771
2772 * w32.c (term_ntproc): Accept (and ignore) one argument, for
2773 consistency with a signature of a signal handler. All callers
2774 changed.
2775 (init_ntproc): Accept an argument DUMPING. If dumping, don't
2776 install term_ntproc as a signal handler for SIGABRT, as that
2777 should be done by the dumped Emacs.
2778
2779 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
2780
2781 * w32select.c (term_w32select): Protect against repeated
2782 invocation by setting clipboard_owner to NULL after calling
2783 DestroyWindow.
2784
2785 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
2786 and term_ntproc to their modified signatures.
2787
2788 * character.c (char_string, string_char): Remove calls to
2789 MAYBE_UNIFY_CHAR. See the discussion starting at
2790 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
2791 for the details.
2792
2793 2012-09-25 Chong Yidong <cyd@gnu.org>
2794
2795 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
2796
2797 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
2798
2799 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
2800 when encountering an unknown bytecode.
2801
2802 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
2803
2804 image.c, indent.c: Use bool for booleans.
2805 * dispextern.h (struct image_type): Members valid_p, load, init
2806 now return bool, not int. All uses changed.
2807 * image.c: Omit unnecessary static decls.
2808 (x_create_bitmap_mask, x_build_heuristic_mask):
2809 Return void, not int, since callers don't care about the return value.
2810 (x_create_bitmap_mask, define_image_type, valid_image_p)
2811 (struct image_keyword, parse_image_spec, image_spec_value)
2812 (check_image_size, image_background)
2813 (image_background_transparent, x_clear_image_1)
2814 (postprocess_image, lookup_image, x_check_image_size)
2815 (x_create_x_image_and_pixmap, xbm_image_p)
2816 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
2817 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
2818 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
2819 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
2820 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
2821 (png_image_p, init_png_functions, png_load_body, png_load)
2822 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
2823 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
2824 (init_gif_functions, gif_load, imagemagick_image_p)
2825 (imagemagick_load_image, imagemagick_load, svg_image_p)
2826 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
2827 (gs_load):
2828 * nsimage.m (ns_load_image):
2829 * nsterm.m (ns_defined_color):
2830 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
2831 * xfns.c (x_defined_color):
2832 * xterm.c (x_alloc_lighter_color_for_widget)
2833 (x_alloc_nearest_color_1, x_alloc_nearest_color)
2834 (x_alloc_lighter_color):
2835 * indent.c (disptab_matches_widthtab, current_column)
2836 (scan_for_column, string_display_width, indented_beyond_p)
2837 (compute_motion, vmotion, Fvertical_motion):
2838 Use bool for booleans.
2839
2840 2012-09-24 Chong Yidong <cyd@gnu.org>
2841
2842 * chartab.c (Fset_char_table_default): Obsolete function removed.
2843
2844 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2845
2846 Move pid_t related decls out of lisp.h.
2847 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
2848 (interruptible_wait_for_termination):
2849 Move these decls from lisp.h to syswait.h, since they use pid_t.
2850 Needed on FreeBSD; see Herbert J. Skuhra in
2851 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
2852 * callproc.c: Include syswait.h.
2853
2854 gnutls.c, gtkutil.c: Use bool for boolean.
2855 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
2856 (emacs_gnutls_handle_error):
2857 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
2858 (xg_hide_tooltip, xg_create_frame_widgets)
2859 (create_dialog, xg_uses_old_file_dialog)
2860 (xg_get_file_with_chooser, xg_get_file_with_selection)
2861 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
2862 (xg_item_label_same_p, xg_update_menubar)
2863 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
2864 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
2865 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
2866 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
2867 (update_frame_tool_bar, free_frame_tool_bar):
2868 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
2869 * nsmenu.m (ns_update_menubar):
2870 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
2871 * xfns.c (Fx_show_tip) [USE_GTK]:
2872 Use bool for boolean.
2873 * gtkutil.c (xg_update_frame_menubar):
2874 * xmenu.c (update_frame_menubar):
2875 Return void, not int, since caller ignores return value.
2876 * gtkutil.c (xg_change_toolbar_position):
2877 Return void, not 1.
2878
2879 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2880
2881 * makefile.w32-in (BLOCKINPUT_H): Remove.
2882 (SYSSIGNAL_H): New macro.
2883 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
2884 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
2885 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
2886 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
2887 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
2888 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
2889 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
2890 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
2891 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
2892 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
2893 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
2894 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
2895 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
2896 ($(BLD)/w32xfns.$(O)): Update dependencies.
2897
2898 2012-09-23 Eli Zaretskii <eliz@gnu.org>
2899
2900 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
2901 fatal_error_backtrace.
2902
2903 * w32proc.c (sys_kill): Undo last change: don't do anything when
2904 invoked to deliver SIGABRT to our own process. This is now
2905 handled by emacs_raise.
2906
2907 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
2908
2909 * w32term.c (w32_read_socket): Remove leftover reference to
2910 interrupt_input_pending.
2911
2912 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2913
2914 Do not use SA_NODEFER.
2915 Problem reported by Dani Moncayo in
2916 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2917 * alloc.c (die):
2918 * sysdep.c (emacs_abort): Do not reset signal handler.
2919 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2920 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2921 wanted even on POSIXish hosts, and it doesn't work on Windows.
2922
2923 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2924
2925 * xterm.c (x_term_init): Call fixup_locale before and after calling
2926 gtk_init (Bug#12392).
2927
2928 2012-09-23 Chong Yidong <cyd@gnu.org>
2929
2930 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2931 Vdynamic_library_alist.
2932
2933 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2934 (Fgnutls_available_p): Caller changed.
2935
2936 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2937 (Flibxml_parse_xml_region): Likewise.
2938
2939 * dispextern.h (struct image_type): Remove arg from init function.
2940
2941 * image.c (Finit_image_library, lookup_image_type)
2942 (define_image_type): Remove now-unneeded second arg.
2943 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2944 (init_tiff_functions, init_gif_functions, init_svg_functions):
2945 Arglist and w32_delayed_load calling convention changed.
2946 (gs_type): Remove init_gs_functions; there is no such function.
2947 (valid_image_p, make_image): Fix caller to lookup_image_type.
2948
2949 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2950
2951 Simplify and avoid signal-handling races (Bug#12471).
2952 * alloc.c (die):
2953 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2954 Avoid recursive loop if there's a fatal error in the function itself.
2955 * atimer.c (pending_atimers):
2956 * blockinput.h: Don't include "atimer.h"; no longer needed.
2957 (interrupt_input_pending): Remove. All uses removed.
2958 pending_signals now counts both atimers and ordinary interrupts.
2959 This is less racy than having three separate pending-signal flags.
2960 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2961 (input_blocked_p):
2962 Rename from their upper-case counterparts BLOCK_INPUT,
2963 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2964 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2965 This makes it easier to access volatile variables more accurately.
2966 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2967 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2968 that's more reliable if the code is buggy and sets
2969 interrupt_input_blocked to a negative value. All uses changed.
2970 * atimer.c (deliver_alarm_signal):
2971 Remove. No need to deliver this to the parent; any thread can
2972 handle this signal now. All uses replaced by underlying handler.
2973 * atimer.c (turn_on_atimers):
2974 * dispnew.c (handle_window_change_signal):
2975 * emacs.c (handle_danger_signal):
2976 * keyboard.c (kbd_buffer_get_event):
2977 Don't reestablish signal handler; not needed with sigaction.
2978 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2979 (UNBLOCK_INPUT_TO):
2980 Rework to avoid unnecessary accesses to volatile variables.
2981 (UNBLOCK_INPUT_TO): Now a function.
2982 (totally_unblock_input, unblock_input): New decls.
2983 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2984 (init_data): Remove. Necessary stuff now done in init_signal.
2985 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2986 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2987 (fatal_error_code): Remove; no longer needed.
2988 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2989 it doesn't always backtrace. All uses changed. No need to reset
2990 signal to default, since sigaction and/or die does that for us now.
2991 Use emacs_raise (FOO), not kill (getpid (), FOO).
2992 (main): Check more-accurately whether we're dumping.
2993 Move fatal-error setup to sysdep.c
2994 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2995 * gtkutil.c (xg_get_file_name, xg_get_font):
2996 Remove no-longer-needed signal-mask manipulation.
2997 * keyboard.c, process.c (POLL_FOR_INPUT):
2998 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2999 * keyboard.c (read_avail_input): Remove.
3000 All uses replaced by gobble_input.
3001 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3002 (kbd_buffer_store_event_hold, gobble_input):
3003 (record_asynch_buffer_change) [USABLE_SIGIO]:
3004 (store_user_signal_events):
3005 No need to mess with signal mask.
3006 (gobble_input): If blocking input and there are terminals, simply
3007 set pending_signals to 1 and return. All hooks changed to not
3008 worry about whether input is blocked.
3009 (process_pending_signals): Clear pending_signals before processing
3010 them, in case a signal comes in while we're processing.
3011 By convention callers now test pending_signals before calling us.
3012 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3013 New functions, to support changes to blockinput.h.
3014 (handle_input_available_signal): Now extern.
3015 (reinvoke_input_signal): Remove. All uses replaced by
3016 handle_async_input.
3017 (quit_count): Now volatile, since a signal handler uses it.
3018 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3019 All callers changed. Block SIGINT only if not already blocked.
3020 Clear sigmask reliably, even if Fsignal returns, which it can.
3021 Omit unnecessary accesses to volatile var.
3022 (quit_throw_to_read_char): No need to restore sigmask.
3023 * keyboard.c (gobble_input, handle_user_signal):
3024 * process.c (wait_reading_process_output):
3025 Call signal-handling code rather than killing ourselves.
3026 * lisp.h: Include <float.h>, for...
3027 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3028 (pending_signals): Now volatile.
3029 (syms_of_data): Now const if IEEE floating point.
3030 (handle_input_available_signal) [USABLE_SIGIO]:
3031 (terminate_due_to_signal, record_child_status_change): New decls.
3032 * process.c (create_process): Avoid disaster if memory is exhausted
3033 while we're processing a vfork, by tightening the critical section
3034 around the vfork.
3035 (send_process_frame, process_sent_to, handle_pipe_signal)
3036 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3037 ignores SIGPIPE.
3038 (send_process): No need for setjmp/longjmp any more, since the
3039 SIGPIPE stuff is now gone. Instead, report an error if errno
3040 is EPIPE.
3041 (record_child_status_change): Now extern. PID and W are now args.
3042 Return void, not bool. All callers changed.
3043 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3044 Remove. All uses removed. This bug should be fixed now in a
3045 different way.
3046 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3047 and record the child status change directly. This avoids the
3048 need to futz with the signal mask.
3049 (process_fatal_action): Move here from emacs.c.
3050 (emacs_sigaction_flags): New function, containing
3051 much of what used to be in emacs_sigaction_init.
3052 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3053 caught by emacs, to make races less likely.
3054 (deliver_process_signal): Rename from handle_on_main_thread.
3055 All uses changed.
3056 (BACKTRACE_LIMIT_MAX): Now at top level.
3057 (thread_backtrace_buffer, threadback_backtrace_pointers):
3058 New static vars.
3059 (deliver_thread_signal, deliver_fatal_thread_signal):
3060 New functions, for more-accurate delivery of thread-specific signals.
3061 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3062 (deliver_arith_signal): Handle in this thread, not
3063 in the main thread, since it's triggered by this thread.
3064 (maybe_fatal_sig): New function.
3065 (init_signals): New arg DUMPING so that we can be more accurate
3066 about whether we're dumping. Caller changed.
3067 Treat thread-specific signals differently from process-general signals.
3068 Block all signals while handling fatal error; that's safer.
3069 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3070 on IEEE hosts.
3071 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3072 Ignore SIGPIPE unless batch.
3073 (emacs_backtrace): Output backtrace for the appropriate thread,
3074 which is not necessarily the main thread.
3075 * syssignal.h: Include <stdbool.h>.
3076 (emacs_raise): New macro.
3077 * xterm.c (x_connection_signal): Remove; no longer needed
3078 now that we use sigaction.
3079 (x_connection_closed): No need to mess with sigmask now.
3080 (x_initialize): No need to reset SIGPIPE handler here, since
3081 init_signals does this for us now.
3082
3083 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3084
3085 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
3086 background rect may be larger (Bug#12245).
3087
3088 2012-09-23 Chong Yidong <cyd@gnu.org>
3089
3090 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3091
3092 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3093
3094 * .gdbinit: Just stop at fatal_error_backtrace.
3095 See Stefan Monnier's request in
3096 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3097 Remove no-longer-used query of system type.
3098
3099 2012-09-22 Chong Yidong <cyd@gnu.org>
3100
3101 * search.c (Freplace_match): Doc fix (Bug#12325).
3102
3103 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3104
3105 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3106 (Fline_end_position): Doc fix.
3107
3108 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3109
3110 2012-09-22 Chong Yidong <cyd@gnu.org>
3111
3112 * dispextern.h (struct image_type): Add new slot, storing a type
3113 initialization function.
3114
3115 * image.c (define_image_type): Call the image initializer function
3116 if it is defined. Arguments and return value changed.
3117 (valid_image_p, make_image): Callers changed.
3118 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3119 (gif_type, imagemagick_type, svg_type, gs_type):
3120 Add initialization functions.
3121 (Finit_image_library): Call lookup_image_type.
3122 (CHECK_LIB_AVAILABLE): Macro deleted.
3123 (lookup_image_type): Call define_image_type here, rather than via
3124 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3125 (syms_of_image): Move define_image_type calls for xbm_type and
3126 pbm_type to lookup_image_type.
3127
3128 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3129
3130 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3131 'idle_timers' from here ...
3132 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3133 lists, to avoid infloops when the timer does something stupid,
3134 like reinvoke itself with the same or smaller time-out.
3135 (Bug#12447)
3136
3137 2012-09-22 Martin Rudalics <rudalics@gmx.at>
3138
3139 * window.c (Fsplit_window_internal): Handle only Qt value of
3140 Vwindow_combination_limit separately.
3141 (Qtemp_buffer_resize): New symbol.
3142 (Vwindow_combination_limit): New default value.
3143 Rewrite doc-string.
3144
3145 2012-09-22 Eli Zaretskii <eliz@gnu.org>
3146
3147 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3148 the new overlay string. (Bug#10159)
3149
3150 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3151
3152 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3153 or that fprintf is async-signal-safe. POSIX doesn't require
3154 either assumption.
3155
3156 2012-09-22 Chong Yidong <cyd@gnu.org>
3157
3158 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3159 (Bug#8207).
3160
3161 2012-09-22 Kenichi Handa <handa@gnu.org>
3162
3163 * composite.c (composition_reseat_it): Handle the case that a
3164 grapheme cluster is not covered by a single font (Bug#12352).
3165
3166 2012-09-21 Chong Yidong <cyd@gnu.org>
3167
3168 * image.c (define_image_type): Avoid adding duplicate types to
3169 image_types (Bug#12463). Suggested by Jörg Walter.
3170
3171 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3172
3173 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3174 (print_load_command_name): Add case LC_DATA_IN_CODE.
3175 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3176
3177 2012-09-21 Glenn Morris <rgm@gnu.org>
3178
3179 * eval.c (Frun_hook_with_args_until_success)
3180 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3181
3182 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
3183
3184 * fileio.c (Ffile_selinux_context): Only call freecon when
3185 lgetfilecon succeeded.
3186 (Fset_file_selinux_context): Likewise. (Bug#12444)
3187
3188 2012-09-21 Eli Zaretskii <eliz@gnu.org>
3189
3190 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3191 reordering, locate the cursor by calling set_cursor_from_row; if
3192 that fails, clear the desired glyph matrix before returning a
3193 failure indication to the caller. Fixes leaving garbled display
3194 when fast scrolling with a down-key. (Bug#12403)
3195 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3196 scrolling through multibyte text.
3197
3198 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3199
3200 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3201 calling mark_vectorlike since that's the one that marks the window.
3202 (mark_discard_killed_buffers): Mark the final cdr.
3203 * window.h (struct window): Move prev/next_buffers to the
3204 non-standard fields.
3205 * window.c (make_window): Initialize prev/next_buffers manually.
3206
3207 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3208
3209 Omit unused arg EXPECTED from socket hooks.
3210 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3211 * nsterm.m (ns_term_init):
3212 * termhooks.h (struct terminal.read_socket_hook):
3213 * w32inevt.c (w32_console_read_socket):
3214 * w32term.c (w32_read_socket):
3215 * xterm.c (XTread_socket):
3216 Omit unused arg EXPECTED. All callers changed.
3217 (store_user_signal_events): Return void, not int, since callers no
3218 longer care about the return value. All uses changed.
3219
3220 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
3221
3222 * w32gui.h (XParseGeometry): Do not declare.
3223
3224 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3225
3226 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
3227 Ignore 'expected'. See Eli Zaretskii in
3228 <http://bugs.gnu.org/12471#8> (last line).
3229
3230 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3231 (XParseGeometry): Now static. Substitute extremal values for
3232 values that are out of range.
3233
3234 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3235
3236 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3237
3238 * nsfns.m (XParseGeometry): Remove.
3239 (Fx_create_frame): Call x_set_offset to correctly interpret
3240 top_pos in geometry.
3241
3242 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
3243 (Fx_parse_geometry): If there is a space in string, call
3244 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3245
3246 2012-09-17 Eli Zaretskii <eliz@gnu.org>
3247
3248 * search.c (scan_buffer): Use character positions in calls to
3249 region_cache_forward and region_cache_backward, not byte
3250 positions. (Bug#12196)
3251
3252 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3253 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3254
3255 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3256 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3257 emacs_blocked_malloc, now deleted.
3258
3259 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3262 The workaround was for improving performance on Solaris 2.4, but
3263 is getting in the way now. Emacs will still work if someone is
3264 still running Solaris 2.4 in a museum somewhere; Sun dropped
3265 support for Solaris 2.4 in 2003.
3266 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3267 * process.c (create_process) [HAVE_WORKING_VFORK]:
3268 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3269 since Emacs no longer uses vfork on that platform.
3270
3271 2012-09-17 Glenn Morris <rgm@gnu.org>
3272
3273 * emacs.c: Use COPYRIGHT.
3274
3275 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3276
3277 Remove configure's --without-sync-input option (Bug#12450).
3278 When auditing signal-handling in preparation for cleaning it up,
3279 I found that SYNC_INPUT has race conditions and would be a real
3280 pain to fix. Since it's an undocumented and deprecated
3281 configure-time option, now seems like a good time to remove it.
3282 Also see <http://bugs.gnu.org/11080#16>.
3283 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3284 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3285 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3286 (malloc_hysteresis):
3287 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3288 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3289 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3290 (dont_register_blocks, bytes_used_when_reconsidered)
3291 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3292 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3293 [!SYSTEM_MALLOC && !SYNC_INPUT]:
3294 Remove. All uses removed.
3295 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3296 implementation, one that depends on whether the new macro
3297 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3298 is defined.
3299 * atimer.c (run_timers, handle_alarm_signal):
3300 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3301 (handle_async_input, process_pending_signals)
3302 (handle_input_available_signal, init_keyboard):
3303 * nsterm.m (ns_read_socket):
3304 * process.c (wait_reading_process_output):
3305 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3306 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3307 (emacs_write):
3308 * xterm.c (XTread_socket):
3309 Assume SYNC_INPUT.
3310 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3311 * eval.c (handling_signal): Remove. All uses removed.
3312 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3313 All uses replaced with the SYNC_INPUT version.
3314 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3315 Remove decls.
3316 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3317 Now static.
3318
3319 * font.c (Ffont_shape_gstring): Remove unused local.
3320
3321 2012-09-16 Glenn Morris <rgm@gnu.org>
3322
3323 * Makefile.in (clean): No longer run nextstep's clean.
3324
3325 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3326 (ns_frag): Remove.
3327 (ns-app): Move here from ns.mk, and simplify.
3328 (clean): Simplify nextstep entry.
3329 * ns.mk: Remove file.
3330
3331 2012-09-17 Kenichi Handa <handa@gnu.org>
3332
3333 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3334 not covert the last few charactes.
3335
3336 2012-09-16 Kenichi Handa <handa@gnu.org>
3337
3338 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3339 here, but just check the validity of glyphs in the glyph-string.
3340
3341 2012-09-16 Martin Rudalics <rudalics@gmx.at>
3342
3343 * window.c (Fwindow_parameter, Fset_window_parameter):
3344 Accept any window as argument (Bug#12452).
3345
3346 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3347
3348 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3349 to ns_term_init to avoid memory leak.
3350
3351 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3352 explicit retain/release.
3353 (ns_term_init): Only allow one display. Initialize outerpool and
3354 ns_*_types.
3355
3356 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3357
3358 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3359 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3360 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3361 the Microsoft problem in a different way, by altering ../nt/config.nt.
3362
3363 2012-09-15 Eli Zaretskii <eliz@gnu.org>
3364
3365 * w32xfns.c:
3366 * w32uniscribe.c:
3367 * w32term.c:
3368 * w32select.c:
3369 * w32reg.c:
3370 * w32proc.c:
3371 * w32menu.c:
3372 * w32inevt.c:
3373 * w32heap.c:
3374 * w32font.c:
3375 * w32fns.c:
3376 * w32console.c:
3377 * w32.c:
3378 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3379 by lisp.h. This completes removal of setjmp.h inclusion
3380 erroneously announced in the previous commit. (Bug#12446)
3381
3382 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3383 more accurate.
3384
3385 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3386 not defined as a macro. The latter happens on MS-Windows.
3387 (Bug#12446)
3388
3389 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3390
3391 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3392 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
3393 Some instances of '#include <setjmp.h>' removed, if the
3394 only reason for the instance was because "lisp.h" was included.
3395 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3396 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3397 and _longjmp with the new symbols. Emacs already uses _setjmp if
3398 available, so this change affects only POSIXish hosts that have
3399 sigsetjmp but not _setjmp, such as some versions of Solaris and
3400 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3401 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3402 (png_load_body) [HAVE_PNG]:
3403 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3404 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3405 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3406 since PNG requires jmp_buf. This is the only exception to the
3407 general rule that we now use sys_setjmp and sys_longjmp.
3408 This exception is OK since this code does not change the signal
3409 mask or longjmp out of a signal handler.
3410
3411 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3412
3413 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3414 Include "syssignal.h", for 'main_thread'.
3415
3416 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3417
3418 Avoid out-of-range marker position (Bug#12426).
3419 * insdel.c (replace_range, replace_range_2):
3420 Adjust markers before overlays, as suggested by comments.
3421 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3422 Remove redundant check before calling offset_intervals.
3423
3424 2012-09-14 Martin Rudalics <rudalics@gmx.at>
3425
3426 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3427 current buffer (Bug#12387).
3428
3429 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
3430
3431 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3432
3433 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3434
3435 Use a more backwards-compatible timer format (Bug#12430).
3436 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3437 vector element, not from the 4th, since PSECS is now at the end.
3438 (Fcurrent_idle_time): Doc fix.
3439
3440 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 Function to mark objects and remove killed buffers at once.
3443 * alloc.c (discard_killed_buffers): Rename to ...
3444 (mark_discard_killed buffers) ... new name. Add marking
3445 of remaining objects. Fix comment. Adjust users.
3446 (mark_object): Do not touch frame buffer lists here.
3447 * frame.c (delete_frame): Reset frame buffer lists here.
3448
3449 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3450
3451 Better workaround for GNOME bug when --enable-gcc-warnings.
3452 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3453 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3454 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3455
3456 Simplify SIGIO usage (Bug#12408).
3457 The code that dealt with SIGIO was crufty and confusing, e.g., it
3458 played tricks like "#undef SIGIO" but these tricks were not used
3459 consistently. Simplify mostly by not #undeffing standard symbols,
3460 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3461 or not as we please) rather than "defined SIGIO" (standard symbol
3462 that we probably shouldn't #undef).
3463 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3464 Modules that need it can include it.
3465 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3466 * dispextern.h (ignore_sigio): New decl.
3467 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3468 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3469 * emacs.c (shut_down_emacs):
3470 * keyboard.c (kbd_buffer_store_event_hold):
3471 Use ignore_sigio rather than invoking 'signal' directly.
3472 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3473 for FIONREAD.
3474 (FIONREAD, SIGIO): Do not #undef.
3475 (tty_read_avail_input): Use #error rather than a syntax error.
3476 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3477 for I_PIPE, used by SETUP_SLAVE_PTY.
3478 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3479 * sysdep.c (croak): Remove; no longer needed. This bit of
3480 temporary code, with Fred N. Fish's comment that it's temporary,
3481 has been in Emacs since at least 1992!
3482 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3483 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3484 * syssignal.h (croak): Remove decl.
3485 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3486 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3487 now that we're termios-only.
3488 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3489 * term.c (dissociate_if_controlling_tty): Use #error rather than
3490 a run-time error.
3491
3492 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3493 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3494 to work around GNOME bug 683906.
3495 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3496 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3497 This works around GCC bug 54561.
3498
3499 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3500
3501 More fixes for 'volatile' and setjmp/longjmp.
3502 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3503 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3504 (png_load_body) [HAVE_PNG]:
3505 (jpeg_load_body) [HAVE_JPEG]:
3506 New function, with most of the old parent function's body.
3507 (png_load) [HAVE_PNG]:
3508 (jpeg_load) [HAVE_JPEG]:
3509 Invoke the new function, to avoid longjmp munging our locals.
3510 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3511 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3512 longjmp is passed 2, as the C standard doesn't guarantee this.
3513 Instead, store the failure code into mgr->failure_code.
3514
3515 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3516
3517 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3518 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3519 (syms_of_keyboard): Remove support for unread-command-char.
3520
3521 2012-09-12 Eli Zaretskii <eliz@gnu.org>
3522
3523 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3524 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3525 violation. (Bug#12426)
3526
3527 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3528
3529 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3530
3531 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3532
3533 * eval.c: Add `inhibit-debugger'.
3534 (Qinhibit_debugger): New symbol.
3535 (call_debugger): Bind it instead of Qdebug_on_error.
3536 (maybe_call_debugger): Test Vinhibit_debugger.
3537 (syms_of_eval): Define inhibit-debugger.
3538 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3539 (syms_of_xdisp): Remove inhibit-debug-on-message.
3540
3541 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3542
3543 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3544 If a nonvolatile local variable is written before a _longjmp to
3545 the frame containing the variable, and is read after the _longjmp,
3546 the value read is indeterminate. Some local variables of type
3547 'struct handler' and 'struct catchtag' are used in this way, so
3548 mark each of their slots as volatile if the slot can be set before
3549 _longjmp and read afterwards.
3550 * lisp.h (struct handler): var and chosen_clause are now volatile.
3551 (struct catchtag): val, next, and pdlcount are now volatile.
3552
3553 * bidi.c (bidi_push_it, bidi_pop_it):
3554 * fns.c (copy_hash_table):
3555 * image.c (define_image_type):
3556 * keyboard.c (kbd_buffer_store_event_hold):
3557 * process.c (Fprocess_send_eof):
3558 * xfaces.c (x_create_gc) [HAVE_NS]:
3559 * xgselect.c (xg_select):
3560 Prefer assignment to memcpy when either will do.
3561
3562 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3563 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3564 time an item is removed. No need to mark this function 'inline';
3565 the compiler knows better than we do.
3566
3567 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3568
3569 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3570 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3571 to change_frame_size (Bug#12388).
3572 (windowDidResize:): Pass YES to updateFrameSize.
3573
3574 * nsterm.h: Add delay parameter to updateFrameSize.
3575
3576 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3577
3578 Discard killed buffers from deleted window and frame objects.
3579 This reduces an amount of references to killed buffers and
3580 helps GC to reclaim them faster.
3581 * alloc.c (discard_killed_buffers): New function.
3582 (mark_object): Use it for deleted windows and frames.
3583 (mark_object): If symbol's value is set up for a killed buffer
3584 or deleted frame, restore its global binding.
3585 * data.c (swap_in_global_binding): Add GC notice.
3586 (swap_in_symval_forwarding): Use convenient set_blv_where.
3587 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3588 * window.h: ... to here.
3589
3590 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3591
3592 Convenient macro to check whether the buffer is live.
3593 * buffer.h (BUFFER_LIVE_P): New macro.
3594 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3595 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3596
3597 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3598
3599 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3600 composition cases (Bug#12364).
3601
3602 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3603 overhang of succeeding glyphs overlapping box cursor.
3604
3605 * w32term.c (x_draw_glyph_string): Likewise.
3606
3607 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3608
3609 Simplify, document, and port floating-point (Bug#12381).
3610 The porting part of this patch fixes bugs on non-IEEE platforms
3611 with frexp, ldexp, logb.
3612 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3613 Now static.
3614 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3615 support, by removing commented-out code and briefly listing the
3616 C89 functions excluded. The commented-out stuff was confusing
3617 maintenance, e.g., we thought we needed cbrt but it was commented out.
3618 (logb): Remove decl; no longer needed.
3619 (isfinite): New macro, if not already supplied.
3620 (isnan): Don't replace any existing macro.
3621 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3622 are present on all C89 platforms.
3623 (Ffrexp): Do not special-case zero, as frexp does the right thing
3624 for that case.
3625 (Flogb): Do not use logb, as it doesn't have the desired meaning
3626 on hosts that use non-base-2 floating point. Instead, stick with
3627 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3628 frexp, to avoid getting an unspecified result.
3629
3630 * xdisp.c (Qinhibit_debug_on_message): Now static.
3631
3632 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3633
3634 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3635 NSBezierPath (Bug#12131).
3636
3637 2012-09-10 Chong Yidong <cyd@gnu.org>
3638
3639 * fns.c (Fdelq, Fdelete): Doc fix.
3640
3641 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3642
3643 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3644 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3645
3646 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3647
3648 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3649 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3650 Use it.
3651
3652 2012-09-09 Eli Zaretskii <eliz@gnu.org>
3653
3654 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3655 left fringe if the window has a left margin. This avoids leaving
3656 traces of the cursor because its leftmost pixel is not drawn over.
3657
3658 * dispnew.c (update_window_line): When the left margin area of a
3659 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3660 that screen line. (Bug#12277)
3661
3662 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3663
3664 Assume C89 or later for math functions (Bug#12381).
3665 This simplifies the code, and makes it a bit smaller and faster,
3666 and (most important) makes it easier to clean up signal handling
3667 since we can stop worring about floating-point exceptions in
3668 library code. That was a problem before C89, but the problem
3669 went away many years ago on all practical Emacs targets.
3670 * data.c, image.c, lread.c, print.c:
3671 Don't include <math.h>; no longer needed.
3672 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3673 might be autoconfigured, as that never happens.
3674 * data.c (fmod):
3675 * doprnt.c (DBL_MAX_10_EXP):
3676 * print.c (DBL_DIG):
3677 Remove. C89 or later always defines these.
3678 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3679 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3680 (arith_error, domain_error, domain_error2):
3681 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3682 no longer needed -- we simply return what C returns. All uses removed.
3683 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3684 the wrapped code.
3685 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3686 Remove. All uses expanded, as these macros are no longer used
3687 more than once and are now more trouble than they're worth.
3688 (Ftan): Use tan, not sin / cos.
3689 (Flogb): Assume C89 frexp.
3690 (fmod_float): Assume C89 fmod.
3691 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3692 (init_floatfns): Remove. All uses removed.
3693
3694 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3695
3696 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3697 compositeToPoint for OSX < 10.6 (Bug#12390).
3698
3699 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3700
3701 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3702 This produces more-accurate results.
3703
3704 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3705
3706 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3707 changes (Bug#12088).
3708
3709 2012-09-08 Chong Yidong <cyd@gnu.org>
3710
3711 * syntax.c (Fstring_to_syntax): Doc fix.
3712
3713 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3714
3715 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3716 in the internal border.
3717 (x_set_window_size): Remove static variables and their usage.
3718 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3719 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3720 Remove fringe/internal border adjustment (Bug#11052).
3721 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3722 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3723 (ns_fix_rect_ibw): Remove.
3724 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3725 (ns_dumpglyphs_box_or_relief): Ditto.
3726 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3727 adjustment.
3728 (ns_dumpglyphs_image): Ditto.
3729 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
3730 border adjustment.
3731 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3732 their usage. Add fringe_extended_p and its use as in other terms.
3733 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3734 scroll bar was removed.
3735 (updateFrameSize): New function.
3736 (windowDidResize): Move code to updateFrameSize and call it.
3737
3738 * nsterm.h (EmacsView): Add updateFrameSize.
3739
3740 2012-09-07 Chong Yidong <cyd@gnu.org>
3741
3742 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3743
3744 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3745
3746 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3747
3748 More signal-handler cleanup (Bug#12327).
3749 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3750 Problem introduced when merging patches. Noted by Eli Zaretskii in
3751 <http://bugs.gnu.org/12327#67>.
3752 * floatfns.c: Comment fix.
3753 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3754 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3755 and anyway the declaration is harmless even if SIGDANGER is not defined.
3756 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3757 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3758 source files not surprisingly expected syssignal.h to define, or
3759 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3760 Include <sys/ioctl.h>, for FIONREAD.
3761 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3762 This eliminates a problem whereby other files mysteriously had
3763 to include "syssignal.h" before including "systty.h" if they
3764 wanted to use "#ifdef SIGIO".
3765
3766 2012-09-07 Eli Zaretskii <eliz@gnu.org>
3767
3768 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3769
3770 * w32.c (sigemptyset): Empty the set.
3771 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
3772
3773 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
3774
3775 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
3776
3777 * alloc.c (mark_buffer): Revert unsafe marking optimization.
3778 (mark_object): Likewise for frame objects.
3779
3780 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3781
3782 * syssignal.h (handle_on_main_thread): Always declare,
3783 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
3784 This ports to platforms without HAVE_PTHREAD.
3785
3786 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3787
3788 Signal-handler cleanup (Bug#12327).
3789 Emacs's signal handlers were written in the old 4.2BSD style with
3790 sigblock and sigmask and so forth, and this led to some
3791 inefficiencies and confusion. Rewrite these to use
3792 pthread_sigmask etc. without copying signal sets around. Also,
3793 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
3794 'signal', and instead use functions that do not attempt to take
3795 over the system name space. This patch causes Emacs's text
3796 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
3797 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
3798 Do not include <signal.h> or "syssignal.h", as these
3799 modules do not use signals.
3800 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
3801 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
3802 Do not include <signal.h>, as "syssignal.h" does that for us now.
3803 * atimer.c (sigmask_atimers): New function.
3804 (block_atimers, unblock_atimers): New functions,
3805 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
3806 All uses replaced.
3807 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
3808 no longer needed here.
3809 * emacs.c (main): Inspect existing signal handler with sigaction,
3810 so that there's no need to block and unblock SIGHUP.
3811 * sysdep.c (struct save_signal): New member 'action', replacing
3812 old member 'handler'.
3813 (save_signal_handlers, restore_signal_handlers):
3814 Use sigaction instead of 'signal' to save and restore.
3815 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
3816 New function. All users of 'signal' modified to use set_sighandler
3817 if they're writeonly, and to use sys_signal if they're read+write.
3818 (emacs_sigaction_init, forwarded_signal): New functions.
3819 (sys_signal): Remove. All uses replaced by calls to sigaction
3820 and emacs_sigaction_init, or by direct calls to 'signal'.
3821 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
3822 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
3823 all uses replaced by pthread_sigmask etc. calls.
3824 * syssignal.h: Include <signal.h>.
3825 (emacs_sigaction_init, forwarded_signal): New decls.
3826 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
3827 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
3828 (sigmask, sys_sigmask): Remove; no longer needed.
3829 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
3830 (sigblock, sigunblock, sigfree):
3831 (sigsetmask) [!defined sigsetmask]:
3832 Remove. All uses replaced by pthread_sigmask.
3833 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
3834 no longer need to be replaced, and its typical old uses
3835 are now done via emacs_sigaction_init and sigaction.
3836 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
3837 (sys_sigdel): Remove; unused.
3838 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
3839
3840 2012-09-06 Eli Zaretskii <eliz@gnu.org>
3841
3842 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
3843 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
3844
3845 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3846
3847 Explicitly mark buffer_defaults and buffer_local_symbols.
3848 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
3849 mark_local_symbols here.
3850 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
3851 since special buffers aren't marked here any more.
3852 (allocate_buffer): Chain new buffer with all_buffers here...
3853 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
3854 not here.
3855 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
3856 (syms_of_buffer): Remove staticpro of the above.
3857 (init_buffer_once): Set names for buffer_defaults and
3858 buffer_local_symbols.
3859
3860 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Use bool for booleans in font-related modules.
3863 * font.c (font_intern_prop, font_style_to_value)
3864 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
3865 (generate_otf_features, font_check_otf_features, font_check_otf)
3866 (font_match_p, font_list_entities, font_at):
3867 * fontset.c (fontset_id_valid_p, reorder_font_vector
3868 (fontset_find_font, Fset_fontset_font)
3869 (face_suitable_for_char_p) [0]:
3870 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
3871 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
3872 (m17n_flt_initialized, ftfont_shape_by_flt):
3873 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
3874 * nsfont.m (nsfont_draw):
3875 * w32font.c (w32font_draw):
3876 * w32term.c (x_draw_glyphless_glyph_string_foreground):
3877 Use bool for booleans.
3878 * font.h: Adjust to above API changes.
3879 (struct font, struct font_driver, struct font_driver_list):
3880 Use bool for booleans.
3881 (struct font): Remove useless member encoding_type.
3882 All users removed.
3883 * fontset.c, xftfont.c: Omit unnecessary static decls.
3884
3885 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
3886
3887 * alloc.c (mark_object): Revert window marking code
3888 since it's unsafe for the Fset_window_configuration.
3889
3890 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3891
3892 Fix race conditions with signal handlers and errno (Bug#12327).
3893 Be more systematic about preserving errno whenever a signal
3894 handler returns, even if it's not in the main thread. Do this by
3895 renaming signal handlers to distinguish between signal delivery
3896 and signal handling. All uses changed.
3897 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
3898 * data.c (deliver_arith_signal): Rename from arith_error.
3899 * dispnew.c (deliver_window_change_signal): Rename from
3900 window_change_signal.
3901 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
3902 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
3903 * keyboard.c (deliver_input_available_signal): Rename from
3904 input_available_signal.
3905 (deliver_user_signal): Rename from handle_user_signal.
3906 (deliver_interrupt_signal): Rename from interrupt_signal.
3907 * process.c (deliver_pipe_signal): Rename from send_process_trap.
3908 (deliver_child_signal): Rename from sigchld_handler.
3909 * atimer.c (handle_alarm_signal):
3910 * data.c (handle_arith_signal):
3911 * dispnew.c (handle_window_change_signal):
3912 * emacs.c (handle_fatal_signal, handle_danger_signal):
3913 * keyboard.c (handle_input_available_signal):
3914 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3915 * process.c (handle_pipe_signal, handle_child_signal):
3916 New functions, with the actual signal-handling code taken from the
3917 original respective signal handlers, sans the sporadic attempts to
3918 preserve errno, since that's now done by handle_on_main_thread.
3919 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3920 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3921 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3922 Move to sysdep.c.
3923 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3924 Move initialization of main_thread to sysdep.c's init_signals.
3925 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3926 our usage, and simplifies the mainline code.
3927 (record_child_status_change): New static function, as a helper
3928 for handle_child_signal, and with most of the old child handler's
3929 contents.
3930 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3931 (handle_child_signal): Use the above.
3932 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3933 Moved here from emacs.c.
3934 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3935 code moved here from emacs.c's main function.
3936 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3937 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3938 This lets callers save and restore errno properly.
3939
3940 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3941
3942 Remove redundant or unused things here and there.
3943 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3944 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3945 * editfns.c (Fcompare_buffer_substrings): Likewise.
3946 * frame.h (struct terminal, struct font_driver_list):
3947 Remove redundant declarations.
3948 * window.h (Qleft, Qright): Likewise.
3949
3950 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3951
3952 Do not mark objects from deleted buffers, windows and frames.
3953 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3954 (mark_object): Likewise for windows and frames.
3955
3956 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3957
3958 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3959 buffer_defaults and buffer_local_symbols as valid objects.
3960 Return special value to denote them.
3961
3962 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3963
3964 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3965 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3966 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3967 (file_name_absolute_p, Fsubstitute_in_file_name):
3968 (check_executable, check_writable, Ffile_accessible_directory_p)
3969 (Fset_file_selinux_context, Fdefault_file_modes)
3970 (Finsert_file_contents, choose_write_coding_system)
3971 (Fwrite_region, build_annotations, a_write, e_write)
3972 (Fdo_auto_save):
3973 * filelock.c (boot_time_initialized, get_boot_time)
3974 (get_boot_time_1, lock_file_1, within_one_second):
3975 * floatfns.c (in_float):
3976 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3977 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3978 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3979 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3980 * window.c (compare_window_configurations):
3981 Use bool for booleans.
3982 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3983 (Fdefault_file_modes): Now mode_t, not int, for modes.
3984 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3985 (internal_delete_file): Now returns void, not a (boolean) int,
3986 since nobody was looking at the return value.
3987 * lisp.h, window.h: Adjust to above API changes.
3988
3989 * xdisp.c (set_message): Simplify and reindent last change.
3990
3991 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
3992
3993 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3994
3995 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3996
3997 * eval.c (call_debugger): Make the function non-static so that we
3998 can call it from set_message.
3999
4000 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4001 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4002
4003 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 Give more-useful info on a fatal error (Bug#12328).
4006 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4007 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4008 of doing the work ourselves.
4009 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4010 do most of the work.
4011 (fatal_error_backtrace): New function, taken from the guts
4012 of the old fatal_error_signal, but with a new option to output
4013 a backtrace.
4014 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4015 info about the signal than just its number.
4016 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4017 * sysdep.c: Include <execinfo.h>
4018 (emacs_backtrace): New function, taken partly from the previous
4019 code of the 'die' function.
4020 (emacs_abort): Call fatal_error_backtrace rather than abort.
4021
4022 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4023
4024 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4025 eager (load-time) macro-expansion.
4026 * lisp.mk (lisp): Add macroexp.
4027
4028 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4029
4030 Simplify redefinition of 'abort' (Bug#12316).
4031 Do not try to redefine the 'abort' function. Instead, redo
4032 the code so that it calls 'emacs_abort' rather than 'abort'.
4033 This removes the need for the NO_ABORT configure-time macro
4034 and makes it easier to change the abort code to do a backtrace.
4035 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4036 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4037 Remove; sysdep.c's emacs_abort now takes its place.
4038 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4039 'abort' changed to use 'emacs_abort'.
4040 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4041 (abort) [!defined abort]: Rename to ...
4042 (emacs_abort): ... new name.
4043 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4044 the place of the old 'abort' in emacs.c.
4045 * w32.c, w32fns.c (abort): Do not #undef.
4046 * w32.c (emacs_abort): Rename from w32_abort.
4047
4048 2012-09-04 Eli Zaretskii <eliz@gnu.org>
4049
4050 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4051 offsets[j].dv, since the y axis of the screen coordinates points
4052 down, while the y axis of the font definition coordinates points
4053 up. This fixes display of Arabic diacritics such as KASRA and
4054 KASRATAN. (Bug#11860)
4055
4056 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4057
4058 Be more systematic about _setjmp vs setjmp.
4059 * alloc.c (test_setjmp, mark_stack):
4060 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4061 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4062 (png_load, my_error_exit, jpeg_load):
4063 * process.c (send_process_trap, send_process):
4064 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4065 The underscored versions are up to 30x faster on some hosts.
4066 Formerly, the code used setjmp+longjmp sometimes and
4067 _setjmp+_longjmp at other times, with no particular reason to
4068 prefer setjmp+longjmp.
4069
4070 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4071
4072 Fix minor problem found by static checking.
4073 * buffer.c (Fdelete_all_overlays): Return nil.
4074
4075 2012-09-03 Martin Rudalics <rudalics@gmx.at>
4076
4077 * buffer.c (Fdelete_all_overlays): New function.
4078
4079 2012-09-03 Chong Yidong <cyd@gnu.org>
4080
4081 * gtkutil.c: Add extern decl for Qxft.
4082
4083 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4084
4085 * emacs.c, eval.c: Use bool for boolean.
4086 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4087 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4088 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4089 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4090 (main, decode_env_path, Fdaemon_initialized):
4091 * eval.c (call_debugger, Finteractive_p, interactive_p):
4092 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4093 (maybe_call_debugger, Fbacktrace):
4094 * process.c (read_process_output, exec_sentinel):
4095 Use bool for booleans.
4096 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4097 All callers changed.
4098 * eval.c (interactive_p): Omit always-true boolean argument
4099 EXCLUDE_SUBRS_P. All callers changed.
4100 * dispextern.h, lisp.h: Reflect above API changes.
4101 * firstfile.c (dummy): Use the address of 'main', whose signature
4102 won't change, instead of the address of 'initialize', whose
4103 signature just changed from int to bool.
4104 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4105 * msdos.c (fatal_error_in_progress): ... from here.
4106 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4107 of incrementing it.
4108 (redisplay_internal, unwind_redisplay): Simply clear
4109 REDISPLAYING_P when unwinding, instead of saving its previous,
4110 always-false value and then restoring it.
4111
4112 Clean up some extern decls.
4113 Mostly, this hoists extern decls out of .c files and into .h files.
4114 That way, we're more likely to catch errors if the interfaces change.
4115 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4116 declare xg_mark_data.
4117 * dispextern.h (x_frame_parm_handlers):
4118 * font.h (Qxft):
4119 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4120 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4121 (Qultra_bold, Qoblique, Qitalic):
4122 Move extern decl here from .c file.
4123 * alloc.c (xg_mark_data) [USE_GTK]:
4124 * doc.c (Qclosure):
4125 * eval.c (Qlexical_binding):
4126 * fns.c (time) [!HAVE_UNISTD_H]:
4127 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4128 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4129 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4130 * lread.c (Qinternal_interpreter_environment):
4131 * minibuf.c (Qbuffer):
4132 * process.c (QCfamily, QCfilter):
4133 * widget.c (free_frame_faces):
4134 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4135 * xfont.c (x_clear_errors):
4136 * xterm.c (x_frame_parm_handlers):
4137 Remove now-redundant extern decls.
4138 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4139 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4140 Now static.
4141 * xfaces.c: Remove unnecessary static decls.
4142 * xterm.c (updating_frame): Remove decl of nonexistent object.
4143
4144 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4145 when building globals.h, as the objects that are not built on
4146 this host are not needed to compile C files on this host.
4147
4148 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4149
4150 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4151
4152 * frame.h: Add missing prototype for x_wm_set_size_hint.
4153
4154 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4155
4156 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4157 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4158 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4159 (Fsubstitute_command_keys):
4160 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4161 (save_excursion_save, save_excursion_restore)
4162 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4163 (format_time_string, general_insert_function)
4164 (make_buffer_string, make_buffer_string_both)
4165 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4166 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4167 (copy_text, insert_1, insert_1_both, insert_from_string)
4168 (insert_from_string_before_markers, insert_from_string_1)
4169 (insert_from_buffer, insert_from_buffer_1, replace_range)
4170 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4171 (del_range_2, modify_region):
4172 * intervals.c (intervals_equal, balance_possible_root_interval)
4173 (adjust_intervals_for_insertion, merge_properties_sticky)
4174 (graft_intervals_into_buffer, lookup_char_property)
4175 (adjust_for_invis_intang, set_point_both)
4176 (get_property_and_range, compare_string_intervals)
4177 (set_intervals_multibyte_1, set_intervals_multibyte):
4178 * keyboard.c (decode_timer):
4179 Use bool for boolean.
4180 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4181 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4182
4183 2012-09-02 Chong Yidong <cyd@gnu.org>
4184
4185 * keymap.c (push_key_description): Print M-TAB as C-M-i
4186 (Bug#11758).
4187
4188 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
4189
4190 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4191 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4192 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4193 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4194 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4195 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4196 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4197
4198 2012-09-01 Eli Zaretskii <eliz@gnu.org>
4199
4200 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4201 more than one grapheme cluster passed to the shaper: compute the
4202 offset adjustment values separately for each cluster. (Bug#11860)
4203
4204 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4205 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4206 about implicit conversions from integer to pointer.
4207
4208 2012-09-01 Daniel Colascione <dancol@dancol.org>
4209
4210 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4211 system used too early.
4212
4213 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4214
4215 Better seed support for (random).
4216 * emacs.c (main): Call init_random.
4217 * fns.c (Frandom): Set the seed from a string argument, if given.
4218 Remove long-obsolete Gentzel cruft.
4219 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4220 (init_random): New function.
4221
4222 2012-09-01 Daniel Colascione <dancol@dancol.org>
4223
4224 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4225 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4226 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4227 x_wm_set_size_hint, x_query_colors, x_real_positions,
4228 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4229 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4230 all of which have been moved to common code.
4231
4232 * xfaces.c: Include TERM_HEADER instead of listing all possible
4233 window-system headers.
4234
4235 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4236 to match header.
4237
4238 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4239 directly accessing frame internals.
4240
4241 * w32font.h: Include font.h. Define syms_of_w32font and
4242 globals_of_w32font.
4243
4244 * process.c: Include TERM_HEADER instead of listing all possible
4245 window-system headers.
4246
4247 * nsterm.h: Remove declarations now in frame.h.
4248 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
4249
4250 * menu.c: Include TERM_HEADER instead of listing all possible
4251 window-system headers.
4252
4253 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4254 window system.
4255
4256 * keyboard.c: Include TERM_HEADER instead of listing all possible
4257 window-system headers.
4258
4259 * image.c: Include TERM_HEADER instead of listing all possible
4260 window-system headers. Declare Vlibrary_cache when compiling for
4261 Windows.
4262
4263 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4264 window system declarations.
4265
4266 * frame.h: Move common functions here: set_frame_menubar,
4267 x_set_window_size, x_sync, x_get_focus_frame,
4268 x_set_mouse_position, x_set_mouse_pixel_position,
4269 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4270 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4271 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4272 x_activate_menubar, x_real_positions, x_bitmap_icon,
4273 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4274 and x_query_colors.
4275
4276 * frame.c: Include TERM_HEADER instead of listing all possible
4277 window-system headers.
4278
4279 * font.c: Include TERM_HEADER instead of listing all possible
4280 window-system headers.
4281
4282 * emacs.c: Include TERM_HEADER.
4283
4284 * dispnew.c: Include TERM_HEADER instead of listing all possible
4285 window-system headers.
4286
4287 * ccl.h: Include character.h.
4288
4289 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4290 the current window system; include in list of objects to link into
4291 Emacs.
4292
4293 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Remove mark_ttys function and fix tty_display_info initialization.
4296 * lisp.h (mark_ttys): Remove prototype.
4297 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4298 to mark_ttys because all possible values of 'top_frame' slot are
4299 the frames which are reachable from Vframe_list.
4300 * term.c (mark_ttys): Remove.
4301 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4302
4303 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4304
4305 Change struct frame bitfields from unsigned char to unsigned.
4306 * frame.h (struct frame): Change type of 'display_preempted',
4307 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4308 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4309 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4310 bitfields from unsigned char to unsigned.
4311
4312 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4313
4314 Remove unused member of struct x_output and struct w32_output.
4315 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4316 * w32term.h (struct w32_output): Likewise.
4317
4318 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4319
4320 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4321 does not become zero (Bug#12234).
4322
4323 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4324
4325 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4326 for GCC 4.7.1 x86-64.
4327
4328 2012-08-30 Glenn Morris <rgm@gnu.org>
4329
4330 * lread.c (init_lread): For out-of-tree builds, only add the
4331 source directory's site-lisp dir to the load-path if it exists,
4332 consistent with in-tree builds. (Bug#12302)
4333
4334 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4335
4336 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
4337 button_values to NULL. Call setStykeMask so dialogs get a close button.
4338 (windowShouldClose:): Set window_closed.
4339 (dealloc): New member, free button_values.
4340 (process_dialog:): Make member function. Remove window argument,
4341 replace window with self. Count buttons and allocate and store values
4342 in button_values.
4343 (addButton:value:row:): value is int with the name tag. Call setTag
4344 with tag. Remove return self, declare return value as void.
4345 (addString:row:): Remove return self, declare return value as void.
4346 (addSplit): Remove return self, declare return value as void.
4347 (clicked:): Remove return self, declare return value as void.
4348 Set dialog_return to button_values[seltag]. Code formatting change.
4349 (initFromContents:isQuestion:): Adjust call to process_dialog.
4350 Code formatting change.
4351 (timeout_handler:): Set timer_fired to YES.
4352 (runDialogAt:): Set timer_fired to NO.
4353 Handle click on close button as quit.
4354
4355 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4356 Add window_closed and button_values. Add void as return value for
4357 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4358 Add process_dialog as new member.
4359
4360 2012-08-28 Eli Zaretskii <eliz@gnu.org>
4361
4362 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4363 is not one of the heaps we manage. (Bug#12242)
4364
4365 2012-08-28 Glenn Morris <rgm@gnu.org>
4366
4367 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4368
4369 2012-08-28 Martin Rudalics <rudalics@gmx.at>
4370
4371 * window.c (Fset_window_configuration): Remove handling of
4372 auto-buffer-name window parameter. Install revision of reverted
4373 fix.
4374
4375 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4376
4377 Do not allow to set major mode for a dead buffer.
4378 * buffer.c (Fset_buffer_major_mode): Signal an error
4379 if the buffer is dead.
4380 (Fother_buffer, other_buffer_safely): Remove redundant
4381 nested declaration.
4382
4383 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4384
4385 Always use set_buffer_if_live to restore original buffer at unwind.
4386 * buffer.h (record_unwind_current_buffer): New function.
4387 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4388 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4389 * undo.c, window.c: Adjust users.
4390 * buffer.c (set_buffer_if_live): Fix comment.
4391
4392 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4393
4394 Fix usage of set_buffer_internal.
4395 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4396 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4397 * coding.c (decode_coding): Omit redundant test.
4398 * fileio.c (decide_coding_unwind): Likewise.
4399 * fns.c (secure_hash): Likewise.
4400 * insdel.c (modify_region): Likewise.
4401 * keyboard.c (command_loop_1): Likewise.
4402 * print.c (PRINTFINISH): Likewise.
4403 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4404
4405 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4406
4407 * dispnew.c: Use bool for boolean.
4408 (frame_garbaged, display_completed, delayed_size_change)
4409 (fonts_changed_p, add_window_display_history)
4410 (add_frame_display_history, verify_row_hash)
4411 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4412 (row_equal_p, realloc_glyph_pool)
4413 (allocate_matrices_for_frame_redisplay)
4414 (showing_window_margins_p)
4415 (adjust_frame_glyphs_for_frame_redisplay)
4416 (build_frame_matrix_from_leaf_window, make_current)
4417 (mirrored_line_dance, mirror_line_dance, update_frame)
4418 (update_window_tree, update_single_window)
4419 (check_current_matrix_flags, update_window, update_text_area)
4420 (update_window_line, set_window_update_flags, scrolling_window)
4421 (update_frame_1, scrolling, buffer_posn_from_coords)
4422 (do_pending_window_change, change_frame_size)
4423 (change_frame_size_1, sit_for):
4424 Use bool for boolean.
4425 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4426 and remove last int (actually boolean) argument, which was always 0.
4427 All callers changed.
4428 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4429 * dispextern.h (struct composition_it): Use bool for boolean.
4430 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4431 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4432 * dired.c (file_name_completion):
4433 Use bool for boolean. (This was missed in an earlier change.)
4434
4435 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4436
4437 * window.c (Fset_window_configuration): Revert first part of
4438 last change.
4439
4440 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4441
4442 * nsterm.h (NSPanel): New class variable dialog_return.
4443
4444 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4445 Initialize dialog_return.
4446 (windowShouldClose:): Use stop instead of stopModalWithCode.
4447 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4448 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4449 event.
4450 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4451 modal loop returns.
4452
4453 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4454
4455 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4456 * composite.c (find_composition, composition_gstring_p)
4457 (composition_reseat_it, find_automatic_composition):
4458 * data.c (let_shadows_buffer_binding_p)
4459 (let_shadows_global_binding_p, set_internal, make_blv)
4460 (Fmake_variable_buffer_local, Fmake_local_variable)
4461 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4462 (cons_to_signed, arith_driver):
4463 * dbusbind.c (xd_in_read_queued_messages):
4464 * dired.c (directory_files_internal, file_name_completion):
4465 Use bool for booleans.
4466 * dired.c (file_name_completion):
4467 * process.h (fd_callback):
4468 Omit int (actually boolean) argument. It wasn't being used.
4469 All uses changed.
4470 * composite.h, lisp.h: Reflect above API changes.
4471
4472 * cmds.c, coding.c: Use bool for booleans.
4473 * cmds.c (move_point, Fself_insert_command):
4474 * coding.h (struct composition status, struct coding_system):
4475 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4476 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4477 (emacs_mule_char, decode_coding_emacs_mule)
4478 (encode_coding_emacs_mule, detect_coding_iso_2022)
4479 (decode_coding_iso_2022, encode_invocation_designation)
4480 (encode_designation_at_bol, encode_coding_iso_2022)
4481 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4482 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4483 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4484 (encode_coding_raw_text, detect_coding_charset)
4485 (decode_coding_charset, encode_coding_charset, detect_eol)
4486 (detect_coding, get_translation_table, produce_chars)
4487 (consume_chars, reused_workbuf_in_use)
4488 (make_conversion_work_buffer, code_conversion_save)
4489 (decode_coding_object, encode_coding_object)
4490 (detect_coding_system, char_encodable_p)
4491 (Funencodable_char_position, code_convert_region)
4492 (code_convert_string, code_convert_string_norecord)
4493 (Fset_coding_system_priority):
4494 * fileio.c (Finsert_file_contents):
4495 Use bool for booleans.
4496 * coding.h, lisp.h: Reflect above API changes.
4497 * coding.c: Remove unnecessary static function decls.
4498 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4499 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4500 not a boolean 'int', since callers never look at the return value.
4501 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4502 * coding.h (decoding_buffer_size, encoding_buffer_size)
4503 (emacs_mule_string_char): Remove unused extern decls.
4504 (struct iso_2022_spec, struct coding_system):
4505 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4506 (struct emacs_mule_spec): Remove unused field 'full_support'.
4507 All initializations removed.
4508 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4509
4510 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4511
4512 Fix spare memory change (Bug#12286).
4513 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4514 (valid_lisp_object_p): Likewise.
4515
4516 2012-08-27 Martin Rudalics <rudalics@gmx.at>
4517
4518 * window.c (Fset_window_configuration): Record any window's old
4519 buffer if it's replaced (see Bug#8789). If the new current
4520 buffer doesn't appear in the selected window, go to its old
4521 point (Bug#12208).
4522
4523 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Special MEM_TYPE_SPARE to denote reserved memory.
4526 * alloc.c (enum mem_type): New memory type.
4527 (refill_memory_reserve): Use new type for spare memory.
4528 This prevents live_cons_p and live_string_p from incorrect
4529 detection of uninitialized objects from spare memory as live.
4530
4531 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4532
4533 Spelling fixes.
4534 * Makefile.in (.PHONY): versioclean -> versionclean.
4535
4536 Remove unused external symbols.
4537 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4538 * window.c (Qwindow_valid_p, decode_valid_window):
4539 Now static, not extern.
4540 * data.c (Qinterval): Remove; unused.
4541 (syms_of_data): Do not define 'interval'.
4542 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4543 * window.h (decode_valid_window):
4544 Remove decls.
4545
4546 * character.c, charset.c, chartab.c: Use bool for booleans.
4547 * character.c (lisp_string_width, string_count_byte8)
4548 (string_escape_byte8):
4549 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4550 (load_charset_map_from_file, map_charset_chars)
4551 (Fdefine_charset_internal, define_charset_internal)
4552 (Fdeclare_equiv_charset, find_charsets_in_text)
4553 (Ffind_charset_region, char_charset, Fiso_charset):
4554 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4555 (sub_char_table_set, sub_char_table_set_range)
4556 (char_table_set_range, optimize_sub_char_table)
4557 (map_sub_char_table):
4558 Use bool for boolean.
4559 * character.c (str_to_unibyte): Omit last boolean argument; it was
4560 always 0. All callers changed.
4561 * character.h, charset.h: Adjust to match previous changes.
4562 * character.h (char_printable_p): Remove decl of nonexistent function.
4563 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4564 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4565 are all boolean, so make them single-bit bitfields.
4566
4567 * lisp.h (ASET): Remove attempt to detect side effects.
4568 It was meant to be temporary and it often doesn't work,
4569 because when IDX has side effects the behavior of IDX==IDX
4570 is undefined. See Stefan Monnier in
4571 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4572
4573 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4574
4575 * lisp.h (functionp): New function (extracted from Ffunctionp).
4576 (FUNCTIONP): Use it.
4577 * eval.c (Ffunctionp): Use it.
4578
4579 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4582 as that's faster and simpler than static storage. Don't bother
4583 with the g_main_context_query overhead if g_main_context_pending
4584 says no events are pending.
4585 (gfds, gfds_size): Remove these static vars.
4586 (xgselect_initialize): Remove; no longer needed.
4587 All uses and decls removed.
4588
4589 * emacs.c (fatal_error_signal_hook): Remove.
4590 All uses removed. This leftover from old code was always 0.
4591
4592 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4593 * casefiddle.c (casify_object, casify_region):
4594 * casetab.c (set_case_table):
4595 * category.c, category.h (word_boundary_p):
4596 * category.h (CHAR_HAS_CATEGORY):
4597 Use bool for booleans, instead of int.
4598
4599 2012-08-25 Eli Zaretskii <eliz@gnu.org>
4600
4601 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4602
4603 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4604
4605 On assertion failure, print backtrace if available.
4606 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4607 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4608 * Makefile.in (LIB_EXECINFO): New macro.
4609 (LIBES): Use it.
4610
4611 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4612 * bytecode.c (exec_byte_code):
4613 * callint.c (check_mark, Fcall_interactively):
4614 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4615 (getenv_internal, sync_process_alive, call_process_exited):
4616 * lisp.h (USE_SAFE_ALLOCA):
4617 Use bool for booleans, instead of int.
4618 * lisp.h, process.h: Adjust prototypes to match above changes.
4619 * callint.c (Fcall_interactively): Don't assume the mark's
4620 offset fits in 'int'.
4621
4622 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4623
4624 * buffer.c, buffer.h: Use bool for boolean.
4625 * buffer.c (reset_buffer_local_variables)
4626 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4627 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4628 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4629 (overlay_touches_p, overlay_strings, Foverlay_put)
4630 (report_overlay_modification, call_overlay_mod_hooks):
4631 (mmap_enlarge, mmap_set_vars):
4632 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4633 Use bool for booleans, instead of int.
4634 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4635 since the 1-or-0 return value is always ignored anyway.
4636 (mmap_initialized_p):
4637 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4638 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4639
4640 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4641
4642 * bidi.c: Use bool for boolean.
4643 This is a bit more readable, and makes the text segment of bidi.o
4644 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4645 Presumably it's faster too.
4646 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4647 Now bool.
4648 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4649 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4650 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4651 (bidi_explicit_dir_char, bidi_level_of_next_char)
4652 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4653 Use bool for booleans, instead of int.
4654 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4655 (bidi_unshelve_cache): Adjust decls to match code.
4656
4657 2012-08-23 Martin Rudalics <rudalics@gmx.at>
4658
4659 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4660 argument.
4661
4662 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4663
4664 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4665 * atimer.h: Include <stdbool.h>.
4666
4667 2012-08-22 Dan Nicolaescu <dann@gnu.org>
4668
4669 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4670 compile time tests instead of run time tests on systems that do
4671 not use them.
4672 (FRAME_MAC_P): Remove leftover from deleted code.
4673 * frame.c (syms_of_frame): Remove leftover from deleted code.
4674
4675 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4676
4677 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4678
4679 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4682 Otherwise, the compiler complains about (A?B:C) where B is void
4683 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
4684 (fontset_add): Return void, for FONTSET_ADD.
4685
4686 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4687
4688 * alloc.c: Use bool for booleans.
4689 (gc_in_progress, abort_on_gc)
4690 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4691 (dont_register_blocks) [GC_MALLOC_CHECK]:
4692 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4693 (check_string_bytes, make_specified_string, memory_full)
4694 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4695 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4696 (mark_stack, valid_pointer_p, make_pure_string)
4697 (Fgarbage_collect, survives_gc_p, gc_sweep):
4698 Use bool for booleans, instead of int.
4699 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4700 Remove unused local.
4701 * alloc.c (PURE_POINTER_P):
4702 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4703 * editfns.c (Fformat):
4704 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4705 (Fdo_auto_save):
4706 * fns.c (sweep_weak_table):
4707 * lisp.h (suppress_checking, push_message, survives_gc_p)
4708 (make_pure_string, gc_in_progress, abort_on_gc):
4709 * lread.c (readchar, read1):
4710 * print.c (Fprin1_to_string):
4711 * xdisp.c (push_message):
4712 Use bool for booleans affected directly or indirectly by
4713 alloc.c's changes.
4714
4715 Make recently-introduced setters macros.
4716 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4717 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4718 (set_fontset_default, set_fontset_fallback): Rename from their
4719 upper-case counterparts, and make them functions rather than macros.
4720 This is more consistent with the other recently-introduced setters.
4721 These don't need to be inline, since they're local.
4722
4723 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4724
4725 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4726 the loop (Bug#12247).
4727
4728 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4729
4730 * lisp.h (vcopy): Use memcpy rather than our own loop.
4731 This fixes a performance regression introduced by the recent
4732 addition of vcopy. This means 'vcopy' will need to be modified
4733 for a copying collector, but that's OK. Also, tighten the
4734 checking in the assertion.
4735
4736 2012-08-21 Eli Zaretskii <eliz@gnu.org>
4737
4738 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4739 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4740 non-base glyph for the width of the base character, according to
4741 what x_draw_composite_glyph_string_foreground expects.
4742 Generate WADJUST value according to composition_gstring_width's
4743 expectations, to produce correct width of the composed character.
4744 Reverse the sign of the DU offset produced by ScriptPlace.
4745
4746 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4747
4748 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4749
4750 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4751
4752 Avoid direct writes to contents member of struct Lisp_Vector.
4753 * lisp.h (vcopy): New function to copy data into vector.
4754 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4755 * fns.c (Ffillarray): Use ASET.
4756 * keyboard.c (timer_check_2): Use AREF and ASET.
4757 (append_tool_bar_item, Frecent_keys): Use vcopy.
4758 * lread.c (read_vector): Use ASET.
4759 * msdos.c (Frecent_doskeys): Use vcopy.
4760 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4761 (Finternal_merge_in_global_face): Use ASET and vcopy.
4762 * xfont.c (xfont_list_pattern): Likewise.
4763
4764 2012-08-21 Martin Rudalics <rudalics@gmx.at>
4765
4766 * window.c (Fwindow_point): For the selected window always return
4767 the position of its buffer's point.
4768 (Fset_window_point): For the selected window always go in its
4769 buffer to the specified position.
4770
4771 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4772
4773 Setter macros for fontsets.
4774 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
4775 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
4776 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
4777 Adjust users.
4778
4779 2012-08-20 Glenn Morris <rgm@gnu.org>
4780
4781 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4782 Don't assume that `ln -f' works.
4783
4784 2012-08-20 Eli Zaretskii <eliz@gnu.org>
4785
4786 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
4787 and later about non-assignments with no effect. See discussion at
4788 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
4789 details.
4790
4791 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4792
4793 Inline setter functions for Lisp_Objects slots of struct specbinding.
4794 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
4795 Adjust users.
4796
4797 2012-08-20 Martin Rudalics <rudalics@gmx.at>
4798
4799 * window.c (select_window): Always make selected window's buffer
4800 current.
4801
4802 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4803
4804 Use AREF and ASET for docstrings of category tables.
4805 * category.h (CATEGORY_DOCSTRING): Use AREF.
4806 (SET_CATEGORY_DOCSTRING): Use ASET.
4807 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
4808
4809 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4810
4811 Inline setter functions for hash table members.
4812 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
4813 (set_hash_hash, set_hash_index): Rename with _slot suffix.
4814 (set_hash_key_and_value, set_hash_index, set_hash_next)
4815 (set_hash_hash): New functions.
4816 * charset.c, fns.c: Adjust users.
4817
4818 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
4819
4820 Inline getter and setter functions for per-buffer values.
4821 * buffer.h (per_buffer_default, set_per_buffer_default)
4822 (per_buffer_value, set_per_buffer_value): New functions.
4823 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
4824 * buffer.c, data.c: Adjust users.
4825
4826 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
4827
4828 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
4829
4830 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
4831
4832 Rely on <config.h> + <unistd.h> to declare 'environ',
4833 as gnulib does this if the system doesn't.
4834 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
4835 Remove declaration. MS-Windows declares it on stdlib.h which is
4836 included by conf_post.h.
4837 * emacs.c (environ) [DOUG_LEA_MALLOC]:
4838 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
4839 * vm-limit.c: Include <unistd.h>, for 'environ'.
4840
4841 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4842 (start_of_data): Remove decl; mem-limits.h provides it.
4843
4844 * xdisp.c (handle_invisible_prop): Make it a bit faster
4845 and avoid a gcc -Wmaybe-uninitialized diagnostic.
4846
4847 2012-08-19 Chong Yidong <cyd@gnu.org>
4848
4849 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
4850 ends (Bug#3874).
4851
4852 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
4853
4854 * .gdbinit: Use call instead of set when calling a function in the
4855 inferior.
4856
4857 * data.c (set_internal): Don't use set_blv_found.
4858 (Fkill_local_variable): Likewise.
4859
4860 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
4861
4862 * nsfont.m (ns_ascii_average_width): Ensure the string
4863 ascii_printable is initialized with a null-terminated character
4864 array. Otherwise, it can contain undesired extra characters.
4865
4866 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4867
4868 port new setting code to Sun C 5.8 2005/10/13
4869 * chartab.c, lisp.h (char_table_set, char_table_set_range):
4870 Return void, not Lisp_Object. Otherwise, the compiler
4871 complains about (A?B:C) where B is void and C is Lisp_Object
4872 when compiling CHAR_TABLE_SET, due to the recent change to
4873 the API of sub_char_table_set_contents.
4874
4875 2012-08-18 Chong Yidong <cyd@gnu.org>
4876
4877 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
4878 for the string case (Bug#3874).
4879
4880 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * buffer.h (BSET): Remove (Bug#12215).
4883 Replace all uses with calls to new setter functions.
4884 (bset_bidi_paragraph_direction, bset_case_canon_table)
4885 (bset_case_eqv_table, bset_directory, bset_display_count)
4886 (bset_display_time, bset_downcase_table)
4887 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
4888 (bset_last_selected_window, bset_local_var_alist)
4889 (bset_mark_active, bset_point_before_scroll, bset_read_only)
4890 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
4891 (bset_width_table):
4892 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4893 (bset_auto_fill_function, bset_auto_save_file_format)
4894 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4895 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4896 (bset_cache_long_line_scans, bset_case_fold_search)
4897 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4898 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4899 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4900 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4901 (bset_header_line_format, bset_indicate_buffer_boundaries)
4902 (bset_indicate_empty_lines, bset_invisibility_spec)
4903 (bset_left_fringe_width, bset_major_mode, bset_mark)
4904 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4905 (bset_name, bset_overwrite_mode, bset_pt_marker)
4906 (bset_right_fringe_width, bset_save_length)
4907 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4908 (bset_scroll_up_aggressively, bset_selective_display)
4909 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4910 (bset_word_wrap, bset_zv_marker):
4911 * category.c (bset_category_table):
4912 * syntax.c (bset_syntax_table):
4913 New setter functions.
4914
4915 * process.h (PSET): Remove (Bug#12215).
4916 Replace all uses with calls to new setter functions.
4917 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4918 (PROCESS_INLINE): New macro.
4919 (pset_childp): New setter function.
4920 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4921 * process.c (PROCESS_INLINE):
4922 Define to EXTERN_INLINE, so that the corresponding functions
4923 are compiled into code.
4924 (pset_buffer, pset_command, pset_decode_coding_system)
4925 (pset_decoding_buf, pset_encode_coding_system)
4926 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4927 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4928 (pset_type, pset_write_queue): New setter functions.
4929
4930 * window.h (WSET): Remove (Bug#12215).
4931 Replace all uses with calls to new setter functions.
4932 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4933 (WINDOW_INLINE): New macro.
4934 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4935 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4936 (wset_total_lines, wset_vertical_scroll_bar)
4937 (wset_window_end_pos, wset_window_end_valid)
4938 (wset_window_end_vpos): New setter functions.
4939 * window.c (WINDOW_INLINE):
4940 Define to EXTERN_INLINE, so that the corresponding functions
4941 are compiled into code.
4942 (wset_combination_limit, wset_dedicated, wset_display_table)
4943 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4944 (wset_new_normal, wset_new_total, wset_next_buffers)
4945 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4946 (wset_prev_buffers, wset_right_fringe_width)
4947 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4948 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4949 (wset_window_parameters):
4950 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4951 (wset_column_number_displayed, wset_region_showing):
4952 New setter functions.
4953
4954 * termhooks.h (TSET): Remove (Bug#12215).
4955 Replace all uses with calls to new setter functions.
4956 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4957 (TERMHOOKS_INLINE): New macro.
4958 (tset_charset_list, tset_selection_alist): New setter functions.
4959 * terminal.c (TERMHOOKS_INLINE):
4960 Define to EXTERN_INLINE, so that the corresponding functions
4961 are compiled into code.
4962 (tset_param_alist): New setter function.
4963
4964 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4965
4966 * keyboard.h (KSET): Remove (Bug#12215).
4967 Replace all uses with calls to new setter functions.
4968 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4969 (KEYBOARD_INLINE): New macro.
4970 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4971 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4972 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4973 New setter functions.
4974 * keyboard.c (KEYBOARD_INLINE):
4975 Define to EXTERN_INLINE, so that the corresponding functions
4976 are compiled into code.
4977 (kset_echo_string, kset_kbd_queue)
4978 (kset_keyboard_translate_table, kset_last_prefix_arg)
4979 (kset_last_repeatable_command, kset_local_function_key_map)
4980 (kset_overriding_terminal_local_map, kset_real_last_command)
4981 (kset_system_key_syms): New setter functions.
4982
4983 * frame.h (FSET): Remove (Bug#12215).
4984 Replace all uses with calls to new setter functions.
4985 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4986 (FRAME_INLINE): New macro.
4987 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4988 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4989 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4990 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4991 (fset_param_alist, fset_root_window, fset_scroll_bars)
4992 (fset_selected_window, fset_title, fset_tool_bar_items)
4993 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4994 * frame.c (FRAME_INLINE):
4995 Define to EXTERN_INLINE, so that the corresponding functions
4996 are compiled into code.
4997 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4998
4999 A few more naming-convention fixes for getters and setters.
5000 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5001 and rename from buffer_overlays_set_before.
5002 (set_buffer_overlays_after): Move here from buffer.h, and rename
5003 from buffer_overlays_set_after.
5004 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5005 All uses changed.
5006 (set_buffer_intervals): Rename from buffer_set_intervals.
5007 * intervals.c (set_interval_object): Move here from intervals.h,
5008 and rename from interval_set_object.
5009 (set_interval_left): Move here from intervals.h, and rename from
5010 interval_set_left.
5011 (set_interval_right): Move here from intervals.h, and rename from
5012 interval_set_right.
5013 (copy_interval_parent): Move here from intervals.h, and rename from
5014 interval_copy_parent.
5015 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5016 (set_interval_plist): Rename from interval_set_plist.
5017 Return void, not Lisp_Object, since no caller uses the result.
5018 * lisp.h (string_intervals): Rename from string_get_intervals.
5019 (set_string_intervals): Rename from string_set_intervals.
5020
5021 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5022 (set_char_table_contents): Rename from char_table_set_contents.
5023 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
5024 All uses changed. See the end of
5025 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5026
5027 * lisp.h (CSET): Remove (Bug#12215).
5028 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5029 (set_char_table_purpose): New functions,
5030 replacing CSET. All uses changed. For example, replace
5031 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
5032 "set_char_table_parent (char_table, parent);".
5033 The old version was confusing because it used the same name
5034 'parent' for two different things.
5035
5036 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5037
5038 Functions to get and set Lisp_Object fields of buffer-local variables.
5039 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5040 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5041 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5042 * data.c, eval.c, frame.c: Adjust users.
5043
5044 2012-08-17 Chong Yidong <cyd@gnu.org>
5045
5046 * xfaces.c (merge_face_vectors): If the target font specfies a
5047 font spec, make the font's attributes take precedence over
5048 directly-specified attributes.
5049 (merge_face_ref): Recognize :font.
5050
5051 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5052
5053 Do not use memcpy for copying intervals.
5054 * intervals.c (reproduce_interval): New function.
5055 (reproduce_tree, reproduce_tree_obj): Use it.
5056 (reproduce_tree_obj): Remove prototype.
5057
5058 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 * lisp.h (duration_to_sec_usec): Remove unused decl.
5061
5062 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5063
5064 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5065 to an allocated instance of NSString, not to the class itself.
5066
5067 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
5068
5069 * makefile.w32-in (C_CTYPE_H): New macro.
5070 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5071 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5072 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5073
5074 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5075
5076 Use ASCII tests for character types.
5077 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5078 * xfns.c, xterm.c:
5079 Don't include <ctype.h>; was not needed.
5080 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5081 * sysdep.c, xfaces.c:
5082 Include <c-ctype.h> instead of <ctype.h>.
5083 * nsterm.m: Include <c-ctype.h>.
5084 * charset.c (read_hex):
5085 * doc.c (Fsnarf_documentation):
5086 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5087 (DRIVE_LETTER) [DOS_NT]:
5088 (Ffile_name_directory, Fexpand_file_name)
5089 (Fsubstitute_in_file_name):
5090 * font.c (font_parse_xlfd, font_parse_fcname):
5091 * frame.c (x_set_font_backend):
5092 * gtkutil.c (xg_get_font):
5093 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5094 * nsimage.m (hexchar):
5095 * nsterm.m (ns_xlfd_to_fontname):
5096 * sysdep.c (system_process_attributes):
5097 * xfaces.c (hash_string_case_insensitive):
5098 Use C-locale tests instead of locale-specific tests for character
5099 types, since we want the ASCII interpretation here, not the
5100 interpretation suitable for whatever happens to be the current locale.
5101
5102 2012-08-16 Martin Rudalics <rudalics@gmx.at>
5103
5104 Consistently check windows for validity/liveness
5105 (Bug#11984, Bug#12025, Bug#12026).
5106 * lisp.h (CHECK_VALID_WINDOW): New macro.
5107 * window.c (decode_window): Rename to decode_live_window.
5108 (decode_valid_window, Fwindow_valid_p): New functions.
5109 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5110 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5111 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5112 (Fwindow_prev_sibling, Fwindow_combination_limit)
5113 (Fset_window_combination_limit, Fwindow_use_time)
5114 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5115 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5116 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5117 (Fwindow_hscroll, Fset_window_hscroll)
5118 (Fwindow_redisplay_end_trigger)
5119 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5120 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5121 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5122 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5123 (Fwindow_end, Fset_window_point, Fset_window_start)
5124 (Fpos_visible_in_window_p, Fwindow_line_height)
5125 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5126 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5127 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5128 (Fset_window_parameter, Fwindow_display_table)
5129 (Fset_window_display_table, Fdelete_other_windows_internal)
5130 (Fset_window_buffer, Fset_window_new_total)
5131 (Fset_window_new_normal, Fdelete_window_internal)
5132 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5133 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5134 (Fwindow_scroll_bars): Check whether argument window is a valid or
5135 live window. Update doc-strings.
5136 (syms_of_window): New symbol Qwindow_valid_p.
5137 * keyboard.c (Fposn_at_x_y): Check whether argument
5138 frame_or_window denotes a valid window.
5139
5140 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5141
5142 Fix previous char table change.
5143 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5144 * chartab.c (optimize_sub_char_table): Likewise.
5145
5146 2012-08-16 Chong Yidong <cyd@gnu.org>
5147
5148 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5149
5150 * xfont.c (xfont_open):
5151 * xftfont.c (xftfont_open): Set the font's max_width field.
5152
5153 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5154 min_width to space_width and average_width to the average over
5155 printable ASCII characters.
5156 (ns_char_width): Code cleanup.
5157 (ns_ascii_average_width): New utility function.
5158
5159 * font.h (struct font): Update comments.
5160
5161 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5162
5163 Simple interface to set Lisp_Object fields of character tables.
5164 * lisp.h (CSET): New macro.
5165 (char_table_set_extras, char_table_set_contents)
5166 (sub_char_table_set_contents): New function.
5167 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5168 * syntax.c: Adjust users.
5169
5170 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5171
5172 * eval.c (eval_sub): Bind lexical-binding.
5173 * lread.c (Qlexical_binding): Make non-static.
5174
5175 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5176
5177 * nsmenu.m (popupSession): Remove.
5178 (pop_down_menu): Remove endModalSession.
5179 (timeout_handler:): New method.
5180 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5181 Call runModalForWindow. Check timer_fired when it returns.
5182 If not set, cancel timer and break out of loop.
5183 Otherwise loop again, with a new timeout.
5184
5185 * nsterm.m: Include fcntl.h if present.
5186 (fd_entry, t_readfds, inNsSelect): Remove.
5187 (select_writefds, select_valid, select_timeout, selfds)
5188 (select_mutex, apploopnr): Add.
5189 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5190 Otherwise call kbd_buffer_store_event.
5191 (ns_send_appdefined): Remove release of fd_entry.
5192 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5193 Increment and decrement apploopnr.
5194 (ns_select): If no file descriptors, just do a NSTimer.
5195 Otherwise copy read/write masks and start select thread (fd_handler).
5196 Start main loop and wait for application defined event.
5197 Inform select thread to stop selecting after main loop is exited.
5198 (ns_term_init): Create selfds pipe and set non-blocking.
5199 Initialize select_mutex. Start the select thread (fd_handler).
5200 (fd_handler:): Loop forever, wait for info from the main thread
5201 to either start or stop selecting. When select returns, send
5202 and appdefined event.
5203 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5204 If not call kbd_buffer_store_event.
5205
5206 * nsterm.h (EmacsApp): fd_handler takes id argument.
5207 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5208
5209 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5210
5211 2012-08-15 Eli Zaretskii <eliz@gnu.org>
5212
5213 * region-cache.c (move_cache_gap): Update gap_len using the actual
5214 growth of the boundaries array. Do not change cache_len.
5215 (Bug#12196)
5216
5217 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5218
5219 Generalize and cleanup font subsystem checks.
5220 * font.h (FONT_DEBUG, font_assert): Remove.
5221 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5222 Change font_assert to eassert. Use eassert where appropriate.
5223
5224 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5225
5226 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5227
5228 2012-08-15 Chong Yidong <cyd@gnu.org>
5229
5230 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5231 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5232 extract the font descriptor instead of just the font name.
5233 In that case, return a font spec instead of a string.
5234 (x_last_font_name): Move to this file from xfns.c.
5235
5236 * xfns.c (Fx_select_font): The return value can also be a font
5237 spec. Move x_last_font_name management to gtkutil.c.
5238
5239 * xfaces.c: Make font weight and style symbols non-static.
5240
5241 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5242
5243 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5244 (bug#12117).
5245
5246 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5247
5248 * alloc.c (Fgarbage_collect): Use plural form consistently.
5249
5250 2012-08-14 Eli Zaretskii <eliz@gnu.org>
5251
5252 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5253 iteration through the command loop. Fixes a problem whereby mouse
5254 movements are ignored until the first mouse click.
5255
5256 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 Use bool, not int, for Lisp booleans.
5259 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5260 makes Emacs a bit smaller and presumably a bit faster.
5261 * lisp.h: Include <stdbool.h>.
5262 (struct Lisp_Boolfwd, defvar_bool):
5263 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5264 * regex.c [!emacs]: Include <stdbool.h>.
5265 (false, true): Remove; <stdbool.h> does this for us now.
5266
5267 2012-08-14 Chong Yidong <cyd@gnu.org>
5268
5269 * character.c (Fcharacterp): Doc fix (Bug#12076).
5270
5271 * data.c (Findirect_variable): Doc fix (Bug#11040).
5272
5273 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5274
5275 * editfns.c (Fformat): Doc fix (Bug#12059).
5276 (Fsave_current_buffer): Doc fix (Bug#11542).
5277
5278 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5279
5280 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5281 (bug#12022).
5282
5283 2012-08-14 Martin Rudalics <rudalics@gmx.at>
5284
5285 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5286 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5287 * minibuf.c (choose_minibuf_frame, read_minibuf):
5288 * w32fns.c (x_create_tip_frame):
5289 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5290 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5291
5292 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5293
5294 * intervals.c (offset_intervals): Remove obsolete comment.
5295
5296 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5297
5298 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5299
5300 2012-08-14 Gergely Risko <gergely@risko.hu>
5301
5302 * coding.c (decode_coding): Record buffer modification before
5303 disabling undo_list (Bug#11773).
5304
5305 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5306
5307 Revert and cleanup some recent overlay changes.
5308 * buffer.h (enum overlay_type): Remove.
5309 (buffer_get_overlays, buffer_set_overlays): Likewise.
5310 (buffer_set_overlays_before, buffer_set_overlays_after):
5311 New function. Adjust users.
5312 (unchain_both): Add eassert.
5313
5314 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5315
5316 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5317
5318 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 * gtkutil.c (xg_mark_data): Don't assume C99.
5321
5322 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5323
5324 * gtkutil.c (xg_frame_tb_info): New struct.
5325 (TB_INFO_KEY): New define.
5326 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5327 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5328 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5329 if not present.
5330 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
5331 is up to date. Otherwise store new data.
5332 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5333
5334 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5335
5336 Use KSET for write access to Lisp_Object members of struct kboard.
5337 * keyboard.h (KSET): New macro.
5338 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5339 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5340 * xterm.c: Adjust users.
5341
5342 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 Use BSET for write access to Lisp_Object members of struct buffer.
5345 * buffer.h (BSET): New macro.
5346 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5347 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5348 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5349 * window.c, xdisp.c, xfns.c: Adjust users.
5350
5351 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5352
5353 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5354
5355 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5356
5357 * nsterm.m (not_in_argv): New function.
5358 (application:openFile, application:openTempFile:):
5359 (application:openFileWithoutUI:, application:openFiles:): Open file
5360 if not_in_argv returns non-zero (bug#12171).
5361
5362 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
5363 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5364 Define for Gtk+ versions less than 3.2.
5365 (xg_get_font_name): Use those functions/macros here.
5366 Reported by Frans Oilinki <moilinki@gmail.com>.
5367
5368 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5369
5370 * unexmacosx.c (copy_data_segment): Copy initialized data in
5371 statically linked libraries from input file rather than memory.
5372
5373 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5374 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5375 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5376
5377 2012-08-10 Glenn Morris <rgm@gnu.org>
5378
5379 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5380 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5381
5382 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5383
5384 Fix last change to allow compilation with low optimization levels.
5385 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5386 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5387
5388 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5389
5390 Use common inline syntax in intervals.h.
5391 * intervals.h (INTERVALS_INLINE): New macro.
5392 Change all users from LISP_INLINE.
5393
5394 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5395
5396 Define Qnone once for all platforms.
5397 * frame.c (Qnone): Define here.
5398 (syms_of_frame): DEFSYM it.
5399 * lisp.h (Qnone): New declaration.
5400 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5401 * xfns.c: Remove duplication. Adjust users.
5402
5403 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 Remove unused macros from intervals.h.
5406 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5407 * intervals.c: Adjust comment.
5408
5409 2012-08-10 Eli Zaretskii <eliz@gnu.org>
5410
5411 * w32fns.c <w32_unicode_gui>: New static variable.
5412 (globals_of_w32fns): Initialize it according to os_subtype.
5413 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5414 testing os_subtype.
5415
5416 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
5417 Eli Zaretskii <eliz@gnu.org>
5418
5419 Fix bug #10299 with Unicode characters sent by customized
5420 keyboards created by MSKLC.
5421 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5422 (w32_init_class): Use it to initialize the Emacs class with either
5423 ANSI or Unicode API calls.
5424 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5425 later.
5426 (w32_wnd_proc): If the character code sent by WM_CHAR or
5427 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5428 original message. Call DefWindowProcW on NT and later.
5429
5430 2012-08-10 Glenn Morris <rgm@gnu.org>
5431
5432 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5433
5434 * lisp.h (DIRECTORY_SEP): Let configure set it.
5435
5436 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5437
5438 Use TSET for write access to Lisp_Object slots of struct terminal.
5439 * termhooks.h (TSET): New macro.
5440 * coding.c, terminal.c, xselect.c: Adjust users.
5441
5442 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5443
5444 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5445 the failing expression, include them in the error message.
5446 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5447 * lisp.h (internal_condition_case_n): Update declaration.
5448
5449 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5450
5451 Inline functions to examine and change buffer overlays.
5452 * buffer.c (unchain_both): New function.
5453 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5454 (buffer_has_overlays): New function.
5455 (enum overlay_type): New enum.
5456 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5457 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5458
5459 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5460
5461 Inline functions to examine and change buffer intervals.
5462 * alloc.c (mark_interval_tree): Remove.
5463 (MARK_INTERVAL_TREE): Simplify.
5464 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5465 * intervals.c (buffer_balance_intervals): New function.
5466 (graft_intervals_into_buffer): Adjust indentation.
5467 (set_intervals_multibyte): Simplify.
5468 * buffer.h (BUF_INTERVALS): Remove.
5469 (buffer_get_intervals, buffer_set_intervals): New function.
5470 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5471 * intervals.c, textprop.c: Adjust users.
5472
5473 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5474
5475 Inline functions to examine and change string intervals.
5476 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5477 (string_get_intervals, string_set_intervals): New function.
5478 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5479 * lread.c, print.c, textprop.c: Adjust users.
5480
5481 2012-08-08 Glenn Morris <rgm@gnu.org>
5482
5483 * lisp.mk (lisp): Remove language/persian.elc.
5484
5485 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5486
5487 Cleanup intervals.
5488 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5489 (NULL_INTERVAL_P): Likewise. Adjust users.
5490 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5491 Adjust comment. Move under #if 0.
5492 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5493 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5494
5495 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 Check total length of intervals with eassert.
5498 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5499 * intervals.c: Change all users to eassert.
5500
5501 2012-08-07 Eli Zaretskii <eliz@gnu.org>
5502
5503 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5504 Rename fields to match removal of FGET and WGET and disuse of
5505 INTERNAL_FIELD in Lisp_Cons.
5506
5507 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5508
5509 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5510 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5511 name since all xname users are fixed long time ago. Do not
5512 use INTERNAL_FIELD.
5513 (set_symbol_name, set_symbol_function, set_symbol_plist):
5514 (set_symbol_next, set_overlay_plist): New function.
5515 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5516 (struct Lisp_Overlay): Likewise.
5517 (CVAR, MVAR, SVAR): Remove.
5518 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5519 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5520 * xterm.c: Adjust users.
5521 * .gdbinit: Change to use name field of struct Lisp_Symbol
5522 where appropriate.
5523
5524 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 Basic functions to set Lisp_Object and pointer slots of intervals.
5527 * intervals.h (interval_set_parent, interval_set_object):
5528 (interval_set_left, interval_set_right, interval_set_plist):
5529 (interval_copy_parent): New function.
5530 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
5531 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5532 Adjust indentation.
5533 (INTERVAL_SIZE): Remove. Adjust users.
5534 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5535
5536 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5537
5538 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5539 * process.h (PGET): Remove.
5540 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5541 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5542
5543 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5544
5545 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5546 * window.h (WGET): Remove.
5547 (struct window): Do not use INTERNAL_FIELD.
5548 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5549 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5550 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5551 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5552 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5553 Adjust users.
5554
5555 2012-08-07 Chong Yidong <cyd@gnu.org>
5556
5557 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5558 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5559 (Fdelete_window_internal): Signal an error if the window is not on
5560 a live frame (Bug#12025).
5561
5562 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5563
5564 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5565 * frame.h (FGET): Remove.
5566 (struct frame): Do not use INTERNAL_FIELD.
5567 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5568 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5569 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5570 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5571
5572 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
5573
5574 * w32.c: Silence compiler warnings.
5575 (map_w32_filename): Remove unused variable `is_fat'.
5576 (chase_symlinks): Add parentheses around expression.
5577
5578 2012-08-06 Glenn Morris <rgm@gnu.org>
5579
5580 * sysdep.c: Respect BROKEN_GETWD.
5581
5582 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5583 Let configure handle it.
5584 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5585
5586 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5587
5588 Use GCALIGNMENT where appropriate.
5589 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5590 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5591 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5592
5593 2012-08-06 Eli Zaretskii <eliz@gnu.org>
5594
5595 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5596 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5597
5598 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5599
5600 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5601 that should be sufficient for everyone.
5602
5603 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5604
5605 * keyboard.c (timer_check_2): Add break so timer_check returns next
5606 timeout.
5607
5608 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5609
5610 Fix Windows build errors introduced after converting to WGET and WSET.
5611 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5612 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5613
5614 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5615
5616 * nsterm.m (ns_frame_rehighlight): Use FSET.
5617
5618 * nsmenu.m (ns_update_menubar): Use FSET.
5619
5620 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5621
5622 Separate read and write access to Lisp_Object slots of Lisp_Process.
5623 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5624 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5625
5626 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Separate read and write access to Lisp_Object slots of struct window.
5629 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5630 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5631 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5632 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5633 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5634 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5635 Adjust users.
5636
5637 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5638
5639 Fix Windows build errors introduced after converting to FGET and FSET.
5640 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5641 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5642 (w32_judge_scroll_bars): Change to use FSET.
5643 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5644
5645 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5646
5647 Fix replacement typo.
5648 * window.c (replace_window): Set root_window instead of
5649 selected_window. This fixes a total window subsystem
5650 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5651
5652 2012-08-06 Glenn Morris <rgm@gnu.org>
5653
5654 * lisp.mk (lisp): Add language/persian.elc.
5655
5656 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5657
5658 Separate read and write access to Lisp_Object slots of struct frame.
5659 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5660 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5661 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5662 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5663 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5664
5665 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5666
5667 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5668
5669 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5670
5671 Generalize common compile-time constants.
5672 * lisp.h (header_size, bool_header_size, word_size): Now here.
5673 (struct Lisp_Vector): Add comment.
5674 (struct Lisp_Bool_Vector): Move up to define handy constants.
5675 (VECSIZE, PSEUDOVECSIZE): Simplify.
5676 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5677 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5678 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5679 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5680 * xfont.c, xmenu.c: Use word_size where appropriate.
5681
5682 2012-08-05 Lawrence Mitchell <wence@gmx.li>
5683
5684 * search.c (Freplace_match): Treat \? in the replacement text
5685 literally (Bug#8161).
5686
5687 2012-08-05 Chong Yidong <cyd@gnu.org>
5688
5689 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5690 * frame.c (Vdelete_frame_functions):
5691 * emacs.c (Vkill_emacs_hook): Doc fix.
5692
5693 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5694
5695 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5696 --with-x-toolkit=no builds.
5697 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5698
5699 2012-08-04 Chong Yidong <cyd@gnu.org>
5700
5701 * syntax.c (Fmodify_syntax_entry): Doc fix.
5702
5703 2012-08-04 Eli Zaretskii <eliz@gnu.org>
5704
5705 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5706 * w32.c (init_environment): Change the default values of many
5707 environment variables in dflt_envvars[] to NULL, to avoid pushing
5708 them into environment when they were not already defined.
5709 Remove the code that deletes site-lisp subdirectories from the default
5710 value of EMACSLOADPATH, as it is no longer needed.
5711 (check_windows_init_file): Now external, not static.
5712 Use Vload_path as is, without adding anything, as this function is now
5713 called when Vload_path is already set up.
5714
5715 * w32.h (check_windows_init_file): Add prototype.
5716
5717 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5718 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5719 compatibility with Posix platforms.
5720 (main): Move the call to check_windows_init_file to here from
5721 w32.c.
5722 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5723 any, in the DEFALT argument into the root of the Emacs build or
5724 installation tree, as appropriate.
5725
5726 * callproc.c (init_callproc_1): Call decode_env_path instead of
5727 doing its equivalent by hand.
5728 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5729 the code that sets Vexec_path run on MS-Windows.
5730
5731 * lread.c (init_lread): Add comments to #ifdef's.
5732
5733 * msdos.c (dos_set_window_size, IT_update_begin)
5734 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5735 instead of direct references.
5736
5737 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5738
5739 Export DEFAULT_REHASH_* to GDB.
5740 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5741 Now constants, not macros.
5742
5743 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 Remove unnecessary casts involving pointers.
5746 These casts are no longer needed now that we assume C89 or later,
5747 since they involve casting to or from void *.
5748 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5749 (make_pure_float, make_pure_vector):
5750 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5751 * macros.c (Fstart_kbd_macro):
5752 * menu.c (find_and_return_menu_selection):
5753 * minibuf.c (read_minibuf_noninteractive):
5754 * sysdep.c (closedir):
5755 * xdisp.c (x_produce_glyphs):
5756 * xfaces.c (compare_fonts_by_sort_order):
5757 * xfns.c (x_real_positions, select_visual):
5758 * xselect.c (x_stop_queuing_selection_requests)
5759 (x_get_window_property, x_get_window_property_as_lisp_data):
5760 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5761 Remove unnecessary pointer casts.
5762 * alloc.c (record_xmalloc): New function.
5763 * lisp.h (record_xmalloc): New decl.
5764 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5765 more like a function. This is because the pointer cast is not
5766 needed. All uses changed.
5767 * print.c (print_string, print_error_message): Avoid length recalc.
5768
5769 Improve fix for macroexp crash with debugging (Bug#12118).
5770 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
5771 ARRAY_MARK_FLAG when checking subscripts, because ASET is
5772 not supposed to be invoked from the garbage collector.
5773 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
5774 (gc_aset): New function, which is like ASET but can be
5775 used in the garbage collector.
5776 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5777 (set_hash_index): Use it instead of ASET.
5778
5779 2012-08-03 Eli Zaretskii <eliz@gnu.org>
5780
5781 Support symlinks on latest versions of MS-Windows.
5782 * w32.c: Include winioctl.h and aclapi.h.
5783 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
5784 (revert_to_self): Forward declarations of static functions.
5785 <static BOOL g_b_init_get_security_info>:
5786 <g_b_init_create_symbolic_link>: New static flags.
5787 (globals_of_w32): Initialize them to zero.
5788 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
5789 (map_w32_filename): Improve commentary. Simplify switch.
5790 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
5791 headers (most versions of MinGW w32api don't).
5792 (get_security_info, create_symbolic_link)
5793 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
5794 New functions.
5795 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
5796 in the argument file name.
5797 (sys_access): Call unc_volume_file_attributes only if
5798 GetFileAttributes fails with network-related error codes.
5799 (sys_rename): Diagnose renaming of a symlink when the user doesn't
5800 have the required privileges.
5801 (get_file_security_desc_by_name): Rename from
5802 get_file_security_desc.
5803 (stat_worker): New function, with most of the guts of 'stat', and
5804 with addition of handling of symlinks and support for 'lstat'.
5805 If possible, get file's attributes and security information by
5806 handle, not by name. Produce S_IFLNK bit for symlinks, when
5807 called from 'lstat'.
5808 (stat, lstat): New functions, call 'stat_worker'.
5809 (symlink, readlink, careadlinkat): Rewritten to create and resolve
5810 symlinks when the underlying filesystem supports them.
5811
5812 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5813
5814 Fix macroexp crash on Windows with debugging (Bug#12118).
5815 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
5816 checking subscripts; problem introduced with the recent
5817 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
5818 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
5819 since it's used in non-static inline functions now.
5820
5821 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
5822 Don't assume buffer size fits in 'int'. Remove unused local.
5823
5824 Use C99-style 'extern inline' if available.
5825 * buffer.h (BUFFER_INLINE):
5826 * category.h (CATEGORY_INLINE):
5827 * character.h (CHARACTER_INLINE):
5828 * charset.h (CHARSET_INLINE):
5829 * composite.h (COMPOSITE_INLINE):
5830 * dispextern.h (DISPEXTERN_INLINE):
5831 * lisp.h (LISP_INLINE):
5832 * systime.h (SYSTIME_INLINE):
5833 New macro, replacing 'static inline' in this header.
5834 * buffer.h, category.h, character.h, charset.h, composite.h:
5835 * dispextern.h, lisp.h, systime.h:
5836 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5837 * alloc.c (LISP_INLINE):
5838 * buffer.c (BUFFER_INLINE):
5839 * category.c (CATEGORY_INLINE):
5840 * character.c (CHARACTER_INLINE):
5841 * charset.c (CHARSET_INLINE):
5842 * composite.c (COMPOSITE_INLINE):
5843 * dispnew.c (DISPEXTERN_INLINE):
5844 * sysdep.c (SYSTIME_INLINE):
5845 Define to EXTERN_INLINE, so that the corresponding functions
5846 are compiled into code.
5847 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
5848 (INLINE_HEADER_END): New macros.
5849 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
5850 since it's used in non-static inline functions now.
5851 (VALMASK) [!USE_LSB_TAG]: Likewise.
5852
5853 2012-08-02 Glenn Morris <rgm@gnu.org>
5854
5855 * s/: Remove empty directory.
5856
5857 * s/ms-w32.h: Move to ../nt/inc.
5858 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
5859 Update for new ms-w32.h location.
5860
5861 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
5862
5863 Port to Solaris 8.
5864 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
5865
5866 2012-08-02 Glenn Morris <rgm@gnu.org>
5867
5868 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
5869 hard-coding the path separator.
5870
5871 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
5874 This how ASET and AREF are supposed to work, and makes
5875 it easier to think about future improvements. See
5876 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
5877 * charset.h (set_charset_attr): New function.
5878 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
5879 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
5880 (aref_addr): New function. All uses of &AREF(...) changed.
5881 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
5882 (set_hash_index): New functions. All lvalue-style uses of
5883 HASH_KEY etc. changed.
5884 * keyboard.c (set_prop): New function. All lvalue-style uses
5885 of PROP changed.
5886
5887 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
5888
5889 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
5890 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
5891 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
5892 * nsfns.m (ns_set_name_as_filename): Likewise.
5893 * nsmenu.m (ns_update_menubar): Likewise.
5894 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
5895
5896 2012-08-01 Eli Zaretskii <eliz@gnu.org>
5897
5898 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
5899 Adapt to latest changes in field names of the corresponding Lisp
5900 objects.
5901
5902 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
5903
5904 2012-08-01 Glenn Morris <rgm@gnu.org>
5905
5906 * s/msdos.h: Remove file.
5907 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
5908 * Makefile.in (S_FILE): Remove.
5909 (config_h): Remove S_FILE.
5910
5911 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5912
5913 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5914 Remove; moved to nt/config.nt.
5915
5916 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5917
5918 Use INTERNAL_FIELD for conses and overlays.
5919 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5920 Remove obsolete comment.
5921 (MVAR): New macro.
5922 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5923 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5924
5925 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5926
5927 Use INTERNAL_FIELD for symbols.
5928 * lisp.h (SVAR): New macro. Adjust users.
5929 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5930 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5931
5932 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 Use INTERNAL_FIELD for processes.
5935 * process.h (PVAR): New macro. Adjust style.
5936 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5937 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5938
5939 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5940
5941 Use INTERNAL_FIELD for windows.
5942 * window.h (WVAR): New macro.
5943 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5944 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5945 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5946 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5947 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5948 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5949
5950 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5951
5952 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5953
5954 2012-08-01 Glenn Morris <rgm@gnu.org>
5955
5956 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5957 Move to configure.ac.
5958
5959 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
5960
5961 * makefile.w32-in (CONFIG_H): Update dependencies.
5962 (CONF_POST_H): New macro.
5963
5964 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5965
5966 2012-07-31 Glenn Morris <rgm@gnu.org>
5967
5968 * Makefile.in (S_FILE): No longer set by configure.
5969
5970 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5971 is available.
5972 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5973
5974 * process.h (NULL_DEVICE):
5975 * emacs.c (SEPCHAR):
5976 * editfns.c (USER_FULL_NAME): Let configure set them.
5977
5978 * s/README, s/template.h: Remove files.
5979
5980 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5981
5982 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5983 Move to configure.ac.
5984
5985 2012-07-31 Eli Zaretskii <eliz@gnu.org>
5986
5987 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5988 resulting renaming of 'struct frame' members.
5989
5990 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5991
5992 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5993 after introduction of FVAR.
5994
5995 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5996
5997 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5998
5999 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6000 instead of compositeToPoint.
6001 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6002
6003 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
6004
6005 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6006
6007 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6008 * lisp.h (INTERNAL_FIELD): New macro.
6009 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
6010 (BVAR): Change to use INTERNAL_FIELD.
6011 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6012 (KVAR): Change to use INTERNAL_FIELD.
6013 * frame.h (FVAR): New macro.
6014 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
6015 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6016 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6017 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6018 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6019
6020 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6021
6022 Miscellaneous fixes for non-default X toolkits.
6023 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6024 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6025 Move under #ifdef USE_LUCID.
6026 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6027 definition and usage to avoid warnings.
6028
6029 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6030
6031 * nsterm.m (openFiles): Fix previous checkin.
6032
6033 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6034
6035 * indent.c (compute_motion): Remove unused local.
6036
6037 2012-07-31 Glenn Morris <rgm@gnu.org>
6038
6039 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6040
6041 * conf_post.h [USG5_4]:
6042 Move remaining contents of s/usg5-4-common.h here.
6043 * s/usg5-4-common.h: Remove file.
6044
6045 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6046 * s/irix6-5.h: Remove file.
6047
6048 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6049 * s/darwin.h: Remove file.
6050
6051 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6052 * s/hpux10-20.h: Remove file, which is now empty.
6053
6054 2012-07-30 Glenn Morris <rgm@gnu.org>
6055
6056 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6057 * Makefile.in (config_h): Add conf_post.h.
6058 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6059
6060 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6061
6062 * nsterm.m (ns_do_open_file): New variable.
6063 (ns_term_init): Set ns_do_open_file to YES after run returns.
6064 (openFile, openTempFile, openFileWithoutUI, openFiles):
6065 Open files only if ns_do_open_file.
6066
6067 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6068
6069 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6070 This no-op macro hasn't been needed for many years.
6071 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6072
6073 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6074 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6075 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6076 gdb_make_enums_visible.
6077 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6078 (DIRECTORY_SEP): Now a constant, not a macro.
6079
6080 2012-07-30 Eli Zaretskii <eliz@gnu.org>
6081
6082 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6083 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6084
6085 * w32term.c <w32_keyboard_codepage>: Renamed from
6086 keyboard_codepage and now external. All users changed.
6087
6088 * w32term.h: Add declaration of w32_keyboard_codepage.
6089
6090 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6091 the codepage to translate keys to Unicode. If this argument is
6092 -1, use the value returned by GetConsoleCP. All callers changed.
6093
6094 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6095
6096 Update .PHONY listings in makefiles.
6097 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6098 bootstrap-clean, distclean, maintainer-clean, versioclean,
6099 extraclean, frc.
6100
6101 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6102 This is a bit clearer. Fix some commentary typos.
6103
6104 2012-07-30 Glenn Morris <rgm@gnu.org>
6105
6106 * s/netbsd.h: Let configure include signal.h if needed.
6107 Remove file, which is now empty.
6108
6109 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6110 Let configure set them.
6111 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6112 No more need to undefine.
6113
6114 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6115
6116 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6117 non-single-byte char when adding meta modifier. (Bug#12090)
6118
6119 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6120
6121 Convert safe_call to use variable number of arguments.
6122 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6123 (safe_call2): Fix comment.
6124 * lisp.h (safe_call): Adjust prototype.
6125 * coding.c (encode_coding_object): Change to use safe_call2.
6126 * xfaces.c (merge_face_heights): Change to use safe_call1.
6127
6128 2012-07-30 Glenn Morris <rgm@gnu.org>
6129
6130 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
6131 does that unconditionally. Remove file, which is now empty.
6132
6133 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6134 Remove empty files.
6135
6136 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6137
6138 Export to GDB most of lisp.h's remaining object-like macros.
6139 * lisp.h (min, max): Move earlier, because they're used earlier now.
6140 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6141 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6142 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6143 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6144 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6145 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6146 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6147 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6148 Now constants, for GDB. They need not be macros.
6149 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6150 Now constants, for GDB, as well as macros, for static initializers.
6151 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6152 Move to after the definition of struct Lisp_Char_Table,
6153 since the former now needs that type defined.
6154 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6155 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6156 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6157 New enums, for gdb_make_enums_visible.
6158 (GLYPH_MODE_LINE_FACE): Remove; unused.
6159 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
6160 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6161 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6162 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6163 enum maxargs, enum MAX_ALLOCA.
6164 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6165 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6166 no longer needed, now that they are done in lisp.h.
6167
6168 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6169
6170 Cleanup string bytes checking.
6171 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6172 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6173 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6174 (check_sblock, compact_small_strings): Simplify.
6175
6176 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6177
6178 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6179 These macros are confusing and no longer need to be defined, as
6180 the enum values now suffice. All uses replaced with definiens.
6181 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6182
6183 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
6184
6185 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6186 ($(BLD)/w32console.$(O)): Update dependencies.
6187
6188 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6189
6190 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6191 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6192 time. Adjust users.
6193 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6194
6195 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6196
6197 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6198 setting sitelisp (Bug#12010).
6199
6200 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6201
6202 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
6203
6204 * w32heap.c (cache_system_info):
6205 * w32.c (sys_rename):
6206 * w32proc.c (find_child_console, sys_kill): All users changed.
6207
6208 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6209
6210 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6211
6212 2012-07-29 Eli Zaretskii <eliz@gnu.org>
6213
6214 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6215
6216 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6217
6218 Cleanup statistics calculation in Fgarbage_collect.
6219 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6220 Fix zombies percentage calculation. Simplify elapsed time calculation.
6221
6222 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6223
6224 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6225 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6226 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6227 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6228 (replace_range, replace_range_2, del_range_2): Change to eassert.
6229 * marker.c (byte_char_debug_check): Adjust style.
6230
6231 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6232
6233 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6234 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6235 long-ago-commented-out code that talks about "WIN32".
6236 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6237 All uses changed.
6238
6239 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6242 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6243 Simplify by using alignof.
6244 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6245 * lisp.h: Include <stdalign.h>.
6246 (GCALIGNMENT): New macro and constant.
6247 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6248 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6249 (stdalign): New macro, if not already defined.
6250
6251 2012-07-28 Eli Zaretskii <eliz@gnu.org>
6252
6253 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6254 * w32inevt.c: Include w32inevt.h.
6255 (w32_read_console_input): New inline function, calls either
6256 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6257 w32_console_unicode_input.
6258 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6259 (w32_kbd_patch_key, key_event): Use the codepage returned by
6260 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6261 (key_event): use uChar.UnicodeChar only if
6262 w32_console_unicode_input is non-zero.
6263
6264 * w32console.c: Include w32heap.h.
6265 <w32_console_unicode_input>: New global variable.
6266 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6267 family of Windows, zero otherwise.
6268
6269 * w32inevt.h: Declare w32_console_unicode_input.
6270
6271 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6272 --without-x. (Bug#11742)
6273
6274 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6275
6276 Adjust GDB to reflect pvec_type changes (Bug#12036).
6277 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
6278 2012-07-04 changes to pseudovector representation.
6279 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
6280
6281 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
6282
6283 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6284 bus address.
6285 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6286
6287 2012-07-27 Eli Zaretskii <eliz@gnu.org>
6288
6289 * alloc.c (listn): Fix the order the arguments are consed onto the
6290 list.
6291
6292 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6293 enumeration constants, as PURE and HEAP are too general, and clash
6294 with other headers and sources, such as gmalloc.c and the
6295 MS-Windows system headers. All users changed.
6296
6297 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6298
6299 Revert last save_excursion_save and save_excursion_restore changes.
6300 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6301 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6302
6303 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 Fix recently-introduced typos in Windows port.
6306 Reported by Martin Rudalics <rudalics@gmx.at>.
6307 * w32.c (init_environment): Replace comma with semicolon.
6308 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
6309
6310 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6311
6312 Improve GDB symbol export (Bug#12036).
6313 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6314 arms of an 'if', not using conditional expressions; otherwise GDB
6315 complains about the types in the unevaluated arm when the argument
6316 is an integer literal.
6317 (xgetint): Simplify expression.
6318 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6319 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6320 Zaretskii in <http://bugs.gnu.org/12036#13>.
6321 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6322 needed now that we have gdb_make_enums_visible.
6323 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6324 (enum enum_USE_LSB_TAG):
6325 New enum types, packaging up enums that need to be exported to GDB.
6326
6327 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6328
6329 Utility function to make a list from specified amount of objects.
6330 * lisp.h (enum constype): New datatype.
6331 (listn): New prototype.
6332 * alloc.c (listn): New function.
6333 (Fmemory_use_count, syms_of_alloc): Use it.
6334 * buffer.c (syms_of_buffer): Likewise.
6335 * callint.c (syms_of_callint): Likewise.
6336 * charset.c (define_charset_internal): Likewise.
6337 * coding.c (syms_of_coding): Likewise.
6338 * keymap.c (syms_of_keymap): Likewise.
6339 * search.c (syms_of_search): Likewise.
6340 * syntax.c (syms_of_syntax): Likewise.
6341 * w32.c (init_environment): Likewise.
6342 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6343 * xdisp.c (syms_of_xdisp): Likewise.
6344 * xfns.c (syms_of_xfns): Likewise.
6345
6346 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6347
6348 Fast save_excursion_save and save_excursion_restore.
6349 * lisp.h (struct Lisp_Excursion): New data type.
6350 (PVEC_EXCURSION): New pseudovector type.
6351 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6352 to deal with it. Adjust comments.
6353 (init_marker, attach_marker): New prototype.
6354 (unchain_marker): Adjust prototype.
6355 * marker.c (attach_marker): Change to global.
6356 (init_marker): New function.
6357 * alloc.c (Fmake_marker, build_marker): Use it.
6358 (build_marker): More easserts.
6359 (mark_object): Handle struct Lisp_Excursion.
6360 * editfns.c (save_excursion_save, save_excursion_restore):
6361 Reimplement to use struct Lisp_Excursion. Add comments.
6362
6363 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6364
6365 Fix export of symbols to GDB (Bug#12036).
6366 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6367 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6368 emacs.c, as this is a more-suitable home. Had this been done earlier
6369 the fix for 12036 would have avoided some of the problems noted in
6370 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6371 would have been more obvious.
6372 * emacs.c: Do not include <verify.h>; no longer needed.
6373 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
6374 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6375 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6376 Remove; now done in lisp.h.
6377 * lisp.h (PUBLISH_TO_GDB): New macro.
6378 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6379 (DATA_SEG_BITS): Use it.
6380 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6381 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6382 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6383 not be usable in #if. This simplifies things.
6384
6385 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
6386
6387 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6388
6389 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6390
6391 Simplify export of symbols to GDB (Bug#12036).
6392 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6393 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6394 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6395 Adjust to changes in lisp.h and emacs.c, by using
6396 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6397 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6398 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6399 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6400 instead of gdb_valbits.
6401 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6402 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6403 instead of gdb_array_mark_flag.
6404 (xboolvector): Get size from $->size, not $->header.size.
6405 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6406 (xreload, hook-run, hookpost-run): Remove.
6407 * emacs.c: Include <verify.h>.
6408 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6409 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6410 Remove.
6411 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6412 (gdb_USE_LSB_TAG): New enum constants.
6413 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6414 Also define these as enum constants, so they're visible to GDB.
6415 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6416 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6417 as constants, so they're visible to GDB.
6418 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6419 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6420 Now enum constants, not macros, so they're visible to GDB.
6421 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6422 more convenient now. All uses changed.
6423 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6424 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6425
6426 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6427
6428 Explicitly free restriction data that are not needed anymore.
6429 * editfns.c (save_restriction_restore): Free restriction data.
6430
6431 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6432
6433 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6434 add argument, tune behavior, and adjust all callers.
6435
6436 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6437
6438 Use typedef for EMACS_INT, EMACS_UINT.
6439 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6440 than macros. This simplifies debugging in the usual case, since
6441 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6442 and it allows expressions involving EMACS_INT casts.
6443 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6444
6445 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6446
6447 * nsterm.m (ns_read_socket): Return early if there is a modal
6448 window (Bug#12043).
6449
6450 2012-07-25 Martin Rudalics <rudalics@gmx.at>
6451
6452 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6453 that FOCUS-FRAME can be omitted.
6454
6455 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 Adjust buffer text indirection counters at the end of Fkill_buffer.
6458 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6459 buffer is definitely dead. This should really fix an issue reported
6460 by Christoph Scholtes again. (Bug#12007).
6461 (init_buffer_once): Initialize indirection counters of
6462 buffer_defaults and buffer_local_symbols (for sanity and safety).
6463
6464 2012-07-24 Eli Zaretskii <eliz@gnu.org>
6465
6466 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6467 and continuation glyphs on tooltip frames, leave them at zero.
6468 Avoids continued lines in tooltips. (Bug#11832)
6469
6470 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6471
6472 Simplify copy_overlay.
6473 * buffer.c (copy_overlay): Simplify. Use build_marker.
6474 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6475
6476 2012-07-23 Eli Zaretskii <eliz@gnu.org>
6477
6478 * print.c (print_object): Don't crash when a frame's name is nil
6479 or invalid. (Bug#12025)
6480
6481 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6482 it signals an error when a tooltip frame is being created.
6483
6484 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6485
6486 Cleanup miscellaneous objects allocation and initialization.
6487 * alloc.c (allocate_misc): Change to static. Add argument to
6488 specify the subtype. Adjust comment and users.
6489 (build_overlay): New function.
6490 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6491 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6492 (allocate_misc): Remove prototype.
6493 (build_overlay): Add prototype.
6494
6495 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6496
6497 Swap buffer text indirection counters in Fbuffer_swap_text.
6498 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6499 This avoids crash reported by Christoph Scholtes at
6500 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6501
6502 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6503
6504 * nsmenu.m (Popdown_data): New struct.
6505 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6506 free Popdown_data.
6507 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6508 (initWithContentRect): Make imgView and contentView non-static
6509 and autorelease them. Also autorelease img and matrix (Bug#12005).
6510 (dealloc): Remove (Bug#12005).
6511
6512 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6513
6514 Adjust consing_since_gc when objects are explicitly freed.
6515 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6516 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6517 (free_cons, free_misc): Subtract object size from consing_since_gc.
6518
6519 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6520
6521 Simplify and cleanup markers positioning code.
6522 * marker.c (attach_marker): More useful eassert.
6523 (live_buffer, set_marker_internal): New function.
6524 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6525 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6526
6527 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6528
6529 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6530 as it's limited by the amount of memory, not by INT_MAX.
6531
6532 2012-07-21 Eli Zaretskii <eliz@gnu.org>
6533
6534 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6535 in special-event-map. See the discussion at
6536 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6537 for the reasons.
6538
6539 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
6540 info.dwItemData. Fixes crashes on 64-bit Windows.
6541 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
6542
6543 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6544
6545 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
6546 (conversationIdentifier): Return value is NSInteger.
6547 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
6548
6549 2012-07-21 Chong Yidong <cyd@gnu.org>
6550
6551 * window.c (decode_any_window): Signal an error if the window is
6552 on a dead frame (Bug#11984).
6553
6554 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6555
6556 Add indirection counting to speed up Fkill_buffer.
6557 * buffer.h (struct buffer): New member.
6558 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6559 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6560 base buffer indirection counter.
6561 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6562 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6563 through buffer list if indirection counter is 0.
6564
6565 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6566
6567 Extend the value returned by Fgarbage_collect with heap statistics.
6568 * alloc.c (Qheap): New symbol.
6569 (syms_of_alloc): DEFSYM it.
6570 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6571 (Fmemory_free): Remove.
6572 (syms_of_alloc): Don't defsubr it.
6573 * buffer.c (Fcompact_buffer): Remove.
6574 (syms_of_buffer): Don't defsubr it.
6575
6576 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6577
6578 Make maybe_gc inline.
6579 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6580 * lisp.h (consing_since_gc, gc_relative_threshold)
6581 (memory_full_cons_threshold): Revert declaration.
6582 (maybe_gc): Remove prototype, define as inline.
6583 * alloc.c: Remove old commented-out code.
6584 (consing_since_gc, gc_relative_threshold)
6585 (memory_full_cons_threshold): Revert to global.
6586 (maybe_gc): Remove.
6587
6588 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6589
6590 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6591 * lisp.h (build_unibyte_string): New function.
6592 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6593 * sysdep.c, w32fns.c, xfns.c: Use it.
6594 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6595 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6596 Adjust users accordingly.
6597 * font.h (font_open_by_name): Adjust prototype.
6598
6599 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6600
6601 Cleanup calls to Fgarbage_collect.
6602 * lisp.h (maybe_gc): New prototype.
6603 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6604 Remove declarations.
6605 * alloc.c (maybe_gc): New function.
6606 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6607 Make them static.
6608 * bytecode.c (MAYBE_GC): Use maybe_gc.
6609 * eval.c (eval_sub, Ffuncall): Likewise.
6610 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6611 to avoid dependency from auto-save feature.
6612
6613 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6616 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6617 'for_each_per_buffer_object_at'.
6618 All uses changed. It's better to use upper-case for macros that
6619 cannot be implemented as functions, to give the reader a clue
6620 that they're special.
6621
6622 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6623
6624 * alloc.c (Fgarbage_collect): Tweak docstring.
6625
6626 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6627
6628 Tweak the value returned from Fgarbage_collect again.
6629 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6630 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6631 Adjust documentation.
6632 (total_vector_bytes): Rename to total_vector_slots, adjust
6633 accounting.
6634 (total_free_vector_bytes): Rename to total_free_vector_slots,
6635 adjust accounting.
6636 (Qstring_bytes, Qvector_slots): New symbols.
6637 (syms_of_alloc): DEFSYM them.
6638
6639 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6640
6641 Buffer compaction primitive which may be used from Lisp.
6642 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6643 (syms_of_buffer): Register Fcompact_buffer.
6644 * alloc.c (Fgarbage_collect): Use compact_buffer.
6645 * buffer.h (compact_buffer): New prototype.
6646 (struct buffer_text): New member.
6647
6648 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6649
6650 New macro to iterate over all buffers, miscellaneous cleanups.
6651 * lisp.h (all_buffers): Remove declaration.
6652 * buffer.h (all_buffers): Add declaration, with comment.
6653 (for_each_buffer): New macro.
6654 * alloc.c (Fgarbage_collect, mark_object): Use it.
6655 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6656 (init_buffer): Likewise.
6657 * data.c (Fset_default): Likewise.
6658 * coding.c (code_conversion_restore): Remove redundant check
6659 for dead buffer.
6660 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6661
6662 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6663
6664 Fix bug that created negative-length intervals.
6665 * intervals.c (merge_interval_right, merge_interval_left):
6666 Do not zero out this interval if it is absorbed by its children,
6667 as this interval's total length doesn't change in that case. See
6668 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6669
6670 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6671
6672 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6673 when invoking (make-bool-vector N t) and N is a positive
6674 multiple of 8 -- the last 8 bits were mistakenly cleared.
6675
6676 Remove some struct layout assumptions in bool vectors.
6677 * alloc.c (bool_header_size): New constant.
6678 (header_size, word_size): Move earlier, as they're now used earlier.
6679 Use 'word_size' in a few more places, where it's appropriate.
6680 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6681 padding before the data member of a bool vector.
6682 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6683 than doing the check by hand with an abort ().
6684
6685 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6686
6687 * eval.c (Fdefvar): Don't check constants since we only set the var if
6688 it's not yet defined anyway (bug#11904).
6689
6690 * lisp.h (last_undo_boundary): Declare new var.
6691 * keyboard.c (command_loop_1): Set it.
6692 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6693 were auto-added by the command loop (bug#11774).
6694
6695 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6696
6697 * w32font.c (Qsymbol): Remove local definition.
6698 (syms_of_w32font): Don't DEFSYM it.
6699
6700 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6701
6702 Fix sweep_vectors to handle large bool vectors correctly.
6703 * alloc.c (sweep_vectors): Account total_vector_bytes for
6704 bool vectors larger than VBLOCK_BYTES_MAX.
6705
6706 2012-07-18 Chong Yidong <cyd@gnu.org>
6707
6708 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6709 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6710
6711 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6712
6713 Return more descriptive data from Fgarbage_collect.
6714 Suggested by Stefan Monnier in
6715 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6716 * alloc.c (bounded_number): New function.
6717 (total_buffers, total_vectors): New variable.
6718 (total_string_size): Rename to total_string_bytes, adjust users.
6719 (total_vector_size): Rename to total_vector_bytes, adjust users.
6720 (sweep_vectors): Account total_vectors and total_vector_bytes.
6721 (Fgarbage_collect): New return value. Adjust documentation.
6722 (gc_sweep): Account total_buffers.
6723 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6724 (VECTOR_SIZE): Remove.
6725 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6726 (Qinterval, Qmisc): New symbols.
6727 (syms_of_data): Initialize them.
6728 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6729 (Qcons, Qbuffer): New declarations.
6730
6731 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6732
6733 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6734 Round up, not down. Improve doc.
6735
6736 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6737
6738 Restore old code in allocate_string_data to avoid Faset breakage.
6739 Reported by Julien Danjou <julien@danjou.info> in
6740 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6741 * alloc.c (allocate_string_data): Restore old code with minor
6742 adjustments, fix comment to explain this subtle issue.
6743
6744 2012-07-17 Eli Zaretskii <eliz@gnu.org>
6745
6746 Remove FILE_SYSTEM_CASE.
6747 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6748
6749 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6750 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6751 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6752 call-process-region passes it through expand-file-name.
6753
6754 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6755
6756 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6757
6758 Fix crash when creating indirect buffer (Bug#11917)
6759 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6760 Don't handle unbound variables specially if non-zero.
6761 (Fbuffer_local_variables): Pass zero.
6762 (clone_per_buffer_values): Pass non-zero.
6763
6764 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6765
6766 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6767 to make the loop interruptible.
6768
6769 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6770
6771 * gnutls.c (emacs_gnutls_handshake): Only retry if
6772 GNUTLS_E_INTERRUPTED.
6773
6774 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6775
6776 Cleanup and convert miscellaneous checks to eassert.
6777 * alloc.c (mark_interval): Fix comment, partially rephrase
6778 old comment from intervals.h (see below).
6779 * intervals.c (find_interval, adjust_intervals_for_insertion)
6780 (delete_interval, adjust_intervals_for_deletion)
6781 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
6782 Convert to eassert.
6783 (adjust_intervals_for_insertion, make_new_interval):
6784 Remove obsolete and unused code.
6785 * intervals.h (struct interval): Remove obsolete comment.
6786 * textprotp.c (erase_properties): Remove unused code.
6787 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
6788 (Fremove_list_of_text_properties): Convert to eassert.
6789
6790 2012-07-17 Chong Yidong <cyd@gnu.org>
6791
6792 * editfns.c (Finsert_char): Doc fix.
6793
6794 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6795
6796 Fix previous change to make Fmemory_free always accurate.
6797 * alloc.c (make_interval): Update total_free_intervals.
6798 (make_float): Likewise for total_free_floats.
6799 (free_cons, Fcons): Likewise for total_free_conses.
6800 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
6801 Likewise for total_free_vector_bytes.
6802 (Fmake_symbol): Likewise for total_free_symbols.
6803 (bytes_free): Remove.
6804
6805 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6806
6807 Simple free memory accounting feature.
6808 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
6809 (sweep_vectors): Accumulate size of free vectors.
6810 (Fgarbage_collect): Setup bytes_free.
6811 (Fmemory_free): New function.
6812 (syms_of_alloc): Register it.
6813
6814 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6815
6816 Cleanup overlays checking.
6817 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
6818 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
6819 eassert and OVERLAYP.
6820 (sort_overlays): Change to use OVERLAYP.
6821
6822 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
6823
6824 * editfns.c (Finsert_char): Make it interactive, and make the
6825 second arg optional. Copy interactive spec and docstring from
6826 ucs-insert.
6827
6828 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6829
6830 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
6831 Unlike the other wrapped functions, fabs has an unspecified
6832 effect on errno.
6833
6834 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
6835
6836 * nsterm.m (keyDown): Interpret flags without left/right bits
6837 as the left key (Bug#11670).
6838
6839 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6840
6841 Remove empty and useless init functions.
6842 * lisp.h (init_character_once, init_fns, init_image)
6843 (init_filelock, init_sound): Remove prototype.
6844 * character.c (init_character_once): Remove.
6845 * filelock.c (init_filelock): Likewise.
6846 * fns.c (init_fns): Likewise.
6847 * image.c (init_image): Likewise.
6848 * sound.c (init_sound): Likewise.
6849 * emacs.c (main): Adjust accordingly.
6850
6851 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
6852
6853 * gtkutil.h: Tiny cleanups.
6854 (use_old_gtk_file_dialog): Remove useless declaration.
6855 (xg_uses_old_file_dialog): Add suggested const attribute.
6856
6857 2012-07-15 Eli Zaretskii <eliz@gnu.org>
6858
6859 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
6860 (bidi_paragraph_init): Use it to limit search forward for a strong
6861 directional character in abnormally large paragraphs full of
6862 neutral or weak characters. (Bug#11943)
6863
6864 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
6865
6866 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
6867 the toolbar (Bug#9451).
6868 (xg_make_tool_item): Give the widget event box a transparent
6869 background.
6870
6871 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6872
6873 Cleanup basic allocation variables and functions.
6874 * alloc.c (ignore_warnings, init_intervals, init_float)
6875 (init_cons, init_symbol, init_marker): Remove.
6876 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
6877 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
6878 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
6879 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
6880 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
6881 (staticidx, init_alloc_once, init_strings, free_ablock):
6882 Remove redundant initialization.
6883 * fns.c (init_weak_hash_tables): Remove.
6884 * lisp.h (init_weak_hash_tables): Remove prototype.
6885
6886 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
6887
6888 Use zero_vector where appropriate.
6889 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
6890 accordingly.
6891 * lisp.h (zero_vector): New declaration.
6892 * font.c (null_vector): Remove.
6893 (syms_of_font): Remove initialization and staticpro.
6894 (font_list_entities, font_find_for_lface): Change to use zero_vector.
6895 * keymap.c (Faccessible_keymaps): Likewise.
6896
6897 2012-07-15 Leo Liu <sdl.web@gmail.com>
6898
6899 * fringe.c: Fix typo in comments.
6900
6901 2012-07-14 Leo Liu <sdl.web@gmail.com>
6902
6903 * fringe.c: Add a new bitmap exclamation-mark.
6904
6905 2012-07-14 Eli Zaretskii <eliz@gnu.org>
6906
6907 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
6908
6909 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
6910 (HAVE_MENUS): Don't define, defined by editing config.in with
6911 msdos/sed2v2.inp.
6912 (GMALLOC_INHIBIT_VALLOC): Don't define.
6913 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6914
6915 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
6916
6917 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6918
6919 2012-07-14 Glenn Morris <rgm@gnu.org>
6920
6921 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6922 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6923 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6924
6925 2012-07-13 Glenn Morris <rgm@gnu.org>
6926
6927 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6928
6929 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6930 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6931
6932 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6933
6934 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6935 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6936 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6937 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6938 where appropriate.
6939 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6940 as boolean expression.
6941 (x_set_window_size): Remove unused variable toolbar.
6942 (ns_get_color_default, ns_mod_to_lisp): Remove.
6943 (ns_mouse_position): Remove unused variables xchar and ychar.
6944 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6945 (ns_set_vertical_scroll_bar): Remove unused variable count.
6946 (ns_delete_terminal): Remove unused variable i.
6947 (ns_term_init): Remove unused variables r, g and b.
6948 (mouseDown): Remove unused variable window.
6949 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6950 (initFrameFromEmacs): Remove unused variable vbextra.
6951 (mouseEntered): Remove unused variables p and dpyinfo.
6952 (mouseExited): Remove unused variables p and r.
6953 (ns_define_frame_cursor, ns_clear_frame_area)
6954 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6955 (menuDown): Assign [sender tag] to variable and cast the variable.
6956
6957 * nsterm.h (menuDown): Add id as type to argument sender.
6958 (ns_display_info_for_name): Add Lisp_Object argument.
6959 (ns_term_init): Add Lisp_Object argument.
6960 (ns_map_event_to_object): Add void argument.
6961 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6962 prototype with arguments and only declare if __OBJC__.
6963 (nxatoms_of_nsselect): Add void argument.
6964 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6965 (ns_alloc_autorelease_pool): Add void argument.
6966 (ns_release_autorelease_pool): Add void* argument.
6967 (ns_get_defaults_value): Add const char* argument.
6968
6969 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6970 (initFromContents): Use SSDATA where appropriate.
6971 (ns_update_menubar): Add braces to ambigous if-else.
6972 (initWithTitle): Put () around assignment in if statement.
6973 (ns_menu_show): Remove unused variables window and keymap.
6974 (update_frame_tool_bar): Remove unused variable selected_p.
6975 (initWithContentRect): Remove unused variable this_cmd_name.
6976
6977 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6978 appropriate.
6979 (setXBMColor): Remove unused variable len.
6980 (setPixmapData): Put () around assignment in loop statement.
6981
6982 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6983 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6984 where appropriate.
6985 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6986 around assignment in loop statement.
6987 (nsfont_open): Remove unused variable i.
6988 (nsfont_open): Remove unused variable len.
6989 (nsfont_draw): Remove unused variable cs.
6990
6991 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6992 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6993 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6994 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6995 (Fns_font_name, Fns_perform_service)
6996 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6997 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6998 (ns_set_name): Remove unused variable view.
6999 (x_set_menu_bar_lines): Remove unused variable olines.
7000 (x_set_tool_bar_lines): Remove unused variable root_window.
7001 (Fns_list_colors): Put () around assignment in while statement.
7002 (Fns_perform_service): Remove unused variable len.
7003 (Fns_display_usable_bounds): Remove unused variable top.
7004 (syms_of_nsfns): Remove unused variable i.
7005
7006 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7007 memcpy (Bug#11907).
7008
7009 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
7010
7011 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7012 and free it with DestroyExceptionInfo (Bug#11558).
7013
7014 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
7015
7016 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7017 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7018 Set here, not in nt/config.nt.
7019
7020 2012-07-13 Eli Zaretskii <eliz@gnu.org>
7021
7022 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7023 cursor overflow into the last glyph on display line when the right
7024 fringe is off. (Bug#11832)
7025
7026 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7027
7028 * xdisp.c (produce_special_glyphs): Now static.
7029 * dispextern.h (produce_special_glyphs): Remove decl.
7030
7031 2012-07-13 Glenn Morris <rgm@gnu.org>
7032
7033 * s/bsd-common.h, s/cygwin.h: Remove empty files.
7034 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7035
7036 * s/usg5-4-common.h (USG, USG5):
7037 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7038 * s/sol2-6.h (SOLARIS2):
7039 * s/irix6-5.h (IRIX6_5):
7040 * s/hpux10-20.h (USG, USG5, HPUX):
7041 * s/gnu-linux.h (USG, GNU_LINUX):
7042 * s/freebsd.h (BSD_SYSTEM):
7043 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7044 * s/cygwin.h (CYGWIN):
7045 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7046 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7047
7048 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
7049
7050 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
7051
7052 2012-07-13 Glenn Morris <rgm@gnu.org>
7053
7054 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7055
7056 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7057
7058 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7059 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7060
7061 2012-07-12 Glenn Morris <rgm@gnu.org>
7062
7063 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
7064
7065 * process.c (init_process_emacs): Rename from init_process.
7066 The old name is also the name of a Mach system call.
7067 * lisp.h, emacs.c: Update for this name change.
7068 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7069 longer needed.
7070
7071 2012-07-12 Eli Zaretskii <eliz@gnu.org>
7072
7073 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7074 memmove call that removes glyphs covered by the left truncation
7075 glyph. Improve commentary.
7076 (display_line): Fix display of continuation glyphs on GUI frames
7077 when the right fringe is turned off and variable-size fonts are
7078 used in the window. Move the code that appends a stretch glyph to
7079 produce_special_glyphs, so that it could be used for truncation
7080 and continuation glyphs alike.
7081 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7082 glyph of a suitably computed width, to align the special glyphs at
7083 the window margin. Code moved from display_line. (Bug#11832)
7084
7085 2012-07-12 Glenn Morris <rgm@gnu.org>
7086
7087 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7088
7089 * s/gnu-linux.h, s/hpux10-20.h:
7090 Do not unconditionally define HAVE_XRMSETDATABASE.
7091
7092 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7093
7094 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7095
7096 Fix typos that broke OS X build.
7097 Reported by Randal L. Schwartz in
7098 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7099 * nsterm.m (ns_timeout): Add missing local decl.
7100 (ns_get_color): snprintf -> sprintf, to fix typo.
7101
7102 2012-07-12 Glenn Morris <rgm@gnu.org>
7103
7104 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7105 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7106 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7107 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7108
7109 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7110 Move PTY_OPEN to configure.
7111
7112 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7113 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7114 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7115
7116 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7117
7118 Use empty_unibyte_string where applicable.
7119 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7120 * lread.c (read1): Likewise.
7121 * xsettings.c (syms_of_xsettings): Likewise.
7122
7123 2012-07-12 Glenn Morris <rgm@gnu.org>
7124
7125 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7126 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7127 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7128 * s/hpux10-20.h (RUN_TIME_REMAP):
7129 * s/bsd-common.h (TABDLY): Move to configure.
7130
7131 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7132
7133 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7134
7135 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7136 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
7137
7138 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
7139
7140 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7141 * s/template.h: Move NARROWPROTO to configure.
7142
7143 2012-07-11 Glenn Morris <rgm@gnu.org>
7144
7145 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7146 unused since 2011-01-17 change to systty.h.
7147
7148 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7149 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7150 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7151
7152 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7153
7154 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7155
7156 2012-07-11 Glenn Morris <rgm@gnu.org>
7157
7158 * s/darwin.h, s/gnu-linux.h, s/template.h:
7159 Move INTERRUPT_INPUT to configure.
7160
7161 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7162
7163 Minor adjustments to interning code.
7164 * lisp.h (intern, intern_c_string): Redefine as static inline
7165 wrappers for intern_1 and intern_c_string_1, respectively.
7166 (intern_1, intern_c_string_1): Rename prototypes.
7167 * lread.c (intern_1, intern_c_string_1, oblookup):
7168 Simplify Vobarray checking.
7169 * font.c (font_intern_prop): Likewise. Adjust comment.
7170 * w32font.c (intern_font_name): Likewise.
7171
7172 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7173
7174 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7175
7176 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7177 of Fcar/Fcdr if possible.
7178 * font.c (check_otf_features): Likewise.
7179 * fontset.c (Fnew_fontset): Likewise.
7180 * gnutls.c (Fgnutls_boot): Likewise.
7181 * minibuf.c (read_minibuf): Likewise.
7182 * msdos.c (IT_set_frame_parameters): Likewise.
7183 * xmenu.c (Fx_popup_dialog): Likewise.
7184 * w32menu.c (Fx_popup_dialog): Likewise.
7185
7186 2012-07-11 Glenn Morris <rgm@gnu.org>
7187
7188 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7189 since nothing has defined it on these platforms.
7190
7191 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7192 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7193
7194 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7195 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7196 Move CLASH_DETECTION to configure.
7197
7198 * s/gnu.h: Remove file, which is now empty.
7199
7200 * s/gnu.h, s/gnu-linux.h:
7201 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7202
7203 2012-07-11 John Wiegley <johnw@newartisans.com>
7204
7205 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7206 function attribute, so we only use it if it exists in the
7207 compiler.
7208
7209 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7210
7211 Avoid call to strlen in fast_c_string_match_ignore_case.
7212 * search.c (fast_c_string_match_ignore_case): Change to use
7213 length argument. Adjust users accordingly.
7214 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7215
7216 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7217
7218 Assume mkdir, rmdir.
7219 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7220 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7221
7222 Assume rename.
7223 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7224
7225 Assume perror.
7226 * s/hpux10-20.h (HAVE_PERROR): Remove.
7227 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7228 Remove dummy definition, as this problem was obsolete long ago.
7229
7230 Assume strerror.
7231 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7232
7233 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7234
7235 Avoid calls to strlen in font processing functions.
7236 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
7237 (font_open_by_name): Change to use length argument.
7238 Adjust users accordingly.
7239 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7240 Adjust prototypes.
7241 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7242 Change to return ptrdiff_t.
7243 (xfont_list_pattern, xfont_match): Use length returned by
7244 xfont_decode_coding_xlfd.
7245 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7246
7247 2012-07-11 Glenn Morris <rgm@gnu.org>
7248
7249 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7250 Move DONT_REOPEN_PTY to configure.
7251
7252 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7253 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7254
7255 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 Remove "#define unix" that is no longer needed (Bug#11905).
7258 * s/aix4-2.h (unix): Remove; no longer needed.
7259
7260 EMACS_TIME simplification (Bug#11875).
7261 This replaces macros (which typically do not work in GDB)
7262 with functions, typedefs and enums, making the code easier to debug.
7263 The functional style also makes code easier to read and maintain.
7264 * systime.h: Include <sys/time.h> on all hosts, not just if
7265 WINDOWSNT, since 'struct timeval' is needed in general.
7266 (EMACS_TIME): Now a typedef, not a macro.
7267 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7268 not macros.
7269 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7270 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7271 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7272 (EMACS_TIME_LE): Now functions, not macros.
7273 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7274 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7275 which are not functions. All uses rewritten to use:
7276 (make_emacs_time): New function.
7277 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7278 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7279 not functions. All uses rewritten to use the following, respectively:
7280 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7281 (add_emacs_time, sub_emacs_time): New functions.
7282 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
7283 * fileio.c (Fcopy_file):
7284 * xterm.c (XTflash): Get the current time closer to when it's used.
7285 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7286
7287 * bytecode.c (targets): Suppress -Woverride-init warnings.
7288
7289 Simplify by avoiding confusing use of strncpy etc.
7290 * doc.c (Fsnarf_documentation):
7291 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7292 * frame.c (Fmake_terminal_frame):
7293 * gtkutil.c (get_utf8_string):
7294 * lread.c (openp):
7295 * nsmenu.m (ns_update_menubar):
7296 * regex.c (regerror):
7297 Prefer memcpy to strncpy and strncat when either will do.
7298 * fileio.c (Fsubstitute_in_file_name):
7299 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7300 (menu_separator_name_p):
7301 * nsmenu.m (ns_update_menubar):
7302 Prefer memcmp to strncmp when either will do.
7303 * nsterm.m: Include <ftoastr.h>.
7304 (ns_get_color):
7305 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7306 Prefer snprintf to strncpy.
7307 * nsterm.m (ns_term_init):
7308 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7309 * nsterm.m (ns_term_init):
7310 Avoid the need for strncpy, by using build_string or
7311 make_unibyte_string directly. Use dtoastr, not snprintf.
7312 * process.c (Fmake_network_process): Diagnose service names that
7313 are too long, rather than silently truncating them or creating
7314 non-null-terminated names.
7315 (Fnetwork_interface_info): Likewise, for interface names.
7316 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7317 Prefer sprintf to strncat.
7318 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7319 Prefer vsnprintf to vsprintf + strncpy.
7320
7321 2012-07-10 Glenn Morris <rgm@gnu.org>
7322
7323 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7324 Clarify fallback case.
7325
7326 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7327
7328 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7329 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7330 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
7331 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7332 where argument type is known to be a Lisp_Cons.
7333
7334 2012-07-10 Tom Tromey <tromey@redhat.com>
7335
7336 * bytecode.c (BYTE_CODE_THREADED): New macro.
7337 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7338 (enum byte_code_op): New type.
7339 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7340 (exec_byte_code): Use them. Use token threading when applicable.
7341
7342 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7343
7344 Optimize pure C strings initialization.
7345 * lisp.h (make_pure_string): Fix prototype.
7346 (build_pure_c_string): New function, defined as static inline. This
7347 provides a better opportunity to optimize away calls to strlen when
7348 the function is called with compile-time constant argument.
7349 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7350 argument, adjust users accordingly. Use build_pure_c_string where
7351 appropriate.
7352 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7353 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7354 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7355
7356 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7357
7358 Avoid calls to strlen in miscellaneous functions.
7359 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7360 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7361 * lread.c (openp): Likewise.
7362
7363 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7364
7365 Avoid calls to strlen in path processing functions.
7366 * fileio.c (file_name_as_directory): Add comment. Change to add
7367 srclen argument and return the length of result. Adjust users
7368 accordingly.
7369 (directory_file_name): Fix comment. Change to add srclen argument,
7370 swap 1st and 2nd arguments to obey the common convention.
7371 Adjust users accordingly.
7372 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7373
7374 2012-07-10 Glenn Morris <rgm@gnu.org>
7375
7376 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7377 Move PENDING_OUTPUT_COUNT definition to configure.
7378
7379 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7380 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7381 * s/gnu.h (DATA_START): Move definitions to configure.
7382
7383 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7384 We include usg5-4-common.h, which defines them both.
7385
7386 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7387 O_RDONLY already includes it).
7388
7389 Stop ns builds setting the EMACSLOADPATH environment variable.
7390 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7391 Now it does not set EMACSLOADPATH, just returns the load-path string.
7392 * nsterm.h: Update accordingly.
7393 * lread.c [HAVE_NS]: Include nsterm.h.
7394 (init_lread) [HAVE_NS]: Use ns_load_path.
7395 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7396
7397 2012-07-09 Glenn Morris <rgm@gnu.org>
7398
7399 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7400 since the included bsd-common.h does so.
7401
7402 Stop ns builds setting the EMACSPATH environment variable.
7403 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7404 (ns_init_paths): Do not set EMACSPATH.
7405 * nsterm.h (ns_exec_path): Add it.
7406 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7407 Use ns_exec_path.
7408
7409 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7410
7411 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 * process.c (wait_reading_process_output): 'waitchannels' was unset
7414 when read_kbd || !NILP (wait_for_cell); fix this.
7415
7416 Add GCC-style 'const' attribute to functions that can use it.
7417 * character.h (char_resolve_modifier_mask):
7418 * keyboard.h (make_ctrl_char):
7419 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7420 (init_character_once, next_almost_prime, init_fns, init_image)
7421 (flush_pending_output, init_sound):
7422 * mem-limits.h (start_of_data):
7423 * menu.h (finish_menu_items):
7424 Add ATTRIBUTE_CONST.
7425 * emacs.c (DEFINE_DUMMY_FUNCTION):
7426 Declare the dummy function with ATTRIBUTE_CONST.
7427 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7428 Add decls with ATTRIBUTE_CONST.
7429
7430 Minor improvements to make_formatted_string.
7431 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7432 where int is good enough, as vsprintf returns an int.
7433 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7434
7435 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7436
7437 Use make_formatted_string to avoid double length calculation.
7438 * lisp.h (make_formatted_string): New prototype.
7439 * alloc.c (make_formatted_string): New function.
7440 * buffer.c (Fgenerate_new_buffer_name): Use it.
7441 * dbusbind.c (syms_of_dbusbind): Likewise.
7442 * editfns.c (Fcurrent_time_zone): Likewise.
7443 * filelock.c (get_boot_time): Likewise.
7444 * frame.c (make_terminal_frame, set_term_frame_name)
7445 (x_report_frame_params): Likewise.
7446 * image.c (gs_load): Likewise.
7447 * minibuf.c (get_minibuffer): Likewise.
7448 * msdos.c (dos_set_window_size): Likewise.
7449 * process.c (make_process): Likewise.
7450 * xdisp.c (ensure_echo_area_buffers): Likewise.
7451 * xsettings.c (apply_xft_settings): Likewise.
7452
7453 2012-07-09 Glenn Morris <rgm@gnu.org>
7454
7455 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7456 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7457 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7458 * nsterm.h (ns_etc_directory): Add it.
7459 * callproc.c [HAVE_NS]: Include nsterm.h.
7460 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7461
7462 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7463
7464 Move marker debugging code under MARKER_DEBUG.
7465 * marker.c (MARKER_DEBUG): Move marker debugging code under
7466 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7467 for bootstrap with --enable-checking (~3x slowdown reported
7468 by Juanma Barranquero <lekktu@gmail.com>).
7469 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7470
7471 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7474 See <http://bugs.gnu.org/11825#29>.
7475
7476 2012-07-08 Eli Zaretskii <eliz@gnu.org>
7477
7478 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7479 has no font, use the frame's font. (Bug#11813)
7480 (display_line): Add commentary about displaying truncation glyphs
7481 on GUI frames.
7482 (produce_special_glyphs): Move here from term.c.
7483
7484 * term.c (produce_special_glyphs): Move to xdisp.c.
7485
7486 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7487 section.
7488
7489 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7490
7491 * xdisp.c (display_line): Avoid warning about implicit declaration
7492 of FRAME_FONT.
7493
7494 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7495
7496 * lisp.h: Remove empty conditional.
7497
7498 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7499
7500 * lread.c (load_path_check): Now static.
7501
7502 Fix some minor --with-ns problems found by static checking.
7503 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7504 (x_set_font) [!HAVE_X_WINDOWS]:
7505 * image.c (xpm_load_image) [HAVE_NS]:
7506 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7507 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7508 Remove unused local.
7509 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7510 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7511 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7512 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7513 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7514 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7515 Fix pointer signedness problem.
7516 * xfaces.c (FRAME_X_FONT_TABLE):
7517 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7518
7519 2012-07-07 Glenn Morris <rgm@gnu.org>
7520
7521 * lread.c (load_path_check): New function, split from init_lread.
7522 (init_lread): Reorganize. Motivation:
7523 If EMACSLOADPATH is set, check/warn about that rather than the
7524 defaults, which we are not going to use. Hence we can remove
7525 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7526 Don't warn if site-lisp directories are missing.
7527 If not installed, start from a blank load-path, since
7528 PATH_LOADSEARCH refers to the eventual installation directories.
7529
7530 2012-07-07 Eli Zaretskii <eliz@gnu.org>
7531
7532 Support truncation and continuation glyphs on GUI frames, when
7533 fringes are disabled. (Bug#11832)
7534 * xdisp.c (init_iterator): Get dimensions of truncation and
7535 continuation glyphs even if on GUI frames.
7536 Adjust it->last_visible_x on GUI frames when the left or right fringes,
7537 or both, are absent.
7538 (start_display, move_it_in_display_line_to): Handle the case of a
7539 GUI frame without a fringe to display continuation or truncation
7540 glyphs.
7541 (insert_left_trunc_glyphs): Support GUI frames: make sure
7542 truncation glyphs overwrite enough glyphs from the current line to
7543 have sufficient space in pixels.
7544 (display_line): Support truncation and continuation glyphs on GUI
7545 frames. If some spare pixels are left on the line after inserting
7546 the truncation glyphs, fill that space with a stretch glyph of a
7547 suitably computed width.
7548
7549 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7550 produce_glyphs, to support GUI sessions.
7551
7552 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7553
7554 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7555
7556 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7557
7558 Do not require float-time's arg to fit in time_t (Bug#11825).
7559 This works better on hosts where time_t is unsigned, and where
7560 float-time is applied to the (negative) difference between two times.
7561 * editfns.c (decode_time_components): Last arg is now double *,
7562 not int *, and means to store all the result as a double, without
7563 worrying about whether the seconds part fits in time_t.
7564 All callers changed.
7565 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7566 All callers changed.
7567 (Ffloat_time): Do not fail merely because the specified time falls
7568 outside of time_t range.
7569
7570 2012-07-07 Glenn Morris <rgm@gnu.org>
7571
7572 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7573 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7574 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7575
7576 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
7577
7578 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7579 Update dependencies.
7580
7581 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7582
7583 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7584
7585 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7586 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7587 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7588 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7589 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7590 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7591
7592 * xfont.c (compare_font_names): Redo to omit the need for casts.
7593
7594 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7595
7596 * xfns.c (Fx_change_window_property): Doc fix.
7597 * w32fns.c (Fx_change_window_property): Doc fix.
7598
7599 * w32fns.c (Fx_window_property): Accept the same arguments as the
7600 X Windows version. Doc fix.
7601 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7602
7603 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
7604 Eli Zaretskii <eliz@gnu.org>
7605
7606 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7607 Windows-specific code from nt/config.nt moved here.
7608 Obsolete settings removed.
7609
7610 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 * process.c: Avoid unnecessary calls to gettime.
7613 (wait_reading_process_output): Don't get the time of day
7614 when gobbling data immediately and not waiting, as there's no need
7615 for it in that case. This removes a FIXME.
7616
7617 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7618
7619 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7620 is defined (Bug#11768).
7621
7622 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7623
7624 Fix marker debugging code.
7625 * marker.c (byte_char_debug_check): Do not perform the check
7626 if buffer is not multibyte.
7627 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7628 Call byte_char_debug_check with correct arguments.
7629
7630 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7631
7632 Compile marker debugging code only if ENABLE_CHECKING is defined.
7633 * marker.c (byte_char_debug_check, count_markers):
7634 Use only if ENABLE_CHECKING is defined.
7635 (byte_debug_flag): Remove.
7636 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7637 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7638
7639 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7640
7641 Avoid code repetition in marker-related functions.
7642 * marker.c (attach_marker): New function.
7643 (Fset_marker, set_marker_restricted, set_marker_both)
7644 (set_marker_restricted_both): Use it.
7645 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7646 Consistently rename charno to charpos.
7647 (marker_position): Add eassert.
7648 (marker_byte_position): Convert to eassert.
7649
7650 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7651
7652 Simplify list operations in unchain_overlay and unchain_marker.
7653 * buffer.c (unchain_overlay): Simplify. Add comment.
7654 * marker.c (unchain_marker): Simplify. Fix comments.
7655
7656 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7657
7658 Introduce fast path for the widely used marker operation.
7659 * alloc.c (build_marker): New function.
7660 * lisp.h (build_marker): New prototype.
7661 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7662 * composite.c (autocmp_chars): Likewise.
7663 * editfns.c (buildmark): Remove.
7664 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7665 (save_restriction_save): Use build_marker.
7666 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7667 * window.c (save_window_save): Likewise.
7668
7669 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7670
7671 Do not use Fdelete_overlay in delete_all_overlays
7672 to avoid redundant calls to unchain_overlay.
7673 * buffer.c (drop_overlay): New function.
7674 (delete_all_overlays, Fdelete_overlay): Use it.
7675 * minibuf.c (get_minibuffer): Fix comment.
7676
7677 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7678
7679 Port to OpenBSD 5.1 amd64.
7680 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7681 This is needed for OpenBSD, and should be harmless on all BSD systems.
7682 Also, include <sys/sysctl.h>, as it should be available on all
7683 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7684 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7685 use p_pid member, not kp_proc.pid.
7686
7687 2012-07-06 Glenn Morris <rgm@gnu.org>
7688
7689 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7690
7691 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7692
7693 More xmalloc and related cleanup.
7694 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7695 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7696 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7697 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7698 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7699 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7700 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7701 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7702 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7703 * xterm.c:
7704 Omit needless casts involving void * pointers and allocation.
7705 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7706 as the former is more robust if P's type is changed.
7707 Prefer xzalloc to xmalloc + memset 0.
7708 Simplify malloc-or-realloc to realloc.
7709 Don't worry about xmalloc returning a null pointer.
7710 Prefer xstrdup to xmalloc + strcpy.
7711 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7712 growing it.
7713 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7714 alloca of a constant.
7715
7716 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7717
7718 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7719 hscroll is larger than the line width. Fixes long and futile
7720 looping inside extend_face_to_end_of_line (on a TTY) producing
7721 glyphs that are not needed and thrown away.
7722
7723 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7724
7725 * marker.c (set_marker_restricted_both): Simplify by using
7726 clip_to_bounds.
7727
7728 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7729
7730 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7731
7732 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7733
7734 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7735 not defined (Bug#11768).
7736 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7737 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7738 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7739 followed by gtk_box_set_homogeneous (Bug#11768).
7740 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
7741 (update_theme_scrollbar_width, xg_create_scroll_bar):
7742 Use gtk_scrollbar_new (Bug#11768).
7743 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7744 (is_box_type): New function (Bug#11768).
7745 (xg_tool_item_stale_p): Call is_box_type.
7746 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
7747 with default display (Bug#11768).
7748
7749 2012-07-05 Eli Zaretskii <eliz@gnu.org>
7750
7751 * xdisp.c (window_hscroll_limited): New function.
7752 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7753 coordinates when window's hscroll is set to insanely large
7754 values. (Bug#11857)
7755
7756 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
7757
7758 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7759 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7760
7761 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7762
7763 Cleanup xmalloc.
7764 * lisp.h (xzalloc): New prototype. Omit needless casts.
7765 * alloc.c (xzalloc): New function. Omit needless casts.
7766 * charset.c: Omit needless casts. Convert all calls to
7767 xmalloc with following memset to xzalloc.
7768 * dispnew.c: Likewise.
7769 * fringe.c: Likewise.
7770 * image.c: Likewise.
7771 * sound.c: Likewise.
7772 * term.c: Likewise.
7773 * w32fns.c: Likewise.
7774 * w32font.c: Likewise.
7775 * w32term.c: Likewise.
7776 * xfaces.c: Likewise.
7777 * xfns.c: Likewise.
7778 * xterm.c: Likewise.
7779 * atimer.c: Omit needless casts.
7780 * buffer.c: Likewise.
7781 * callproc.c: Likewise.
7782 * ccl.c: Likewise.
7783 * coding.c: Likewise.
7784 * composite.c: Likewise.
7785 * doc.c: Likewise.
7786 * doprnt.c: Likewise.
7787 * editfns.c: Likewise.
7788 * emacs.c: Likewise.
7789 * eval.c: Likewise.
7790 * filelock.c: Likewise.
7791 * fns.c: Likewise.
7792 * gtkutil.c: Likewise.
7793 * keyboard.c: Likewise.
7794 * lisp.h: Likewise.
7795 * lread.c: Likewise.
7796 * minibuf.c: Likewise.
7797 * msdos.c: Likewise.
7798 * print.c: Likewise.
7799 * process.c: Likewise.
7800 * region-cache.c: Likewise.
7801 * search.c: Likewise.
7802 * sysdep.c: Likewise.
7803 * termcap.c: Likewise.
7804 * terminal.c: Likewise.
7805 * tparam.c: Likewise.
7806 * w16select.c: Likewise.
7807 * w32.c: Likewise.
7808 * w32reg.c: Likewise.
7809 * w32select.c: Likewise.
7810 * w32uniscribe.c: Likewise.
7811 * widget.c: Likewise.
7812 * xdisp.c: Likewise.
7813 * xmenu.c: Likewise.
7814 * xrdb.c: Likewise.
7815 * xselect.c: Likewise.
7816
7817 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7818
7819 * fileio.c (time_error_value): Check the right error number.
7820 Problem reported by Troels Nielsen in
7821 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
7822
7823 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7824
7825 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
7826 This should be fixed in a better way; see Eli Zaretskii in
7827 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
7828 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
7829
7830 * fileio.c (time_error_value): Rename from special_mtime.
7831 The old name's problems were noted by Eli Zaretskii in
7832 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
7833
7834 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
7835 This variable's comment says Emacs needs at least one GDB-visible
7836 symbol of type enum pvec_type, to work around GDB problems.
7837 The symbol's value doesn't matter.
7838
7839 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
7840 that causes compilation to fail on pre-C99 compilers.
7841
7842 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
7843
7844 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
7845 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
7846
7847 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7848
7849 * buffer.c (init_buffer_once): Fix initialization of
7850 headers for buffer_defaults and buffer_local_symbols.
7851 Reported by Juanma Barranquero <lekktu@gmail.com>.
7852
7853 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7854
7855 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
7856 * lisp.h (enum pvec_type): Use fewer bits.
7857 (PSEUDOVECTOR_SIZE_BITS): New constant.
7858 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
7859 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
7860 change in pvec_type.
7861 (PSEUDOVECTOR_TYPEP): New macro.
7862 (TYPED_PSEUDOVECTORP): Use it.
7863 * fns.c (internal_equal): Adapt code to extract pvectype.
7864 * emacs.c (gdb_pvec_type): Update type.
7865 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
7866 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
7867 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
7868 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
7869 (sweep_vectors): Use it. Use local var `total_bytes' instead of
7870 abusing vector->header.next.nbytes.
7871 (live_vector_p): Use PVEC_TYPE.
7872 (mark_object): Adapt code to extract pvectype. Use switch.
7873
7874 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7875
7876 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
7877 Tighten new eassert a bit.
7878
7879 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7880
7881 Fix compilation with --enable-gcc-warnings and -O1
7882 optimization level.
7883 * doprnt.c (doprnt): Change type of tem to int, initialize
7884 to avoid compiler warning. Add eassert.
7885 * search.c (simple_search): Initialize match_byte to avoid
7886 compiler warning. Add eassert.
7887
7888 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 Avoid weird behavior with large horizontal scrolls.
7891 Without this change, for example, large hscroll values would
7892 mess up Emacs's display on Fedora 15 x86, presumably due to
7893 overflows in int calculations in the display code.
7894 Also, if buffers had long lines, Emacs would freeze.
7895 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
7896 (set_window_hscroll): New function, containing the old guts of
7897 Fset_window_hscroll. Return the clipped value.
7898 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
7899 This avoids the need to check against PTRDIFF_MAX.
7900
7901 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
7902
7903 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
7904
7905 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
7906
7907 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
7910 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
7911 since GCC 4.4.6 issues a bogus warning for them.
7912
7913 Fix bugs in file timestamp newness comparisons.
7914 * fileio.c (Ffile_newer_than_file_p):
7915 * lread.c (Fload): Use full timestamp resolution of files,
7916 not just the 1-second resolution, so that files that are only
7917 slightly newer still count as newer.
7918 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7919 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7920
7921 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7922
7923 * fileio.c: Improve handling of file time marker. (Bug#11852)
7924 (special_mtime): New function.
7925 (Finsert_file_contents, Fverify_visited_file_modtime):
7926 Use it to set special mtime values consistently.
7927
7928 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7929
7930 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7931 marker for non-existing file. (Bug#11852)
7932
7933 2012-07-03 Glenn Morris <rgm@gnu.org>
7934
7935 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7936 and did not make it into globals.h).
7937
7938 2012-07-03 Tom Tromey <tromey@redhat.com>
7939
7940 * window.c (Fset_window_margins, Fset_window_fringes)
7941 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7942 * textprop.c (Fprevious_property_change): No longer static.
7943 * syntax.c (Fsyntax_table_p): No longer static.
7944 * process.c (Fget_process, Fprocess_datagram_address): No longer
7945 static.
7946 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7947 * keyboard.c (Fcommand_execute): No longer static.
7948 Remove EXFUN.
7949 * insdel.c (Fcombine_after_change_execute): No longer static.
7950 * image.c (Finit_image_library): No longer static.
7951 * fileio.c (Fmake_symbolic_link): No longer static.
7952 * eval.c (Ffetch_bytecode): No longer static.
7953 * editfns.c (Fuser_full_name): No longer static.
7954 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7955 No longer static.
7956 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7957 static.
7958 * dired.c (Ffile_attributes): No longer static.
7959 * composite.c (Fcomposition_get_gstring): No longer static.
7960 * callproc.c (Fgetenv_internal): No longer static.
7961
7962 * ccl.h: Remove EXFUNs.
7963 * buffer.h: Remove EXFUNs.
7964 * dispextern.h: Remove EXFUNs.
7965 * intervals.h: Remove EXFUNs.
7966 * fontset.h: Remove EXFUN.
7967 * font.h: Remove EXFUNs.
7968 * dosfns.c (system_process_attributes): Remove EXFUN.
7969 * keymap.h: Remove EXFUNs.
7970 * lisp.h: Remove EXFUNs.
7971 * w32term.h: Remove EXFUNs.
7972 * window.h: Remove EXFUNs.
7973 * xsettings.h: Remove EXFUN.
7974 * xterm.h: Remove EXFUN.
7975
7976 2012-07-03 Glenn Morris <rgm@gnu.org>
7977
7978 * lisp.h (Frandom): Make it visible to C.
7979 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7980 buffer for invisible buffers. (Bug#1229)
7981
7982 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7983
7984 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7985 values which aren't power of 2.
7986 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
7987 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
7988 accordingly.
7989
7990 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7991
7992 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7993
7994 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7995
7996 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7997
7998 * alloc.c (allocate_vector_block): Remove redundant
7999 calls to mallopt if DOUG_LEA_MALLOC is defined.
8000 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8001 avoid calls to mallopt if zero_vector is returned.
8002
8003 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8004
8005 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8006 is enabled, avoid dereferencing NULL current_sblock if
8007 running undumped.
8008
8009 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8010
8011 Cleanup basic buffer management.
8012 * buffer.h (struct buffer): Change layout to use generic vector
8013 marking code. Fix some comments. Change type of 'clip_changed'
8014 to bitfield. Remove unused #ifndef old.
8015 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8016 (GET_OVERLAYS_AT): Fix indentation.
8017 (for_each_per_buffer_object_at): New macro.
8018 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8019 (Fbuffer_local_variables): Use it.
8020 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8021 * alloc.c (allocate_buffer): Adjust to match new layout of
8022 struct buffer. Fix comment.
8023 (mark_overlay): New function.
8024 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8025 Lisp area of struct buffer.
8026 (mark_object): Use it. Adjust marking of misc objects
8027 and related comments.
8028
8029 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8030
8031 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8032 wrapper that is not needed because the wrapped code is a no-op (zero
8033 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8034 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8035
8036 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8037
8038 * alloc.c (mark_buffer): Simplify. Remove prototype.
8039 (mark_object): Add comment. Reorganize marking of vector-like
8040 objects. Use CHECK_LIVE for all vector-like objects except buffers
8041 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8042 Avoid redundant calls to mark_vectorlike for bool vectors.
8043
8044 2012-06-30 Glenn Morris <rgm@gnu.org>
8045
8046 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8047
8048 * epaths.in (PATH_SITELOADSEARCH): New.
8049 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8050 This is rather than relying on --enable-locallisppath elements
8051 having "site-lisp" in their names. (Bug#10208#25, 11658)
8052
8053 2012-06-30 Eli Zaretskii <eliz@gnu.org>
8054
8055 * w32proc.c (sys_select): Accept and ignore one more argument.
8056
8057 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8058
8059 * sysselect.h [DOS_NT]: Don't include sys/select.h.
8060 (pselect) [!MS_DOS]: Redirect to sys_select.
8061
8062 * sysdep.c: Don't include dos.h and dosfns.h.
8063
8064 * process.c (sys_select):
8065 * msdos.c (sys_select): Accept one more argument and ignore it.
8066
8067 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8068 adapt data types and code to that.
8069
8070 * dosfns.c:
8071 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8072 which clashes with the gnulib function of the same name.
8073
8074 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8075
8076 * font.c (font_style_to_value, font_style_symbolic)
8077 (font_prop_validate_style): Add type checks for values in
8078 font_style_table.
8079
8080 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8081 argument.
8082 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8083 uses.
8084
8085 2012-06-29 Eli Zaretskii <eliz@gnu.org>
8086
8087 * xdisp.c (try_window_id): Undo last change.
8088
8089 * w32.c (getwd): Adjust commentary about startup_dir.
8090 (init_environment): Always call sys_access, even in non-MSVC
8091 builds. Don't chdir to the directory of the Emacs executable.
8092 This undoes code from 1997 which was justified by the need to
8093 "avoid conflicts when removing and renaming directories". But its
8094 downside was that every relative file name was being interpreted
8095 relative to the directory of the Emacs executable, which can never
8096 be TRT. In particular, it broke sys_access when called with
8097 relative file names.
8098 (sys_access): Map GetLastError to errno.
8099
8100 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8101
8102 * window.h (struct window): Change type of 'fringes_outside_margins'
8103 to bitfield. Fix comment. Adjust users accordingly.
8104 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
8105 Adjust comment.
8106 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8107 to ptrdiff_t.
8108
8109 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
8110
8111 * gnutls.c (emacs_gnutls_handshake):
8112 Add QUIT to make the loop interruptible.
8113
8114 2012-06-29 Glenn Morris <rgm@gnu.org>
8115
8116 * charset.c (init_charset): Make lack of etc/charsets fatal.
8117
8118 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8119
8120 * editfns.c (region_limit): Fix type mismatch.
8121
8122 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8123
8124 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8125 undefined. Convert from xassert to eassert.
8126 * nsmenu.m: Convert from xassert to eassert.
8127 * nsterm.m: Likewise.
8128
8129 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8130
8131 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8132
8133 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8134
8135 Avoid integer overflow on scroll-left and scroll-right.
8136 * window.c (HSCROLL_MAX): New macro.
8137 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8138 overflow when requested scroll falls outside ptrdiff_t range.
8139
8140 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8141
8142 * window.h (struct window): Change type of 'hscroll',
8143 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8144 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8145 Adjust users accordingly.
8146 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8147 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8148 from EMACS_INT to ptrdiff_t.
8149 (make_window): Omit redundant initialization.
8150
8151 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
8152
8153 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8154
8155 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8156
8157 * window.h (struct window): Change type of 'use_time' and
8158 'sequence_number' from Lisp_Object to int.
8159 * frame.c (make_frame): Adjust users accordingly.
8160 * print.c (print_object): Likewise.
8161 * window.c (select_window, Fwindow_use_time, make_parent_window)
8162 (make_window): Likewise.
8163
8164 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8165
8166 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8167 enabled with --enable-checking=[all,glyphs] configure option.
8168 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8169 adjust comments accordingly.
8170 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8171 undefined, adjust comments accordingly.
8172 * image.c: Likewise.
8173 * scroll.c: Likewise.
8174 * w32fns.c: Likewise.
8175 * w32term.c: Likewise.
8176 * xdisp.c: Likewise.
8177 * xfaces.c: Likewise.
8178 * xfns.c: Likewise.
8179 * xterm.c: Likewise.
8180
8181 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8182
8183 Generalize run-time debugging checks.
8184 * dispextern.h (XASSERTS): Remove.
8185 * fontset.c (xassert): Remove.
8186 Convert from xassert to eassert.
8187 * alloc.c: Convert from xassert to eassert.
8188 * bidi.c: Likewise.
8189 * dispnew.c: Likewise.
8190 * fns.c: Likewise.
8191 * fringe.c: Likewise.
8192 * ftfont.c: Likewise.
8193 * gtkutil.c: Likewise.
8194 * image.c: Likewise.
8195 * keyboard.c: Likewise.
8196 * menu.c: Likewise.
8197 * process.c: Likewise.
8198 * scroll.c: Likewise.
8199 * sound.c: Likewise.
8200 * term.c: Likewise.
8201 * w32console.c: Likewise.
8202 * w32fns.c: Likewise.
8203 * w32term.c: Likewise.
8204 * window.c: Likewise.
8205 * xdisp.c: Likewise.
8206 * xfaces.c: Likewise.
8207 * xfns.c: Likewise.
8208 * xselect.c: Likewise.
8209 * xterm.c: Likewise.
8210
8211 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8212
8213 * fns.c (maybe_resize_hash_table): Output message when growing the
8214 purify-hashtable.
8215
8216 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8217
8218 * alloc.c (allocate_string_data): Remove dead code.
8219 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8220 avoid GCC warning about unused macro.
8221
8222 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8223
8224 * alloc.c (allocate_string): Omit intervals initialization.
8225 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8226 as in make_pure_string and make_pure_c_string.
8227
8228 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8229
8230 * alloc.c (allocate_string): Fix last change.
8231
8232 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8233
8234 * alloc.c (allocate_string): Remove two redundant calls
8235 to memset, add explicit initialization where appropriate.
8236
8237 2012-06-27 Glenn Morris <rgm@gnu.org>
8238
8239 * lisp.mk (lisp): Remove paths.elc.
8240
8241 2012-06-27 Chong Yidong <cyd@gnu.org>
8242
8243 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8244
8245 2012-06-26 John Wiegley <johnw@newartisans.com>
8246
8247 * unexmacosx.c (copy_data_segment): Add two section names used
8248 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8249
8250 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8251 when building with Clang.
8252
8253 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8254
8255 * eval.c (Fapply): Allow calling it with a single argument.
8256
8257 2012-06-26 Eli Zaretskii <eliz@gnu.org>
8258
8259 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8260 _stricmp and _strnicmp.
8261 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8262
8263 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8264
8265 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8266 allocated window.
8267 (allocate_process): Likewise for new process.
8268 (allocate_terminal): Change to use offsetof.
8269 (allocate_frame): Likewise.
8270 * frame.c (make_frame): Omit redundant initialization.
8271 * window.c (make_parent_window): Use memset.
8272 (make_window): Omit redundant initialization.
8273 * process.c (make_process): Omit redundant initialization.
8274 * terminal.c (create_terminal): Likewise.
8275
8276 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8277
8278 * term.c (delete_tty): Remove redundant call to memset.
8279
8280 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8281
8282 * alloc.c: Remove build_string.
8283 * lisp.h: Define build_string as static inline. This provides
8284 a better opportunity to optimize away calls to strlen when the
8285 function is called with compile-time constant argument.
8286 * image.c (imagemagick_error): Convert to build_string.
8287 * w32proc.c (sys_spawnve): Likewise.
8288 * xterm.c (x_term_init): Likewise.
8289
8290 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8291
8292 Use sprintf return value instead of invoking strlen on result.
8293 In the old days this wasn't portable, since some sprintf
8294 implementations returned char *. But they died out years ago and
8295 Emacs already assumes sprintf returns int.
8296 Similarly for float_to_string.
8297 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8298 * ccl.c (ccl_driver):
8299 * character.c (string_escape_byte8):
8300 * data.c (Fnumber_to_string):
8301 * doprnt.c (doprnt):
8302 * print.c (print_object):
8303 * xdisp.c (message_dolog):
8304 * xfns.c (syms_of_xfns):
8305 Use sprintf or float_to_string result to avoid need to call strlen.
8306 * data.c (Fnumber_to_string):
8307 Use make_unibyte_string, since the string must be ASCII.
8308 * lisp.h, print.c (float_to_string): Now returns int length.
8309 * term.c (produce_glyphless_glyph):
8310 Use sprintf result rather than recomputing it.
8311
8312 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8313 * Makefile.in (ALL_CFLAGS):
8314 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8315 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8316
8317 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8318
8319 * dispextern.h (xstrcasecmp): Define to library function
8320 strcasecmp if available.
8321 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8322
8323 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8324
8325 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8326 Avoid comma operator.
8327 * menu.c (push_submenu_start, push_submenu_end)
8328 (push_left_right_boundary, push_menu_pane): Likewise.
8329 * msdos.c (dos_rawgetc): Likewise.
8330
8331 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8332
8333 * xfns.c (xic_create_fontsetname): Remove redundant calls
8334 to memset.
8335
8336 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8337
8338 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8339 sprintf already null-terminates its output.
8340
8341 * xfns.c (x_window): Remove redundant cast.
8342
8343 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8344
8345 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8346 `const char *' to `char *' to avoid compiler warning.
8347
8348 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8351 instead of truncating it to 63 (admittedly a generous limit).
8352
8353 * process.c: Fix spelling and caps in comments.
8354
8355 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8356
8357 * emacs.c (setpgrp): Remove definition, unused.
8358 * sysdep.c (setpgrp): Remove definition, not used in this file.
8359
8360 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
8361
8362 * makefile.w32-in: Update dependencies.
8363
8364 2012-06-24 Eli Zaretskii <eliz@gnu.org>
8365
8366 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8367 (SYSTIME_H): Add nt/inc/sys/time.h.
8368
8369 * systime.h [WINDOWSNT]: Include sys/time.h.
8370
8371 * s/ms-w32.h (struct timespec): Definition moved from
8372 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8373
8374 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8375
8376 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8377 * buffer.h (buffer_slot_type_mismatch):
8378 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8379 * eval.c (unwind_to_catch):
8380 * image.c (my_png_error, my_error_exit):
8381 * keyboard.c (quit_throw_to_read_char, user_error)
8382 (Fexit_recursive_edit, Fabort_recursive_edit):
8383 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8384 (wrong_type_argument, buffer_overflow, __executable_start)
8385 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8386 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8387 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8388 (fatal):
8389 (child_setup) [!DOS_NT]:
8390 * lread.c (end_of_file_error, invalid_syntax):
8391 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8392 * puresize.h (pure_write_error):
8393 * search.c (matcher_overflow):
8394 * sound.c (sound_perror, alsa_sound_perror):
8395 * sysdep.c, syssignal.h (croak):
8396 * term.c (maybe_fatal, vfatal):
8397 * textprop.c (text_read_only):
8398 * undo.c (user_error):
8399 * unexmacosx.c (unexec_error):
8400 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8401 Use _Noreturn rather than NO_RETURN.
8402 No need for separate decl merely because of _Noreturn.
8403 * sound.c (sound_warning, parse_sound):
8404 Remove unnecessary forward decls.
8405
8406 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8407
8408 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8409 * lisp.h (WAIT_READING_MAX): New macro.
8410 * dispnew.c (Fsleep_for, sit_for):
8411 * keyboard.c (kbd_buffer_get_event):
8412 * process.c (Faccept_process_output):
8413 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8414 This improves on the previous patch, which introduced a bug
8415 when time_t is unsigned and as wide as intmax_t.
8416 See <http://bugs.gnu.org/9000#51>.
8417
8418 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8419
8420 * dispnew.c (sit_for, Fsleep_for):
8421 * keyboard.c (kbd_buffer_get_event):
8422 * process.c (Faccept_process_output): Avoid compiler warnings when
8423 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8424
8425 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
8426
8427 * makefile.w32-in: Update dependencies.
8428
8429 * w32.c (ltime): Add return type and declare static.
8430 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8431
8432 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8435 Privately reported by Herbert J. Skuhra.
8436 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8437 All uses changed.
8438 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8439 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8440
8441 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8442
8443 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8444 last argument of make_unibyte_string.
8445
8446 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8447 language ID in the event parameters.
8448
8449 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8450 event.code, not the obscure "character set ID".
8451
8452 2012-06-23 Chong Yidong <cyd@gnu.org>
8453
8454 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8455
8456 2012-06-23 Eli Zaretskii <eliz@gnu.org>
8457
8458 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8459 * w32.c (fdutimens): New function.
8460
8461 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8462
8463 * s/ms-w32.h (pselect): Redirect to sys_select.
8464
8465 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8466
8467 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8468 in the logic of incrementing and decrementing the value of
8469 use_relocatable_buffers.
8470
8471 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8472
8473 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8474 Privately reported by Herbert J. Skuhra.
8475 [__FreeBSD__]: Remove "*/" typo after "#include".
8476 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8477 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8478 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8479 Don't assume EMACS_TIME and struct timeval are the same type.
8480
8481 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8482
8483 Support higher-resolution time stamps (Bug#9000).
8484 The time stamps are only nanosecond-resolution at the C level,
8485 since that's the best that any real-world system supports now.
8486 But they are picosecond-resolution at the Lisp level, as that's
8487 easy, and leaves room for future OS improvements.
8488
8489 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8490 (LIBES): Use it.
8491
8492 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8493 Don't get current time unless it's needed.
8494
8495 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8496 now provides it if it's absent.
8497 (start_atimer): Port to higher-res time stamps.
8498 Check for time stamp overflow. Don't get current time more
8499 often than is needed.
8500
8501 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8502 Include systime.h, not time.h.
8503 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8504
8505 * dired.c: Include stat-time.h.
8506 (Ffile-attributes): File times now have higher resolution.
8507
8508 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8509 (struct image): Timestamp now has higher resolution.
8510
8511 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8512 has at least microseconds now. All uses removed.
8513 (update_frame, update_single_window, update_window, update_frame_1)
8514 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
8515 (duration_to_sec_usec): Remove; no longer needed.
8516
8517 * editfns.c (time_overflow): Now extern.
8518 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8519 (float-time, Fformat_time_string, Fcurrent_time_string)
8520 (Fcurrent_time_zone): Accept and generate higher-resolution
8521 time stamps.
8522 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8523 (decode_time_components, lisp_seconds_argument): New functions.
8524 (make_time): Now static.
8525 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8526 Report an error if the time is invalid, rather than having the caller
8527 do that.
8528
8529 * fileio.c: Include <stat-time.h>
8530 (Fcopy_file): Copy higher-resolution time stamps.
8531 Prefer to set the time stamp via a file descriptor if that works.
8532 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8533 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8534 (Fvisited_file_modtime, Fset_visited_file_modtime):
8535 Support higher-resolution time stamps.
8536
8537 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8538
8539 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8540
8541 * image.c (prepare_image_for_display, clear_image_cache)
8542 (lookup_image): Port to higer-resolution time stamps.
8543
8544 * keyboard.c (start_polling, bind_polling_period):
8545 Check for time stamp overflow.
8546 (read_char, kbd_buffer_get_event, timer_start_idle)
8547 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8548 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8549 Port to higher-resolution time stamps. Do not assume time_t is signed.
8550 (decode_timer): New function. Timers are now vectors of length 9,
8551 not 8, to accommodate the picosecond component.
8552 (timer_check_2): Use it.
8553
8554 * nsterm.m (select_timeout, timeval_subtract): Remove.
8555 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8556 as they're a bit more accurate and handle overflow better.
8557 (ns_select): Change prototype to be compatible with pselect.
8558 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8559 * nsterm.h (ns_select): Adjust prototype.
8560
8561 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8562 us-resolution time stamps.
8563 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8564
8565 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8566
8567 * lisp.h (time_overflow): New decl.
8568 (wait_reading_process_output): First arg is now intmax_t, not int,
8569 to accommodate larger waits.
8570
8571 * process.h (struct Lisp_Process.read_output_delay):
8572 Now counts nanoseconds, not microseconds.
8573 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8574 EMACS_HAS_USECS.
8575 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8576 (wait_reading_process_output):
8577 Port to ns-resolution time stamps.
8578 (Faccept_process_output, wait_reading_process_output):
8579 Check for time stamp overflow. Do not assume time_t is signed.
8580 (select_wrapper): Remove; we now use pselect.
8581 (Fprocess_attributes): Now generates ns-resolution time stamps.
8582
8583 * sysdep.c: Include utimens.h. Don't include utime.h
8584 or worry about struct utimbuf; gnulib does that for us now.
8585 (gettimeofday): Remove; gnulib provides a substitute.
8586 (make_timeval): New function.
8587 (set_file_times): Now sets ns-resolution time stamps.
8588 New arg FD; all uses changed.
8589 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8590 (system_process_attributes):
8591 Now returns ns-resolution time stamp. All uses changed.
8592 Check for time stamp overflow.
8593
8594 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8595 provides a substitute now.
8596
8597 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8598 since it guarantees struct timespec.
8599 (EMACS_TIME): Now struct timespec, so that we can support
8600 ns-resolution time stamps.
8601 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8602 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8603 (EMACS_USECS): Remove.
8604 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8605 so multiply the arg by 1000 before storing it.
8606 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8607 New macros.
8608 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8609 Port to ns-resolution time stamps.
8610 (EMACS_TIME_NEG_P): Remove; replaced by....
8611 (EMACS_TIME_SIGN): New macro.
8612 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8613 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8614 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8615 (make_timeval, make_lisp_time, decode_time_components): New decls.
8616 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8617 that it mishandled time_t overflow. You can't compare by subtracting!
8618 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8619 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8620
8621 * term.c: Include <sys/time.h>.
8622 (timeval_to_Time): New function, for proper overflow wraparound.
8623 (term_mouse_position, term_mouse_click): Use it.
8624
8625 * undo.c (record_first_change): Support higher-resolution time stamps
8626 in the undo buffer.
8627 (Fprimitive_undo): Use them when restoring time stamps.
8628
8629 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8630 (w32_get_internal_run_time):
8631 Port to higher-resolution Emacs time stamps.
8632 (ltime): Now accepts single 64-bit integer, as that's more convenient
8633 for callers.
8634
8635 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8636
8637 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8638 for compatibility with pselect. Support ns-resolution time stamps.
8639
8640 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8641
8642 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8643 Check for time stamp overflow, and support ns-resolution time stamps.
8644
8645 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8646 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8647 (timeval_subtract): Remove; no longer needed.
8648 (XTflash, XTring_bell, x_wait_for_event):
8649 Port to ns-resolution time stamps. Don't assume time_t is signed.
8650
8651 2012-06-22 Chong Yidong <cyd@gnu.org>
8652
8653 * xdisp.c (x_consider_frame_title): Revert last change.
8654
8655 2012-06-22 Eli Zaretskii <eliz@gnu.org>
8656
8657 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8658 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8659 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8660 staticidx goes up to 1597 out of 1600 = 0x640.)
8661
8662 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8663
8664 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8665 Otherwise, the umask might be mistakenly 0 while handling input signals.
8666
8667 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8668
8669 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8670
8671 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8672
8673 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8674 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8675 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8676 access to `contents' member of Lisp_Vector objects with AREF and ASET
8677 where appropriate.
8678
8679 2012-06-19 Chong Yidong <cyd@gnu.org>
8680
8681 * frame.c (delete_frame): When selecting a frame on a different
8682 text terminal, do not alter the terminal's top-frame.
8683
8684 * xdisp.c (format_mode_line_unwind_data): Record the target
8685 frame's selected window and its terminal's top-frame.
8686 (unwind_format_mode_line): Restore them.
8687 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8688 Callers changed.
8689 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8690 since tty frames can be explicitly named.
8691 (prepare_menu_bars): Likewise.
8692
8693 * term.c (Ftty_top_frame): New function.
8694
8695 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8696
8697 Port byte-code-meter to modern targets.
8698 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8699 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8700 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
8701 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8702 (METER_1, METER_2): Simplify.
8703
8704 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8705
8706 * data.c (Fdefalias): Return `symbol' (bug#11686).
8707
8708 2012-06-18 Martin Rudalics <rudalics@gmx.at>
8709
8710 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
8711 gets killed during executing of this function (Bug#11665).
8712 Try to always return Qt when the buffer has been actually killed.
8713 (Vkill_buffer_query_functions): In doc-string say that functions
8714 run by this hook should not change the current buffer.
8715
8716 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8717
8718 Fix recently-introduced process.c problems found by static checking.
8719 * process.c (write_queue_push, write_queue_pop, send_process):
8720 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8721 (write_queue_pop): Fix pointer signedness problem.
8722 (send_process): Remove unused local.
8723
8724 2012-06-17 Chong Yidong <cyd@gnu.org>
8725
8726 * xdisp.c (redisplay_internal): No need to redisplay terminal
8727 frames that are not on top.
8728
8729 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
8730
8731 * process.c (make_process): Initialize write_queue.
8732 (write_queue_push, write_queue_pop): New functions.
8733 (send_process): Use them to maintain correct ordering of process
8734 writes (Bug#10815).
8735
8736 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8737
8738 * lisp.h (eassert): Assume C89 or later.
8739 This removes the need for CHECK.
8740 (CHECK): Remove. Its comments about always evaluating its
8741 argument were confusing, as 'eassert' typically does not evaluate
8742 its argument.
8743
8744 * coding.c (produce_chars): Use ptrdiff_t, not int.
8745
8746 * xterm.c (x_draw_underwave): Check for integer overflow.
8747 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8748
8749 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
8750
8751 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8752 referenced (Bug#11583).
8753
8754 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8755
8756 Implement wave-style variant of underlining.
8757 * dispextern.h (face_underline_type): New enum.
8758 (face): Add field for underline type.
8759 * nsterm.m (ns_draw_underwave): New function.
8760 (ns_draw_text_decoration): Use it.
8761 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8762 New functions.
8763 (x_draw_glyph_string): Use them.
8764 * xfaces.c (Qline, Qwave): New Lisp objects.
8765 (check_lface_attrs, merge_face_ref)
8766 (Finternal_set_lisp_face_attribute, realize_x_face):
8767 Handle wave-style underline face attributes.
8768 * xterm.c (x_draw_underwave): New function.
8769 (x_draw_glyph_string): Use it.
8770
8771 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
8772
8773 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
8774 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
8775 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
8776 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
8777 ($(BLD)/w32select.$(O)): Update dependencies.
8778
8779 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8780
8781 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
8782 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
8783 * character.c (_fetch_multibyte_char_p): Remove.
8784 * alloc.c: Include "character.h" before "buffer.h".
8785 * bidi.c: Likewise.
8786 * buffer.c: Likewise.
8787 * bytecode.c: Likewise.
8788 * callint.c: Likewise.
8789 * callproc.c: Likewise.
8790 * casefiddle.c: Likewise.
8791 * casetab.c: Likewise.
8792 * category.c: Likewise.
8793 * cmds.c: Likewise.
8794 * coding.c: Likewise.
8795 * composite.c: Likewise.
8796 * dired.c: Likewise.
8797 * dispnew.c: Likewise.
8798 * doc.c: Likewise.
8799 * dosfns.c: Likewise.
8800 * editfns.c: Likewise.
8801 * emacs.c: Likewise.
8802 * fileio.c: Likewise.
8803 * filelock.c: Likewise.
8804 * font.c: Likewise.
8805 * fontset.c: Likewise.
8806 * fringe.c: Likewise.
8807 * indent.c: Likewise.
8808 * insdel.c: Likewise.
8809 * intervals.c: Likewise.
8810 * keyboard.c: Likewise.
8811 * keymap.c: Likewise.
8812 * lread.c: Likewise.
8813 * macros.c: Likewise.
8814 * marker.c: Likewise.
8815 * minibuf.c: Likewise.
8816 * nsfns.m: Likewise.
8817 * nsmenu.m: Likewise.
8818 * print.c: Likewise.
8819 * process.c: Likewise.
8820 * regex.c: Likewise.
8821 * region-cache.c: Likewise.
8822 * search.c: Likewise.
8823 * syntax.c: Likewise.
8824 * term.c: Likewise.
8825 * textprop.c: Likewise.
8826 * undo.c: Likewise.
8827 * unexsol.c: Likewise.
8828 * w16select.c: Likewise.
8829 * w32fns.c: Likewise.
8830 * w32menu.c: Likewise.
8831 * window.c: Likewise.
8832 * xdisp.c: Likewise.
8833 * xfns.c: Likewise.
8834 * xmenu.c: Likewise.
8835 * xml.c: Likewise.
8836 * xselect.c: Likewise.
8837
8838 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8839
8840 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
8841 If all the glyphs of the glyph row came from strings, and we have no
8842 cursor positioning clues, put the cursor on the first glyph of the
8843 row.
8844 (handle_face_prop): Use chunk-relative overlay string index when
8845 indexing into it->string_overlays array. (Bug#11653)
8846 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
8847 the rightmost. (Bug#11720)
8848
8849 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
8850
8851 * category.h (CHAR_HAS_CATEGORY): Define as inline.
8852 (CATEGORY_MEMBER): Enforce 1/0 value.
8853 * category.c (_temp_category_set): Remove.
8854
8855 2012-06-16 Eli Zaretskii <eliz@gnu.org>
8856
8857 * window.c (Fdelete_other_windows_internal)
8858 (Fdelete_window_internal): Don't access frame's mouse highlight
8859 info of the initial frame. (Bug#11677)
8860
8861 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
8862
8863 * .gdbinit (xgetint): Fix recently-introduced paren typo.
8864 Assume USE_2_TAGS_FOR_INTS.
8865 (xreload): Adjust $tagmask width to match recent lisp.h change.
8866
8867 Simplify lisp.h in minor ways that should not affect code.
8868 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
8869 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
8870 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
8871 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
8872 (INTTYPEBITS): New macro, for clarity.
8873 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
8874 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
8875 Simplify now that USE_LSB_TAG is always defined.
8876 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
8877 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
8878
8879 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
8880
8881 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
8882
8883 2012-06-13 Glenn Morris <rgm@gnu.org>
8884
8885 * s/bsd-common.h (BSD4_3):
8886 * s/usg5-4-common.h (USG5_4): No longer define; unused.
8887
8888 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
8889
8890 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
8891 instead of union.
8892 (XLI, XIL): Define.
8893 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
8894 Use them.
8895 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
8896 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
8897 * alloc.c (widen_to_Lisp_Object): Remove.
8898 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
8899 * frame.c (delete_frame): Remove outdated comment.
8900 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
8901 USE_LISP_UNION_TYPE.
8902 (Fw32_unregister_hot_key): Likewise.
8903 (Fw32_toggle_lock_key): Likewise.
8904 * w32menu.c (add_menu_item): Likewise.
8905 (w32_menu_display_help): Use XIL instead of checking
8906 USE_LISP_UNION_TYPE.
8907 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
8908 (init_heap): Likewise.
8909 * w32term.c (w32_read_socket): Update comment.
8910
8911 2012-06-13 Glenn Morris <rgm@gnu.org>
8912
8913 * s/usg5-4-common.h, src/s/unixware.h:
8914 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8915
8916 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8917
8918 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8921 * alloc.c (make_number) [!defined make_number]:
8922 Remove, as lisp.h always defines this now.
8923 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8924 (roundup_size): Verify that it is a power of 2.
8925 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8926 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8927 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8928 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8929 USE_LSB_TAG now is always defined to be either 0 or 1.
8930 All uses changed.
8931 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8932 code works fine either way, and efficiency is not a concern here,
8933 as the union type is for debugging, not for production.
8934 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8935 Use an inline function on all platforms when using the union type,
8936 since this is simpler and 'static inline' can be used portably
8937 within Emacs now.
8938 (LISP_INITIALLY_ZERO): New macro.
8939 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8940 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8941
8942 2012-06-12 Glenn Morris <rgm@gnu.org>
8943
8944 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8945
8946 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
8947
8948 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8949 Move BROKEN_SIGIO to configure.
8950
8951 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8952 Move NO_TERMIO to configure.
8953
8954 2012-06-12 Chong Yidong <cyd@gnu.org>
8955
8956 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8957 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8958 MagickExportImagePixels is undefined.
8959
8960 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8961
8962 * image.c (imagemagick_load_image): Remove unused label.
8963
8964 2012-06-11 Glenn Morris <rgm@gnu.org>
8965
8966 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8967 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8968 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8969 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8970
8971 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8972
8973 * alloc.c (make_byte_code): New function.
8974 (Fmake_byte_code): Use it. Don't purify here.
8975 * lread.c (read1): Use it as well to avoid extra allocation.
8976
8977 2012-06-11 Chong Yidong <cyd@gnu.org>
8978
8979 * image.c (imagemagick_load_image): Implement transparency.
8980
8981 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8982
8983 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8984 account for preceding backslashes. (Bug#11663)
8985
8986 2012-06-09 Chong Yidong <cyd@gnu.org>
8987
8988 * term.c: Support italics in capable terminals (Bug#9652).
8989 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8990 (turn_on_face): Output using TS_enter_italic_mode if available.
8991 Don't handle unused blinking and alt-charset cases.
8992 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8993 and tty_alt_charset_p cases.
8994 (tty_capable_p, init_tty): Support italics.
8995
8996 * termchar.h (struct tty_display_info): Add field for italics.
8997 Remove unused blink field.
8998
8999 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9000 Handle slant.
9001
9002 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9003 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9004 tty_alt_charset_p. Add tty_italic_p.
9005
9006 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
9007
9008 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9009 dbus_type_is_basic if available.
9010 (xd_extract_signed, xd_extract_unsigned): Rename from
9011 extract_signed and extract_unsigned, respectively. Adapt callers.
9012
9013 2012-06-09 Chong Yidong <cyd@gnu.org>
9014
9015 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9016
9017 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9018 case (Bug#9752).
9019
9020 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9021
9022 * xdisp.c (vmessage): Treat frame message as multibyte.
9023 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9024 would generate the diagnostic "Making \302\247 buffer-local while
9025 let-bound!".
9026
9027 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9028
9029 * dispnew.c (showing_window_margins_p): Undo last change, which
9030 was done due to an inadvertent commit.
9031 (adjust_frame_glyphs_for_frame_redisplay): Do call
9032 showing_window_margins_p.
9033
9034 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9035
9036 * eval.c (Fmake_var_non_special): New primitive.
9037 (syms_of_eval): Defsubr it.
9038 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9039
9040 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
9041
9042 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9043 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9044
9045 2012-06-08 Eli Zaretskii <eliz@gnu.org>
9046
9047 * alloc.c (allocate_vectorlike): Fix last change.
9048
9049 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9050
9051 Block-based vector allocation of small vectors.
9052 * lisp.h (struct vectorlike_header): New field `nbytes',
9053 adjust comment accordingly.
9054 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
9055 to denote vector blocks. Adjust users (live_vector_p,
9056 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9057 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9058 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9059 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9060 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9061 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9062 (roundup_size): New constant.
9063 (struct vector_block): New data type.
9064 (vector_blocks, vector_free_lists, zero_vector): New variables.
9065 (all_vectors): Rename to `large_vectors'.
9066 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9067 (sweep_vectors): New functions.
9068 (allocate_vectorlike): Return `zero_vector' as the only vector of
9069 0 items. Allocate new vector from block if vector size is less than
9070 or equal to VBLOCK_BYTES_MAX.
9071 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9072 (init_alloc_once): Add call to init_vectors.
9073
9074 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9075
9076 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9077
9078 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 * doprnt.c (doprnt): Truncate multibyte char correctly.
9081 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9082 would mishandle a string argument "Xc" if X was a multibyte
9083 character of length 2: it would truncate after X's first byte
9084 rather than including all of X.
9085
9086 2012-06-06 Chong Yidong <cyd@gnu.org>
9087
9088 * buffer.c (word_wrap): Doc fix.
9089
9090 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9091
9092 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9093
9094 2012-06-03 Glenn Morris <rgm@gnu.org>
9095
9096 * xdisp.c (tool-bar-style): Doc fix.
9097
9098 2012-06-03 Ulrich Müller <ulm@gentoo.org>
9099
9100 * Makefile.in (PAXCTL): Define.
9101 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9102 binary via PaX flags if the paxctl utility is available.
9103 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9104 Restore PaX flags to their default. (Bug#11398)
9105
9106 2012-06-03 Chong Yidong <cyd@gnu.org>
9107
9108 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9109 buffer (Bug#11226).
9110
9111 2012-06-03 Chong Yidong <cyd@gnu.org>
9112
9113 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9114 (note_mode_line_or_margin_highlight): If there is no help echo,
9115 use mode-line-default-help-echo. Handle the case where the mouse
9116 position is past the end of the mode line string.
9117
9118 * buffer.c (buffer_local_value_1): New function, split from
9119 Fbuffer_local_value; can return Qunbound.
9120 (Fbuffer_local_value): Use it.
9121 (Vmode_line_format): Docstring tweaks.
9122
9123 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9124
9125 * sysdep.c (system_process_attributes): Improve comment.
9126
9127 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9128
9129 * keyboard.c: Export real-this-command to Elisp.
9130 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9131 and DEFVAR it. Update all users.
9132
9133 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9134
9135 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9136
9137 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9138 Convert pctcpu and pctmem to Lisp float properly.
9139 Let the compiler fold better, as 100.0/0x8000 is exact.
9140
9141 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9142
9143 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9144 cons_block.
9145
9146 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9149
9150 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9151
9152 For a 'struct window', replace some Lisp_Object fields to
9153 bitfields where appropriate, remove unused fields.
9154 * window.h (struct window): Remove unused 'last_mark_x' and
9155 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
9156 change its type from Lisp_Object to bitfield.
9157 Change type of 'force_start', 'optional_new_start',
9158 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
9159 fields from Lisp_Object to bitfield. Adjust users accordingly.
9160
9161 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9162
9163 Pacify gcc -Wdouble-precision when using Xaw.
9164 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9165 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9166 Use 'float' consistently, rather than 'float' in most places
9167 and 'double' in a couple of places.
9168
9169 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9170
9171 * xdisp.c (handle_stop): Detect whether we have overlay strings
9172 loaded by testing it->current.overlay_string_index to be
9173 non-negative, instead of checking whether n_overlay_strings is
9174 positive. (Bug#11587)
9175
9176 2012-05-31 Chong Yidong <cyd@gnu.org>
9177
9178 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9179
9180 * doc.c (Fsubstitute_command_keys): Doc fix.
9181
9182 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9183
9184 * search.c (search_buffer): Remove calls to
9185 r_alloc_inhibit_buffer_relocation, as it is now called by
9186 maybe_unify_char, which was the cause of relocation of buffer text
9187 in bug#11519.
9188
9189 2012-05-31 Eli Zaretskii <eliz@gnu.org>
9190
9191 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9192 for the duration of call to load_charset, to avoid problems with
9193 callers of maybe_unify_char that access buffer text through C
9194 pointers.
9195
9196 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9197 decrement the inhibition flag, instead of just setting or
9198 resetting it.
9199
9200 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9201
9202 Remove obsolete '#define static' cruft.
9203 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9204 This #undef was "temporary" in 2000; it is no longer needed
9205 now that '#define static' has gone away.
9206 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9207 (gray_bitmap_bits): Remove; no longer needed.
9208 All uses replaced with definiens.
9209 * xterm.c: Include "bitmaps/gray.xbm".
9210
9211 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9212
9213 Clean up __executable_start, monstartup when --enable-profiling.
9214 The following changes affect the code only when profiling.
9215 * dispnew.c (__executable_start): Rename from safe_bcopy.
9216 Define only on platforms that need it.
9217 * emacs.c: Include <sys/gmon.h> when profiling.
9218 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9219 (__executable_start): Remove decl, since lisp.h does it now.
9220 (safe_bcopy): Remove decl; no longer has that name.
9221 (main): Coalesce #if into single bit of code, for simplicity.
9222 Cast pointers to uintptr_t, since standard libraries want integers
9223 and not pointers.
9224 * lisp.h (__executable_start): New decl.
9225
9226 2012-05-31 Glenn Morris <rgm@gnu.org>
9227
9228 * image.c (Fimagemagick_types): Doc fix.
9229
9230 2012-05-30 Jim Meyering <meyering@redhat.com>
9231
9232 * callproc.c (Fcall_process_region): Include directory component
9233 in mkstemp error message (Bug#11586).
9234
9235 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 * alloc.c, lisp.h (make_pure_vector): Now static.
9238
9239 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9240
9241 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9242 Move to byte-run.el.
9243 (Fautoload): Do the hash-doc more carefully.
9244 * data.c (Fdefalias): Purify definition, except for keymaps.
9245 (Qdefun): Move from eval.c.
9246 * lisp.h (Qdefun): Remove.
9247 * lread.c (read1): Tiny simplification.
9248
9249 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
9250
9251 Do not create empty overlays with the evaporate property (Bug#9642).
9252 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9253 Bug#9642, but explicitly check that the buffer the overlay would
9254 be moved to is live and rearrange lines to make sure that errors
9255 will not put the overlay in an inconsistent state.
9256 (Fdelete_overlay): Cosmetics.
9257
9258 2012-05-28 Eli Zaretskii <eliz@gnu.org>
9259
9260 * w32term.c (my_bring_window_to_top): New function.
9261 (x_raise_frame): Use handle returned by DeferWindowPos, which
9262 could be different from the original one.
9263 Call my_bring_window_to_top instead of my_set_foreground_window.
9264 (Bug#11513)
9265
9266 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9267 by calling BringWindowToTop.
9268
9269 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9270 (WM_EMACS_END): Increase by one.
9271
9272 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9273
9274 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9275 This avoids undefined behavior that might cause the eassert
9276 to not catch an out-of-range value.
9277
9278 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
9279
9280 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9281 Update dependencies.
9282
9283 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9284
9285 * bidi.c (bidi_mirror_char): Fix last change.
9286
9287 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9288
9289 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9290 when referring to sectname field in printf format.
9291
9292 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9295 Only r_alloc_inhibit_buffer_relocation needed to be added;
9296 the others were already declared.
9297
9298 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9299 before checking whether it's out of range. Put the check inside
9300 eassert. See
9301 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9302
9303 2012-05-27 Ken Brown <kbrown@cornell.edu>
9304
9305 * callproc.c (Fcall_process): Restore a line that was accidentally
9306 commented out in the 2011-02-13 change (bug#11547).
9307
9308 2012-05-27 Eli Zaretskii <eliz@gnu.org>
9309
9310 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9311 defined on ralloc.c.
9312
9313 * buffer.c [REL_ALLOC]: Remove prototypes of
9314 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9315 they are now on lisp.h.
9316
9317 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9318
9319 * search.c (search_buffer): Use it to inhibit relocation of buffer
9320 text while re_search_2 is doing its job, because re_search_2 is
9321 passed C pointers to buffer text. (Bug#11519)
9322
9323 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9324 Update value to 24.
9325
9326 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9327 state after an additional call to move_it_in_display_line_to, keep
9328 the values of it->max_ascent and it->max_descent found for the
9329 entire line.
9330 (pos_visible_p): Revert the comparison against bottom_y to what it
9331 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9332 (Bug#11464)
9333
9334 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9335
9336 Fix coding-related core dumps with gcc -ftrapv.
9337 The code was computing A - B, where A and B are pointers, and B is
9338 random garbage. This can lead to core dumps on platforms that
9339 have special pointer registers, and it also leads to core dumps on
9340 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9341 A - B only when B is initialized properly.
9342 * coding.c (coding_set_source, coding_set_destination): Return void.
9343 (coding_change_source, coding_change_destinations): New functions,
9344 with the old behaviors of coding_set_source and coding_set_destination.
9345 All callers that need an offset changed to use these new functions.
9346
9347 2012-05-26 Glenn Morris <rgm@gnu.org>
9348
9349 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9350
9351 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9352
9353 Extend mouse support on W32 text-mode console.
9354 * xdisp.c (draw_row_with_mouse_face):
9355 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
9356
9357 * w32console.c: Include window.h.
9358 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9359 New functions.
9360 (initialize_w32_display): Initialize mouse-highlight data.
9361
9362 * w32inevt.c: Include termchar.h and window.h.
9363 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9364 moves, call note_mouse_highlight. If help_echo changed, call
9365 gen_help_event to produce help-echo message in the echo area.
9366 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9367 highlight info.
9368
9369 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9370
9371 * lread.c (read1): Simplify slightly to avoid an overflow warning
9372 with GCC 4.7.0 on x86-64.
9373
9374 2012-05-26 Eli Zaretskii <eliz@gnu.org>
9375
9376 * bidi.c (bidi_mirror_char): Revert last change: an int is
9377 definitely wide enough here.
9378
9379 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 Fix integer width and related bugs (Bug#9874).
9382 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
9383 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9384 (string_bytes, check_sblock, allocate_string_data):
9385 (compact_small_strings, Fmake_bool_vector, make_string)
9386 (make_unibyte_string, make_multibyte_string)
9387 (make_string_from_bytes, make_specified_string)
9388 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9389 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9390 (mark_vectorlike):
9391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9392 (allocate_pseudovector):
9393 Use int, not EMACS_INT, where int is wide enough.
9394 (inhibit_garbage_collection, Fgarbage_collect):
9395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9396 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9397 int might not be wide enough.
9398 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9399 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9400 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9401 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9402 (bidi_level_of_next_char, bidi_move_to_visually_next):
9403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9404 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9405 (Fkill_buffer, Fset_buffer_major_mode)
9406 (advance_to_char_boundary, Fbuffer_swap_text)
9407 (Fset_buffer_multibyte, overlays_at, overlays_in)
9408 (overlay_touches_p, struct sortvec, record_overlay_string)
9409 (overlay_strings, recenter_overlay_lists)
9410 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9411 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9412 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9413 (Foverlay_recenter, last_overlay_modification_hooks_used)
9414 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9416 (validate_region): Omit unnecessary test for b <= e,
9417 since that's guaranteed by the previous test.
9418 (adjust_overlays_for_delete): Avoid pos + length overflow.
9419 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9420 (report_overlay_modification):
9421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9422 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9423 Omit pointer cast, which isn't needed anyway, and doesn't work
9424 after the EMACS_INT -> ptrdiff_t change.
9425 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
9426 * buffer.h: Adjust decls to match defn changes elsewhere.
9427 (struct buffer_text, struct buffer):
9428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9429 Use EMACS_INT, not int, where int might not be wide enough.
9430 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9431 not int, to avoid needless 32-bit limit on 64-bit hosts.
9432 (exec_byte_code): Use tighter memory-full test, one that checks
9433 for alloca overflow. Don't compute the address of the object just
9434 before an array, as that's not portable. Use EMACS_INT, not
9435 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
9436 * callint.c (Fcall_interactively):
9437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9438 * callproc.c (call_process_kill, Fcall_process):
9439 Don't assume pid_t fits into an Emacs fixnum.
9440 (call_process_cleanup, Fcall_process, child_setup):
9441 Don't assume pid_t fits into int.
9442 (call_process_cleanup, Fcall_process, delete_temp_file)
9443 (Fcall_process_region):
9444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9445 (Fcall_process): Simplify handling of volatile integers.
9446 Use int, not EMACS_INT, where int will do.
9447 * casefiddle.c (casify_object, casify_region, operate_on_word)
9448 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9449 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9450 (casify_object): Avoid integer overflow when overallocating buffer.
9451 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
9452 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
9453 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9454 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9455 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9456 integers are now checked earlier. All uses replaced with XINT.
9457 (ccl_driver):
9458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9459 For CCL_MapSingle, check that content and value are in int range.
9460 (ccl_driver, Fregister_code_conversion_map):
9461 Check that Vcode_version_map_vector is a vector.
9462 (resolve_symbol_ccl_program): Check that vector header is in range.
9463 Always copy the vector, so that we can check its contents reliably
9464 now rather than having to recheck each instruction as it's being
9465 executed. Check that vector words fit in 'int'.
9466 (ccl_get_compiled_code, Fregister_ccl_program)
9467 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9468 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9469 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9470 contents are in range.
9471 (Fccl_execute_on_string): Check that status is in range.
9472 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9473 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9474 Accept and return EMACS_INT, not int, because callers can pass values
9475 out of 'int' range.
9476 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9477 (multibyte_chars_in_text, parse_str_as_multibyte)
9478 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9479 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9480 (string_escape_byte8, Fget_byte):
9481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9482 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
9483 avoid mishandling large integers.
9484 * character.h: Adjust decls to match defn changes elsewhere.
9485 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9486 (Ffind_charset_region):
9487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9488 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9489 (load_charset_map_from_vector, Fdefine_charset_internal):
9490 Don't assume fixnum fits in int.
9491 (load_charset_map_from_vector, Fmap_charset_chars):
9492 Remove now-unnecessary CHECK_NATNUMs.
9493 (Fdefine_charset_internal): Check ranges here, more carefully.
9494 Don't rely on undefined behavior with signed left shift overflow.
9495 Don't assume unsigned int fits into fixnum, or that fixnum fits
9496 into unsigned int. Don't require max_code to be a valid fixnum;
9497 that's not true for gb10830 4-byte on a 32-bit host. Allow
9498 invalid_code to be a cons, for the same reason. Require code_offset
9499 to be a character. Avoid int overflow if max_char is close
9500 to INT_MAX.
9501 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9502 this is intended anyway and avoids some undefined behavior.
9503 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9504 INDEX_TO_CODE_POINT, as that's what it expects.
9505 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
9506 * charset.h (DECODE_CHAR): Return int, not unsigned;
9507 this is what was intended anyway, and it avoids undefined behavior.
9508 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9509 integer-overflow issues.
9510 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9511 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9512 where the argument is EMACS_INT, and this behavior is not intended.
9513 * chartab.c (Fmake_char_table, Fset_char_table_range)
9514 (uniprop_get_decoder, uniprop_get_encoder):
9515 Don't assume fixnum fits in int.
9516 * cmds.c (move_point): New function, that does the gist of
9517 Fforward_char and Fbackward_char, but does so while checking
9518 for integer overflow more accurately.
9519 (Fforward_char, Fbackward_char): Use it.
9520 (Fforward_line, Fend_of_line, internal_self_insert)
9521 (internal_self_insert):
9522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9523 Fix a FIXME, by checking for integer overflow when calculating
9524 target_clm and actual_clm.
9525 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
9526 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
9527 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9528 (coding_alloc_by_making_gap, alloc_destination)
9529 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9530 (encode_coding_utf_16, detect_coding_emacs_mule)
9531 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9532 (detect_coding_iso_2022, decode_coding_iso_2022)
9533 (encode_invocation_designation, encode_designation_at_bol)
9534 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9535 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9536 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9537 (encode_coding_ccl, encode_coding_raw_text)
9538 (detect_coding_charset, decode_coding_charset)
9539 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9540 (produce_composition, produce_charset, produce_annotation)
9541 (decode_coding, handle_composition_annotation)
9542 (handle_charset_annotation, consume_chars, decode_coding_gap)
9543 (decode_coding_object, encode_coding_object, detect_coding_system)
9544 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9545 (code_convert_region, code_convert_string)
9546 (Fdefine_coding_system_internal)
9547 (coding_set_source, coding_set_destination):
9548 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9549 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9550 (Fdefine_coding_system_internal):
9551 Don't assume fixnums fit in int.
9552 (decode_coding_gap, decode_coding_object, encode_coding_object)
9553 (Fread_coding_system, Fdetect_coding_region)
9554 (Funencodable_char_position, Fcheck_coding_systems_region)
9555 (get_translation, handle_composition_annotation, consume_chars):
9556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9557 (consume_chars): Rewrite to not calculate an address outside buffer.
9558 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
9559 Don't access memory outside of the args array.
9560 (Fdefine_coding_system_internal): Check for charset-id overflow.
9561 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9562 result of ENCODE_CHAR.
9563 * coding.h: Adjust decls to match defn changes elsewhere.
9564 (struct coding_system):
9565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9566 * composite.c (get_composition_id, find_composition)
9567 (run_composition_function, update_compositions)
9568 (compose_text, composition_gstring_put_cache)
9569 (composition_gstring_p, composition_gstring_width)
9570 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9571 (composition_compute_stop_pos, composition_reseat_it)
9572 (composition_update_it, struct position_record)
9573 (find_automatic_composition, composition_adjust_point)
9574 (Fcomposition_get_gstring, Ffind_composition_internal):
9575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9576 (update_compositions):
9577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9578 * composite.h: Adjust decls to match defn changes elsewhere.
9579 (struct composition):
9580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9581 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9582 Do not attempt to compute the address of the object just before a
9583 buffer; this is not portable.
9584 (Faref, Faset):
9585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9586 (Faset): Use int, not EMACS_INT, where int is wide enough.
9587 (Fstring_to_number): Don't assume fixnums fit in int.
9588 (Frem): Don't assume arg is nonnegative.
9589 * dbusbind.c (xd_append_arg): Check for integers out of range.
9590 (Fdbus_call_method): Don't overflow the timeout int.
9591 (extract_signed, extract_unsigned): New functions.
9592 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9593 (xd_get_connection_references): Return ptrdiff_t, not int.
9594 All uses changed.
9595 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9596 (xd_read_message_1):
9597 Use int, not unsigned, where the dbus API uses int.
9598 (Fdbus_message_internal): Don't overflow mtype.
9599 (syms_of_dbusbind): Allocate right-sized buffer for integers.
9600 * dired.c (directory_files_internal, file_name_completion, scmp)
9601 (file_name_completion_stat):
9602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9603 (file_name_completion): Don't overflow matchcount.
9604 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9605 * dispextern.h: Adjust decls to match defn changes elsewhere.
9606 (struct text_pos, struct glyph, struct bidi_saved_info)
9607 (struct bidi_string_data, struct bidi_it, struct composition_it)
9608 (struct it):
9609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9610 (struct display_pos, struct composition_it, struct it):
9611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9612 * dispnew.c (increment_matrix_positions)
9613 (increment_row_positions, mode_line_string)
9614 (marginal_area_string):
9615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9616 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
9617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9618 (duration_to_sec_usec): New function, to check for overflow better.
9619 (Fsleep_for, sit_for): Use it.
9620 * doc.c (get_doc_string, store_function_docstring):
9621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9622 (get_doc_string, Fsnarf_documentation):
9623 Use int, not EMACS_INT, where int is wide enough.
9624 (get_doc_string):
9625 Use SAFE_ALLOCA, not alloca.
9626 Check for overflow when converting EMACS_INT to off_t.
9627 * doprnt.c (doprnt):
9628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9629 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9630 Don't assume uid_t fits into fixnum.
9631 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9632 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9633 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9634 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9635 (general_insert_function)
9636 (Finsert_char, make_buffer_string, make_buffer_string_both)
9637 (update_buffer_properties, Fbuffer_substring)
9638 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9639 (Fsubst_char_in_region, check_translation)
9640 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9641 (transpose_markers, Ftranspose_regions):
9642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9643 (clip_to_bounds): Move to lisp.h as an inline function).
9644 (Fconstrain_to_field): Don't assume integers are nonnegative.
9645 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9646 (Fsubst_char_in_region, Fsave_restriction):
9647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9648 (Femacs_pid): Don't assume pid_t fits into fixnum.
9649 (lo_time): Use int, not EMACS_INT, when int suffices.
9650 (lisp_time_argument): Check for usec out of range.
9651 (Fencode_time): Don't assume fixnum fits in int.
9652 (Fuser_login_name, Fuser_full_name): Signal an error
9653 if a uid argument is out of range, rather than relying on
9654 undefined behavior.
9655 (Fformat_time_string): Remove now-unnecessary check.
9656 lisp_time_argument checks for out-of-range usec now.
9657 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
9658 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9659 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9660 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9661 (init_cmdargs, Fdump_emacs):
9662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9663 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9664 the bottom (typically) 32 bits of the fixnum.
9665 * eval.c (specpdl_size, call_debugger):
9666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9667 (when_entered_debugger, Fbacktrace_debug):
9668 Don't assume fixnum can fit in int.
9669 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9670 the object just before a buffer; this is not portable.
9671 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9672 (grow_specpdl, unbind_to):
9673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9674 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9675 (grow_specpdl): Simplify allocation by using xpalloc.
9676 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
9677 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9678 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9680 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9681 (a_write, e_write):
9682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9683 (Fcopy_file, non_regular_nbytes, read_non_regular)
9684 (Finsert_file_contents):
9685 Use int, not EMACS_INT, where int is wide enough.
9686 (READ_BUF_SIZE): Verify that it fits in int.
9687 (Finsert_file_contents): Check that counts are in proper range,
9688 rather than assuming fixnums fit into ptrdiff_t etc.
9689 Don't assume fixnums fit into int.
9690 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
9691 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9692 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
9693 (string_char_to_byte, string_byte_to_char)
9694 (string_make_multibyte, string_to_multibyte)
9695 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9696 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9697 (substring_both, Fdelete, internal_equal, Ffillarray)
9698 (Fclear_string, mapcar1)
9699 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9700 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9701 (larger_vector, make_hash_table, maybe_resize_hash_table)
9702 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9703 (Fmaphash, secure_hash):
9704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9705 (concat): Check for string index and length overflow.
9706 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9707 (Frequire):
9708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9709 (larger_vector): New API (vec, incr_min, size_max) replaces old
9710 one (vec, new_size, init). This catches size overflow.
9711 INIT was removed because it was always Qnil.
9712 All callers changed.
9713 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9714 the upper bound on a hash table index size.
9715 (make_hash_table, maybe_resize_hash_table): Use it.
9716 (secure_hash): Computer start_byte and end_byte only after
9717 they're known to be in ptrdiff_t range.
9718 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9719 (Ffont_get_glyphs, Ffont_at):
9720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9721 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9722 (Flist_fonts, Fopen_font):
9723 Don't assume fixnum can fit in int.
9724 (check_gstring): Don't assume index can fit in int.
9725 (font_match_p): Check that fixnum is a character, not a nonnegative
9726 fixnum, since the later code needs to stuff it into an int.
9727 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9728 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9729 conversion overflow issues.
9730 (Fopen_font): Check for integer out of range.
9731 (Ffont_get_glyphs): Don't assume index can fit in int.
9732 * font.h: Adjust decls to match defn changes elsewhere.
9733 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9734 integer overflow.
9735 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9736 printmax_t, where ptrdiff_t is wide enough.
9737 (Finternal_char_font):
9738 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9739 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9740 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9741 (Fset_frame_position, x_set_frame_parameters)
9742 (x_set_line_spacing, x_set_border_width)
9743 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9744 Check that fixnums are in proper range for system types.
9745 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9747 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9748 Use SAFE_ALLOCA_LISP, not alloca.
9749 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9750 intptr_t is wide enough.
9751 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9752 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9753 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9754 Check for fixnum out of range.
9755 * ftfont.c (ftfont_list): Don't assume index fits in int.
9756 Check that fixnums are in proper range for system types.
9757 (ftfont_shape_by_flt):
9758 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9759 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9761 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9762 Check that fixnums are in proper range for system types.
9763 * gnutls.h: Adjust decls to match defn changes elsewhere.
9764 * gtkutil.c (xg_dialog_run):
9765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9766 (update_frame_tool_bar):
9767 Check that fixnums are in proper range for system types.
9768 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
9769 (lookup_image): Check that fixnums are in range for system types.
9770 * indent.c (last_known_column, last_known_column_point):
9771 (current_column_bol_cache):
9772 (skip_invisible, current_column, check_display_width):
9773 (check_display_width, scan_for_column, current_column_1)
9774 (Findent_to, Fcurrent_indentation, position_indentation)
9775 (indented_beyond_p, Fmove_to_column, compute_motion):
9776 (Fcompute_motion, Fvertical_motion):
9777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9778 (last_known_column_modified): Use EMACS_INT, not int.
9779 (check_display_width):
9780 (Fcompute_motion):
9781 Check that fixnums and floats are in proper range for system types.
9782 (compute_motion): Don't assume index or fixnum fits in int.
9783 (compute_motion, Fcompute_motion):
9784 Use int, not EMACS_INT, when it is wide enough.
9785 (vmotion): Omit local var start_hpos that is always 0; that way
9786 we don't need to worry about overflow in expressions involving it.
9787 * indent.h: Adjust decls to match defn changes elsewhere.
9788 (struct position):
9789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9790 Use int, not EMACS_INT, where int is wide enough.
9791 Remove unused members ovstring_chars_done and tab_offset;
9792 all uses removed.
9793 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
9794 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
9795 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
9796 (make_gap, copy_text, insert, insert_and_inherit)
9797 (insert_before_markers, insert_before_markers_and_inherit)
9798 (insert_1, count_combining_before, count_combining_after)
9799 (insert_1_both, insert_from_string)
9800 (insert_from_string_before_markers, insert_from_string_1)
9801 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
9802 (adjust_after_replace, adjust_after_insert, replace_range)
9803 (replace_range_2, del_range, del_range_1, del_range_byte)
9804 (del_range_both, del_range_2, modify_region)
9805 (prepare_to_modify_buffer, signal_before_change)
9806 (signal_after_change, Fcombine_after_change_execute):
9807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9808 * intervals.c (traverse_intervals, rotate_right, rotate_left)
9809 (balance_an_interval, split_interval_right, split_interval_left)
9810 (find_interval, next_interval, update_interval)
9811 (adjust_intervals_for_insertion, delete_node, delete_interval)
9812 (interval_deletion_adjustment, adjust_intervals_for_deletion)
9813 (static_offset_intervals, offset_intervals)
9814 (merge_interval_right, merge_interval_left, make_new_interval)
9815 (graft_intervals_into_buffer, temp_set_point_both)
9816 (temp_set_point, set_point, adjust_for_invis_intang)
9817 (set_point_both, move_if_not_intangible, get_property_and_range)
9818 (get_local_map, copy_intervals, copy_intervals_to_string)
9819 (compare_string_intervals, set_intervals_multibyte_1):
9820 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9821 * intervals.h: Adjust decls to match defn changes elsewhere.
9822 (struct interval):
9823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9824 * keyboard.c (this_command_key_count, this_single_command_key_start)
9825 (before_command_key_count, before_command_echo_length, echo_now)
9826 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
9827 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
9828 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
9829 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
9830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9831 (last_non_minibuf_size, last_point_position, echo_truncate)
9832 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
9833 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
9834 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
9835 (stuff_buffered_input):
9836 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9837 (last_auto_save, command_loop_1, read_char):
9838 Use EMACS_INT, not int, to avoid integer overflow.
9839 (record_char): Avoid overflow in total_keys computation.
9840 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
9841 * keyboard.h: Adjust decls to match defn changes elsewhere.
9842 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
9843 (Fkey_description, Fdescribe_vector, Flookup_key):
9844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9845 (click_position): New function, to check that positions are in range.
9846 (Fcurrent_active_maps):
9847 (describe_command):
9848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9849 (Faccessible_keymaps, Fkey_description):
9850 (preferred_sequence_p):
9851 Don't assume fixnum can fit into int.
9852 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
9853 Check for integer overflow in size calculations.
9854 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
9855 avoid mishandling large integers.
9856 * lisp.h: Adjust decls to match defn changes elsewhere.
9857 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
9858 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
9859 (struct Lisp_Marker):
9860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9861 (clip_to_bounds): Now an inline function, moved here from editfns.c.
9862 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
9863 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
9864 All callers changed.
9865 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
9866 Assume the arg has valid form, since it always does.
9867 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
9868 unsigned integer system type.
9869 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
9870 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
9871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9872 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
9873 (duration_to_sec_usec): New decl.
9874 * lread.c (read_from_string_index, read_from_string_index_byte)
9875 (read_from_string_limit, readchar, unreadchar, openp)
9876 (read_internal_start, read1, oblookup):
9877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9878 (Fload, readevalloop, Feval_buffer, Feval_region):
9879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9880 (openp): Check for out-of-range argument to 'access'.
9881 (read1): Use int, not EMACS_INT, where int is wide enough.
9882 Don't assume fixnum fits into int.
9883 Fix off-by-one error that can read outside a buffer.
9884 (read_filtered_event): Use duration_to_sec_usec
9885 to do proper overflow checking on durations.
9886 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
9887 in size calculation.
9888 (Fexecute_kbd_macro):
9889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9890 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
9891 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
9892 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
9893 (set_marker_both, set_marker_restricted_both, marker_position)
9894 (marker_byte_position, Fbuffer_has_markers_at):
9895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9896 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
9897 * menu.c (ensure_menu_items): Rename from grow_menu_items.
9898 It now merely ensures that the menu is large enough, without
9899 necessarily growing it, as this avoids some integer overflow issues.
9900 All callers changed.
9901 (keymap_panes, parse_single_submenu, Fx_popup_menu):
9902 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9903 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
9904 Use SAFE_ALLOCA_LISP, not alloca.
9905 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
9906 to EMACS_INT. Check that fixnums are in proper range for system types.
9907 * minibuf.c (minibuf_prompt_width, string_to_object)
9908 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
9909 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
9910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9911 (get_minibuffer, read_minibuf_unwind):
9912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9913 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9914 this simplifies overflow checking. All callers changed.
9915 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9916 (Ftest_completion):
9917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9918 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9919 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9920 Check that fixnums are in proper range for system types.
9921 (Fx_create_frame, Fx_show_tip):
9922 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9923 * nsfont.m (ns_findfonts, nsfont_list_family):
9924 Don't assume fixnum fits in long.
9925 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9927 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9928 wide enough.
9929 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
9930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9931 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9932 (PRINTDECLARE, PRINTPREPARE):
9933 (strout, print_string):
9934 (print, print_preprocess, print_check_string_charset_prop)
9935 (print_object):
9936 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9937 (PRINTDECLARE):
9938 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9940 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
9941 (printchar, strout): Use xpalloc to catch size calculation overflow.
9942 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
9943 (print_error_message): Use SAFE_ALLOCA, not alloca.
9944 (print_object): Use int, not EMACS_INT, where int is wide enough.
9945 (print_depth, new_backquote_output, print_number_index):
9946 Use ptrdiff_t, not int, where int might not be wide enough.
9947 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9948 (Fset_process_window_size, Fformat_network_address)
9949 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
9950 (sigchld_handler):
9951 Check that fixnums are in proper range for system types.
9952 (Fsignal_process): Simplify by avoiding a goto.
9953 Check for process-ids out of pid_t range rather than relying on
9954 undefined behavior.
9955 (process_tick, update_tick): Use EMACS_INT, not int.
9956 (Fformat_network_address, read_process_output, send_process)
9957 (Fprocess_send_region, status_notify):
9958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9959 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9960 (wait_reading_process_output, read_process_output, exec_sentinel):
9961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9962 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9963 (Faccept_process_output): Use duration_to_sec_usec to do proper
9964 overflow checking on durations.
9965 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9966 Don't assume pid_t fits in int.
9967 * process.h (struct Lisp_Process): Members tick and update_tick
9968 are now of type EMACS_INT, not int.
9969 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9970 configured --with-wide-int.
9971 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9972 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9973 * search.c (looking_at_1, string_match_1):
9974 (fast_string_match, fast_c_string_match_ignore_case)
9975 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9976 (scan_newline, find_before_next_newline, search_command)
9977 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9978 (set_search_regs, wordify):
9979 (Freplace_match):
9980 (Fmatch_data):
9981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9982 (string_match_1, search_buffer, set_search_regs):
9983 (Fmatch_data):
9984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9985 (wordify): Check for overflow in size calculation.
9986 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9987 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9988 Check that fixnums are in proper range for system types.
9989 * sound.c (struct sound_device)
9990 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9992 (Fplay_sound_internal):
9993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9994 * syntax.c (struct lisp_parse_state, find_start_modiff)
9995 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9996 (Fparse_partial_sexp):
9997 Don't assume fixnums can fit in int.
9998 (struct lisp_parse_state, find_start_pos, find_start_value)
9999 (find_start_value_byte, find_start_begv)
10000 (update_syntax_table, char_quoted, dec_bytepos)
10001 (find_defun_start, prev_char_comend_first, back_comment):
10002 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10003 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10005 (Finternal_describe_syntax_value): Check that match_lisp is a
10006 character, not an integer, since the code stuffs it into int.
10007 (scan_words, scan_sexps_forward):
10008 Check that fixnums are in proper range for system types.
10009 (Fforward_word):
10010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10011 (scan_sexps_forward):
10012 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10013 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10014 * syntax.h: Adjust decls to match defn changes elsewhere.
10015 (struct gl_state_s):
10016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10017 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10018 MOST_POSITIVE_FIXNUM.
10019 * sysdep.c (wait_for_termination_1, wait_for_termination)
10020 (interruptible_wait_for_termination, mkdir):
10021 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10022 (emacs_read, emacs_write):
10023 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10024 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10025 and double all fit in int.
10026 * term.c (set_tty_color_mode):
10027 Check that fixnums are in proper range for system types.
10028 * termhooks.h (struct input_event):
10029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10030 * textprop.c (validate_interval_range, interval_of)
10031 (Fadd_text_properties, set_text_properties_1)
10032 (Fremove_text_properties, Fremove_list_of_text_properties)
10033 (Ftext_property_any, Ftext_property_not_all)
10034 (copy_text_properties, text_property_list, extend_property_ranges)
10035 (verify_interval_modification):
10036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10037 (Fnext_single_char_property_change)
10038 (Fprevious_single_char_property_change):
10039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10040 (copy_text_properties):
10041 Check for integer overflow in index calculation.
10042 * undo.c (last_boundary_position, record_point, record_insert)
10043 (record_delete, record_marker_adjustment, record_change)
10044 (record_property_change):
10045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10046 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10048 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10049 (Fx_hide_tip, Fx_file_dialog):
10050 * w32menu.c (set_frame_menubar):
10051 Use ptrdiff_t, not int, for consistency with rest of code.
10052 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10053 (select_window, Fdelete_other_windows_internal)
10054 (window_scroll_pixel_based, window_scroll_line_based)
10055 (Frecenter, Fset_window_configuration):
10056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10057 (Fset_window_hscroll, run_window_configuration_change_hook)
10058 (set_window_buffer, temp_output_buffer_show, scroll_command)
10059 (Fscroll_other_window, Frecenter):
10060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10061 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10062 Don't assume fixnum fits in int.
10063 (Fset_window_scroll_bars):
10064 Check that fixnums are in proper range for system types.
10065 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10066 (string_pos, c_string_pos, number_of_chars, init_iterator)
10067 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10068 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10069 (compute_display_string_end, handle_face_prop)
10070 (face_before_or_after_it_pos, handle_invisible_prop)
10071 (handle_display_prop, handle_display_spec, handle_single_display_spec)
10072 (display_prop_intangible_p, string_buffer_position_lim)
10073 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10074 (get_overlay_strings_1, get_overlay_strings)
10075 (iterate_out_of_display_property, forward_to_next_line_start)
10076 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10077 (get_next_display_element, set_iterator_to_next)
10078 (get_visually_first_element, compute_stop_pos_backwards)
10079 (handle_stop_backwards, next_element_from_buffer)
10080 (move_it_in_display_line_to, move_it_in_display_line)
10081 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10082 (add_to_log, message_dolog, message_log_check_duplicate)
10083 (message2, message2_nolog, message3, message3_nolog
10084 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10085 (current_message_1, truncate_echo_area, truncate_message_1)
10086 (set_message, set_message_1, store_mode_line_noprop)
10087 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10088 (text_outside_line_unchanged_p, check_point_in_composition)
10089 (reconsider_clip_changes)
10090 (redisplay_internal, set_cursor_from_row, try_scrolling)
10091 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10092 (redisplay_window, find_last_unchanged_at_beg_row)
10093 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10094 (trailing_whitespace_p, find_row_edges, display_line)
10095 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10096 (display_mode_element, store_mode_line_string)
10097 (pint2str, pint2hrstr, decode_mode_spec)
10098 (display_count_lines, display_string, draw_glyphs)
10099 (x_produce_glyphs, x_insert_glyphs)
10100 (rows_from_pos_range, mouse_face_from_buffer_pos)
10101 (fast_find_string_pos, mouse_face_from_string_pos)
10102 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10104 (safe_call, init_from_display_pos, handle_fontified_prop)
10105 (handle_single_display_spec, load_overlay_strings)
10106 (with_echo_area_buffer, setup_echo_area_for_printing)
10107 (display_echo_area, echo_area_display)
10108 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10109 (update_tool_bar, hscroll_window_tree, redisplay_internal)
10110 (redisplay_window, dump_glyph_row, display_mode_line)
10111 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
10112 (handle_display_spec, display_prop_string_p):
10113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10114 (handle_single_display_spec, build_desired_tool_bar_string)
10115 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10116 (get_specified_cursor_type):
10117 Check that fixnums are in proper range for system types.
10118 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10119 (Flookup_image_map):
10120 Don't assume fixnums fit in int.
10121 (compare_overlay_entries):
10122 Avoid mishandling comparisons due to subtraction overflow.
10123 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10124 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10125 (handle_tool_bar_click):
10126 Use int, not unsigned, since we prefer signed and the signedness
10127 doesn't matter here.
10128 (get_next_display_element, next_element_from_display_vector):
10129 Use int, not EMACS_INT, when int is wide enough.
10130 (start_hourglass): Use duration_to_sec_usec to do proper
10131 overflow checking on durations.
10132 * xfaces.c (Fbitmap_spec_p):
10133 Check that fixnums are in proper range for system types.
10134 (compare_fonts_by_sort_order):
10135 Avoid mishandling comparisons due to subtraction overflow.
10136 (Fx_family_fonts, realize_basic_faces):
10137 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10138 (Fx_family_fonts):
10139 Don't assume fixnum fits in int.
10140 Use SAFE_ALLOCA_LISP, not alloca.
10141 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10142 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10143 (face_at_buffer_position, face_for_overlay_string)
10144 (face_at_string_position):
10145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10146 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10147 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10148 (Fx_show_tip):
10149 Check that fixnums are in proper range for system types.
10150 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10151 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10153 (Fx_change_window_property): Don't assume fixnums fit in int.
10154 * xfont.c (xfont_chars_supported):
10155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10156 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10157 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10158 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10159 * xml.c (parse_region):
10160 * xrdb.c (magic_file_p):
10161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10162 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10163 (x_get_local_selection, x_reply_selection_request)
10164 (x_handle_selection_request, wait_for_property_change):
10165 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10166 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10167 short is wide enough.
10168 (x_send_client_event): Don't assume fixnum fits in int.
10169 * xterm.c (x_x_to_emacs_modifiers):
10170 Don't assume EMACS_INT overflows nicely into int.
10171 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10172 may come from Lisp.
10173 (handle_one_xevent): NATNUMP can eval its arg twice.
10174 (x_connection_closed):
10175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10176 * xterm.h: Adjust decls to match defn changes elsewhere.
10177 (struct scroll_bar): Use struct vectorlike_header
10178 rather than rolling our own approximation.
10179 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10180
10181 2012-05-25 Glenn Morris <rgm@gnu.org>
10182
10183 * lisp.mk (lisp): Update for more files being compiled now.
10184
10185 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10186
10187 * lread.c: Remove `read_pure' which makes no difference.
10188 (read_pure): Remove var.
10189 (unreadpure): Remove function.
10190 (readevalloop): Don't call read_list with -1 flag.
10191 (read1, read_vector): Don't test read_pure any more.
10192 (read_list): Simplify.
10193
10194 * fileio.c, character.h: Minor style tweaks.
10195
10196 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10197
10198 * window.h (clip_changed): Remove useless declaration.
10199
10200 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
10201
10202 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10203 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10204
10205 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10206
10207 Remove src/m/*.
10208 This directory predates autoconf and is no longer needed nowadays.
10209 Move its few remaining bits of functionality to where they're needed.
10210 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10211 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10212 * m/template.h: Remove.
10213 * Makefile.in (M_FILE): Remove. All uses removed.
10214 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10215 * lisp.h (USE_LSB_TAG):
10216 * mem-limits.h (EXCEEDS_LISP_PTR):
10217 Use VAL_MAX, not VALBITS, in #if.
10218 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10219 (EMACS_UINT): Define unconditionally now.
10220 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10221 (BITS_PER_EMACS_INT): New constants, replacing
10222 what used to be in config.h, but not useful in #if.
10223 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10224 define them any more.
10225 (VAL_MAX): New macro.
10226 (VALMASK): Use it.
10227 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10228 BITS_PER_EMACS_INT, in #if.
10229 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10230 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10231 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10232 * s/ms-w32.h (DATA_START):
10233 Move here from removed file m/intel386.h.
10234 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10235 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10236
10237 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10238
10239 Assume C89 or later.
10240 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10241 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10242 (xrealloc):
10243 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10244 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10245 * textprop.c, tparam.c (NULL): Remove.
10246 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10247 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10248 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10249 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10250 * xterm.c (input_signal_count): Assume volatile works.
10251
10252 2012-05-21 Ken Brown <kbrown@cornell.edu>
10253
10254 * xgselect.c (xg_select): Fix first argument in call to 'select'
10255 (bug#11508).
10256
10257 2012-05-20 Ken Brown <kbrown@cornell.edu>
10258
10259 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
10260 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
10261
10262 2012-05-19 Ken Brown <kbrown@cornell.edu>
10263
10264 * xfns.c (x_in_use): Remove `static' qualifier.
10265 * xterm.h (x_in_use): Declare.
10266 * xgselect.c: Include xterm.h.
10267 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10268 and `display_arg' (bug#9754).
10269
10270 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10271
10272 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10273
10274 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10275 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10276
10277 2012-05-18 Eli Zaretskii <eliz@gnu.org>
10278
10279 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10280
10281 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
10282 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
10283
10284 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10285 reference to image_cache->refcount.
10286 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10287
10288 2012-05-17 Juri Linkov <juri@jurta.org>
10289
10290 * search.c (Fword_search_regexp, Fword_search_backward)
10291 (Fword_search_forward, Fword_search_backward_lax)
10292 (Fword_search_forward_lax): Move functions to isearch.el
10293 (bug#10145, bug#11381).
10294
10295 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10296
10297 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10298
10299 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10300
10301 * lread.c (init_obarray): Declare Qt and Qnil as special.
10302
10303 2012-05-14 Glenn Morris <rgm@gnu.org>
10304
10305 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
10306 Put "libexec" before "bin", for the sake of init_callproc_1.
10307
10308 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10309
10310 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10311
10312 * unexaix.c: Port to more-recent AIX compilers.
10313 (report_error, report_error_1, make_hdr, copy_sym)
10314 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10315 Make arguments const char *, not char *, to avoid violations of C
10316 standard and to fix some AIX warnings reported by Gilles Pion.
10317
10318 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10319
10320 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10321 already have overlays loaded.
10322 (handle_single_display_spec): Before returning without displaying
10323 fringe bitmap, synchronize the bidi iterator with the main display
10324 iterator, by calling iterate_out_of_display_property.
10325 (iterate_out_of_display_property): Detect buffer iteration by
10326 testing that it->string is a Lisp string.
10327 (get_next_display_element): When the current object is exhausted,
10328 and there's something on it->stack, call set_iterator_to_next to
10329 proceed with what's on the stack, instead of returning zero.
10330 (set_iterator_to_next): If called at the end of a Lisp string,
10331 proceed to consider_string_end without incrementing string
10332 position. Don't increment display vector index past the end of
10333 the display vector. (Bug#11417)
10334 (pos_visible_p): Don't report a position visible when move_it_to
10335 stopped at the last line of window, which happens to be scanned
10336 backwards by the bidi iteration. (Bug#11464)
10337
10338 2012-05-14 Eli Zaretskii <eliz@gnu.org>
10339
10340 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10341 and right-margin display specs even if the spec is invalid or we
10342 are on a TTY, and thus unable to display on the fringes.
10343 That's because the text with the property will not be displayed anyway,
10344 so we need to signal to the caller that this is a "replacing"
10345 display spec. This fixes display when the spec is invalid or we
10346 are on a TTY.
10347
10348 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10349
10350 * unexaix.c (make_hdr): Fix typo in prototype.
10351 This bug broke the build on AIX. Problem reported by Gilles Pion.
10352
10353 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
10354
10355 * keyboard.c (kbd_buffer_get_event): Read special events also in
10356 batch mode. (Bug#11415)
10357
10358 2012-05-12 Glenn Morris <rgm@gnu.org>
10359
10360 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10361
10362 2012-05-12 Eli Zaretskii <eliz@gnu.org>
10363
10364 * lisp.mk (lisp): Add newcomment.elc.
10365
10366 2012-05-12 Glenn Morris <rgm@gnu.org>
10367
10368 * Makefile.in (MKDIR_P): New, set by configure.
10369 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10370
10371 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10372
10373 Remove unused function hourglass_started.
10374 * dispextern.h (hourglass_started):
10375 * w32fns.c (hourglass_started):
10376 * xdisp.c (hourglass_started): Remove.
10377
10378 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
10379
10380 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10381 Update dependencies.
10382
10383 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10384
10385 * xgselect.c (xg_select): Put maxfds+1 into a var.
10386 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10387
10388 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10389
10390 2012-05-10 Dave Abrahams <dave@boostpro.com>
10391
10392 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10393 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10394
10395 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
10396
10397 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10398 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10399 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10400 Initialize xd_registered_buses.
10401
10402 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10403
10404 Untag more efficiently if USE_LSB_TAG.
10405 This is based on a proposal by YAMAMOTO Mitsuharu in
10406 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10407 For an admittedly artificial (nth 8000 longlist) benchmark on
10408 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10409 Emacs's overall text size by 1%.
10410 * lisp.h (XUNTAG): New macro.
10411 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10412 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10413 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10414 * eval.c (Fautoload):
10415 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10416 * frame.h (XFRAME): Use XUNTAG.
10417
10418 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10419 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10420 Remove unportable assumptions about print widths of types like
10421 dbus_uint32_t.
10422 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10423 intptr_t when converting between pointer and integer, to avoid GCC
10424 warnings about wrong width.
10425
10426 2012-05-09 Eli Zaretskii <eliz@gnu.org>
10427
10428 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10429 stack for each reader_thread, instead of defaulting to 8MB
10430 determined by the linker. This avoids failures in creating
10431 subprocesses on Windows 7, see the discussion in this thread:
10432 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10433
10434 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10435
10436 Fix up display of the *Minibuf-0* buffer in the mini window.
10437 * keyboard.c (read_char): Don't clear the echo area if there's no
10438 message to clear.
10439 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
10440 contents of *Minibuf-0*) if there's no message displayed in its stead.
10441
10442 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
10443
10444 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10445 batch mode.
10446
10447 2012-05-06 Chong Yidong <cyd@gnu.org>
10448
10449 * lisp.mk (lisp): Update.
10450
10451 2012-05-05 Jim Meyering <meyering@redhat.com>
10452
10453 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10454
10455 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10456
10457 * data.c (PUT_ERROR): New macro.
10458 (syms_of_data): Use it. Add new error type `user-error'.
10459 * undo.c (user_error): New function.
10460 (Fprimitive_undo): Use it.
10461 * print.c (print_error_message): Adjust print style for `user-error'.
10462 * keyboard.c (user_error): New function.
10463 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10464
10465 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10466
10467 Do not limit current-time-string to years 1000..9999.
10468 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10469 (Fcurrent_time_string): Support any year that is supported by the
10470 underlying localtime representation. Don't use asctime, as it
10471 has undefined behavior for years outside the range -999..9999.
10472
10473 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10474
10475 Fix race conditions involving setenv, gmtime, localtime, asctime.
10476 Without this fix, interrupts could mess up code that uses these
10477 nonreentrant functions, since setting TZ invalidates existing
10478 tm_zone or tzname values, and since most of these functions return
10479 pointers to static storage.
10480 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10481 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10482 Grow the critical sections to include not just invoking
10483 localtime/gmtime, but also accessing these functions' results
10484 including their tm_zone values if any, and any related TZ setting.
10485 (format_time_string): Last arg is now struct tm *, not struct tm **,
10486 so that the struct tm is saved in the critical section.
10487 All callers changed. Simplify allocation of initial buffer, partly
10488 motivated by the fact that memory allocation needs to be outside
10489 the critical section.
10490
10491 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10492
10493 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10494 with RESET_INTERVAL.
10495
10496 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10497 Remove duplicated buffer name initialization.
10498
10499 2012-05-02 Jim Meyering <jim@meyering.net>
10500
10501 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10502
10503 * xfns.c (x_window): Use xstrdup (Bug#11375).
10504
10505 2012-05-02 Eli Zaretskii <eliz@gnu.org>
10506
10507 * xdisp.c (pos_visible_p): If already at a newline from the
10508 display string before the 'while' loop, don't walk back the glyphs
10509 from it3.glyph_row. Solves assertion violation when the display
10510 string begins with a newline (egg.el). (Bug#11367)
10511
10512 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10513
10514 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10515 Move to simple.el.
10516
10517 2012-05-01 Glenn Morris <rgm@gnu.org>
10518
10519 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10520 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10521 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10522 All were removed before 23.1.
10523
10524 * dispnew.c: Remove HAVE_LIBNCURSES test;
10525 it is always true on relevant platforms.
10526
10527 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10528 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10529
10530 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10531
10532 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10533
10534 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10535 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10536 Remove.
10537
10538 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10539
10540 Do not avoid creating empty evaporating overlays (Bug#9642).
10541 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10542 That is, do not delete an evaporating overlay if it becomes
10543 empty after its bounds are adjusted to fit within its buffer.
10544 This fix caused other problems, and I'm reverting it until we get
10545 to the bottom of them.
10546
10547 2012-04-27 Chong Yidong <cyd@gnu.org>
10548
10549 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10550
10551 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10552
10553 * xdisp.c (pos_visible_p): If the window start position is beyond
10554 ZV, start the display from buffer beginning. Prevents assertion
10555 violation in init_iterator when the minibuffer window is scrolled
10556 via the scroll bar.
10557
10558 * window.c (window_scroll_pixel_based): Likewise.
10559
10560 2012-04-27 Chong Yidong <cyd@gnu.org>
10561
10562 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10563
10564 2012-04-27 Glenn Morris <rgm@gnu.org>
10565
10566 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10567 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10568
10569 2012-04-27 Eli Zaretskii <eliz@gnu.org>
10570
10571 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10572 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
10573
10574 2012-04-26 Eli Zaretskii <eliz@gnu.org>
10575
10576 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10577 display element, check also the underlying string or buffer
10578 character. (Bug#11341)
10579
10580 * w32menu.c: Include w32heap.h.
10581 (add_menu_item): If the call to AppendMenuW (via
10582 unicode_append_menu) fails, disable Unicode menus only if we are
10583 running on Windows 9X/Me.
10584
10585 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10586
10587 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10588 (xgetint): Add missing shift for LSB tags.
10589
10590 2012-04-24 Martin Rudalics <rudalics@gmx.at>
10591
10592 * keyboard.c (read_char): Don't wipe echo area for select window
10593 events: These might get delayed via `mouse-autoselect-window'
10594 (Bug#11304).
10595
10596 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
10597
10598 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10599 manipulation of :loaded-from data.
10600
10601 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
10602
10603 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10604 now a cons (bug#11311).
10605
10606 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10607
10608 Do not create empty overlays with the evaporate property (Bug#9642).
10609 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10610 if it becomes empty after its bounds are adjusted to fit within
10611 its buffer. Without this fix, in a nonempty buffer (let ((o
10612 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10613 yields an empty overlay that has the evaporate property, which is
10614 not supposed to happen.
10615
10616 Fix minor GTK3 problems found by static checking.
10617 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10618 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10619 (struct _EmacsFixedClass, emacs_fixed_get_type):
10620 Move decls here from emacsgtkfixed.h, since they needn't be public.
10621 (emacs_fixed_get_type): Now static.
10622 (emacs_fixed_class_init): Omit unused local.
10623 (emacs_fixed_child_type): Remove; unused.
10624 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10625 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10626 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10627 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10628 (EMACS_FIXED_GET_CLASS): Remove; unused.
10629 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10630
10631 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10632 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10633
10634 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
10637 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
10638 (__malloc_size_t, __malloc_ptrdiff_t):
10639 Remove. All uses removed, replaced by the definiens if needed,
10640 since we can assume C89 or better now.
10641 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10642 (protect_malloc_state, align, get_contiguous_space)
10643 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10644 (malloc_atfork_handler_child, malloc_enable_thread)
10645 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10646 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10647 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10648 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10649 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10650 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10651 Define using prototypes, not old style.
10652 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10653 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10654 (align): Don't assume that signed integer overflow wraps around.
10655 Omit unused local var.
10656 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10657 (_free_internal_nolock, memalign, mallochook, reallochook):
10658 Omit no-longer-needed casts.
10659 (valloc): Use getpagesize, not __getpagesize.
10660 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10661 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10662
10663 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10664
10665 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
10666
10667 Move functions from C to Lisp. Make non-blocking method calls
10668 the default. Implement further D-Bus standard interfaces.
10669
10670 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10671 (QCdbus_request_name_allow_replacement)
10672 (QCdbus_request_name_replace_existing)
10673 (QCdbus_request_name_do_not_queue)
10674 (QCdbus_request_name_reply_primary_owner)
10675 (QCdbus_request_name_reply_in_queue)
10676 (QCdbus_request_name_reply_exists)
10677 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10678 (QCdbus_registered_serial, QCdbus_registered_method)
10679 (QCdbus_registered_signal): New Lisp objects.
10680 (XD_DEBUG_MESSAGE): Use sizeof.
10681 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10682 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10683 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10684 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10685 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10686 (xd_signature, xd_append_arg): Allow float for integer types.
10687 (xd_get_connection_references): New function.
10688 (xd_get_connection_address): Rename from xd_initialize.
10689 Return cached address.
10690 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10691 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10692 level.
10693 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
10694 Return number of refcounts.
10695 (Fdbus_get_unique_name): Make stronger parameter check.
10696 (Fdbus_message_internal): New defun.
10697 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10698 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10699 (Fdbus_send_signal, Fdbus_register_service)
10700 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10701 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10702 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10703 (Vdbus_compiled_version, Vdbus_runtime_version)
10704 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10705 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10706 (Vdbus_message_type_signal): New defvars.
10707 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10708 Adapt docstring.
10709
10710 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10711
10712 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10713 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10714 Do not assume ptrdiff_t is the same width as 'int'.
10715
10716 * alloc.c: Handle unusual debugging option combinations.
10717 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10718 since the two debugging options are incompatible.
10719 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10720 is defined.
10721 (mem_init, mem_insert, mem_insert_fixup):
10722 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10723 (NEED_MEM_INSERT): Remove; no longer needed.
10724
10725 2012-04-22 Leo Liu <sdl.web@gmail.com>
10726
10727 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10728
10729 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * sysdep.c [__FreeBSD__]: Minor cleanups.
10732 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10733 Use Emacs indenting style more consistently. Avoid some casts.
10734 Use 'double' consistently rather than mixing 'float' and 'double'.
10735
10736 2012-04-21 Eduard Wiebe <usenet@pusto.de>
10737
10738 * sysdep.c (list_system_processes, system_process_attributes):
10739 Add implementation for FreeBSD (Bug#5243).
10740
10741 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10742
10743 * lisp.mk (lisp): Update.
10744
10745 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10746
10747 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10748 It is never used otherwise.
10749
10750 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10751
10752 * print.c (print_preprocess): Only check print_depth if print-circle
10753 is nil.
10754 (print_object): Check for cycles even when print-circle is nil and
10755 print-gensym is t, but only check print_depth if print-circle is nil.
10756
10757 2012-04-20 Chong Yidong <cyd@gnu.org>
10758
10759 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10760 set the status to "failed" and ensure that sentinel is run.
10761
10762 2012-04-20 Glenn Morris <rgm@gnu.org>
10763
10764 * process.c (Fset_process_inherit_coding_system_flag)
10765 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10766 (Fmake_network_process, Fmake_serial_process): Doc fix.
10767
10768 2012-04-20 Eli Zaretskii <eliz@gnu.org>
10769
10770 * xdisp.c (string_buffer_position_lim): Limit starting position to
10771 BEGV.
10772 (set_cursor_from_row): If called for a mode-line or header-line
10773 row, return zero immediately.
10774 (try_cursor_movement): If inside continuation line, don't back up
10775 farther than the first row after the header line, if any.
10776 Don't consider the header-line row as "partially visible", even if
10777 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
10778
10779 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10780
10781 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
10782 (bug#11238).
10783
10784 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
10785 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
10786
10787 configure: new option --enable-gcc-warnings (Bug#11207)
10788 * Makefile.in (C_WARNINGS_SWITCH): Remove.
10789 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
10790 (ALL_CFLAGS): Use new macros rather than old.
10791 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
10792 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
10793 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
10794 -Wunused-result, -Wunused-variable. This should go away once
10795 the Emacs and Gnulib regex code is merged.
10796 (xmalloc, xrealloc): Now static.
10797
10798 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 * dired.c (Fsystem_groups): Remove unused local.
10801
10802 2012-04-17 Glenn Morris <rgm@gnu.org>
10803
10804 * dired.c (Fsystem_users): Doc fix.
10805
10806 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
10807
10808 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
10809 (syms_of_dired): Add them.
10810
10811 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
10812
10813 Fix minor alloc.c problems found by static checking.
10814 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
10815 New extern decls, to avoid calling undeclared functions.
10816 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
10817 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
10818 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
10819 (NEED_MEM_INSERT): New macro.
10820 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
10821 Remove one incorrect comment and fix another.
10822
10823 Fix minor ralloc.c problems found by static checking.
10824 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10825 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
10826 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
10827 (r_alloc_sbrk): Now static.
10828
10829 Improve ralloc.c interface checking.
10830 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
10831 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
10832 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
10833 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
10834 [REL_ALLOC]: ... to here, to check interface.
10835 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
10836 Remove decls. This fixes an "It stinks!".
10837
10838 * alloc.c (which_symbols): Fix alignment issue / type clash.
10839
10840 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
10841
10842 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
10843 (struct Lisp_Misc_Any): Likewise.
10844 (struct Lisp_Free): Likewise.
10845 * alloc.c (union aligned_Lisp_Symbol): Define.
10846 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
10847 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
10848 (union aligned_Lisp_Misc): Define.
10849 (MARKER_BLOCK_SIZE, struct marker_block): Use union
10850 aligned_Lisp_Misc instead of union Lisp_Misc.
10851 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
10852
10853 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
10854
10855 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
10856 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
10857 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
10858 * s/netbsd.h, s/sol2-6.h:
10859 Remove definition of GC_MARK_STACK, since the default now works.
10860 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
10861 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
10862 no longer the default.
10863 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
10864
10865 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
10866
10867 * lread.c (lisp_file_lexically_bound_p):
10868 Fix hang at ";-*-\n" (bug#11238).
10869
10870 2012-04-14 Eli Zaretskii <eliz@gnu.org>
10871
10872 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
10873 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
10874
10875 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
10876
10877 * nsterm.m (constrainFrameRect): Always constrain when there is only
10878 one screen (Bug#10962).
10879
10880 2012-04-13 Ken Brown <kbrown@cornell.edu>
10881
10882 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
10883
10884 2012-04-13 Reuben Thomas <rrt@sc3d.org>
10885
10886 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
10887
10888 2012-04-11 Daniel Colascione <dancol@dancol.org>
10889
10890 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
10891 against is gone. It's better to use vfork now so that when Cygwin
10892 gains a new, working vfork, we use it automatically (bug#10398).
10893
10894 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10895
10896 * window.c (save_window_save): Obey window-point-insertion-type.
10897
10898 2012-04-11 Glenn Morris <rgm@gnu.org>
10899
10900 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
10901
10902 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
10903
10904 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
10905
10906 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
10907
10908 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
10909 (force_quit_count): New var.
10910 (handle_interrupt): Use it.
10911
10912 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
10913
10914 * w32.c (w32_delayed_load): Record the full path of the library
10915 being loaded (bug#10424).
10916
10917 2012-04-09 Glenn Morris <rgm@gnu.org>
10918
10919 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10920 not just in the obarray, before snarfing them. (Bug#11036)
10921
10922 * Makefile.in ($(leimdir)/leim-list.el):
10923 Pass EMACS rather than BUILT_EMACS.
10924
10925 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10926
10927 * process.c (make_process):
10928 * process.h: Add integer `gnutls_handshakes_tried' member to
10929 process struct.
10930
10931 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10932 Add convenience `GNUTLS_LOG2i' macro.
10933
10934 * gnutls.c (gnutls_log_function2i): Convenience log function.
10935 (emacs_gnutls_read): Use new log functions,
10936 `gnutls_handshakes_tried' process member, and
10937 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10938 attempts per process (connection).
10939
10940 2012-04-09 Chong Yidong <cyd@gnu.org>
10941
10942 * eval.c (Fuser_variable_p, user_variable_p_eh)
10943 (lisp_indirect_variable): Functions deleted.
10944 (Fdefvar): Caller changed.
10945
10946 * callint.c (Finteractive, Fcall_interactively):
10947 * minibuf.c (Fread_variable): Callers changed.
10948
10949 2012-04-09 Eli Zaretskii <eliz@gnu.org>
10950
10951 * xdisp.c (set_cursor_from_row): If the display string appears in
10952 the buffer at position that is closer to point than the position
10953 after the display string, display the cursor on the first glyph of
10954 the display string. Fixes cursor display when a 'display' text
10955 property immediately follows invisible text. (Bug#11094)
10956
10957 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10958
10959 composite.c: use 'double' consistently
10960 * composite.c (get_composition_id): Use 'double' consistently
10961 instead of converting 'float' to 'double' and vice versa; this is
10962 easier to understand and avoids a GCC warning.
10963
10964 2012-04-09 Glenn Morris <rgm@gnu.org>
10965
10966 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10967 preparation for dumping it with emacs. (Bug#4789)
10968 (leimdir): New variable.
10969 ($(leimdir)/leim-list.el): New rule.
10970 (emacs$(EXEEXT)): Depend on leim-list.el.
10971
10972 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10973 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10974 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10975
10976 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10977
10978 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10979 proper alignment.
10980
10981 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
10982
10983 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10984 Remove unused local variable.
10985
10986 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10987
10988 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10989 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10990 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10991 objects, as mark_maybe_pointer will catch them otherwise.
10992 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10993 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10994
10995 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10996
10997 Fix typo that broke non-Windows builds.
10998 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10999
11000 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11001
11002 Support building on MS-Windows with libxml2.
11003
11004 * makefile.w32-in (OBJ2): Add xml.$(O).
11005 (GLOBAL_SOURCES): Add xml.c.
11006 ($(BLD)/xml.$(O)): New dependency list.
11007
11008 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11009 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11010 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11011 [!WINDOWSNT]: New macros.
11012 (init_libxml2_functions, libxml2_loaded_p): New functions.
11013 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11014 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11015 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11016 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11017 linked in).
11018 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11019 Call init_libxml2_functions before calling libxml2 functions.
11020 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11021
11022 * emacs.c: Don't include libxml/parser.h.
11023 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11024 xmlCleanupParser directly.
11025
11026 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11027
11028 2012-04-07 Eli Zaretskii <eliz@gnu.org>
11029
11030 * indent.c (Fvertical_motion): If there is a display string at
11031 point, use it.vpos to compute how many lines to backtrack after
11032 move_it_to point. (Bug#11133)
11033
11034 2012-04-06 Eli Zaretskii <eliz@gnu.org>
11035
11036 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11037 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11038 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11039 macros related to unification of CJK characters. For the details,
11040 see the discussion following the message here:
11041 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11042
11043 2012-04-04 Chong Yidong <cyd@gnu.org>
11044
11045 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11046
11047 2012-04-01 Eli Zaretskii <eliz@gnu.org>
11048
11049 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11050 instead of alloca. (Bug#11138)
11051
11052 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11053
11054 * w32menu.c (is_simple_dialog): Properly check lisp types.
11055 (Bug#11141)
11056
11057 2012-03-31 Eli Zaretskii <eliz@gnu.org>
11058
11059 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11060 position we get to after a call to move_it_to fails the
11061 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11062 only if we wind up in a string from display property. (Bug#11063)
11063
11064 * window.c (Fdelete_other_windows_internal): Invalidate the row
11065 and column information about mouse highlight, so that redisplay
11066 restores it after reallocating the glyph matrices. (Bug#7464)
11067
11068 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11069 string comes from a `display' text property, use the buffer
11070 position of that property as if we actually saw that position in
11071 the row's glyphs.
11072 (move_it_by_lines): Remove the assertion that
11073 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11074 violated when there's a before-string at the beginning of a line.
11075 (Bug#11063)
11076
11077 2012-03-30 Eli Zaretskii <eliz@gnu.org>
11078
11079 * xdisp.c (append_space_for_newline): If the default face was
11080 remapped, use the remapped face for the appended newline.
11081 (extend_face_to_end_of_line): Use the remapped default face for
11082 extending the face to the end of the line.
11083 (display_line): Call extend_face_to_end_of_line when the default
11084 face was remapped. (Bug#11068)
11085
11086 2012-03-29 Eli Zaretskii <eliz@gnu.org>
11087
11088 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11089
11090 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11091
11092 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11093
11094 2012-03-27 Glenn Morris <rgm@gnu.org>
11095
11096 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11097 Doc fixes.
11098
11099 2012-03-26 Kenichi Handa <handa@m17n.org>
11100
11101 * dispextern.h (struct glyph): Fix previous change. Change the
11102 bit length of glyphless.ch to 25 (Bug#11082).
11103
11104 2012-03-26 Chong Yidong <cyd@gnu.org>
11105
11106 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11107 (command_loop_1): Use it; inhibit selection update for
11108 handle-select-window too (Bug#8996).
11109
11110 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11111
11112 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
11113
11114 2012-03-25 Kenichi Handa <handa@m17n.org>
11115
11116 * dispextern.h (struct glyph): Change the bit length of
11117 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11118
11119 2012-03-24 Eli Zaretskii <eliz@gnu.org>
11120
11121 * s/ms-w32.h (tzname): Include time.h before redirecting to
11122 _tzname. Fixes the MSVC build. (Bug#9960)
11123
11124 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11125
11126 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11127 characters.
11128
11129 * xterm.c (XTread_socket): Only modify handling_signal if
11130 !SYNC_INPUT. (Bug#11080)
11131
11132 2012-03-23 Eli Zaretskii <eliz@gnu.org>
11133
11134 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11135 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11136 when fetching a multibyte character consumes more bytes than
11137 CHAR_BYTES returns, due to unification of CJK characters in
11138 string_char. (Bug#11073)
11139
11140 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11141
11142 * process.c (wait_reading_process_output): Handle pty disconnect
11143 by refraining from sending oneself a SIGCHLD (bug#10933).
11144
11145 2012-03-22 Chong Yidong <cyd@gnu.org>
11146
11147 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11148
11149 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
11150 Mark string as coming from a prefix property.
11151 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11152 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11153
11154 2012-03-21 Chong Yidong <cyd@gnu.org>
11155
11156 * xfaces.c (Vface_remapping_alist): Doc fix.
11157
11158 2012-03-20 Eli Zaretskii <eliz@gnu.org>
11159
11160 * w32proc.c (Fw32_set_console_codepage)
11161 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11162 Doc fixes.
11163
11164 2012-03-20 Chong Yidong <cyd@gnu.org>
11165
11166 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11167 to reflect default non-nil value of redisplay-dont-pause.
11168
11169 2012-03-19 Kenichi Handa <handa@m17n.org>
11170
11171 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11172 it fit in a valid range (Bug#11003).
11173
11174 2012-03-18 Eli Zaretskii <eliz@gnu.org>
11175
11176 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11177 that is not from display property, accept the row as a "cursor
11178 row" if one of the string's character has a non-nil `cursor'
11179 property. Fixes cursor positioning when there are newlines in
11180 overlay strings, e.g. in icomplete.el. (Bug#11035)
11181
11182 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11185
11186 2012-03-12 Chong Yidong <cyd@gnu.org>
11187
11188 * eval.c (inhibit_lisp_code): Rename from
11189 inhibit_window_configuration_change_hook; move from window.c.
11190
11191 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11192 * window.c (run_window_configuration_change_hook)
11193 (syms_of_window): Callers changed.
11194
11195 2012-03-11 Chong Yidong <cyd@gnu.org>
11196
11197 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11198
11199 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11200
11201 2012-03-10 Chong Yidong <cyd@gnu.org>
11202
11203 * frame.c (other_visible_frames): Don't assume the selected frame
11204 is visible (Bug#10955).
11205
11206 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11207
11208 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11209
11210 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11211
11212 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11213 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11214 zero (Bug#10954).
11215
11216 2012-03-03 Glenn Morris <rgm@gnu.org>
11217
11218 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
11219
11220 2012-03-02 Eli Zaretskii <eliz@gnu.org>
11221
11222 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11223 position past the first glyph_row that ends at ZV. (Bug#10902)
11224 (redisplay_window, next_element_from_string): Fix typos in
11225 comments.
11226 (redisplay_window): Pass to move_it_vertically the margin in
11227 pixels, not in screen lines.
11228
11229 2012-03-02 Glenn Morris <rgm@gnu.org>
11230
11231 * buffer.c (buffer-list-update-hook): Doc fix.
11232
11233 2012-02-29 Eli Zaretskii <eliz@gnu.org>
11234
11235 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11236 push_it before setting up the iterator for the first overlay
11237 string, even if we have an empty string loaded.
11238 (next_overlay_string): If there's an empty string on the iterator
11239 stack, pop the stack. (Bug#10903)
11240
11241 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11242
11243 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11244 Suggested by Stefan Monnier in
11245 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11246 * alloc.c (widen_to_Lisp_Object): New static function.
11247 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11248 and widening them to Lisp_Objects. This would work even if
11249 USE_LSB_TAG is defined and wide integers are used, which might
11250 happen in a future version of Emacs.
11251
11252 2012-02-25 Chong Yidong <cyd@gnu.org>
11253
11254 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11255 Doc fix.
11256
11257 * xselect.c (Fx_selection_exists_p): Doc fix.
11258 (x_clipboard_manager_save_all): Print an informative message
11259 before saving to clipboard manager.
11260
11261 2012-02-24 Chong Yidong <cyd@gnu.org>
11262
11263 * keyboard.c (process_special_events): Handle all X selection
11264 requests in kbd_buffer, not just the next one (Bug#8869).
11265
11266 2012-02-23 Chong Yidong <cyd@gnu.org>
11267
11268 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11269 call when setting menu-bar-lines and tool-bar-lines parameters.
11270 (unwind_create_frame_1): New helper function.
11271
11272 * window.c (inhibit_window_configuration_change_hook): New var.
11273 (run_window_configuration_change_hook): Obey it.
11274 (syms_of_window): Initialize it.
11275
11276 2012-02-22 Chong Yidong <cyd@gnu.org>
11277
11278 * xterm.c (x_draw_image_relief): Add missing type check for
11279 Vtool_bar_button_margin (Bug#10743).
11280
11281 2012-02-21 Chong Yidong <cyd@gnu.org>
11282
11283 * fileio.c (Vfile_name_handler_alist): Doc fix.
11284
11285 * buffer.c (Fget_file_buffer): Protect against invalid file
11286 handler return value.
11287
11288 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11289
11290 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11291 when computing $valmask.
11292
11293 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11294 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11295 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11296 It's useless in that case, and it can cause problems on hosts
11297 that allocate halves of EMACS_INT values separately.
11298 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11299 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11300 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11301 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11302 it avoids undefined behavior on hosts where shifting right by more
11303 than the word width has undefined behavior.
11304
11305 2012-02-19 Chong Yidong <cyd@gnu.org>
11306
11307 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11308 (Funhandled_file_name_directory, Ffile_name_as_directory)
11309 (Fdirectory_file_name, Fexpand_file_name)
11310 (Fsubstitute_in_file_name): Protect against invalid file handler
11311 return values (Bug#10845).
11312
11313 2012-02-18 Eli Zaretskii <eliz@gnu.org>
11314
11315 * .gdbinit (pitx): Fix incorrect references to fields of the
11316 iterator stack.
11317
11318 2012-02-17 Chong Yidong <cyd@gnu.org>
11319
11320 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11321
11322 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11325 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11326
11327 2012-02-15 Chong Yidong <cyd@gnu.org>
11328
11329 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11330 marked as special. Also, starting docstrings with * is obsolete.
11331
11332 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11333
11334 * gnutls.c (emacs_gnutls_write): Fix last change.
11335
11336 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11337
11338 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11339 send_process.
11340
11341 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11342
11343 * keymap.c (Fsingle_key_description): Handle char ranges.
11344
11345 2012-02-12 Chong Yidong <cyd@gnu.org>
11346
11347 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11348 as that creates a dangerous corner case.
11349
11350 * window.c (Fdelete_window_internal): Invalidate the mouse
11351 highlight (Bug#9904).
11352
11353 2012-02-12 Glenn Morris <rgm@gnu.org>
11354
11355 * xselect.c (Fx_own_selection_internal)
11356 (Fx_get_selection_internal, Fx_disown_selection_internal)
11357 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11358 * nsselect.m (Fx_own_selection_internal)
11359 (Fx_disown_selection_internal, Fx_selection_exists_p)
11360 (Fx_selection_owner_p, Fx_get_selection_internal):
11361 Sync docs and argument specs with the xselect.c versions.
11362
11363 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11364
11365 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11366
11367 2012-02-11 Eli Zaretskii <eliz@gnu.org>
11368
11369 * w32select.c (Fx_selection_exists_p): Sync doc string and
11370 argument list with xselect.c. (Bug#10783)
11371
11372 * w16select.c (Fx_selection_exists_p): Sync doc string and
11373 argument list with xselect.c. (Bug#10783)
11374
11375 2012-02-10 Glenn Morris <rgm@gnu.org>
11376
11377 * fns.c (Fsecure_hash): Doc fix.
11378
11379 2012-02-09 Kenichi Handa <handa@m17n.org>
11380
11381 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11382
11383 2012-02-07 Chong Yidong <cyd@gnu.org>
11384
11385 * buffer.c (Fbuffer_local_variables)
11386 (buffer_lisp_local_variables): Handle unbound vars correctly;
11387 don't let Qunbound leak into Lisp.
11388
11389 2012-02-07 Glenn Morris <rgm@gnu.org>
11390
11391 * image.c (Fimagemagick_types): Doc fix.
11392
11393 * image.c (imagemagick-render-type): Change it from a lisp object
11394 to an integer. Move the doc here from the lisp manual.
11395 Treat all values not equal to 0 the same.
11396
11397 2012-02-06 Chong Yidong <cyd@gnu.org>
11398
11399 * doc.c (store_function_docstring): Avoid applying docstring of
11400 alias to base function (Bug#2603).
11401
11402 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11403
11404 * .gdbinit (pp1, pv1): Remove redundant defines.
11405 (pr): Use pp.
11406
11407 2012-02-04 Chong Yidong <cyd@gnu.org>
11408
11409 * nsterm.m: Declare a global (Bug#10694).
11410
11411 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11412
11413 * w32.c (get_emacs_configuration_options):
11414 Include --enable-checking, if specified, in the return value.
11415
11416 2012-02-04 Martin Rudalics <rudalics@gmx.at>
11417
11418 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11419 after rounding frame sizes. (Bug#9723)
11420
11421 2012-02-04 Eli Zaretskii <eliz@gnu.org>
11422
11423 * keyboard.c (adjust_point_for_property): Don't position point
11424 before BEGV. (Bug#10696)
11425
11426 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 Handle overflow when computing char display width (Bug#9496).
11429 * character.c (char_width): Return EMACS_INT, not int.
11430 (char_width, c_string_width): Check for overflow when
11431 computing the width; this is possible now that individual
11432 characters can have unbounded width. Problem introduced
11433 by merge from Emacs 23 on 2012-01-19.
11434
11435 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
11436
11437 * dbusbind.c (Fdbus_register_method): Mention the return value
11438 :ignore in the docstring.
11439
11440 2012-02-02 Glenn Morris <rgm@gnu.org>
11441
11442 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11443
11444 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11445 Unconditionally set to t. (Bug#10673)
11446 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11447 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11448 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11449
11450 2012-02-02 Kenichi Handa <handa@m17n.org>
11451
11452 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11453 0, do not call append_composite_glyph.
11454
11455 2012-02-02 Kenichi Handa <handa@m17n.org>
11456
11457 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11458 NULL (Bug#6988).
11459 (x_produce_glyphs): If the component of a composition is a null
11460 string, set it->pixel_width to 1 to avoid zero-width glyph.
11461
11462 2012-02-01 Eli Zaretskii <eliz@gnu.org>
11463
11464 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11465 first 2 arguments are identical. This makes inserting large
11466 output from a subprocess an order of magnitude faster on
11467 MS-Windows, where all sbrk'ed memory is always contiguous.
11468
11469 2012-01-31 Glenn Morris <rgm@gnu.org>
11470
11471 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11472 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11473 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11474
11475 2012-01-29 Glenn Morris <rgm@gnu.org>
11476
11477 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11478
11479 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11480
11481 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11482
11483 2012-01-28 Chong Yidong <cyd@gnu.org>
11484
11485 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11486
11487 2012-01-26 Chong Yidong <cyd@gnu.org>
11488
11489 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11490
11491 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11492 repeat counts (Bug#10507).
11493
11494 2012-01-26 Glenn Morris <rgm@gnu.org>
11495
11496 * lread.c (syms_of_lread): Doc fix.
11497
11498 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11499
11500 * coding.c (encode_designation_at_bol): Change return value to
11501 EMACS_INT.
11502
11503 2012-01-25 Chong Yidong <cyd@gnu.org>
11504
11505 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11506
11507 2012-01-21 Chong Yidong <cyd@gnu.org>
11508
11509 * floatfns.c (Fcopysign): Make the second argument non-optional,
11510 since nil is not allowed anyway.
11511
11512 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11513
11514 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11515 (send_process): Likewise.
11516
11517 2012-01-19 Martin Rudalics <rudalics@gmx.at>
11518
11519 * window.c (save_window_save, Fcurrent_window_configuration)
11520 (Vwindow_persistent_parameters): Do not use Qstate.
11521 Rewrite doc-strings.
11522
11523 2012-01-19 Kenichi Handa <handa@m17n.org>
11524
11525 * character.c (char_width): New function.
11526 (Fchar_width, c_string_width, lisp_string_width):
11527 Use char_width (Bug#9496).
11528
11529 2012-01-16 Martin Rudalics <rudalics@gmx.at>
11530
11531 * window.c (Vwindow_persistent_parameters): New variable.
11532 (Fset_window_configuration, save_window_save): Handle persistent
11533 window parameters.
11534
11535 2012-01-14 Eli Zaretskii <eliz@gnu.org>
11536
11537 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11538 thrashing the stack of the thread. (Bug#9087)
11539
11540 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11541
11542 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11543
11544 2012-01-11 Eli Zaretskii <eliz@gnu.org>
11545
11546 * xdisp.c (rows_from_pos_range): Handle the case where the
11547 highlight ends on a newline. (Bug#10464)
11548 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11549 he end column for display of highlight that ends on a newline
11550 before a R2L line.
11551
11552 2012-01-11 Glenn Morris <rgm@gnu.org>
11553
11554 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11555 from load-path also when installation-directory is nil. (Bug#10208)
11556
11557 2012-01-10 Glenn Morris <rgm@gnu.org>
11558
11559 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11560
11561 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11562 Update template values to be closer to their typical values these days.
11563
11564 2012-01-09 Eli Zaretskii <eliz@gnu.org>
11565
11566 * xdisp.c (rows_from_pos_range): Accept additional argument
11567 DISP_STRING, and accept any glyph in a row whose object is that
11568 string as eligible for mouse highlight. Fixes mouse highlight of
11569 display strings from overlays. (Bug#10464)
11570
11571 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 emacs: fix an auto-save permissions race condition (Bug#10400)
11574 * fileio.c (auto_saving_dir_umask): New static var.
11575 (Fmake_directory_internal): Use it.
11576 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11577 creating the directory. The old code temporarily assigns
11578 too-generous permissions to the directory.
11579 (do_auto_save_eh): Clear it.
11580 (Fdo_auto_save): Catch all errors, not just file errors, so
11581 that the var is always cleared.
11582
11583 2012-01-07 Eli Zaretskii <eliz@gnu.org>
11584
11585 * search.c (scan_buffer): Pass character positions to
11586 know_region_cache, not byte positions. (Bug#6540)
11587
11588 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
11589
11590 * w32.c (sys_rename): Report EXDEV when rename of a directory
11591 fails because the target is on another logical disk. (Bug#10284)
11592
11593 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11594
11595 * xterm.c (x_embed_request_focus): New function.
11596
11597 * xterm.h: Add prototype.
11598
11599 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11600
11601 2012-01-05 Glenn Morris <rgm@gnu.org>
11602
11603 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11604
11605 2012-01-01 Eli Zaretskii <eliz@gnu.org>
11606
11607 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11608 Load gnutls_transport_set_lowat only if GnuTLS version is below
11609 2.11.1.
11610 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11611 GnuTLS versions below 2.11.1.
11612
11613 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11614
11615 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11616 to the doc string advising against its use for altering the way
11617 windows are scrolled.
11618
11619 2011-12-28 Kenichi Handa <handa@m17n.org>
11620
11621 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11622 coding-system ASCII compatible only when it does not produce BOM
11623 on encoding (Bug#10383).
11624
11625 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11626
11627 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11628 can scroll.
11629 (create_and_show_popup_menu): Always use menu_position_func for
11630 Gtk3 (Bug#10361).
11631
11632 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11633
11634 * callint.c (Fcall_interactively): Don't truncate prompt string.
11635
11636 2011-12-23 Eli Zaretskii <eliz@gnu.org>
11637
11638 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11639 property that ends at ZV, so that the bidi iteration could be
11640 resumed from there (after widening). (Bug#10360)
11641
11642 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11643
11644 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11645
11646 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11647
11648 * nsterm.m (x_free_frame_resources):
11649 Release f->output_data.ns->miniimage.
11650 (ns_index_color): Fix indentation. Do not retain
11651 color_table->colors[i].
11652
11653 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11654 before returning.
11655
11656 * nsfns.m (x_set_background_color): Assign return value from
11657 ns_index_color to face-background instead of NSColor*.
11658 (ns_implicitly_set_icon_type): Fix indentation.
11659 Change assignment in for loop to comparison.
11660
11661 * emacs.c (ns_pool): New variable.
11662 (main): Assign ns_pool.
11663 (Fkill_emacs): Call ns_release_autorelease_pool.
11664
11665 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11666 autorelease fdesc, release fdAttrs and tdict.
11667 (ns_get_covering_families): Release charset.
11668 (ns_findfonts): Release NSFontDescriptor created with new.
11669 (ns_uni_to_glyphs): Fix indentation.
11670 (setString): Release attrStr before assigning new value.
11671
11672 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11673
11674 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11675 and NS_IMPL_COCOA.
11676 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11677 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11678
11679 2011-12-18 David Reitter <reitter@cmu.edu>
11680
11681 * nsterm.m (ns_term_init): Subscribe for notifications
11682 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11683 to method trackingNotification in EmacsMenu.
11684
11685 * nsmenu.m (trackingMenu): New variable.
11686 (trackingNotification): New method (from Aquamacs).
11687 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
11688 from Aquamacs (Bug#7030).
11689
11690 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11691
11692 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11693 (symbol_to_nsstring): Fix indentation.
11694 (ns_symbol_to_pb): New function.
11695 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11696 (Fns_rotate_cut_buffers_internal): Remove.
11697 (Fns_store_selection_internal): Rename from
11698 Fns_store_cut_buffer_internal.
11699 (ns_get_foreign_selection, Fx_own_selection_internal)
11700 (Fx_disown_selection_internal, Fx_selection_exists_p)
11701 (Fns_get_selection_internal, Fns_store_selection_internal):
11702 Use ns_symbol_to_pb and check if return value is nil.
11703 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11704 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
11705 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11706 renamed to Sns_store_selection_internal.
11707 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11708 and remove this function.
11709 (ns_handle_selection_clear): Remove, never used.
11710 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11711 here.
11712
11713 2011-12-17 Ken Brown <kbrown@cornell.edu>
11714
11715 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11716 GID is unknown (Bug#10257).
11717
11718 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11719
11720 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11721 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11722 which caused a build failure on GNU/Linux IA-64. This problem was
11723 introduced by my 2011-10-07 patch.
11724
11725 2011-12-15 Juri Linkov <juri@jurta.org>
11726
11727 * image.c (imagemagick_error): New function. (Bug#10112)
11728 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11729 Use `imagemagick_error' where ImageMagick functions return
11730 `MagickFalse'.
11731 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11732 proper order.
11733
11734 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11735
11736 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11737 fill background (Bug#8992).
11738
11739 2011-12-13 Martin Rudalics <rudalics@gmx.at>
11740
11741 * window.c (Vwindow_combination_resize)
11742 (Vwindow_combination_limit): Use t instead of non-nil in
11743 doc-strings.
11744 (Vrecenter_redisplay): Add first sentence of doc-string on
11745 separate line.
11746 (Frecenter): Fix doc-string typo.
11747
11748 2011-12-11 Kenichi Handa <handa@m17n.org>
11749
11750 * coding.c (Funencodable_char_position): Pay attention to the
11751 buffer text relocation (Bug#9389).
11752
11753 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11754
11755 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11756 gtk_init (Bug#10100).
11757
11758 2011-12-10 Eli Zaretskii <eliz@gnu.org>
11759
11760 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11761 IT->string is nil. (Bug#10263)
11762
11763 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11764
11765 * nsterm.h (x_free_frame_resources): Declare.
11766
11767 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11768 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11769
11770 * nsterm.h (ns_get_defaults_value): Declare.
11771
11772 * nsterm.m (ns_default): Call ns_get_defaults_value.
11773
11774 2011-12-09 Eli Zaretskii <eliz@gnu.org>
11775
11776 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
11777 (Bug#10170)
11778
11779 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11780
11781 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
11782 that where the value of an _OBJC_* symbol points to is in the .bss
11783 section (Bug#10240).
11784
11785 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11786
11787 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
11788 after the loop to call ccl_driver at least once (Bug#8619).
11789
11790 2011-12-08 Kenichi Handa <handa@m17n.org>
11791
11792 * ftfont.c (get_adstyle_property): Fix previous change
11793 (Bug#10233).
11794
11795 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
11796
11797 * w32.c (init_environment): If no_site_lisp, remove site-lisp
11798 dirs from the default value of EMACSLOADPATH (bug#10208).
11799
11800 2011-12-07 Glenn Morris <rgm@gnu.org>
11801
11802 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
11803 installation and source directories as well. (Bug#10208)
11804
11805 2011-12-06 Chong Yidong <cyd@gnu.org>
11806
11807 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
11808
11809 2011-12-06 Glenn Morris <rgm@gnu.org>
11810
11811 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
11812 as an error, not just -1. (Bug#10217)
11813
11814 2011-12-05 Chong Yidong <cyd@gnu.org>
11815
11816 * keyboard.c (process_special_events): New function.
11817 (swallow_events, Finput_pending_p): Use it (Bug#10195).
11818
11819 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
11820
11821 * coding.c (encode_designation_at_bol): Don't use uninitialized
11822 local variable (Bug#9318).
11823
11824 2011-12-05 Kenichi Handa <handa@m17n.org>
11825
11826 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
11827 return Qnil (Bug#8046, Bug#10193).
11828
11829 2011-12-05 Kenichi Handa <handa@m17n.org>
11830
11831 * coding.c (encode_designation_at_bol): New args charbuf_end and
11832 dst. Return the number of produced bytes. Callers changed.
11833 (coding_set_source): Return how many bytes coding->source was
11834 relocated.
11835 (coding_set_destination): Return how many bytes
11836 coding->destination was relocated.
11837 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
11838 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
11839
11840 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
11841
11842 * coding.c (CODING_CHAR_CHARSET_P): New macro.
11843 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
11844 macro (Bug#9318).
11845
11846 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
11847
11848 The following changes are to fix Bug#9318.
11849
11850 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
11851 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
11852 (encode_coding_iso_2022, encode_coding_sjis)
11853 (encode_coding_big5, encode_coding_charset): Use the above macros.
11854
11855 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
11856
11857 * lisp.h (process_quit_flag): Fix external declaration.
11858
11859 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
11860
11861 Don't macro-inline non-performance-critical code.
11862 * eval.c (process_quit_flag): New function.
11863 * lisp.h (QUIT): Use it.
11864
11865 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
11866
11867 * nsfns.m (get_geometry_from_preferences): New function.
11868 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
11869
11870 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
11871
11872 * emacs.c (Qkill_emacs): Define.
11873 (syms_of_emacs): Initialize it.
11874 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
11875 Qquit_flag to `kill-emacs' instead.
11876 (quit_throw_to_read_char): Add parameter `from_signal'.
11877 All callers changed. Call Fkill_emacs if requested and safe.
11878 * lisp.h (QUIT): Call Fkill_emacs if requested.
11879
11880 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
11881
11882 * widget.c (update_wm_hints): Return if wmshell is null.
11883 (widget_update_wm_size_hints): New function.
11884
11885 * widget.h (widget_update_wm_size_hints): Declare.
11886
11887 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
11888 widget_update_wm_size_hints (Bug#10104).
11889
11890 2011-12-03 Eli Zaretskii <eliz@gnu.org>
11891
11892 * xdisp.c (handle_invisible_prop): If the invisible text ends just
11893 before a newline, prepare the bidi iterator for consuming the
11894 newline, and keep the current paragraph direction. (Bug#10183)
11895 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
11896
11897 2011-12-02 Juri Linkov <juri@jurta.org>
11898
11899 * search.c (Fword_search_regexp): New Lisp function created from
11900 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
11901 (Fword_search_backward, Fword_search_forward)
11902 (Fword_search_backward_lax, Fword_search_forward_lax):
11903 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
11904 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
11905
11906 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
11907
11908 * fileio.c (Finsert_file_contents): Move after-change-function call
11909 to before the "handled:" label, since all "goto handled" appear in
11910 cases where the *-change-functions have already been properly called
11911 (bug#10117).
11912
11913 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11914
11915 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11916 waiting for input. (Bug#10169)
11917
11918 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11919
11920 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11921 verifies glyph row's hash code--we have just reallocated the
11922 glyphs, so their contents can be complete garbage. (Bug#10164)
11923
11924 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
11925
11926 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11927
11928 2011-11-30 Eli Zaretskii <eliz@gnu.org>
11929
11930 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11931 attributes are tested _before_ calling verify_row_hash, to protect
11932 against GCC re-ordering of the tests. (Bug#10164)
11933
11934 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11935
11936 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11937
11938 * xterm.c (handle_one_xevent): Only set async_visible and friends
11939 if net_wm_state_hidden_seen is non-zero (Bug#10002)
11940 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
11941 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11942
11943 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11944
11945 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11946 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11947 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11948 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11949 All uses changed to use GCPRO1 etc.
11950 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11951 Revert to old implementation (i.e., before 2011-03-11).
11952
11953 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11954
11955 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11956 of scroll runs so as to avoid assigning disabled bogus rows and
11957 unnecessary graphics copy operations.
11958
11959 2011-11-27 Eli Zaretskii <eliz@gnu.org>
11960
11961 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11962 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11963 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11964 (malloc, free, realloc, calloc): Redirect to e_* only when
11965 compiling Emacs.
11966
11967 * lisp.h (GCTYPEBITS): Move before first use.
11968 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11969 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11970 this macro definition.
11971
11972 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11973 _MSC_VER.
11974
11975 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11976
11977 * gtkutil.c (xg_create_frame_widgets):
11978 Call gtk_window_set_has_resize_grip (FALSE) if that function is
11979 present with Gtk+ 2.0.
11980
11981 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11982
11983 * fileio.c (Finsert_file_contents): Undo previous change; see
11984 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11985
11986 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11987
11988 Rename locals to avoid shadowing.
11989 * fileio.c (Finsert_file_contents):
11990 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11991 * process.c (wait_reading_process_output):
11992 Rename inner 'proc' to 'p' to avoid shadowing.
11993 Indent for consistency with usual Emacs style.
11994
11995 2011-11-25 Eli Zaretskii <eliz@gnu.org>
11996
11997 * xdisp.c (redisplay_window): If cursor row is not fully visible
11998 after recentering, and scroll-conservatively is set to a large
11999 number, scroll window by a few more lines to make the cursor fully
12000 visible and out of scroll-margin. (Bug#10105)
12001 (start_display): Don't move to the next line if the display should
12002 start at a newline that is part of a display vector or an overlay
12003 string. (Bug#10119)
12004
12005 2011-11-24 Juri Linkov <juri@jurta.org>
12006
12007 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12008 after the `MagickPingImage' call. (Bug#10112)
12009
12010 2011-11-23 Chong Yidong <cyd@gnu.org>
12011
12012 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12013
12014 2011-11-23 Martin Rudalics <rudalics@gmx.at>
12015
12016 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12017 making another buffer current. (Bug#10114)
12018
12019 2011-11-23 Glenn Morris <rgm@gnu.org>
12020
12021 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12022
12023 2011-11-23 Chong Yidong <cyd@gnu.org>
12024
12025 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12026 using it (Bug#5984).
12027
12028 2011-11-22 Eli Zaretskii <eliz@gnu.org>
12029
12030 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12031 and header-lines, as they don't have one computed for them.
12032 (Bug#10098)
12033
12034 * .gdbinit (prow): Make displayed values more self-explaining.
12035 Add row's hash code.
12036
12037 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12038
12039 * process.c (wait_reading_process_output): Fix asynchrounous
12040 GnuTLS socket handling on some versions of the GnuTLS library.
12041 (wait_reading_process_output): Add comment and URL.
12042
12043 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12044
12045 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12046
12047 2011-11-21 Chong Yidong <cyd@gnu.org>
12048
12049 * window.c (Fnext_window, Fprevious_window): Doc fix.
12050
12051 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12052
12053 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12054
12055 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12056
12057 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12058
12059 2011-11-20 Martin Rudalics <rudalics@gmx.at>
12060
12061 * window.c (Fset_window_combination_limit): Rename argument
12062 STATUS to LIMIT.
12063 (Vwindow_combination_limit): Remove "status" from doc-string.
12064
12065 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12066
12067 * m/ibms390.h: Remove.
12068 * m/ibms390x.h: Don't include "ibms390.h".
12069
12070 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12071
12072 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12073 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12074
12075 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
12076
12077 * casetab.c (Fset_case_table):
12078 * charset.c (Fcharset_after): Fix typos.
12079
12080 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
12081
12082 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12083 Otherwise, valgrind does not work on some platforms.
12084 Problem reported by Andreas Schwab in
12085 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12086 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12087 is set, removing the need for VIRT_ADDRESS_VARIES.
12088 (PURE_P): Use a more-efficient implementation that needs just one
12089 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12090 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12091 to 4 (xorl, subq, cmpq, setbe).
12092 * alloc.c (pure): Always extern now, since that's the
12093 VIRT_ADDR_VARIES behavior.
12094 (PURE_POINTER_P): Use a single comparison, not two, for
12095 consistency with the new puresize.h.
12096 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12097 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12098 Remove VIRT_ADDR_VARIES no longer needed.
12099
12100 2011-11-19 Eli Zaretskii <eliz@gnu.org>
12101
12102 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12103 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12104 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12105 behave as if the cursor position were at the window margin.
12106
12107 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12108 and the cursor position is out of bounds, behave as if the cursor
12109 position were at the window margin. (Bug#10075)
12110
12111 2011-11-18 Chong Yidong <cyd@gnu.org>
12112
12113 * window.c (Fwindow_combination_limit): Make first argument
12114 non-optional, since it is meaningless for live windows like the
12115 selected window.
12116
12117 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12118
12119 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12120
12121 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12122
12123 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12124 (graft_intervals_into_buffer): Simplify.
12125
12126 2011-11-18 Eli Zaretskii <eliz@gnu.org>
12127
12128 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12129 hash values of the two rows.
12130 (copy_row_except_pointers): Preserve the used[] arrays and the
12131 hash values of the two rows. (Bug#10035)
12132 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
12133
12134 * xdisp.c (row_hash): New function, body extracted from
12135 compute_line_metrics.
12136 (compute_line_metrics): Call row_hash, instead of computing the
12137 hash code inline.
12138
12139 * dispnew.c (verify_row_hash): Call row_hash for computing the
12140 hash code of a row, instead of duplicating code from xdisp.c.
12141
12142 * dispextern.h (row_hash): Add prototype.
12143
12144 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12145
12146 * frame.c (delete_frame): Don't delete the terminal when the last
12147 X frame is closed if emacs is built with GTK toolkit.
12148
12149 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
12150
12151 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12152
12153 2011-11-17 Martin Rudalics <rudalics@gmx.at>
12154
12155 * window.c (Vwindow_splits): Rename to
12156 Vwindow_combination_resize. Suggested by Juri Linkov.
12157 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12158 of Vwindow_splits.
12159
12160 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
12161
12162 * nsfns.m (Fns_font_name):
12163 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
12164
12165 2011-11-16 Martin Rudalics <rudalics@gmx.at>
12166
12167 * window.h (window): Rename slot "nest" to "combination_limit".
12168 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12169 (Fset_window_nest): Rename to Fset_window_combination_limit.
12170 (Vwindow_nest): Rename to Vwindow_combination_limit.
12171 (recombine_windows, make_parent_window, make_window)
12172 (Fsplit_window_internal, saved_window)
12173 (Fset_window_configuration, save_window_save): Rename all
12174 occurrences of window_nest to window_combination_limit.
12175
12176 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
12177
12178 * image.c (imagemagick_load_image): Fix typo.
12179
12180 2011-11-14 Eli Zaretskii <eliz@gnu.org>
12181
12182 * xdisp.c (display_line): Move the call to
12183 highlight_trailing_whitespace before the call to
12184 compute_line_metrics, since the latter needs to see the final
12185 faces of all the glyphs to compute ROW's hash value.
12186 Fixes assertion violations in row_equal_p. (Bug#10035)
12187
12188 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
12189
12190 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12191 just return (bug#10044).
12192
12193 2011-11-12 Eli Zaretskii <eliz@gnu.org>
12194
12195 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12196 with user-defined heap size. Bump the default size of the temacs
12197 heap to 27MB, to avoid memory warning when running temacs.
12198 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12199
12200 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12201 current_matrix and desired_matrix. (Bug#9990)
12202 (verify_row_hash) [XASSERTS]: New function.
12203 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12204 that the hash value of glyph rows is correct.
12205
12206 2011-11-12 Martin Rudalics <rudalics@gmx.at>
12207
12208 * window.h (window): Remove splits slot.
12209 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12210 (Fdelete_other_windows_internal, make_parent_window)
12211 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12212 (Fset_window_configuration, save_window_save): Don't deal with
12213 split status of windows.
12214 (saved_window): Remove splits slot.
12215 (Vwindow_splits): Rewrite doc-string.
12216
12217 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12218
12219 * xfns.c (unwind_create_frame):
12220 * nsfns.m (unwind_create_frame):
12221 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12222 Vframe_list (Bug#9999).
12223
12224 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12225
12226 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
12227
12228 2011-11-11 Kenichi Handa <handa@m17n.org>
12229
12230 * callproc.c (Fcall_process): Set the member dst_multibyte of
12231 process_coding.
12232
12233 2011-11-11 Johan Bockgård <bojohan@gnu.org>
12234
12235 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12236 avoid a crash (bug#9496).
12237
12238 2011-11-09 Chong Yidong <cyd@gnu.org>
12239
12240 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12241 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12242
12243 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12244
12245 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12246
12247 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12248
12249 Avoid some portability problems by eschewing 'extern inline' functions.
12250 The trivial performance wins aren't worth the portability hassles; see
12251 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12252 et seq.
12253 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12254 (window_box_width, window_box_left, window_box_left_offset)
12255 (window_box_right, window_box_right_offset): Undo previous change,
12256 by removing the "extern"s.
12257 * intervals.c (adjust_intervals_for_insertion)
12258 (adjust_intervals_for_deletion): Undo previous change,
12259 making these static again.
12260 (offset_intervals, temp_set_point_both, temp_set_point)
12261 (copy_intervals_to_string): No longer inline.
12262 * xdisp.c (window_text_bottom_y, window_box_width)
12263 (window_box_height, window_box_left_offset)
12264 (window_box_right_offset, window_box_left, window_box_right)
12265 (window_box): No longer inline.
12266
12267 2011-11-08 Chong Yidong <cyd@gnu.org>
12268
12269 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
12270 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12271 Signal an error if not a live window.
12272 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12273 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12274
12275 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
12276
12277 * lisp.h (syms_of_abbrev): Remove declaration.
12278 Reported by CHENG Gao <chenggao@royau.me>.
12279
12280 2011-11-07 Eli Zaretskii <eliz@gnu.org>
12281
12282 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12283 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12284 of temacs in GUI mode.
12285
12286 2011-11-07 Martin Rudalics <rudalics@gmx.at>
12287
12288 * window.h: Declare delete_all_child_windows instead of
12289 delete_all_subwindows.
12290 * window.c (Fwindow_nest, Fset_window_nest)
12291 (Fset_window_new_total, Fset_window_new_normal)
12292 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12293 (delete_all_subwindows): Rename to delete_all_child_windows.
12294 (Fdelete_other_windows_internal, Fset_window_configuration):
12295 Call delete_all_child_windows instead of delete_all_subwindows.
12296 * frame.c (delete_frame): Call delete_all_child_windows instead
12297 of delete_all_subwindows.
12298
12299 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12300
12301 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12302 This is also needed for porting to any host where GC_MARK_STACK is
12303 not GC_MAKE_GCPROS_NOOPS.
12304 (which_symbols): Use it.
12305
12306 2011-11-07 Kenichi Handa <handa@m17n.org>
12307
12308 * coding.c (coding_set_destination): Check coding->src_pos only
12309 when coding->src_object is a buffer (bug#9910).
12310
12311 * process.c (send_process): Set the member src_multibyte of coding
12312 to 0 (bug#9911) when sending a unibyte text.
12313
12314 * callproc.c (Fcall_process): Set the member src_multibyte of
12315 process_coding to 0 (bug#9912).
12316
12317 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12318
12319 * xmenu.c (cleanup_widget_value_tree): New function.
12320 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12321 calling free_menubar_widget_value_tree directly (Bug#9830).
12322
12323 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12324
12325 Fix some portability problems with 'inline'.
12326 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12327 (window_box_width, window_box_left, window_box_left_offset)
12328 (window_box_right, window_box_right_offset): Declare extern.
12329 Otherwise, these inline functions do not conform to C99 and
12330 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12331 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12332 * intervals.c (adjust_intervals_for_insertion)
12333 (adjust_intervals_for_deletion): Now extern, because otherwise the
12334 extern inline functions 'offset_intervals' couldn't refer to it.
12335 (static_offset_intervals): Remove.
12336 (offset_intervals): Rewrite using the old contents of
12337 static_offset_intervals. The old version didn't conform to C99
12338 because an extern inline function contained a reference to an
12339 identifier with static linkage.
12340
12341 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12342
12343 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12344 GC.
12345
12346 2011-11-06 Eli Zaretskii <eliz@gnu.org>
12347
12348 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12349 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12350 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12351 return Qleft_to_right.
12352
12353 2011-11-06 Chong Yidong <cyd@gnu.org>
12354
12355 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12356 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12357 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12358 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12359 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12360 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12361 (Fwindow_vscroll): Doc fix.
12362 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12363 argument, since it makes no sense to pass a live window and for
12364 consistency with window-child.
12365
12366 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12367
12368 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12369 support MSVC.
12370
12371 2011-11-05 Jason Rumney <jasonr@gnu.org>
12372
12373 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12374 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12375 fonts (Bug#6029).
12376 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12377 bitwise arithmetic preventing use of unicode-sip and non-truetype
12378 opentype fonts.
12379
12380 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12381
12382 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12383 "emacs"-only part.
12384
12385 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12386 initialization code to keep similarity to xfns.c after changes
12387 from 2011-11-05.
12388
12389 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12390
12391 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12392 (unwind_create_frame): New function (Bug#9943).
12393 (Fx_create_frame): Restructure code to be more similar to the one in
12394 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12395 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12396 Move terminal->reference_count++ just before making the frame official
12397 (Bug#9943).
12398
12399 * nsterm.m (x_free_frame_resources): New function.
12400 (x_destroy_window): Move code to x_free_frame_resources.
12401
12402 * xfns.c (unwind_create_frame): Fix comment.
12403 (Fx_create_frame, x_create_tip_frame):
12404 Move terminal->reference_count++ just before making the frame
12405 official. Move initialization of image_cache_refcount and
12406 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12407
12408 2011-11-05 Eli Zaretskii <eliz@gnu.org>
12409
12410 Support MSVC build with newer versions of Visual Studio.
12411 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12412 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12413 nt/gmake.defs.
12414
12415 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12416 which are not supported by MSVC.
12417 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12418 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12419 bitfields.
12420 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12421 types in bitfields.
12422 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12423
12424 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12425
12426 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
12427
12428 Support MSVC build with newer versions of Visual Studio.
12429 * w32.c: Don't include w32api.h for MSVC.
12430 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12431
12432 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12433 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12434 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12435 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12436 e_* cousins.
12437 (alloca) [_MSC_VER]: Define to _alloca.
12438
12439 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12440
12441 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12442
12443 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12444
12445 * xdisp.c (note_mouse_highlight): If either of
12446 previous/next-single-property-change returns nil, treat that as
12447 the beginning or the end of the buffer. (Bug#9955)
12448
12449 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12450
12451 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
12452 label is not null (Bug#9951).
12453 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12454 may be NULL.
12455
12456 2011-11-04 Eli Zaretskii <eliz@gnu.org>
12457
12458 * window.c (Fwindow_body_size): Mention in the doc string that the
12459 return value is in frame's canonical units. (Bug#9949)
12460
12461 2011-11-03 Eli Zaretskii <eliz@gnu.org>
12462
12463 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12464
12465 * w32fns.c (unwind_create_frame): If needed, free the glyph
12466 matrices of the partially constructed frame. (Bug#9943)
12467 * xfns.c (unwind_create_frame): Likewise.
12468
12469 2011-11-01 Eli Zaretskii <eliz@gnu.org>
12470
12471 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12472 Don't stop backward scan on the continuation glyph, even though
12473 its CHARPOS is positive.
12474 (mouse_face_from_buffer_pos, note_mouse_highlight):
12475 Rename cover_string to disp_string.
12476
12477 2011-11-01 Martin Rudalics <rudalics@gmx.at>
12478
12479 * window.c (temp_output_buffer_show): Don't use
12480 Vtemp_buffer_show_specifiers.
12481 (Vtemp_buffer_show_specifiers): Remove unused variable.
12482
12483 2011-10-30 Eli Zaretskii <eliz@gnu.org>
12484
12485 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12486 past the beginning of the current glyph matrix.
12487
12488 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
12489
12490 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12491 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12492 HAVE_GTK3 (Bug#9869).
12493
12494 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12495 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12496
12497 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12498
12499 * xterm.c: Declare x_handle_net_wm_state to return int.
12500 (handle_one_xevent): Check if we are iconified but don't have
12501 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12502 (get_current_wm_state): Return non-zero if not hidden,
12503 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12504 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12505 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12506 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12507
12508 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12509
12510 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12511 so that this new function doesn't get optimized away by a
12512 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12513
12514 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12515
12516 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12517
12518 2011-10-29 Eli Zaretskii <eliz@gnu.org>
12519
12520 Fix the `xbytecode' command.
12521 * .gdbinit (xprintbytestr): New command.
12522 (xwhichsymbols): Rename from `which'; all callers changed.
12523 (xbytecode): Print the byte-code string as well.
12524
12525 2011-10-29 Kim Storm <storm@cua.dk>
12526
12527 * alloc.c (which_symbols): New function.
12528
12529 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12530
12531 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12532 line. (Bug#9903)
12533
12534 2011-10-29 Glenn Morris <rgm@gnu.org>
12535
12536 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12537 Not clear what it was for, and it causes various bugs. (Bug#9839)
12538
12539 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12540
12541 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12542 possible random value that matches one of those tested as
12543 condition to clear the mouse face.
12544
12545 2011-10-28 Chong Yidong <cyd@gnu.org>
12546
12547 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12548
12549 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12550
12551 * window.c (make_window): Initialize phys_cursor_on_p.
12552
12553 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12554
12555 * lisp.h (struct Lisp_Symbol): Update comments.
12556
12557 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
12558
12559 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12560
12561 2011-10-28 Eli Zaretskii <eliz@gnu.org>
12562
12563 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12564 <oslsachem@gmail.com> for helping to debug this.
12565
12566 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12567 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12568 (g_b_init_get_glyph_outline_w): New static variables.
12569 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12570 (GetGlyphOutlineW_Proc): New typedefs.
12571 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
12572 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12573 New functions.
12574 (w32font_open_internal, compute_metrics):
12575 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
12576 instead of calling the "wide" APIs directly.
12577
12578 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12579
12580 * w32.h (syms_of_w32font): Add prototype.
12581
12582 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12583
12584 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12585 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12586 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12587 (Fmove_to_window_line): Doc fix.
12588
12589 2011-10-27 Chong Yidong <cyd@gnu.org>
12590
12591 * process.c (make_process): Set gnutls_state to NULL.
12592
12593 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12594 non-NULL, regardless of GNUTLS_INITSTAGE.
12595 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12596 an error. Set process slots as soon as we allocate them.
12597
12598 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12599
12600 2011-10-27 Chong Yidong <cyd@gnu.org>
12601
12602 * gnutls.c (emacs_gnutls_deinit): New function.
12603 Deallocate credentials structures as well as calling gnutls_deinit.
12604 (Fgnutls_deinit, Fgnutls_boot): Use it.
12605
12606 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12607 (deactivate_process): Call emacs_gnutls_deinit.
12608
12609 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
12610
12611 * image.c (x_create_x_image_and_pixmap):
12612 * w32.c (sys_rename, w32_delayed_load):
12613 * w32font.c (fill_in_logfont):
12614 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12615
12616 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
12617
12618 * w32fns.c (w32_default_color_map): New function,
12619 extracted from Fw32_default_color_map.
12620 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
12621
12622 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12623
12624 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12625
12626 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12627
12628 * keyboard.c (test_undefined): New function (bug#9751).
12629 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12630
12631 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12632
12633 * sysdep.c (init_sys_modes): Fix the check for the controlling
12634 terminal (Bug#6649).
12635
12636 2011-10-20 Eli Zaretskii <eliz@gnu.org>
12637
12638 * dispextern.h (struct bidi_it): New member next_en_type.
12639
12640 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12641 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12642 current character, check also for next_en_type being WEAK_EN.
12643 (bidi_resolve_weak): Don't enter the expensive loop if the current
12644 position is before next_en_pos. Record the bidi type of the first
12645 non-ET, non-BN character we find, in addition to its position.
12646 (bidi_level_of_next_char): Invalidate next_en_type when
12647 next_en_pos is over-stepped.
12648
12649 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12650
12651 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12652 * editfns.c: Rewrite current-time-zone so that it invokes
12653 the equivalent of (format-time-string "%Z") to get the time zone name.
12654 This fixes a bug when the time zone name contains characters that
12655 need converting from the system time locale to Emacs internal format.
12656 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12657 that patch fixed format-time-string to do the conversion, but
12658 I forgot to fix current-time-zone.
12659 (format_time_string): New function, containing most of
12660 what Fformat_time_string used to contain.
12661 (Fformat_time_string): Rewrite in terms of format_time_string.
12662 This doesn't change this function's behavior.
12663 (current-time-zone): Rewrite to use format_time_string.
12664 This fixes the bug reported by Michael Schierl in
12665 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12666 Jason Rumney's 2007-06-07 change worked around this bug, but
12667 didn't fix it.
12668 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12669
12670 2011-10-19 Eli Zaretskii <eliz@gnu.org>
12671
12672 * xdisp.c (start_display): If the character at POS is displayed
12673 via a display vector, reset IT->current.dpvec_index to zero.
12674 (try_window_reusing_current_matrix): If a line ends in a display
12675 vector or the next line starts in a display vector, continue
12676 redrawing the window even though the character position of
12677 start_row was reached.
12678 (Bug#9771, part 2)
12679
12680 2011-10-18 Chong Yidong <cyd@gnu.org>
12681
12682 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12683 with nobreak-char-display too.
12684
12685 2011-10-18 Eli Zaretskii <eliz@gnu.org>
12686
12687 Fix part 3 of bug#9771.
12688 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12689 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12690 non-neutral characters if the current character is a paragraph
12691 separator (a.k.a. Newline). This avoids running the same
12692 expensive loop twice, once when we consume the preceding newline
12693 and the other time when the line actually needs to be displayed.
12694 Avoid the loop when we see neutrals on the base embedding level
12695 following a character whose directionality is the same as the
12696 paragraph's. This avoids running the expensive loop when a line
12697 ends in a long sequence of neutrals, like control characters.
12698 Add assertion against STRONG_AL type. Slightly rearrange code
12699 that determines the type of a neutral given the first non-neutral
12700 that follows it.
12701 (bidi_level_of_next_char): Set next_en_pos to zero when
12702 invalidating its info.
12703
12704 2011-10-17 Eli Zaretskii <eliz@gnu.org>
12705
12706 * xdisp.c (push_display_prop): Determine whether to record string
12707 or buffer position by IT->string, not by IT->method. Allow
12708 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
12709 (move_it_vertically_backward): Don't look for character position
12710 immediately after the newline when in a continuation line.
12711 (Bug#9771, part 1)
12712
12713 2011-10-15 Martin Rudalics <rudalics@gmx.at>
12714
12715 * window.c (coordinates_in_window): Rewrite and delabelize
12716 vertical border check. (Bug#5357) (Bug#9618)
12717
12718 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12719
12720 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12721 errors in XSetWindowBorder (bug#9310).
12722
12723 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12724
12725 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12726 avoid crash when xmalloc overrun checking is enabled.
12727
12728 2011-10-13 Eli Zaretskii <eliz@gnu.org>
12729
12730 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12731 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12732 cursor motion with <left> and <right> arrow keys.
12733
12734 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12735 some callers set that themselves.
12736
12737 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12738
12739 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12740 display string and the previous row comes from the same string and
12741 is empty. (Bug#9739) (Bug#9738)
12742
12743 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12744
12745 * doc.c (get_doc_string): Encode file name (bug#9735).
12746
12747 2011-10-12 Eli Zaretskii <eliz@gnu.org>
12748
12749 * bidi.c (bidi_level_of_next_char):
12750 * xdisp.c (get_visually_first_element): Remove old incorrect
12751 comments regarding the Unicode Line Separator character.
12752
12753 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12754
12755 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12756
12757 * alloc.c (Fgc_status): Do not access beyond zombies array
12758 boundary if nzombies > MAX_ZOMBIES.
12759 * alloc.c (dump_zombies): Add missing format specifier.
12760
12761 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12762
12763 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12764 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12765
12766 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12767 Some packages use them to denote characters with modifiers.
12768
12769 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12770
12771 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
12772 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
12773 matching a pp-number. Rename parameter var to var1.
12774
12775 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
12776
12777 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
12778
12779 2011-10-08 Glenn Morris <rgm@gnu.org>
12780
12781 * callint.c (Fcall_interactively): Give a more explicit error for the
12782 'c' case with a non-character input. (Bug#8479)
12783
12784 2011-10-08 Eli Zaretskii <eliz@gnu.org>
12785
12786 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
12787 lines.
12788 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
12789 lines that are hscrolled on the left.
12790
12791 * dispnew.c (buffer_posn_from_coords): Account for a possible
12792 presence of header-line. (Bug#4426)
12793
12794 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
12795
12796 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
12797 Don't advertise functionality which we discourage or doesn't work.
12798
12799 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
12800
12801 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
12802 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
12803 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
12804 this makes Emacs dump core during garbage collection on rare
12805 occasions. sizeof is obviously inferior to offsetof here, so
12806 stick with offsetof.
12807 (GC_POINTER_ALIGNMENT): New macro.
12808 (mark_memory): Omit 3rd (offset) arg; caller changed.
12809 Don't assume EMACS_INT alignment is the same as pointer alignment.
12810
12811 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
12812
12813 * keyboard.c (read_key_sequence_remapped): New var.
12814 (read_key_sequence): Compute remapping in the right buffer.
12815 (command_loop_1): Use read_key_sequence's remapping directly.
12816
12817 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
12818
12819 * dired.c (file_name_completion): Don't expand file name.
12820 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
12821 before checking file name handler.
12822
12823 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
12824 they've been requested explicitly (bug#9591).
12825
12826 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
12827
12828 * keymap.c (Fsingle_key_description): Use make_specified_string
12829 instead of build_string to build string from push_key_description.
12830 (Bug#5193)
12831
12832 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12833
12834 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
12835 This fixes a Y2038 bug on 64-bit hosts.
12836 * buffer.c (reset_buffer):
12837 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
12838 (Fclear_buffer_auto_save_failure):
12839 Use 0, not -1, to represent an unset failure time, since time_t
12840 might not be signed.
12841
12842 Remove dependency on glibc malloc internals.
12843 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12844 Move back here from lisp.h, but with their new implementations.
12845 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12846 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
12847 * charset.c (charset_table_init): New static var.
12848 (syms_of_charset): Use it instead of xmalloc. This removes a
12849 dependency on glibc malloc internals. See Eli Zaretskii's comment in
12850 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
12851 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12852 Move back to alloc.c.
12853 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12854 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
12855
12856 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
12857
12858 * nsterm.m (windowDidResize): Call x_set_window_size only when
12859 ns_in_resize is true. Otherwise set pixelwidth/height and
12860 call change_frame_size (Bug#9628).
12861
12862 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
12863
12864 Port --enable-checking=all to Fedora 14 x86-64.
12865 * charset.c (syms_of_charset): Also account for glibc malloc's
12866 internal overhead when calculating the initial malloc maximum.
12867
12868 Port --enable-checking=all to Fedora 14 x86.
12869 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12870 Move to lisp.h.
12871 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
12872 (overrun_check_realloc, overrun_check_free):
12873 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
12874 That way, xmalloc returns a properly-aligned pointer even if
12875 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
12876 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
12877 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
12878 into account when calculating the initial malloc maximum.
12879 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
12880 Move here from alloc.c, so that charset.c can use it too.
12881 Properly align; the old code wasn't right for common 32-bit hosts
12882 when configured with --enable-checking=all.
12883 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
12884 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
12885
12886 2011-09-29 Eli Zaretskii <eliz@gnu.org>
12887
12888 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
12889 use EDOM.
12890
12891 2011-09-28 Eli Zaretskii <eliz@gnu.org>
12892
12893 * xdisp.c (compute_display_string_end): If there's no display
12894 string at CHARPOS, return -1.
12895
12896 * bidi.c (bidi_fetch_char): When compute_display_string_end
12897 returns a negative value, treat the character as a normal
12898 character not covered by a display string. (Bug#9624)
12899
12900 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
12901
12902 * lread.c (Fread_from_string): Fix typo in docstring.
12903
12904 2011-09-27 Eli Zaretskii <eliz@gnu.org>
12905
12906 * xdisp.c (handle_invisible_prop): If invisible text ends on a
12907 newline, reseat the iterator instead of bidi-iterating there one
12908 character at a time. (Bug#9610)
12909 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
12910 TO_CHARPOS if the bidi iterator is at base embedding level.
12911
12912 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12913
12914 * lread.c (readevalloop): Use correct code for NBSP.
12915 (read1): Likewise. (Bug#9608)
12916
12917 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
12918
12919 * dbusbind.c (Fdbus_register_signal): When service is not
12920 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12921
12922 2011-09-25 Glenn Morris <rgm@gnu.org>
12923
12924 * buffer.c (truncate-lines): Doc fix.
12925
12926 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
12927
12928 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12929 (Fset_window_next_buffers): Doc fix.
12930
12931 2011-09-24 Glenn Morris <rgm@gnu.org>
12932
12933 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12934
12935 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12936
12937 Fix minor problems found by static checking.
12938 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
12939 * indent.c (Fvertical_motion): Fix == vs = typo.
12940
12941 2011-09-24 Eli Zaretskii <eliz@gnu.org>
12942
12943 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12944 Default value is now t. Doc fix.
12945
12946 * indent.c (Fvertical_motion): Compute and apply the overshoot
12947 logic when moving up, not only when moving down. Fix the
12948 confusing name and values of the it_overshoot_expected variable;
12949 logic changes accordingly. (Bug#9254) (Bug#9549)
12950
12951 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12952 CHARPOS is covered by a display string which includes newlines.
12953 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12954 is covered by a display string with embedded newlines.
12955
12956 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
12957
12958 * dbusbind.c (Fdbus_register_signal): Add match rule to
12959 Vdbus_registered_objects_table. (Bug#9581)
12960 (Fdbus_register_method, Vdbus_registered_objects_table):
12961 Fix docstring.
12962
12963 2011-09-24 Jim Meyering <meyering@redhat.com>
12964
12965 do not ignore write error for any output size
12966 The previous change was incomplete.
12967 While it makes emacs --batch detect the vast majority of stdout
12968 write failures, errors were still ignored whenever the output size is
12969 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12970 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12971 && echo FAIL: ignored write error
12972 FAIL: ignored write error
12973 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12974 && echo FAIL: ignored write error
12975 FAIL: ignored write error
12976 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12977
12978 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12979
12980 * emacs.c (Fkill_emacs): In noninteractive mode exit
12981 non-successfully if a write error occurred on stdout. (Bug#9574)
12982
12983 2011-09-21 Eli Zaretskii <eliz@gnu.org>
12984
12985 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12986 the xassert test.
12987
12988 * dispextern.h (struct it): Update the comment documenting what
12989 can it->OBJECT be.
12990
12991 2011-09-20 Eli Zaretskii <eliz@gnu.org>
12992
12993 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12994 a display string, extend search for cursor position to end of row.
12995 (find_row_edges): If the row ends in a newline from a display
12996 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12997 Handle the case of a display string with multiple newlines.
12998 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12999 non-empty line. Fixes confusing cursor motion with arrow keys at
13000 the beginning of a line that starts with whitespace.
13001
13002 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13003
13004 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13005 (bug#9493).
13006
13007 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
13008
13009 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13010 boolean (Bug#9154).
13011
13012 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13013
13014 * xdisp.c (display_line): Record maximum and minimum buffer
13015 positions even if no glyphs were produced (e.g., by a zero-width
13016 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13017 buffer positions that will be removed from the glyph row because
13018 they don't fit.
13019 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13020 column is beyond frame width: don't subtract 1 "pixel" when
13021 computing width of the stretch.
13022 (reseat_at_next_visible_line_start): Undo the change made on
13023 2011-09-17 that saved paragraph information and restored it after
13024 the call to `reseat'. (Bug#9545)
13025
13026 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13027
13028 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13029 and turn window cursor on if cleared (Bug#9415).
13030
13031 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
13032
13033 * search.c (boyer_moore): Take unibyte characters from pattern
13034 literally. (Bug#9458)
13035
13036 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13037
13038 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13039
13040 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13041
13042 Fix minor problem found by static checking.
13043 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13044 initialized, to pacify gcc -Wuninitialized.
13045
13046 * fileio.c: Report proper errno when syscall falls.
13047 (Finsert_file_contents): Save and restore errno,
13048 so that report_file_error outputs the correct diagnostic.
13049 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13050
13051 2011-09-18 Eli Zaretskii <eliz@gnu.org>
13052
13053 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13054
13055 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13056
13057 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13058 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13059
13060 2011-09-17 Eli Zaretskii <eliz@gnu.org>
13061
13062 * xdisp.c (reseat_at_next_visible_line_start): Keep information
13063 about the current paragraph and restore it after the call to reseat.
13064
13065 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13066 (bidi_find_paragraph_start): Search back for paragraph beginning
13067 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13068 (bidi_move_to_visually_next): Only trigger paragraph-related
13069 computations when the last character is a newline or at EOB, not
13070 just any NEUTRAL_B. (Bug#9470)
13071
13072 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13073 truncated lines if point is covered by a display string. (Bug#9524)
13074
13075 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13076
13077 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13078 (cons_to_x_long): New function.
13079 (lisp_data_to_selection_data): Use it. Correct the test for
13080 short-versus-long data; it was negated. Break out of vector
13081 loop, for efficiency, when a long datum is discovered.
13082
13083 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13084
13085 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13086
13087 2011-09-16 Eli Zaretskii <eliz@gnu.org>
13088
13089 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13090 GCC PR/17406) by declaring this function with external scope.
13091
13092 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13093
13094 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13095 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13096
13097 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13098
13099 * editfns.c (Fformat): Correctly handle text properties on "%%".
13100
13101 2011-09-15 Eli Zaretskii <eliz@gnu.org>
13102
13103 * xterm.c (x_draw_composite_glyph_string_foreground):
13104 * w32term.c (x_draw_composite_glyph_string_foreground):
13105 * term.c (encode_terminal_code):
13106 * composite.c (composition_update_it, get_composition_id):
13107 * xdisp.c (get_next_display_element)
13108 (fill_composite_glyph_string): Add comments about special meaning
13109 of TAB characters in a composition.
13110
13111 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13112
13113 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
13114 This occurs when processing a multibyte format.
13115 Problem reported by Wolfgang Jenker.
13116
13117 2011-09-15 Johan Bockgård <bojohan@gnu.org>
13118
13119 * xdisp.c (try_cursor_movement): Only check for exact match if
13120 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13121
13122 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13123
13124 Remove unused external symbols.
13125 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13126 * xdisp.c (calc_pixel_width_or_height): Now static.
13127 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13128 * indent.c (check_display_width):
13129 * w32term.c: Fix comment to match code.
13130 * xterm.c, xterm.h (x_catching_errors): Remove.
13131
13132 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13133
13134 * xselect.c: Use signed conversions more consistently (Bug#9498).
13135 (selection_data_to_lisp_data): Assume incoming selection data are
13136 signed integers, not unsigned. This is to be consistent with
13137 outgoing selection data, which was modified to use signed integers
13138 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13139 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13140 expects long, not unsigned long.
13141
13142 2011-09-14 Eli Zaretskii <eliz@gnu.org>
13143
13144 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13145 computation of loop end. Reported by Johan Bockgård
13146 <bojohan@gnu.org>.
13147
13148 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
13149
13150 * frame.c (Fother_visible_frames_p): Function deleted.
13151
13152 2011-09-12 Eli Zaretskii <eliz@gnu.org>
13153
13154 * indent.c (compute_motion): Process display vector front to back
13155 rather than the other way around. (Bug#2496)
13156
13157 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13158
13159 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13160
13161 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
13162
13163 * minibuf.c (Fread_from_minibuffer): Doc fix.
13164
13165 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13166
13167 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13168 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13169
13170 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13171
13172 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13173 value for non-existent files.
13174
13175 2011-09-11 Eli Zaretskii <eliz@gnu.org>
13176
13177 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13178 set its "size" to -1. This will set the modtime_size field of
13179 the corresponding buffer to -1, which is what
13180 verify-visited-file-modtime expects for files that do not exist.
13181 (Bug#9139)
13182
13183 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13184
13185 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13186 here ...
13187 * lisp.h: ... from here. push_key_description is no longer
13188 defined in keyboard.c, so its declaration should not be in
13189 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13190 logically belongs with push_key_description.
13191
13192 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13193
13194 * buffer.h: Include <sys/types.h> instead of <time.h>.
13195 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13196 Problem reported by Herbert J. Skuhra.
13197
13198 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13199
13200 * xml.c (parse_region): Make the parsing work for
13201 non-comment-starting XML files again (bug#9144).
13202
13203 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13204
13205 * image.c (gif_load): Fix calculation of bottom and right corner.
13206 (Bug#9468)
13207
13208 2011-09-10 Eli Zaretskii <eliz@gnu.org>
13209
13210 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13211 redisplay in small windows.
13212
13213 2011-09-09 Eli Zaretskii <eliz@gnu.org>
13214
13215 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13216
13217 2011-09-08 Martin Rudalics <rudalics@gmx.at>
13218
13219 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13220 Operate on live windows only.
13221
13222 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
13223
13224 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13225
13226 2011-09-07 Eli Zaretskii <eliz@gnu.org>
13227
13228 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13229 only under bidi iteration.
13230
13231 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13232
13233 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13234
13235 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13236
13237 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13238 Without this fix, the command to link temacs failed due to an
13239 undefined symbol __builtin_isnan. This is because
13240 /usr/include/iso/math_c99.h #defines isnan(x) to
13241 __builtin_isnan(x), but the bundled gcc, which identifies itself
13242 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13243 a __builtin_isnan.
13244 * floatfns.c (isnan): #undef, and then #define to a clone of
13245 what's in data.c.
13246 (Fisnan): Always define, since it's always available now.
13247 (syms_of_floatfns): Always define isnan at the Lisp level.
13248
13249 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13250
13251 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13252
13253 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13254
13255 * fileio.c: Fix bugs with large file offsets (Bug#9428).
13256 The previous code assumed that file offsets (off_t values) fit in
13257 EMACS_INT variables, which is not true on typical 32-bit hosts.
13258 The code messed up by falsely reporting buffer overflow in cases
13259 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13260 when "big" contains more than 2**29 bytes, even though this
13261 inserts just one byte and does not overflow the buffer.
13262 (Finsert_file_contents): Store file offsets as off_t
13263 values, not as EMACS_INT values. Check for overflow when
13264 converting between EMACS_INT and off_t. When checking for
13265 buffer overflow or for overlap, take the offsets into account.
13266 Don't use EMACS_INT for small values where int suffices.
13267 When checking for overlap, fix a typo: ZV was used where
13268 ZV_BYTE was intended.
13269 (Fwrite_region): Don't assume off_t fits into 'long'.
13270 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13271
13272 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
13273
13274 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13275
13276 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13277
13278 sprintf-related integer and memory overflow issues (Bug#9412).
13279
13280 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
13281 (esprintf, exprintf, evxprintf): New functions.
13282 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
13283 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
13284 (modify_event_symbol): Do not assume that the length of
13285 name_alist_or_stem is safe to alloca and fits in int.
13286 (Fexecute_extended_command): Likewise for function name and binding.
13287 (Frecursion_depth): Wrap around reliably on integer overflow.
13288 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13289 since some callers pass EMACS_INT values.
13290 (Fsingle_key_description): Don't crash if symbol name contains more
13291 than MAX_ALLOCA bytes.
13292 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13293 (get_minibuffer): Arg is now EMACS_INT, not int.
13294 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
13295 (esprintf, exprintf, evxprintf): New decls.
13296 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13297
13298 * dbusbind.c (signature_cat): New function.
13299 (xd_signature, Fdbus_register_signal):
13300 Do not overrun buffer; instead, report string overflow.
13301
13302 * dispnew.c (add_window_display_history): Don't overrun buffer.
13303 Truncate instead; this is OK since it's just a log.
13304
13305 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13306 even if the time zone offset is outlandishly large.
13307 Don't mishandle offset == INT_MIN.
13308
13309 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13310 when creating daemon; the previous buffer-overflow check was incorrect.
13311
13312 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13313 which has the guts of the old verror function.
13314
13315 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13316 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13317
13318 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13319 (font_unparse_xlfd): Don't blindly alloca long strings.
13320 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
13321 fits in int, when using sprintf. Use single snprintf to count
13322 length of string rather than counting it via multiple sprintfs;
13323 that's simpler and more reliable.
13324 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13325 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13326 sprintf, in case result does not fit in int.
13327
13328 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13329 (fontset_from_font): Print it.
13330
13331 * frame.c (tty_frame_count): Now printmax_t, not int.
13332 (make_terminal_frame, set_term_frame_name): Print it.
13333 (x_report_frame_params): In X, window IDs are unsigned long,
13334 not signed long, so print them as unsigned.
13335 (validate_x_resource_name): Check for implausibly long names,
13336 and don't assume name length fits in 'int'.
13337 (x_get_resource_string): Don't blindly alloca invocation name;
13338 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13339 not fit in int.
13340
13341 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13342 (xg_check_special_colors, xg_set_geometry):
13343 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13344
13345 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13346 Use esprintf, not sprintf, in case result does not fit in int.
13347
13348 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13349 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13350 it as a large positive number.
13351 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13352 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13353
13354 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13355 in case result does not fit in int.
13356
13357 * print.c (float_to_string): Detect width overflow more reliably.
13358 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13359 buffer overrun. Don't assume list length fits in 'int'. Treat
13360 print length of 0 as 0, not as infinity; to be consistent with other
13361 uses of print length in this function. Don't overflow print length
13362 index. Don't assume hash table size fits in 'long', or that
13363 vectorlike size fits in 'unsigned long'.
13364
13365 * process.c (make_process): Use printmax_t, not int, to format
13366 process-name gensyms.
13367
13368 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13369
13370 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13371 to avoid potential buffer overrun.
13372
13373 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13374 if X resource line is longer than 512 bytes.
13375
13376 * xfns.c (x_window): Make sprintf buffer a bit bigger
13377 to avoid potential buffer overrun.
13378
13379 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13380
13381 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13382
13383 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13384
13385 Integer overflow fixes for scrolling, etc.
13386 Without these, Emacs silently mishandles large integers sometimes.
13387 For example, "C-u 4294967297 M-x recenter" was treated as if
13388 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13389
13390 * xdisp.c (try_window_id): Check Emacs fixnum range before
13391 converting to 'int'.
13392
13393 * window.c (window_scroll_line_based, Frecenter):
13394 Check that an Emacs fixnum is in range before assigning it to 'int'.
13395 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13396 values converted from Emacs fixnums.
13397 (Frecenter): Don't wrap around a line count if it is out of 'int'
13398 range; instead, treat it as an extreme value.
13399 (Fset_window_configuration, compare_window_configurations):
13400 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13401
13402 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13403 that can exceed INT_MAX. Check that EMACS_INT value is in range
13404 before assigning it to the (possibly-narrower) index.
13405 (match_limit): Don't assume that a fixnum can fit in 'int'.
13406
13407 * print.c (print_object): Use ptrdiff_t, not int, for index that can
13408 exceed INT_MAX.
13409
13410 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
13411 (Fvertical_motion): Don't wrap around LINES values that don't fit
13412 in 'int'. Instead, treat them as extreme values. This is good
13413 enough for windows, which can't have more than INT_MAX lines anyway.
13414
13415 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13416
13417 * Require libxml/parser.h to avoid compilation warning.
13418
13419 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13420
13421 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13422 since this reportedly can destroy thread storage.
13423
13424 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
13425
13426 * syntax.c (find_defun_start): Update all cache variables if
13427 exiting early (Bug#9401).
13428
13429 2011-08-30 Eli Zaretskii <eliz@gnu.org>
13430
13431 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13432
13433 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13434 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13435 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13436
13437 * term.c (tty_append_glyph): New function.
13438 (produce_stretch_glyph): Static function and its prototype deleted.
13439
13440 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13441 Add prototypes.
13442
13443 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13444
13445 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13446 when checking :margin (Bug#9390).
13447 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
13448 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
13449 so that the name doesn't mislead. All uses changed.
13450
13451 2011-08-28 Johan Bockgård <bojohan@gnu.org>
13452
13453 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13454 set_tty_hooks.
13455
13456 2011-08-27 Eli Zaretskii <eliz@gnu.org>
13457
13458 * xdisp.c (move_it_to): Don't bail out early when reaching
13459 position beyond to_charpos, if we are scanning backwards.
13460 (move_it_vertically_backward): When DY == 0, make sure we get to
13461 the first character in the line after the newline.
13462
13463 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13464
13465 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13466 (ccl_driver): Do not generate an out-of-range pointer.
13467 (Fccl_execute_on_string): Remove unnecessary check for
13468 integer overflow, noted by Stefan Monnier in
13469 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13470 Remove a FIXME that didn't need fixing.
13471 Simplify the newly-introduced buffer reallocation code.
13472
13473 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
13474
13475 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13476
13477 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
13478
13479 Integer and memory overflow issues (Bug#9196).
13480
13481 * doc.c (get_doc_string): Rework so that
13482 get_doc_string_buffer_size is the actual buffer size, rather than
13483 being 1 less than the actual buffer size; this makes xpalloc more
13484 convenient.
13485
13486 * image.c (x_allocate_bitmap_record, cache_image):
13487 * xselect.c (Fx_register_dnd_atom):
13488 Simplify previous changes by using xpalloc.
13489
13490 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13491 since either will do and ptrdiff_t is convenient with xpalloc.
13492
13493 * charset.c (charset_table_size)
13494 (struct charset_sort_data.priority): Now ptrdiff_t.
13495 (charset_compare): Don't overflow if priorities differ greatly.
13496 (Fsort_charsets): Don't assume list length fits in int.
13497 Check for size-calculation overflow when allocating sort data.
13498 (syms_of_charset): Allocate an initial charset table that is
13499 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13500
13501 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13502
13503 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13504 The actual value is always <= INT_MAX, and leaving it unsigned made
13505 overflow checking harder.
13506
13507 * dispextern.h (struct glyph_matrix.rows_allocated)
13508 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13509 with xpalloc. The values are still always <= INT_MAX.
13510
13511 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13512
13513 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13514 (SAFE_NALLOCA): New macro.
13515
13516 * region-cache.c (struct boundary.pos, find_cache_boundary)
13517 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13518 (set_cache_region, invalidate_region_cache)
13519 (revalidate_region_cache, know_region_cache, region_cache_forward)
13520 (region_cache_backward, pp_cache):
13521 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13522 so that ptrdiff_t * can be passed to xpalloc.
13523 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13524 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13525 (pp_cache): Don't assume cache_len fits in int.
13526 * region-cache.h: Adjust extern decls to match.
13527
13528 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13529 EMACS_INT, since either will do, for xpalloc.
13530
13531 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13532 (xnmalloc, xnrealloc, xpalloc): New functions.
13533
13534 * bidi.c (bidi_shelve_header_size): New constant.
13535 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13536 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13537
13538 * bidi.c (bidi_cache_shrink):
13539 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13540 (overlay_strings):
13541 Don't update size of array until after memory allocation succeeds,
13542 because xmalloc/xrealloc may not return.
13543 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13544 now that we have proper integer overflow checking.
13545 (record_overlay_string, overlay_strings): Catch overflows when
13546 calculating size of overlay_str_buf.
13547
13548 * callproc.c (Fcall_process): Check for size overflow when
13549 calculating size of args2.
13550 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13551 Normally we prefer signed values, but sticking with ptrdiff_t would
13552 require adding more-complicated checks.
13553
13554 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13555 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13556 Redo buffer-overflow calculations to avoid integer overflow.
13557 Add a FIXME comment where memory seems to be over-allocated.
13558
13559 * character.c (Fstring): Check for size-calculation overflow.
13560
13561 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13562 unnecessary integer overflow. Check for size overflow.
13563 (encode_coding_object): Don't update size until xmalloc succeeds.
13564
13565 * composite.c (get_composition_id): Check for overflow in glyph
13566 length calculations.
13567
13568 Integer and memory overflow fixes for display code.
13569 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13570 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13571 (scrolling_window): Check for overflow in size calculations.
13572 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13573 Don't assume glyph table len fits in int.
13574 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13575 (row_table_size): Now ptrdiff_t, not int.
13576 (scrolling_window): Avoid overflow in size calculations.
13577 Don't update size until allocation succeeds.
13578 * fns.c (concat): Check for overflow in size calculations.
13579 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13580 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13581 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13582
13583 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13584 (get_doc_string): Check for size calculation overflow.
13585 Don't update size until allocation succeeds.
13586 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13587 EMACS_INT, where ptrdiff_t will do.
13588 (Fsubstitute_command_keys): Check for string overflow.
13589
13590 * editfns.c (set_time_zone_rule): Don't assume environment length
13591 fits in int.
13592 (message_length): Now ptrdiff_t, not int.
13593 (Fmessage_box): Don't update size until allocation succeeds.
13594 Don't assume message length fits in int.
13595 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13596
13597 * emacs.c (main): Do not reallocate argv, since there is a null at
13598 the end that can be overwritten, and this way there's no need to
13599 worry about size-calculation overflow.
13600 (sort_args): Check for size-calculation overflow.
13601
13602 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13603 alloc succeeds.
13604 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13605
13606 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13607 (x_set_scroll_bar_width, x_figure_window_size):
13608 Check for integer overflow.
13609 (x_set_alpha): Do not assume XINT fits in int.
13610
13611 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13612 This is for the members text_lines, text_cols, total_lines, total_cols,
13613 where the system imposes an 'int' limit.
13614
13615 * fringe.c (Fdefine_fringe_bitmap):
13616 Don't update size until alloc works.
13617
13618 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13619 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13620
13621 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13622 Check for size-calculation overflow.
13623 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13624 do, as we prefer signed integers.
13625 (id_to_widget.max_size, id_to_widget.used)
13626 (xg_store_widget_in_map, xg_remove_widget_from_map)
13627 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13628 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13629 Use and return ptrdiff_t, not int.
13630 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13631 * gtkutil.h: Change prototypes to match the above.
13632
13633 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13634 are duplicate now that they've been promoted to lisp.h.
13635 (x_allocate_bitmap_record, x_alloc_image_color)
13636 (make_image_cache, cache_image, xpm_load):
13637 Don't update size until alloc is done.
13638 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13639 (x_detect_edges):
13640 Check for size calculation overflow.
13641 (ct_colors_allocated_max): New constant.
13642 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13643 overflow.
13644
13645 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13646 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13647 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13648 Use ptrdiff_t, not int, to count maps.
13649 (read_char_minibuf_menu_prompt): Check for overflow in size
13650 calculations. Don't update size until allocation succeeds.
13651 Redo calculations to avoid overflow.
13652 * keyboard.h: Change prototypes to match the above.
13653
13654 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13655 to count maps.
13656 (current_minor_maps): Check for size calculation overflow.
13657 * keymap.h: Change prototypes to match the above.
13658
13659 * lread.c (read1, init_obarray): Don't update size until alloc done.
13660
13661 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13662 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13663
13664 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13665 Now ptrdiff_t, not int.
13666 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13667 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13668
13669 * process.c (Fnetwork_interface_list): Check for overflow
13670 in size calculation.
13671
13672 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13673
13674 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13675 overflow. Don't bother calling xmalloc when xrealloc will do.
13676
13677 * search.c (Freplace_match): Check for size calculation overflow.
13678 (Fset_match_data): Don't assume list lengths fit in 'int'.
13679
13680 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13681 for command line length. Do not attempt to address one before the
13682 beginning of an array, as that's not portable.
13683
13684 * term.c (max_frame_lines): Remove; unused.
13685 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13686 not int.
13687 (encode_terminal_code, calculate_costs): Check for size
13688 calculation overflow.
13689 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13690 table lengths and related sizes. Don't update size until alloc
13691 done. Redo calculations to avoid overflow.
13692 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13693
13694 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13695 subtracting pointers.
13696 (gobble_line): Check for overflow more carefully. Don't update size
13697 until alloc done.
13698
13699 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13700 Don't update size until alloc done.
13701 Redo size calculations to avoid overflow.
13702 Check for size calculation overflow.
13703 (main) [DEBUG]: Fix typo in invoking tparam1.
13704
13705 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13706 Use ptrdiff_t, not int, for sizes.
13707 (store_mode_line_noprop_char): Don't update size until alloc done.
13708
13709 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13710 Use ptrdiff_t, not int, for sizes.
13711 (Finternal_make_lisp_face, cache_face):
13712 Check for size calculation overflow.
13713 (cache_face): Treat size calculation overflows as if they were
13714 memory exhaustion (the usual treatment), rather than aborting.
13715
13716 * xfns.c (x_encode_text, x_set_name_internal)
13717 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13718 sizes, since they can exceed INT_MAX in size. Check for size
13719 calculation overflow.
13720
13721 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13722 (xg_select): Check for size calculation overflow.
13723 Don't update size until alloc done.
13724
13725 * xrdb.c (get_environ_db): Don't assume path length fits in int,
13726 as sprintf is limited to int lengths.
13727
13728 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13729 (X_LONG_MIN): New macros.
13730 Use them to make the following changes clearer.
13731 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13732 This change doesn't affect the value now, but it may help remind
13733 future maintainers not to raise the value too much later.
13734 (SELECTION_QUANTUM): Remove, replacing with ...
13735 (selection_quantum): ... new function, which avoids overflow.
13736 All uses changed.
13737 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13738 assumption that selection length fits in 'int'.
13739 (x_reply_selection_request, x_handle_selection_request)
13740 (x_get_window_property, receive_incremental_selection)
13741 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13742 (lisp_data_to_selection_data, clean_local_selection_data):
13743 Use ptrdiff_t, not int, to record length of selection.
13744 (x_reply_selection_request, x_get_window_property)
13745 (receive_incremental_selection, x_property_data_to_lisp):
13746 Redo calculations to avoid overflow.
13747 (x_reply_selection_request): When sending hint, ceiling it at
13748 X_LONG_MAX rather than relying on wraparound overflow to send
13749 something.
13750 (x_get_window_property, receive_incremental_selection)
13751 (lisp_data_to_selection_data, x_property_data_to_lisp):
13752 Check for size-calculation overflow.
13753 (x_get_window_property, receive_incremental_selection)
13754 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13755 Don't store size until memory allocation succeeds.
13756 (x_get_window_property): Plug memory leak on memory exhaustion.
13757 Don't double-block input; malloc is safe here. Don't assume 2**34
13758 - 4 fits in unsigned long. Add an xassert to check
13759 XGetWindowProperty overflow. Be more careful about overflow
13760 calculations, and distinguish size from memory overflow better.
13761 (receive_incremental_selection): When tracing, don't assume
13762 unsigned int is less than INT_MAX.
13763 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13764 harmful) conversions of unsigned short to int.
13765 (lisp_data_to_selection_data): Don't assume that integers
13766 in the range -65535 through -1 fit in an X unsigned short.
13767 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13768 result parameters unless successful. Rely on cons_to_unsigned
13769 to report problems with elements; the old code wasn't right anyway.
13770 (x_check_property_data): Check for int overflow; we cannot use
13771 a wider type due to X limits.
13772 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
13773
13774 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
13775
13776 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
13777 (x_term_init): Check for size calculation overflow.
13778 (x_color_cells): Don't store size until memory allocation succeeds.
13779 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
13780 Don't assume alloca size is less than MAX_ALLOCA.
13781 (x_term_init): Don't assume length fits in int (sprintf is limited
13782 to int size).
13783
13784 Use ptrdiff_t for composition IDs.
13785 * character.c (lisp_string_width):
13786 * composite.c (composition_table_size, n_compositions)
13787 (get_composition_id, composition_gstring_from_id):
13788 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
13789 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
13790 * window.c (Frecenter):
13791 Use ptrdiff_t, not int, for composition IDs.
13792 * composite.c (get_composition_id): Check for integer overflow.
13793 * composite.h: Adjust prototypes to match the above changes.
13794
13795 Use ptrdiff_t for hash table indexes.
13796 * category.c (hash_get_category_set):
13797 * ccl.c (ccl_driver):
13798 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
13799 * coding.c (coding_system_charset_list, detect_coding_system):
13800 * coding.h (struct coding_system.id):
13801 * composite.c (get_composition_id, gstring_lookup_cache):
13802 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
13803 * image.c (xpm_get_color_table_h):
13804 * lisp.h (hash_lookup, hash_put):
13805 * minibuf.c (Ftest_completion):
13806 Use ptrdiff_t for hash table indexes, not int (which is too
13807 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
13808 32-bit --with-wide-int hosts).
13809
13810 * charset.c (Fdefine_charset_internal): Check for integer overflow.
13811 Add a FIXME comment about memory leaks.
13812 (syms_of_charset): Don't assume xmalloc returns.
13813
13814 Don't assume that stated character widths fit in int.
13815 * character.c (Fchar_width, c_string_width, lisp_string_width):
13816 * character.h (CHAR_WIDTH):
13817 * indent.c (MULTIBYTE_BYTES_WIDTH):
13818 Use sanitize_char_width to avoid undefined and/or bad behavior
13819 with outlandish widths.
13820 * character.h (sanitize_tab_width): Rename from sanitize_width,
13821 now that we have two such functions. All uses changed.
13822 (sanitize_char_width): New inline function.
13823
13824 Don't assume that tab-width fits in int.
13825 * character.h (sanitize_width): New inline function.
13826 (SANE_TAB_WIDTH): New macro.
13827 (ASCII_CHAR_WIDTH): Use it.
13828 * indent.c (sane_tab_width): Remove. All uses replaced by
13829 SANE_TAB_WIDTH (current_buffer).
13830 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
13831
13832 * fileio.c: Integer overflow issues with file modes.
13833 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
13834
13835 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
13836 Remove unreachable code.
13837 (read_hex, load_charset_map_from_file): Check for integer overflow.
13838
13839 * xterm.c: Don't go over XClientMessageEvent limit.
13840 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
13841 (x_send_scroll_bar_event): Likewise. Check that the size does not
13842 exceed limits imposed by XClientMessageEvent, as well as the usual
13843 ptrdiff_t and size_t limits.
13844
13845 * keyboard.c: Overflow, signedness and related fixes.
13846 (make_lispy_movement): Use same integer type in forward decl
13847 that is used in the definition.
13848 (read_key_sequence, keyremap_step):
13849 Change bufsize argument back to int, undoing my 2011-03-30 change.
13850 We prefer signed types, and int is wide enough here.
13851 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
13852 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
13853 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
13854 length, not size_t. Use ptrdiff_t for index, not int.
13855 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
13856 possibility of integer overflow.
13857
13858 Overflow, signedness and related fixes for images.
13859
13860 * dispextern.h (struct it.stack[0].u.image.image_id)
13861 (struct_it.image_id, struct image.id, struct image_cache.size)
13862 (struct image_cache.used, struct image_cache.ref_count):
13863 * gtkutil.c (update_frame_tool_bar):
13864 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
13865 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
13866 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
13867 * nsmenu.m (update_frame_tool_bar):
13868 * xdisp.c (calc_pixel_width_or_height):
13869 * xfns.c (image_cache_refcount):
13870 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
13871 on typical 64-bit hosts.
13872
13873 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13874 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
13875 Omit unnecessary casts to int.
13876 (parse_image_spec): Check that integers fall into 'int' range
13877 when the callers expect that.
13878 (image_ascent): Redo ascent calculation to avoid int overflow.
13879 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
13880 (lookup_image): Remove unnecessary tests.
13881 (xbm_image_p): Locals are now of int, not EMACS_INT,
13882 since parse_image_check makes sure they fit into int.
13883 (png_load, gif_load, svg_load_image):
13884 Prefer int to unsigned where either will do.
13885 (tiff_handler): New function, combining the cores of the
13886 old tiff_error_handler and tiff_warning_handler.
13887 This function is rewritten to use vsnprintf and thereby avoid
13888 stack buffer overflows. It uses only the features of vsnprintf
13889 that are common to both POSIX and native Microsoft.
13890 (tiff_error_handler, tiff_warning_handler): Use it.
13891 (tiff_load, gif_load, imagemagick_load_image):
13892 Don't assume :index value fits in 'int'.
13893 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
13894 (imagemagick_load_image): Check that crop parameters fit into
13895 the integer types that MagickCropImage accepts. Don't assume
13896 Vimagemagick_render_type has a nonnegative value. Don't assume
13897 size_t fits in 'long'.
13898 (gs_load): Use printmax_t to print the widest integers possible.
13899 Check for integer overflow when computing image height and width.
13900
13901 2011-08-26 Eli Zaretskii <eliz@gnu.org>
13902
13903 * xdisp.c (redisplay_window): Don't force window start if point
13904 will be invisible in the resulting window. (Bug#9324)
13905
13906 2011-08-25 Eli Zaretskii <eliz@gnu.org>
13907
13908 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
13909 the display spec is of the form `(space ...)'.
13910 (handle_display_spec): Return the value returned by
13911 handle_single_display_spec, not just 1 or zero.
13912 (handle_single_display_spec): If the display spec is of the form
13913 `(space ...)', and specifies display in the text area, return 2
13914 rather than 1.
13915 (try_cursor_movement): Check for the need to scroll more
13916 accurately, and prefer exact match for point under bidi.
13917 Don't advance `row' beyond the last row of the window.
13918
13919 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13920 into disp_prop; all users changed.
13921
13922 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13923 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13924 for the text covered by the display property.
13925
13926 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
13927
13928 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13929 Change return value to nil.
13930 (Frecord_buffer): Delete unused function.
13931
13932 2011-08-24 Eli Zaretskii <eliz@gnu.org>
13933
13934 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13935 buffers, return left-to-right.
13936 (set_cursor_from_row): Consider candidate row a win if its glyph
13937 represents a newline and point is on that newline. Fixes cursor
13938 positioning on the newline at EOL of R2L text within L2R
13939 paragraph, and vice versa.
13940 (try_cursor_movement): Check continued rows, in addition to
13941 continuation rows. Fixes unwarranted scroll when point enters a
13942 continued line of R2L text within an L2R paragraph, or vice versa.
13943 (cursor_row_p): Consider the case of point being equal to
13944 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13945 from the end of a short line to the beginning of a continued line
13946 of R2L text within L2R paragraph.
13947 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13948 composed characters.
13949
13950 * bidi.c (bidi_check_type): Use xassert.
13951 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13952 members.
13953
13954 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13955
13956 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13957 a character.
13958
13959 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
13960
13961 * nsfont.m (ns_otf_to_script): Fix typo.
13962
13963 2011-08-22 Kenichi Handa <handa@m17n.org>
13964
13965 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13966 extra slot even if the purpose is char-code-property-table.
13967
13968 2011-08-23 Eli Zaretskii <eliz@gnu.org>
13969
13970 * xdisp.c (redisplay_window): When computing centering_position,
13971 account for the height of the header line. (Bug#8874)
13972
13973 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13974 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13975 candidate is selected by the mouse, and that candidate has a
13976 composed character under the mouse.
13977
13978 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13979 coordinates reported by pos-visible-in-window-p for a composed
13980 character in column zero.
13981
13982 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13983
13984 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13985
13986 2011-08-22 Eli Zaretskii <eliz@gnu.org>
13987
13988 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13989 consider it a hit if to_charpos is anywhere in the range of the
13990 composed buffer positions.
13991
13992 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
13993
13994 * image.c (gif_load): Don't assume that each subimage has the same
13995 dimensions as the base image. Handle disposal method that is
13996 "undefined" by the gif spec (Bug#9335).
13997
13998 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
13999
14000 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
14001 (Fcondition_case): Document `debug' symbol in error handler.
14002
14003 2011-08-19 Eli Zaretskii <eliz@gnu.org>
14004
14005 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14006 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14007 from an Org mode buffer to a Speedbar frame.
14008
14009 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14010 a composition, take its buffer position from IT->cmp_it.charpos.
14011 Fixes cursor positioning at the beginning of a line that begins
14012 with a composed character.
14013
14014 2011-08-18 Eli Zaretskii <eliz@gnu.org>
14015
14016 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14017 character bidirectional type, use STRONG_L instead. Fixes crashes
14018 in a buffer produced by `describe-categories'.
14019
14020 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14021 members before the level stack, so they would be saved and
14022 restored when copying iterator state. Fixes incorrect reordering
14023 around TABs covered by display properties.
14024
14025 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14026
14027 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
14028
14029 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
14030
14031 * eval.c (internal_condition_case, internal_condition_case_1)
14032 (internal_condition_case_2, internal_condition_case_n):
14033 Remove unnecessary aborts (Bug#9081).
14034
14035 2011-08-17 Eli Zaretskii <eliz@gnu.org>
14036
14037 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14038 has no `load' handler, try opening the file locally. (Bug#9311)
14039
14040 2011-08-16 Ken Brown <kbrown@cornell.edu>
14041
14042 * gmalloc.c: Expand comment.
14043
14044 2011-08-16 Eli Zaretskii <eliz@gnu.org>
14045
14046 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14047 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14048
14049 2011-08-16 Ken Brown <kbrown@cornell.edu>
14050
14051 Fix memory allocation problems in Cygwin build (Bug#9273).
14052
14053 * unexcw.c ( __malloc_initialized): Declare external variable.
14054 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14055
14056 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14057 New variables.
14058 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14059 dumped emacs.
14060 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14061 in the static heap.
14062 [CYGWIN] (special_realloc): New function.
14063 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14064 requests to realloc storage in the static heap.
14065
14066 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14067
14068 * bidi.c (bidi_initialize): Remove unused local.
14069
14070 2011-08-15 Eli Zaretskii <eliz@gnu.org>
14071
14072 * bidimirror.h:
14073 * biditype.h: Remove file.
14074 * makefile.w32-in ($(BLD)/bidi.$(O)):
14075 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
14076
14077 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14078
14079 * chartab.c: Improve commentary for the uniprop_table API.
14080
14081 * bidi.c (bidi_paragraph_init): Support zero value of
14082 bidi_ignore_explicit_marks_for_paragraph_level.
14083 (bidi_initialize): Use uniprop_table instead of including
14084 biditype.h and bidimirror.h.
14085
14086 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14087 coordinates of the iterator when restoring from ppos_it.
14088 (Bug#9296)
14089
14090 2011-08-14 Kenichi Handa <handa@m17n.org>
14091
14092 * process.c (create_process): Call setup_process_coding_systems
14093 after the pid of the process is set to -1 (Bug#8162).
14094
14095 2011-08-14 Eli Zaretskii <eliz@gnu.org>
14096
14097 * xdisp.c (move_it_in_display_line_to): Don't invoke
14098 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14099 ppos_it. Fixes vertical cursor motion when line beginning is
14100 covered by an image. (Bug#9296)
14101
14102 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14103
14104 * nsterm.h (ns_run_ascript): Declare.
14105 (NSAPP_DATA2_RUNASSCRIPT): Define.
14106
14107 * nsfns.m (as_script, as_result, as_status): New static variables.
14108 (ns_run_ascript): New function.
14109 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
14110 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14111 the event loop. Get status from as_status (Bug#7276).
14112
14113 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14114 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14115 the event loop (Bug#7276).
14116
14117 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14118
14119 * gnutls.c (QCgnutls_bootprop_priority)
14120 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14121 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14122 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14123 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14124 (QCgnutls_bootprop_verify_hostname_error)
14125 (QCgnutls_bootprop_callbacks_verify): Rename from
14126 Qgnutls_bootprop_..., all uses changed.
14127
14128 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14129 uses changed.
14130
14131 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14132
14133 * xfaces.c (Qframe_set_background_mode): Now static.
14134 * dispextern.h (Qframe_set_background_mode): Remove decl.
14135
14136 * process.c (Fnetwork_interface_info): Declare local only if needed.
14137
14138 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14139
14140 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14141 (Fnetwork_interface_list): Allocate in increments of bytes instead
14142 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14143 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14144 sockaddr.
14145 (struct ifflag_def): notrailers is smart on OSX.
14146 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14147 Get hardware address with getifaddrs if available.
14148
14149 2011-08-12 Eli Zaretskii <eliz@gnu.org>
14150
14151 * xdisp.c (iterate_out_of_display_property): xassert that
14152 IT->position is set to within IT->object's boundaries. Break from
14153 the loop as soon as EOB is reached; avoids infloops in redisplay
14154 when IT->position is set up wrongly due to some bug.
14155 Set IT->current to match the bidi iterator unconditionally.
14156 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14157 entry. Force push_it to save on the stack the current
14158 buffer/string position, to be restored by pop_it. Fix flags in
14159 the iterator structure wrt the object coming from a display
14160 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14161 properties. (Bug#9284)
14162
14163 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
14164
14165 * fontset.c (fontset_get_font_group): Add proper type checks.
14166 (Bug#9172)
14167
14168 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14169
14170 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14171 and LC_VERSION_MIN_MACOSX.
14172 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14173 (dump_it) [LC_FUNCTION_STARTS]: Use it.
14174
14175 2011-08-08 Eli Zaretskii <eliz@gnu.org>
14176
14177 * xdisp.c (forward_to_next_line_start): Allow to use the
14178 no-display-properties-and-no-overlays under bidi display.
14179 Set disp_pos in the bidi iterator to avoid searches for display
14180 properties and overlays.
14181
14182 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
14183
14184 * editfns.c (Fset_time_zone_rule): Document relationship with the
14185 setenv function.
14186
14187 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14188 the font entity extracted from the cache (Bug#8109).
14189
14190 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
14191
14192 * composite.c (autocmp_chars): Don't reset point. That is done by
14193 restore_point_unwind (Bug#5984).
14194
14195 2011-08-07 Juri Linkov <juri@jurta.org>
14196
14197 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14198 to show the arg `TIME' instead of `TIMEVAL'.
14199
14200 2011-08-06 Eli Zaretskii <eliz@gnu.org>
14201
14202 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14203 display property strides EOL and includes a newline, as in
14204 longlines-mode. (Bug#9254)
14205 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14206 word-wrap under bidirectional display. (Bug#9224)
14207
14208 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14209 is non-zero, even if the data buffer is NULL. Fixes a crash in
14210 vertical-motion with longlines-mode. (Bug#9254)
14211
14212 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14213
14214 * bidi.c <bidi_cache_total_alloc>: Now static.
14215 (bidi_initialize): Initialize bidi_cache_total_alloc.
14216
14217 * xdisp.c (display_line): Release buffer allocated for shelved bidi
14218 cache. (Bug#9221)
14219
14220 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14221 amount allocated this far in `bidi_cache_total_alloc'.
14222 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14223 non-zero, only free the data buffer without restoring the cache
14224 contents. All callers changed.
14225
14226 * dispextern.h (bidi_unshelve_cache): Update prototype.
14227
14228 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14229 (move_it_in_display_line, move_it_to)
14230 (move_it_vertically_backward, move_it_by_lines): Replace the call
14231 to xfree to an equivalent call to bidi_unshelve_cache.
14232 (move_it_in_display_line_to): Fix logic of returning
14233 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
14234
14235 2011-08-05 Eli Zaretskii <eliz@gnu.org>
14236
14237 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14238 came from a string character with a `cursor' property. (Bug#9229)
14239
14240 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14241
14242 * Makefile.in (LIB_PTHREAD): New variable.
14243 (LIBES): Add LIB_PTHREAD (Bug#9216).
14244
14245 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14246 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14247
14248 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14249
14250 * regex.c (re_iswctype): Remove some redundant boolean conversions.
14251
14252 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14253
14254 * xterm.c (x_find_topmost_parent): New function.
14255 (x_set_frame_alpha): Find topmost parent window with
14256 x_find_topmost_parent and set the property there also (bug#9181).
14257 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14258
14259 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14260
14261 * callproc.c (Fcall_process): Avoid vfork clobbering
14262 the local vars buffer, coding_systems, current_dir.
14263
14264 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14265
14266 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14267
14268 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14269
14270 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14271 so that it is not optimized away.
14272
14273 * xdisp.c (compute_display_string_pos): Remove unused local.
14274
14275 2011-08-02 Eli Zaretskii <eliz@gnu.org>
14276
14277 Fix slow cursor motion and scrolling in large buffers with
14278 selective display, like Org Mode buffers. (Bug#9218)
14279
14280 * dispextern.h (struct bidi_it): New member disp_prop_p.
14281
14282 * xdisp.c: Remove one-slot cache of display string positions.
14283 (compute_display_string_pos): Accept an additional argument
14284 DISP_PROP_P; callers changed. Scan at most 5K characters forward
14285 for a display string or property. If found, set DISP_PROP_P
14286 non-zero.
14287
14288 * bidi.c (bidi_fetch_char): Accept an additional argument
14289 DISP_PROP_P, and pass it to compute_display_string_pos.
14290 Only handle text covered by a display string if DISP_PROP_P is returned
14291 non-zero. All callers of bidi_fetch_char changed.
14292
14293 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14294
14295 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14296
14297 2010-12-03 Don March <don@ohspite.net>
14298
14299 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14300 last character M-[char] is translated to ESC [char] (bug#7541).
14301
14302 2011-08-02 Kenichi Handa <handa@m17n.org>
14303
14304 * lisp.h (uniprop_table): Extern it.
14305
14306 * chartab.c (uniprop_table): Make it non-static.
14307
14308 2011-08-01 Eli Zaretskii <eliz@gnu.org>
14309
14310 * xdisp.c (forward_to_next_line_start): Accept additional argument
14311 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14312 on the newline.
14313 (reseat_at_next_visible_line_start): Use the bidi iterator state
14314 returned by forward_to_next_line_start to restore the state of
14315 it->bidi_it after backing up to previous newline. (Bug#9212)
14316
14317 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14318
14319 * regex.c (re_comp): Protoize.
14320 (re_exec): Fix return type.
14321 (regexec): Fix type of `ret'. (Bug#9203)
14322
14323 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14324
14325 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14326 This is needed if max-image-size is a floating-point number.
14327
14328 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14329
14330 * print.c (print_object): Print empty symbol as ##.
14331
14332 * lread.c (read1): Read ## as empty symbol.
14333
14334 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14335
14336 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14337 setting frame foreground color (Bug#9175).
14338 (x_set_background_color): Likewise.
14339
14340 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14341 contents (Bug#9176).
14342 (EmacsTooltip -init): Remove bezels and add shadows to
14343 tooltip windows.
14344
14345 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14346 or scroll bar (Bug#8470).
14347
14348 * nsfont.m (nsfont_open): Remove assignment to voffset and
14349 unnecessary vars hshink, expand, hd, full_height, min_height.
14350 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14351
14352 * nsterm.h (nsfont_info): Remove voffset field.
14353
14354 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14355
14356 Implement strike-through and overline on NextStep (Bug#8863).
14357
14358 * nsfont.m (nsfont_open): Use underline position provided by font,
14359 instead of hard-coded value of 2.
14360 (nsfont_draw): Call ns_draw_text_decoration instead.
14361
14362 * nsterm.h: Add declaration for ns_draw_text_decoration.
14363
14364 * nsterm.m (ns_draw_text_decoration): New function for drawing
14365 underline, overline, and strike-through.
14366 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14367 ns_draw_text_decoration. Change treatment of cursor drawing to
14368 accommodate underlining, etc.
14369
14370 2011-07-28 Eli Zaretskii <eliz@gnu.org>
14371
14372 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14373 default.
14374
14375 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14376
14377 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14378 Without this fix, if a signal arrives just after memory fills up,
14379 'malloc' might be invoked reentrantly.
14380
14381 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14382 In other words, assume that every image size is allowed, on non-X
14383 hosts. This assumption is probably wrong, but it lets Emacs compile.
14384
14385 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14386
14387 * regex.c (re_iswctype): Convert return values to boolean.
14388
14389 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14390
14391 * xdisp.c (compute_display_string_pos): Don't use cached display
14392 string position if the buffer had its restriction changed.
14393 (Bug#9184)
14394
14395 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14396
14397 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14398
14399 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14400
14401 Integer signedness and overflow and related fixes. (Bug#9079)
14402
14403 * bidi.c: Integer size and overflow fixes.
14404 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14405 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14406 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14407 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14408 (bidi_find_other_level_edge):
14409 Use ptrdiff_t instead of EMACS_INT where either will do.
14410 This works better on 32-bit hosts configured --with-wide-int.
14411 (bidi_cache_ensure_space): Check for size-calculation overflow.
14412 Use % rather than repeated addition, for better worst-case speed.
14413 Don't set bidi_cache_size until after xrealloc returns, because it
14414 might not return.
14415 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
14416 (bidi_cache_ensure_space): Also check that the bidi cache size
14417 does not exceed that of the largest Lisp string or buffer. See Eli
14418 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
14419
14420 * alloc.c (__malloc_size_t): Remove.
14421 All uses replaced by size_t. See Andreas Schwab's note
14422 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14423
14424 * image.c: Improve checking for integer overflow.
14425 (check_image_size): Assume that f is nonnull, since
14426 it is always nonnull in practice. This is one less thing to
14427 worry about when checking for integer overflow later.
14428 (x_check_image_size): New function, which checks for integer
14429 overflow issues inside X.
14430 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14431 This removes the need for a memory_full check.
14432 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14433 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14434 (xbm_read_bitmap_data): Change locals back to 'int', since
14435 their values must fit in 'int'.
14436 (xpm_load_image, png_load, tiff_load):
14437 Invoke x_create_x_image_and_pixmap earlier,
14438 to avoid much needless work if the image is too large.
14439 (tiff_load): Treat overly large images as if
14440 x_create_x_image_and_pixmap failed, not as malloc failures.
14441 (gs_load): Use x_check_image_size.
14442
14443 * gtkutil.c: Omit integer casts.
14444 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14445 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14446
14447 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14448
14449 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14450 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14451 would wrongly return t on a 64-bit host.
14452
14453 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14454 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14455 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14456 and therefore cause GCC to emit a bogus diagnostic in some cases.
14457
14458 * image.c: Integer signedness and overflow and related fixes.
14459 This is not an exhaustive set of fixes, but it's time to
14460 record what I've got.
14461 (lookup_pixel_color, check_image_size): Remove redundant decls.
14462 (check_image_size): Don't assume that arbitrary EMACS_INT values
14463 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14464 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14465 (tiff_load, imagemagick_load_image):
14466 Check for overflow in size calculations.
14467 (x_create_x_image_and_pixmap): Remove unnecessary test for
14468 xmalloc returning NULL; that can't happen.
14469 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14470 (xpm_color_bucket): Use better integer hashing function.
14471 (xpm_cache_color): Don't possibly over-allocate memory.
14472 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14473 (gif_memory_source):
14474 Use ptrdiff_t, not int or size_t, to record sizes.
14475 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14476 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14477 either works, as we prefer signed integers.
14478 (tiff_read_from_memory, tiff_write_from_memory):
14479 Return tsize_t, not size_t, since that's what the TIFF API wants.
14480 (tiff_read_from_memory): Don't fail simply because the read would
14481 go past EOF; instead, return a short read.
14482 (tiff_load): Omit no-longer-needed casts.
14483 (Fimagemagick_types): Don't assume size fits into 'int'.
14484
14485 Improve hashing quality when configured --with-wide-int.
14486 * fns.c (hash_string): New function, taken from sxhash_string.
14487 Do not discard information about ASCII character case; this
14488 discarding is no longer needed.
14489 (sxhash-string): Use it. Change sig to match it. Caller changed.
14490 * lisp.h: Declare it.
14491 * lread.c (hash_string): Remove, since we now use fns.c's version.
14492 The fns.c version returns a wider integer if --with-wide-int is
14493 specified, so this should help the quality of the hashing a bit.
14494
14495 * emacs.c: Integer overflow minor fix.
14496 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14497 Define only if GNU_LINUX.
14498 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14499
14500 * dispnew.c: Integer signedness and overflow fixes.
14501 Remove unnecessary forward decls, that were a maintenance hassle.
14502 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14503 All uses changed.
14504 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14505 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14506 (prepare_desired_row, line_draw_cost):
14507 Use int, not unsigned, where either works.
14508 (save_current_matrix, restore_current_matrix):
14509 Use ptrdiff_t, not size_t, where either works.
14510 (init_display): Check for overflow more accurately, and without
14511 relying on undefined behavior.
14512
14513 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14514 Remove, replacing with the new symbols in lisp.h. All uses changed.
14515 * fileio.c (make_temp_name):
14516 * filelock.c (lock_file_1, lock_file):
14517 * xdisp.c (message_dolog):
14518 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14519 Use pMd etc. instead.
14520 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14521 replacing the pWIDE etc. symbols removed from editfns.c.
14522
14523 * keyboard.h (num_input_events): Now uintmax_t.
14524 This is (very slightly) less likely to mess up due to wraparound.
14525 All uses changed.
14526
14527 * buffer.c: Integer signedness fixes.
14528 (alloc_buffer_text, enlarge_buffer_text):
14529 Use ptrdiff_t rather than size_t when either will do, as we prefer
14530 signed integers.
14531
14532 * alloc.c: Integer signedness and overflow fixes.
14533 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14534 (__malloc_size_t): Default to size_t, not to int.
14535 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14536 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14537 Prefer ptrdiff_t to size_t when either would do, as we prefer
14538 signed integers.
14539 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14540 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14541 Now const. Initialize with values that are in range even if char
14542 is signed.
14543 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14544 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14545 These functions do the right thing with sizes > 2**32.
14546 (check_depth): Now ptrdiff_t, not int.
14547 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14548 Adjust to new way of storing sizes. Check for size overflow bugs
14549 in rest of code.
14550 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14551 slightly wrong anyway, as it missed one instance of
14552 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14553 (refill_memory_reserve): Omit needless cast to size_t.
14554 (mark_object_loop_halt): Mark as externally visible.
14555
14556 * xselect.c: Integer signedness and overflow fixes.
14557 (Fx_register_dnd_atom, x_handle_dnd_message):
14558 Use ptrdiff_t, not size_t, since we prefer signed.
14559 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14560 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14561 x_dnd_atoms_size and x_dnd_atoms_length.
14562
14563 * doprnt.c: Prefer signed to unsigned when either works.
14564 * eval.c (verror):
14565 * doprnt.c (doprnt):
14566 * lisp.h (doprnt):
14567 * xdisp.c (vmessage):
14568 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14569 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14570 prefer signed arithmetic to avoid comparison confusion.
14571 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14572 but is a bit tricky.
14573
14574 Assume freestanding C89 headers, string.h, stdlib.h.
14575 * data.c, doprnt.c, floatfns.c, print.c:
14576 Include float.h unconditionally.
14577 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14578 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14579 * regex.c: Likewise for stddef.h, string.h.
14580 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14581 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14582 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14583 (STDC_HEADERS): Remove obsolete defines.
14584 * sysdep.c: Include limits.h unconditionally.
14585
14586 Assume support for memcmp, memcpy, memmove, memset.
14587 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14588 * regex.c (memcmp, memcpy):
14589 Remove; we assume C89 now.
14590
14591 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14592 (__malloc_safe_bcopy): Remove; no longer needed.
14593
14594 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
14595 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14596 well either way, and we prefer signed to unsigned.
14597
14598 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14599
14600 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14601 closes the connection while we're reading (bug#9182).
14602
14603 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
14604
14605 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14606 are specified (Bug#9168).
14607
14608 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14609
14610 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14611 Found by GCC static checking and --with-wide-int on a 32-bit host.
14612
14613 2011-07-25 Eli Zaretskii <eliz@gnu.org>
14614
14615 * xdisp.c (compute_display_string_pos): Fix logic of caching
14616 previous display string position. Initialize cached_prev_pos to
14617 -1. Fixes slow-down at the beginning of a buffer.
14618
14619 2011-07-24 Eli Zaretskii <eliz@gnu.org>
14620
14621 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14622 for attrs[LFACE_FONTSET_INDEX].
14623
14624 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14625
14626 * xml.c (parse_region): Remove unused local
14627 that was recently introduced.
14628
14629 2011-07-23 Eli Zaretskii <eliz@gnu.org>
14630
14631 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14632 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14633
14634 * xdisp.c (move_it_in_display_line_to): Record the best matching
14635 position for TO_CHARPOS while scanning the line, and restore it on
14636 exit if none of the characters scanned was an exact match.
14637 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
14638 when exact match is impossible due to invisible text, and the
14639 lines are truncated.
14640
14641 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14642
14643 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14644 for OSX >= 10.7.
14645
14646 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14647
14648 Fix a significant slow-down of cursor motion with C-n, C-p,
14649 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14650 auto-repeat under bidi redisplay in fontified buffers.
14651 * xdisp.c (compute_stop_pos_backwards): New function.
14652 (next_element_from_buffer): Call compute_stop_pos_backwards to
14653 find a suitable prev_stop when we find ourselves before
14654 base_level_stop.
14655 (reseat): Don't look for prev_stop, as that could mean a very long
14656 run.
14657 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14658 <cached_disp_overlay_modiff>: Cache for last found display string
14659 position.
14660 (compute_display_string_pos): Return the cached position if asked
14661 about the same buffer in the same area of character positions, and
14662 the buffer wasn't changed since the time the display string
14663 position was cached.
14664
14665 2011-07-22 Eli Zaretskii <eliz@gnu.org>
14666
14667 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14668 is an integer, which is important for empty lines. (Bug#9149)
14669
14670 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
14671
14672 * frame.c (Fmodify_frame_parameters): In tty case, update the
14673 default face if necessary (Bug#4238).
14674
14675 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
14676
14677 * editfns.c (Fstring_to_char): No need to explain what a character
14678 is in the docstring (Bug#6576).
14679
14680 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14681
14682 * xml.c (parse_region): Make sure we always return a tree.
14683
14684 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14685
14686 * xml.c (parse_region): If a document contains only comments,
14687 return that, too.
14688
14689 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14690
14691 * xml.c (make_dom): Return comments, too.
14692
14693 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14694
14695 Port to OpenBSD.
14696 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14697 and the surrounding thread.
14698 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14699 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14700 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14701 timer goes off.
14702 * s/openbsd.h (BROKEN_SIGIO): Define.
14703 * unexelf.c (unexec) [__OpenBSD__]:
14704 Don't update the .mdebug section of the Alpha COFF symbol table.
14705
14706 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14707
14708 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14709 (bug#8460).
14710
14711 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14712
14713 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14714 This fixes some race conditions on the permissions of any newly
14715 created file.
14716
14717 * alloc.c (valid_pointer_p): Use pipe, not open.
14718 This fixes some permissions issues when debugging.
14719
14720 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14721 If fchown fails to set both uid and gid, try to set just gid,
14722 as that is sometimes allowed. Adjust the file's mode to eliminate
14723 setuid or setgid bits that are inappropriate if fchown fails.
14724
14725 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14726
14727 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14728 to compare Lisp_Objects.
14729 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14730 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14731 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14732
14733 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14734
14735 * lread.c (read_integer): Unread even EOF character.
14736 (read1): Likewise. Properly record start position of symbol.
14737
14738 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14739 symbol character follows.
14740
14741 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14742
14743 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14744 This works around a problem with the previous change to Fcopy_file.
14745 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14746 and without this change, GCC might complain about discarding
14747 fchown's return value.
14748
14749 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
14750
14751 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14752
14753 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14754
14755 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14756
14757 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14758
14759 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14760 it's used from the C level.
14761
14762 * process.c: Use the same condition for POLL_FOR_INPUT in both
14763 keyboard.c and process.c (bug#1858).
14764
14765 2011-07-09 Lawrence Mitchell <wence@gmx.li>
14766
14767 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14768 (Fgnutls_boot): Use it.
14769
14770 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
14771
14772 * doc.c (Fsubstitute_command_keys): Revert last change.
14773
14774 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
14775
14776 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
14777 quotes the next character, and doesn't affect other longer
14778 sequences (bug#8935).
14779
14780 * lread.c (syms_of_lread): Clarify that is isn't only
14781 `eval-buffer' and `eval-defun' that's affected by
14782 `lexical-binding' (bug#8460).
14783
14784 2011-07-15 Eli Zaretskii <eliz@gnu.org>
14785
14786 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
14787 bidi redisplay when a line includes both an image and is truncated.
14788
14789 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
14790
14791 Fix minor problems found by static checking.
14792 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
14793 (elsz): Now a signed constant, not a size_t var. We prefer signed
14794 types to unsigned, to avoid integer comparison confusion. Without
14795 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
14796 "cannot optimize loop, the loop counter may overflow", a symptom
14797 of the confusion.
14798 * indent.c (Fvertical_motion): Mark locals as initialized.
14799 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
14800
14801 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14802
14803 * search.c (Fre_search_backward): Mention `case-fold-search' in
14804 all the re_search_* functions (bug#8138).
14805
14806 * keyboard.c (Fopen_dribble_file): Document when the file is
14807 closed (bug#8056).
14808
14809 2011-07-14 Eli Zaretskii <eliz@gnu.org>
14810
14811 * bidi.c (bidi_dump_cached_states): Fix format of displaying
14812 bidi_cache_idx.
14813
14814 Support bidi reordering of display and overlay strings.
14815 * xdisp.c (compute_display_string_pos)
14816 (compute_display_string_end): Accept additional argument STRING.
14817 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
14818 (reseat_to_string): Initialize bidi_it->string.s and
14819 bidi_it->string.schars.
14820 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
14821 NULL (avoids a crash in bidi_paragraph_init).
14822 Initialize itb.string.lstring.
14823 (init_iterator): Call bidi_init_it only of a valid
14824 buffer position was specified. Initialize paragraph_embedding to
14825 L2R.
14826 (reseat_to_string): Initialize the bidi iterator.
14827 (display_string): If we need to ignore text properties of
14828 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
14829 original value of -1 will not work with bidi.)
14830 (compute_display_string_pos): First arg is now struct
14831 `text_pos *'; all callers changed. Support display properties on
14832 Lisp strings.
14833 (compute_display_string_end): Support display properties on Lisp
14834 strings.
14835 (init_iterator, reseat_1, reseat_to_string): Initialize the
14836 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
14837 when iterating on a string not from display properties).
14838 (compute_display_string_pos, compute_display_string_end):
14839 Fix calculation of the object to scan. Fixes an error when using
14840 arrow keys.
14841 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
14842 base_level_stop; instead, set base_level_stop to BEGV.
14843 Fixes crashes in vertical-motion.
14844 (next_element_from_buffer): Improve commentary for when
14845 the iterator is before prev_stop.
14846 (init_iterator): Initialize bidi_p from the default value of
14847 bidi-display-reordering, not from buffer-local value. Use the
14848 buffer-local value only if initializing for buffer iteration.
14849 (handle_invisible_prop): Support invisible properties on strings
14850 that are being bidi-reordered.
14851 (set_iterator_to_next): Support bidi reordering of C strings and
14852 Lisp strings.
14853 (next_element_from_string): Support bidi reordering of Lisp
14854 strings.
14855 (handle_stop_backwards): Support Lisp strings as well.
14856 (display_string): Support display of R2L glyph rows.
14857 Use IT_STRING_CHARPOS when displaying from a Lisp string.
14858 (init_iterator): Don't initialize it->bidi_p for strings
14859 here.
14860 (reseat_to_string): Initialize it->bidi_p for strings here.
14861 (next_element_from_string, next_element_from_c_string)
14862 (next_element_from_buffer): Add xassert's for correspondence
14863 between IT's object being iterated and it->bidi_it.string
14864 structure.
14865 (face_before_or_after_it_pos): Support bidi iteration.
14866 (next_element_from_c_string): Handle the case of the first string
14867 character that is not the first one in the visual order.
14868 (get_visually_first_element): New function, refactored from common
14869 parts of next_element_from_buffer, next_element_from_string, and
14870 next_element_from_c_string.
14871 (tool_bar_lines_needed, redisplay_tool_bar)
14872 (display_menu_bar): Force left-to-right direction. Add a FIXME
14873 comment for making that be controlled by a user option.
14874 (push_it, pop_it): Save and restore the state of the
14875 bidi iterator. Save and restore the bidi_p flag.
14876 (pop_it): Iterate out of display property for string iteration as
14877 well.
14878 (iterate_out_of_display_property): Support iteration over strings.
14879 (handle_single_display_spec): Set up it->bidi_it for iteration
14880 over a display string, and call bidi_init_it.
14881 (handle_single_display_spec, next_overlay_string)
14882 (get_overlay_strings_1, push_display_prop): Set up the bidi
14883 iterator for displaying display or overlay strings.
14884 (forward_to_next_line_start): Don't use the shortcut if
14885 bidi-iterating.
14886 (back_to_previous_visible_line_start): If handle_display_prop
14887 pushed the iterator stack, restore the internal state of the bidi
14888 iterator by calling bidi_pop_it same number of times.
14889 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
14890 and we are bidi-iterating, don't decrement the iterator position;
14891 instead, set the first_elt flag in the bidi iterator, to produce
14892 the same effect.
14893 (reseat_1): Remove redundant setting of string_from_display_prop_p.
14894 (push_display_prop): xassert that we are iterating a buffer.
14895 (push_it, pop_it): Save and restore paragraph_embedding member.
14896 (handle_single_display_spec, next_overlay_string)
14897 (get_overlay_strings_1, reseat_1, reseat_to_string)
14898 (push_display_prop): Set up the `unibyte' member of bidi_it.string
14899 correctly. Don't assume unibyte strings are not bidi-reordered.
14900 (compute_display_string_pos)
14901 (compute_display_string_end): Fix handling the case of C string.
14902 (push_it, pop_it): Save and restore from_disp_prop_p.
14903 (handle_single_display_spec, push_display_prop): Set the
14904 from_disp_prop_p flag.
14905 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
14906 (pop_it): Call iterate_out_of_display_property only if we are
14907 popping after iteration over a string that came from a display
14908 property. Fix a typo in popping stretch info. Add an assertion
14909 for verifying that the iterator position is in sync with the bidi
14910 iterator.
14911 (handle_single_display_spec, get_overlay_strings_1)
14912 (push_display_prop): Fix initialization of paragraph direction for
14913 string when that of the parent object is not yet determined.
14914 (reseat_1): Call bidi_init_it to resync the bidi
14915 iterator with IT's position. (Bug#7616)
14916 (find_row_edges): If ROW->start.pos gives position
14917 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14918 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14919 Reset the from_disp_prop_p flag.
14920 (SAVE_IT, RESTORE_IT): New macros.
14921 (pos_visible_p, face_before_or_after_it_pos)
14922 (back_to_previous_visible_line_start)
14923 (move_it_in_display_line_to, move_it_in_display_line)
14924 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14925 (try_scrolling, redisplay_window, display_line): Use them when
14926 saving a temporary copy of the iterator and restoring it back.
14927 (back_to_previous_visible_line_start, reseat_1)
14928 (init_iterator): Empty the bidi cache "stack".
14929 (move_it_in_display_line_to): If iterator ended up at
14930 EOL, but we never saw any buffer positions smaller than
14931 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14932 motion in bidi-reordered lines.
14933 (move_it_in_display_line_to): Record prev_method and prev_pos
14934 immediately before the call to set_iterator_to_next. Fixes cursor
14935 motion in bidi-reordered lines with stretch glyphs and strings
14936 displayed in margins. (Bug#8133) (Bug#8867)
14937 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14938 TO_CHARPOS.
14939 (pos_visible_p): Support positions in bidi-reordered lines.
14940 Save and restore bidi cache.
14941
14942 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14943 (bidi_paragraph_info): Delete unused struct.
14944 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14945 (bidi_cache_start): New variable.
14946 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14947 to zero.
14948 (bidi_cache_fetch_state, bidi_cache_search)
14949 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14950 (bidi_cache_find, bidi_peek_at_next_level)
14951 (bidi_level_of_next_char, bidi_find_other_level_edge)
14952 (bidi_move_to_visually_next): Compare cache index with
14953 bidi_cache_start rather than with zero.
14954 (bidi_fetch_char): Accept new argument STRING; all callers
14955 changed. Support iteration over a string. Support strings with
14956 display properties. Support unibyte strings. Fix the type of
14957 `len' according to what STRING_CHAR_AND_LENGTH expects.
14958 (bidi_paragraph_init, bidi_resolve_explicit_1)
14959 (bidi_resolve_explicit, bidi_resolve_weak)
14960 (bidi_level_of_next_char, bidi_move_to_visually_next):
14961 Support iteration over a string.
14962 (bidi_set_sor_type, bidi_resolve_explicit_1)
14963 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14964 can now be zero (for strings); special values 0 and -1 were
14965 changed to -1 and -2, respectively.
14966 (bidi_char_at_pos): New function.
14967 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14968 Call it instead of FETCH_MULTIBYTE_CHAR.
14969 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14970 initialized to valid values.
14971 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14972 values.
14973 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14974 the test for valid cached positions. Fix the logic for looking up
14975 the sentinel state in the cache. GCPRO the Lisp string we are
14976 iterating.
14977 (bidi_push_it, bidi_pop_it): New functions.
14978 (bidi_initialize): Initialize the bidi cache start stack pointer.
14979 (bidi_cache_ensure_space): New function, refactored from part of
14980 bidi_cache_iterator_state. Don't assume the required size is just
14981 one BIDI_CACHE_CHUNK away.
14982 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14983 (bidi_count_bytes, bidi_char_at_pos): New functions.
14984 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14985 always valid if bidi_cache_idx is valid.
14986 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14987 is valid if it's going to be used.
14988 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14989 (bidi_cache_fetch_state, bidi_cache_search)
14990 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14991 (bidi_cache_iterator_state, bidi_cache_find)
14992 (bidi_find_other_level_edge, bidi_cache_start_stack):
14993 All variables related to cache indices are now EMACS_INT.
14994
14995 * dispextern.h (struct bidi_string_data): New structure.
14996 (struct bidi_it): New member `string'. Make flag members be 1-bit
14997 fields, and put them last in the struct.
14998 (compute_display_string_pos, compute_display_string_end):
14999 Update prototypes.
15000 (bidi_push_it, bidi_pop_it): Add prototypes.
15001 (struct iterator_stack_entry): New members bidi_p,
15002 paragraph_embedding, and from_disp_prop_p.
15003 (struct it): Member bidi_p is now a bit field 1 bit wide.
15004 (bidi_shelve_cache, bidi_unshelve_cache):
15005 Declare prototypes.
15006
15007 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15008 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15009 and vector-like objects.
15010
15011 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15012 cache around display iteration.
15013
15014 * window.c (Fwindow_end, window_scroll_pixel_based)
15015 (displayed_window_lines, Frecenter): Save and restore the bidi
15016 cache around display iteration.
15017
15018 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15019
15020 * editfns.c (Fdelete_region): Clarify the use of the named
15021 parameters (bug#6788).
15022
15023 2011-07-14 Martin Rudalics <rudalics@gmx.at>
15024
15025 * indent.c (Fvertical_motion): Set and restore w->pointm when
15026 saving and restoring the window's buffer (Bug#9006).
15027
15028 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15029
15030 * editfns.c (Fstring_to_char): Clarify just what is returned
15031 (bug#6576). Text by Eli Zaretskii.
15032
15033 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
15034
15035 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15036
15037 2011-07-13 Eli Zaretskii <eliz@gnu.org>
15038
15039 * buffer.c (mmap_find): Fix a typo.
15040
15041 2011-07-13 Johan Bockgård <bojohan@gnu.org>
15042
15043 Fix execution of x selection hooks.
15044 * xselect.c (Qx_lost_selection_functions)
15045 (Qx_sent_selection_functions): New vars.
15046 (syms_of_xselect): DEFSYM them.
15047 (x_handle_selection_request): Pass Qx_sent_selection_functions
15048 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15049 (x_handle_selection_clear,x_clear_frame_selections):
15050 Pass Qx_lost_selection_functions rather than
15051 Vx_lost_selection_functions to Frun_hook_with_args.
15052
15053 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15054
15055 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
15056 The old code sometimes used this field without initializing it.
15057
15058 * alloc.c (gc_sweep): Don't read past end of array.
15059 In theory, the old code could also have corrupted Emacs internals,
15060 though it'd be very unlikely.
15061
15062 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15063
15064 * character.c (Fcharacterp): Don't advertise optional ignored
15065 argument. (Bug#4026)
15066
15067 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15068
15069 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15070 key" (bug#4257).
15071
15072 * window.c (Fset_window_start): Doc fix (bug#4199).
15073 (Fset_window_hscroll): Ditto.
15074
15075 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15076
15077 Fix minor new problems caught by GCC 4.6.1.
15078 * term.c (init_tty): Remove unused local.
15079 * xsettings.c (store_monospaced_changed): Define this function only
15080 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
15081 not used otherwise.
15082
15083 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
15084
15085 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15086
15087 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15088
15089 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15090 are the mini-buffer and the echo area (bug#3320).
15091
15092 * term.c (init_tty): Remove support for supdup, c10 and perq
15093 terminals, which are no longer supported (bug#1482).
15094
15095 2011-07-10 Johan Bockgård <bojohan@gnu.org>
15096
15097 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15098
15099 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15100
15101 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15102 for non-popups (Bug#3642).
15103
15104 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15105
15106 * alloc.c (reset_malloc_hooks): Protoize.
15107 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
15108 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15109 * cm.c (losecursor): Likewise.
15110 * data.c (fmod): Likewise.
15111 * dispnew.c (swap_glyphs_in_rows): Likewise.
15112 * emacs.c (memory_warning_signal): Likewise.
15113 * floatfns.c (float_error): Likewise.
15114 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15115 (otf_open, font_otf_capability, generate_otf_features)
15116 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15117 Likewise.
15118 * image.c (pbm_read_file): Likewise.
15119 * indent.c (string_display_width): Likewise.
15120 * intervals.c (check_for_interval, search_for_interval)
15121 (inc_interval_count, count_intervals, root_interval)
15122 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15123 * lread.c (defalias): Likewise.
15124 * ralloc.c (r_alloc_check): Likewise.
15125 * regex.c (set_image_of_range_1, set_image_of_range)
15126 (regex_grow_registers): Likewise.
15127 * sysdep.c (strerror): Likewise.
15128 * termcap.c (valid_filename_p, tprint, main): Likewise.
15129 * tparam.c (main): Likewise.
15130 * unexhp9k800.c (run_time_remap, save_data_space)
15131 (update_file_ptrs, read_header, write_header, calculate_checksum)
15132 (copy_file, copy_rest, display_header): Likewise.
15133 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15134 Likewise.
15135 * xdisp.c (check_it): Likewise.
15136 * xfaces.c (register_color, unregister_color, unregister_colors):
15137 Likewise.
15138 * xfns.c (print_fontset_result): Likewise.
15139 * xrdb.c (member, fatal, main): Likewise.
15140
15141 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15142
15143 Fix minor problems found by static checking (Bug#9031).
15144 * chartab.c (char_table_set_range, map_sub_char_table):
15145 Remove unused locals.
15146 (uniprop_table): Now static.
15147 * composite.c (_work_char): Remove unused static var.
15148
15149 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
15150
15151 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15152
15153 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15154
15155 * gtkutil.c (qttip_cb): Remove code without function.
15156
15157 2011-07-09 Eli Zaretskii <eliz@gnu.org>
15158
15159 * w32.c (pthread_sigmask): New stub.
15160
15161 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
15162
15163 Use pthread_sigmask, not sigprocmask (Bug#9010).
15164 sigprocmask is portable only for single-threaded applications, and
15165 Emacs can be multi-threaded when it uses GTK.
15166 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15167 (LIBES): Use it.
15168 * callproc.c (Fcall_process):
15169 * process.c (create_process):
15170 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15171 Use pthread_sigmask, not sigprocmask.
15172
15173 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15174
15175 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15176 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15177 wrong (Bug#8591).
15178
15179 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15180
15181 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15182 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15183 (xg_hide_tooltip): Fix comment.
15184
15185 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15186 in registerServicesMenuSendTypes.
15187 (validRequestorForSendType): Don't check ns_return_types.
15188
15189 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15190 ns_return_type.
15191
15192 2011-07-08 Jason Rumney <jasonr@gnu.org>
15193
15194 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15195 SH_SHOW for hidden windows (Bug#5482).
15196
15197 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15198 frame struct members of non-existent frames (Bug#6284).
15199
15200 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15201
15202 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15203 variable firstTime not needed on OSX >= 10.6.
15204 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15205 >= 10.5. Use setKnobProportion, setDoubleValue.
15206
15207 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15208 (MAC_OS_X_VERSION_10_5): Define if not defined.
15209 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15210 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15211 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15212
15213 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
15214 cString and lossyCString on OSX >= 10.4.
15215
15216 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
15217 sizeToFit on OSX >= 10.2.
15218
15219 * nsimage.m (allocInitFromFile): Don't use deprecated method
15220 bestRepresentationForDevice on OSX >= 10.6.
15221
15222 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15223 to avoid warning.
15224
15225 * emacs.c: Declare unexec_init_emacs_zone.
15226
15227 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15228
15229 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15230
15231 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15232 on svcsMenu (Bug#8842).
15233
15234 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15235 ns_return_types.
15236 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15237
15238 * nsterm.m (QUTF8_STRING): Declare.
15239 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15240 (validRequestorForSendType): Return type is (id).
15241 Change indexOfObjectIdenticalTo to indexOfObject.
15242 Check if we have local selection before returning self (Bug#8842).
15243 (writeSelectionToPasteboard): Put local selection into paste board
15244 if we have a local selection (Bug#8842).
15245 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15246
15247 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15248 (ns_get_local_selection): Declare.
15249
15250 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15251
15252 * keymap.c (describe_map_tree): Don't insert a double newline at
15253 the end of the buffer (bug#1169) and return whether we inserted
15254 something.
15255
15256 * callint.c (Fcall_interactively): Change "reading args" to
15257 "providing args" to try to clarify what it does (bug#1010).
15258
15259 2011-07-07 Kenichi Handa <handa@m17n.org>
15260
15261 * composite.c (composition_compute_stop_pos): Ignore a static
15262 composition starting before CHARPOS (Bug#8915).
15263
15264 * xdisp.c (handle_composition_prop): Likewise.
15265
15266 2011-07-07 Eli Zaretskii <eliz@gnu.org>
15267
15268 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15269 (Bug#9015)
15270
15271 2011-07-07 Kenichi Handa <handa@m17n.org>
15272
15273 * character.h (unicode_category_t): New enum type.
15274
15275 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15276 (Qchar_code_property_table): New variable.
15277 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15278 (UNIPROP_COMPRESSED_FORM_P): New macros.
15279 (char_table_ascii): Uncompress the compressed values.
15280 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15281 Uncompress the compressed values.
15282 (sub_char_table_ref_and_range): Likewise.
15283 (char_table_ref_and_range): Uncompress the compressed values.
15284 (sub_char_table_set): New arg is_uniprop. Callers changed.
15285 Uncompress the compressed values.
15286 (sub_char_table_set_range): Args changed. Callers changed.
15287 (char_table_set_range): Adjuted for the above change.
15288 (map_sub_char_table): Delete args default_val and parent. Add arg
15289 top. Give decoded values to a Lisp function.
15290 (map_char_table): Adjust for the above change. Give decoded
15291 values to a Lisp function. Gcpro more variables.
15292 (uniprop_table_uncompress)
15293 (uniprop_decode_value_run_length): New functions.
15294 (uniprop_decoder, uniprop_decoder_count): New variables.
15295 (uniprop_get_decoder, uniprop_encode_value_character)
15296 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15297 New functions.
15298 (uniprop_encoder, uniprop_encoder_count): New variables.
15299 (uniprop_get_encoder, uniprop_table)
15300 (Funicode_property_table_internal, Fget_unicode_property_internal)
15301 (Fput_unicode_property_internal): New functions.
15302 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15303 Sunicode_property_table_internal, Sget_unicode_property_internal,
15304 and Sput_unicode_property_internal. Defvar_lisp
15305 char-code-property-alist.
15306
15307 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
15308 Vunicode_category_table.
15309
15310 * font.c (font_range): Adjust for the change of
15311 Vunicode_category_table.
15312
15313 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15314
15315 * m/iris4d.h: Remove file, move contents ...
15316 * s/irix6-5.h: ... here.
15317
15318 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15319
15320 Remove unportable assumption about struct layout (Bug#8884).
15321 * alloc.c (mark_buffer):
15322 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15323 (clone_per_buffer_values): Don't assume that
15324 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15325 This isn't true in general, and it's particularly not true
15326 if Emacs is configured with --with-wide-int.
15327 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15328 New macros, used in the buffer.c change.
15329
15330 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15331
15332 * xsettings.c: Use both GConf and GSettings if both are available.
15333 (store_config_changed_event): Add comment.
15334 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15335 (store_tool_bar_style_changed): New functions.
15336 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
15337 (struct xsettings): Move font inside HAVE_XFT.
15338 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
15339 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
15340 Move inside HAVE_XFT.
15341 (something_changed_gsettingsCB): Rename from something_changedCB.
15342 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15343 also.
15344 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
15345 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
15346 (something_changed_gconfCB): Rename from something_changedCB.
15347 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15348 (parse_settings): Move check for font inside HAVE_XFT.
15349 (read_settings, apply_xft_settings): Add comment.
15350 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15351 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15352 call store_font_name_changed.
15353 (xft_settings_event): Add comment.
15354 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15355 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15356 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15357 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15358 (xsettings_initialize): Call init_gsettings last.
15359 (xsettings_get_system_font, xsettings_get_system_normal_font):
15360 Add comment.
15361
15362 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15363
15364 Random fixes. E.g., (random) never returned negative values.
15365 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15366 subseconds part to the entropy, as that's a bit more random.
15367 Prefer signed to unsigned, since the signedness doesn't matter and
15368 in general we prefer signed. When given a limit, use a
15369 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15370 latter isn't right if USE_2_TAGS_FOR_INTS.
15371 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15372 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15373
15374 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15375
15376 * textprop.c (text_property_stickiness):
15377 Obey Vtext_property_default_nonsticky.
15378 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15379 * w32fns.c (syms_of_w32fns):
15380 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15381
15382 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15383
15384 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15385 This is more efficient than Ffile_directory_p and avoids a minor race.
15386
15387 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15388
15389 * buffer.c (Foverlay_put): Say what the return value is
15390 (bug#7835).
15391
15392 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15393 is a directory before asking whether to use the file name
15394 (bug#7564).
15395 (barf_or_query_if_file_exists): Make the "File is a directory"
15396 error be more correct.
15397
15398 * fns.c (Frequire): Remove the mention of the .gz files, since
15399 that's installation-specific, but keep the mention of
15400 `get-load-suffixes'.
15401
15402 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15403
15404 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15405 Report string overflow if the output is too long.
15406
15407 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
15408
15409 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15410 (syms_of_gnutls): Remove duplicate DEFSYM for
15411 Qgnutls_bootprop_verify_hostname_error, an error for
15412 Qgnutls_bootprop_verify_error (which is no longer used).
15413
15414 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15415 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15416 Also (re)move comments that are misplaced or no longer relevant.
15417
15418 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15419
15420 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15421
15422 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
15423
15424 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15425 and background color parameters if they have been changed.
15426
15427 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15428
15429 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15430
15431 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15432
15433 * xsettings.c (SYSTEM_FONT): Define only when used.
15434 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15435
15436 * keymap.c (access_keymap_1): Now static.
15437
15438 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
15439
15440 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15441 leave any prefix arg for the up event (Bug#1586).
15442
15443 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15444
15445 * lread.c (syms_of_lread): Mention single symbols defined by
15446 `defvar' or `defconst' (bug#7154).
15447
15448 * fns.c (Frequire): Mention .el.gz files (bug#7314).
15449 (Frequire): Mention get-load-suffixes.
15450
15451 2011-07-02 Martin Rudalics <rudalics@gmx.at>
15452
15453 * window.h (window): Remove clone_number slot.
15454 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15455 Remove.
15456 (make_parent_window, make_window, saved_window)
15457 (Fset_window_configuration, save_window_save): Don't deal with
15458 clone numbers.
15459 * buffer.c (Qclone_number): Remove declaration.
15460 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15461
15462 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15463
15464 Add multiple inheritance to keymaps.
15465 * keymap.c (Fmake_composed_keymap): New function.
15466 (Fset_keymap_parent): Simplify.
15467 (fix_submap_inheritance): Remove.
15468 (access_keymap_1): New function extracted from access_keymap to handle
15469 embedded parents and handle lists of maps.
15470 (access_keymap): Use it.
15471 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15472 (Fcopy_keymap): Handle embedded parents.
15473 (Fcommand_remapping, define_as_prefix): Simplify.
15474 (Fkey_binding): Simplify.
15475 (syms_of_keymap): Move minibuffer-local-completion-map,
15476 minibuffer-local-filename-completion-map,
15477 minibuffer-local-must-match-map, and
15478 minibuffer-local-filename-must-match-map to Elisp.
15479 (syms_of_keymap): Defsubr make-composed-keymap.
15480 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15481 (parse_menu_item): Trivial simplification.
15482
15483 2011-07-01 Glenn Morris <rgm@gnu.org>
15484
15485 * Makefile.in (SETTINGS_LIBS): Fix typo.
15486
15487 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15488
15489 * coding.c (Fencode_coding_string): Record the last coding system
15490 used, as the function doc string says (bug#8738).
15491
15492 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15493
15494 * xsettings.c (store_monospaced_changed): Take new font as arg and
15495 check for change against current_mono_font.
15496 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15497 (emacs_settings_constructor, emacs_settings_get_property)
15498 (emacs_settings_set_property, emacs_settings_class_init)
15499 (emacs_settings_init, gsettings_obj): Remove.
15500 (something_changedCB): New function for HAVE_GSETTINGS.
15501 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15502 with value as argument.
15503 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15504 g_settings_new (Bug#8967). Do not create gsettings_obj.
15505 Remove calls to g_settings_bind. Connect something_changedCB to
15506 "changed".
15507
15508 * xgselect.c: Add defined (HAVE_GSETTINGS).
15509 (xgselect_initialize): Ditto.
15510
15511 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15512 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15513 xg_select.
15514
15515 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15516
15517 * eval.c (struct backtrace): Simplify and port the data structure.
15518 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15519 signed bit field, as this assumption is not portable and it makes
15520 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15521 "char debug_on_exit : 1" as this is not portable either; instead,
15522 use the portable "unsigned int debug_on_exit : 1". Remove unused
15523 member evalargs. Remove obsolete comments about cc bombing out.
15524
15525 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15526
15527 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
15528 Let HAVE_GSETTINGS override HAVE_GCONF.
15529 (store_monospaced_changed): New function.
15530 (EMACS_SETTINGS): A new type derived from GObject to handle
15531 GSettings notifications.
15532 (emacs_settings_constructor, emacs_settings_get_property)
15533 (emacs_settings_set_property, emacs_settings_class_init):
15534 New functions.
15535 (gsettings_client, gsettings_obj): New variables.
15536 (GSETTINGS_SCHEMA): New define.
15537 (something_changedCB): Call store_monospaced_changed.
15538 (init_gsettings): New function.
15539 (xsettings_initialize): Call init_gsettings.
15540 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15541 to NULL.
15542
15543 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
15544 GCONF_CFLAGS/LIBS.
15545
15546 2011-06-29 Martin Rudalics <rudalics@gmx.at>
15547
15548 * window.c (resize_root_window, grow_mini_window)
15549 (shrink_mini_window): Rename Qresize_root_window to
15550 Qwindow_resize_root_window and Qresize_root_window_vertically to
15551 Qwindow_resize_root_window_vertically.
15552
15553 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15554
15555 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15556
15557 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
15558
15559 * makefile.w32-in: Redesign dependencies so they reflect more
15560 clearly which files are directly included by each source file,
15561 and not through other includes.
15562
15563 2011-06-27 Martin Rudalics <rudalics@gmx.at>
15564
15565 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15566 (sort_overlays, overlay_strings): When an overlay's clone number
15567 matches the window's clone number process the overlay even if
15568 the overlay's window property doesn't match the current window.
15569
15570 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15571 (Fwindow_hchild): Rename to Fwindow_left_child.
15572 (Fwindow_next): Rename to Fwindow_next_sibling.
15573 (Fwindow_prev): Rename to Fwindow_prev_sibling.
15574 (resize_window_check): Rename to window_resize_check.
15575 (resize_window_apply): Rename to window_resize_apply.
15576 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15577 (Fdelete_other_windows_internal, resize_frame_windows)
15578 (Fsplit_window_internal, Fdelete_window_internal)
15579 (grow_mini_window, shrink_mini_window)
15580 (Fresize_mini_window_internal): Fix callers accordingly.
15581
15582 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15583
15584 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15585 (emacs_fixed_set_min_size): Remove.
15586 (emacs_fixed_new): Take frame as argument.
15587
15588 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15589 (_EmacsFixedPrivate): Remove minwidth/height.
15590 Add struct frame *f.
15591 (emacs_fixed_init): Initialize priv->f.
15592 (get_parent_class, emacs_fixed_set_min_size): Remove.
15593 (emacs_fixed_new): Set priv->f to argument.
15594 (emacs_fixed_get_preferred_width)
15595 (emacs_fixed_get_preferred_height): Use min_width/height from
15596 frames size_hint to set minimum and natural (Bug#8919).
15597 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15598 and use min_width/height from frames size_hint to set
15599 min_width/height (Bug#8919).
15600
15601 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
15602 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15603 Fix indentation.
15604
15605 2011-06-26 Eli Zaretskii <eliz@gnu.org>
15606
15607 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15608 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15609 called at ZV.
15610
15611 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
15612
15613 * process.c (wait_reading_process_output): Bypass select if
15614 waiting for a cell while ignoring keyboard input, and input is
15615 pending. Suggested by Jan Djärv (Bug#8869).
15616
15617 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15618
15619 Use gnulib's dup2 module instead of rolling our own.
15620 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15621
15622 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15623
15624 * dispnew.c (scrolling_window): Before scrolling, turn off a
15625 mouse-highlight in the window being scrolled.
15626
15627 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
15628
15629 Move DEFSYM to lisp.h and use everywhere.
15630
15631 * character.h (DEFSYM): Move declaration...
15632 * lisp.h (DEFSYM): ...here.
15633
15634 * gnutls.c:
15635 * minibuf.c:
15636 * w32menu.c:
15637 * w32proc.c:
15638 * w32select.c: Don't include character.h.
15639
15640 * alloc.c (syms_of_alloc):
15641 * buffer.c (syms_of_buffer):
15642 * bytecode.c (syms_of_bytecode):
15643 * callint.c (syms_of_callint):
15644 * casefiddle.c (syms_of_casefiddle):
15645 * casetab.c (init_casetab_once):
15646 * category.c (init_category_once, syms_of_category):
15647 * ccl.c (syms_of_ccl):
15648 * cmds.c (syms_of_cmds):
15649 * composite.c (syms_of_composite):
15650 * dbusbind.c (syms_of_dbusbind):
15651 * dired.c (syms_of_dired):
15652 * dispnew.c (syms_of_display):
15653 * doc.c (syms_of_doc):
15654 * editfns.c (syms_of_editfns):
15655 * emacs.c (syms_of_emacs):
15656 * eval.c (syms_of_eval):
15657 * fileio.c (syms_of_fileio):
15658 * fns.c (syms_of_fns):
15659 * frame.c (syms_of_frame):
15660 * fringe.c (syms_of_fringe):
15661 * insdel.c (syms_of_insdel):
15662 * keymap.c (syms_of_keymap):
15663 * lread.c (init_obarray, syms_of_lread):
15664 * macros.c (syms_of_macros):
15665 * msdos.c (syms_of_msdos):
15666 * print.c (syms_of_print):
15667 * process.c (syms_of_process):
15668 * search.c (syms_of_search):
15669 * sound.c (syms_of_sound):
15670 * syntax.c (init_syntax_once, syms_of_syntax):
15671 * terminal.c (syms_of_terminal):
15672 * textprop.c (syms_of_textprop):
15673 * undo.c (syms_of_undo):
15674 * w32.c (globals_of_w32):
15675 * window.c (syms_of_window):
15676 * xdisp.c (syms_of_xdisp):
15677 * xfaces.c (syms_of_xfaces):
15678 * xfns.c (syms_of_xfns):
15679 * xmenu.c (syms_of_xmenu):
15680 * xsettings.c (syms_of_xsettings):
15681 * xterm.c (syms_of_xterm): Use DEFSYM.
15682
15683 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15684
15685 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
15686
15687 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15688
15689 Integer and buffer overflow fixes (Bug#8873).
15690
15691 * print.c (printchar, strout): Check for string overflow.
15692 (PRINTPREPARE, printchar, strout):
15693 Don't set size unless allocation succeeds.
15694
15695 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15696 for sizes. Check for string overflow more accurately.
15697 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15698
15699 * macros.c: Integer and buffer overflow fixes.
15700 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15701 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15702 Use ptrdiff_t, not int, for sizes.
15703 Don't increment bufsize until after realloc succeeds.
15704 Check for size-calculation overflow.
15705 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15706
15707 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15708
15709 * lread.c: Integer overflow fixes.
15710 (read_integer): Radix is now EMACS_INT, not int,
15711 to improve quality of diagnostics for out-of-range radices.
15712 Calculate buffer size correctly for out-of-range radices.
15713 (read1): Check for integer overflow in radices, and in
15714 read-circle numbers.
15715 (read_escape): Avoid int overflow.
15716 (Fload, openp, read_buffer_size, read1)
15717 (substitute_object_recurse, read_vector, read_list, map_obarray):
15718 Use ptrdiff_t, not int, for sizes.
15719 (read1): Use EMACS_INT, not int, for sizes.
15720 Check for size overflow.
15721
15722 * image.c (cache_image): Check for size arithmetic overflow.
15723
15724 * lread.c: Integer overflow issues.
15725 (saved_doc_string_size, saved_doc_string_length)
15726 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15727 Now ptrdiff_t, not int.
15728 (read1): Don't assume doc string length fits in int. Check for
15729 out-of-range doc string lengths.
15730 (read_list): Don't assume file position fits in int.
15731 (read_escape): Check for hex character overflow.
15732
15733 2011-06-22 Leo Liu <sdl.web@gmail.com>
15734
15735 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15736 Move to minibuffer.el.
15737
15738 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15739
15740 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
15741 The following patches are for when GLYPH_DEBUG && !XASSERT.
15742 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15743 * dispnew.c (flush_stdout):
15744 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15745 Mark as externally visible.
15746 * dispnew.c (check_window_matrix_pointers): Now static.
15747 * dispnew.c (window_to_frame_vpos):
15748 * xfns.c (unwind_create_frame):
15749 * xterm.c (x_check_font): Remove unused local.
15750 * scroll.c (CHECK_BOUNDS):
15751 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15752 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15753 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15754 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15755 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15756 Now static.
15757 (debug_method_add): Use va_list and vsprintf rather than relying
15758 on undefined behavior with wrong number of arguments.
15759 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15760 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15761 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15762 since we're not interested in debugging glyphs with old libraries.
15763 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15764 GCC 4.6.0's static checking.
15765
15766 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15767
15768 Integer overflow and signedness fixes (Bug#8873).
15769 A few related buffer overrun fixes, too.
15770
15771 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
15772
15773 * dispextern.h (struct face.stipple):
15774 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
15775 (x_bitmap_mask, x_allocate_bitmap_record)
15776 (x_create_bitmap_from_data, x_create_bitmap_from_file)
15777 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
15778 (x_create_bitmap_from_xpm_data):
15779 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
15780 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
15781 (.bitmaps_last):
15782 * xfaces.c (load_pixmap):
15783 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
15784 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
15785 (.bitmaps_last, struct x_output.icon_bitmap):
15786 Use ptrdiff_t, not int, for bitmap indexes.
15787 (x_allocate_bitmap_record): Check for size overflow.
15788 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
15789
15790 Use ptrdiff_t, not int, for overlay counts.
15791 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
15792 * editfns.c (overlays_around, get_pos_property):
15793 * textprop.c (get_char_property_and_overlay):
15794 * xdisp.c (next_overlay_change, note_mouse_highlight):
15795 * xfaces.c (face_at_buffer_position):
15796 * buffer.c (OVERLAY_COUNT_MAX): New macro.
15797 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
15798 (Fnext_overlay_change, Fprevious_overlay_change)
15799 (mouse_face_overlay_overlaps, Foverlays_in):
15800 Use ptrdiff_t, not int, for sizes.
15801 (overlays_at, overlays_in): Check for size-calculation overflow.
15802
15803 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
15804
15805 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
15806 (x_session_initialize): Do not assume string length fits in int.
15807
15808 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
15809 This is unlikely, but can occur if DPI is outlandish.
15810
15811 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
15812 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
15813
15814 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
15815 * xrdb.c (magic_file_p, search_magic_path):
15816 Omit last arg SUFFIX; it was always 0. All callers changed.
15817 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
15818
15819 * xfont.c (xfont_match): Avoid need for strlen.
15820
15821 * xfns.c: Don't assume strlen fits in int.
15822 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
15823
15824 * xdisp.c (message_log_check_duplicate): Return intmax_t,
15825 not unsigned long, as we prefer signed integers. All callers changed.
15826 Detect integer overflow in repeat count.
15827 (message_dolog): Don't assume print length fits in 39 bytes.
15828 (display_mode_element): Don't assume strlen fits in int.
15829
15830 * termcap.c: Don't assume sizes fit in int and never overflow.
15831 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
15832 (gobble_line): Check for size-calculation overflow.
15833
15834 * minibuf.c (Fread_buffer):
15835 * lread.c (intern, intern_c_string):
15836 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
15837 Don't assume string length fits in int.
15838
15839 * keyboard.c (parse_tool_bar_item):
15840 * gtkutil.c (style_changed_cb): Avoid need for strlen.
15841
15842 * font.c: Don't assume string length fits in int.
15843 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
15844 Use ptrdiff_t, not int.
15845 (font_intern_prop): Don't assume string length fits in int.
15846 Don't assume integer property fits in fixnum.
15847 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
15848
15849 * filelock.c: Fix some buffer overrun and integer overflow issues.
15850 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
15851 Reformulate so as not to need the command string.
15852 Invoke gzip -cd rather than gunzip, as it's more portable.
15853 (lock_info_type, lock_file_1, lock_file):
15854 Don't assume pid_t and time_t fit in unsigned long.
15855 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
15856 (current_lock_owner): Prefer signed type for sizes.
15857 Use memcpy, not strncpy, where memcpy is what is really wanted.
15858 Don't assume (via atoi) that time_t and pid_t fit in int.
15859 Check for time_t and/or pid_t out of range, e.g., via a network share.
15860 Don't alloca where an auto var works fine.
15861
15862 * fileio.c: Fix some integer overflow issues.
15863 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
15864 Don't assume string length fits in int.
15865 (directory_file_name): Don't assume string length fits in long.
15866 (make_temp_name): Don't assume pid fits in int, or that its print
15867 length is less than 20.
15868
15869 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
15870
15871 * coding.c (make_subsidiaries): Don't assume string length fits in int.
15872
15873 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
15874
15875 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
15876 We prefer signed integers, even for size calculations.
15877
15878 * emacs.c: Don't assume string length fits in 'int'.
15879 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
15880 (main): Don't invoke strlen when not needed.
15881
15882 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
15883 (XD_DEBUG_MESSAGE): Don't waste a byte.
15884
15885 * callproc.c (getenv_internal_1, getenv_internal)
15886 (Fgetenv_internal):
15887 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
15888
15889 * lread.c (invalid_syntax): Omit length argument.
15890 All uses changed. This doesn't fix a bug, but it simplifies the
15891 code away from its former Hollerith-constant appearance, and it's
15892 one less 'int' to worry about when looking at integer-overflow issues.
15893 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
15894
15895 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
15896 This didn't break anything, but it didn't help either.
15897 It's confusing to put a bogus integer in a place where the actual
15898 value does not matter.
15899 (LIST_END_P): Remove unused macro and its bogus comment.
15900 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
15901
15902 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
15903 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
15904 implementation.
15905 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
15906 We prefer signed types, and the value cannot exceed the EMACS_INT
15907 range anyway (because otherwise the length would not be representable).
15908 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
15909 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
15910 This avoids a GCC warning when WIDE_EMACS_INT.
15911
15912 * indent.c (sane_tab_width): New function.
15913 (current_column, scan_for_column, Findent_to, position_indentation)
15914 (compute_motion): Use it. This is just for clarity.
15915 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
15916
15917 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
15918
15919 * lisp.h (lint_assume): New macro.
15920 * composite.c (composition_gstring_put_cache):
15921 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15922
15923 * editfns.c, insdel.c:
15924 Omit unnecessary forward decls, to simplify future changes.
15925
15926 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15927
15928 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15929
15930 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
15931 Use much-faster test for byte-length change.
15932 Don't assume string byte-length fits in 'int'.
15933 Check that character arg fits in 'int'.
15934 (mapcar1): Declare byte as byte, for clarity.
15935
15936 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15937
15938 * fns.c (concat): Catch string overflow earlier.
15939 Do not rely on integer wraparound.
15940
15941 * dispextern.h (struct it.overlay_strings_charpos)
15942 (struct it.selective): Now EMACS_INT, not int.
15943 * xdisp.c (forward_to_next_line_start)
15944 (back_to_previous_visible_line_start)
15945 (reseat_at_next_visible_line_start, next_element_from_buffer):
15946 Don't arbitrarily truncate the value of 'selective' to int.
15947
15948 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15949
15950 * composite.c: Don't truncate sizes to 'int'.
15951 (composition_gstring_p, composition_reseat_it)
15952 (composition_adjust_point): Use EMACS_INT, not int.
15953 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15954 not EMACS_UINT, for indexes.
15955
15956 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15957
15958 * buffer.c: Include <verify.h>.
15959 (struct sortvec.priority, struct sortstr.priority):
15960 Now EMACS_INT, not int.
15961 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
15962 (struct sortstr.size, record_overlay_string)
15963 (struct sortstrlist.size, struct sortlist.used):
15964 Don't truncate size to int.
15965 (record_overlay_string): Check for size-calculation overflow.
15966 (init_buffer_once): Check at compile-time, not run-time.
15967
15968 2011-06-22 Jim Meyering <meyering@redhat.com>
15969
15970 Don't leak an XBM-image-sized buffer
15971 * image.c (xbm_load): Free the image buffer after using it.
15972
15973 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15974
15975 Port to Sun C.
15976 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15977 that Sun C diagnosed.
15978 * fns.c (secure_hash): Fix pointer signedness issue.
15979 * intervals.c (static_offset_intervals): New function.
15980 (offset_intervals): Use it.
15981
15982 2011-06-21 Leo Liu <sdl.web@gmail.com>
15983
15984 * deps.mk (fns.o):
15985 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15986 sha512.h.
15987
15988 * fns.c (secure_hash): Rename from crypto_hash_function and change
15989 the first arg to accept symbols.
15990 (Fsecure_hash): New primitive.
15991 (syms_of_fns): New symbols.
15992
15993 2011-06-20 Deniz Dogan <deniz@dogan.se>
15994
15995 * process.c (Fset_process_buffer): Clarify return value in
15996 docstring.
15997
15998 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
15999
16000 * dispnew.c (add_window_display_history): Use BVAR.
16001
16002 * xdisp.c (debug_method_add): Use BVAR.
16003 (check_window_end, dump_glyph_matrix, dump_glyph)
16004 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16005
16006 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16007 Likewise.
16008
16009 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16010 check till after the cache is created in init_frame_faces.
16011
16012 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16013
16014 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16015
16016 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16017
16018 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16019 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16020 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16021
16022 Improve buffer-overflow checking (Bug#8873).
16023 * fileio.c (Finsert_file_contents):
16024 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16025 Remove the old (too-loose) buffer overflow checks.
16026 They weren't needed, since make_gap checks for buffer overflow.
16027 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16028 The old code merely checked for Emacs fixnum overflow, and relied
16029 on undefined (wraparound) behavior. The new code avoids undefined
16030 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16031
16032 * editfns.c (Finsert_char): Don't dump core with very negative counts.
16033 Tune. Don't use wider integers than needed. Don't use alloca.
16034 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
16035
16036 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16037
16038 * insdel.c, lisp.h (buffer_overflow): New function.
16039 (insert_from_buffer_1, replace_range, replace_range_2):
16040 * insdel.c (make_gap_larger):
16041 * editfns.c (Finsert_char):
16042 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16043
16044 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16045
16046 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16047
16048 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
16049
16050 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16051 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16052
16053 * fileio.c: Don't assume EMACS_INT fits in off_t.
16054 (emacs_lseek): New static function.
16055 (Finsert_file_contents, Fwrite_region): Use it.
16056 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16057
16058 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16059
16060 * fns.c: Don't overflow int when computing a list length.
16061 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16062 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16063 truncation on 64-bit hosts. Check for QUIT every
16064 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16065 faster and is responsive enough.
16066 (Flength): Report an error instead of overflowing an integer.
16067 (Fsafe_length): Return a float if the value is not representable
16068 as a fixnum. This shouldn't happen except in contrived situations.
16069 (Fnthcdr, Fsort): Don't assume list length fits in int.
16070 (Fcopy_sequence): Don't assume vector length fits in int.
16071
16072 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16073 (header_size, word_size): New constants.
16074 (allocate_vectorlike): Don't check size overflow here.
16075 (allocate_vector): Check it here instead, since this is the only
16076 caller of allocate_vectorlike that could cause overflow.
16077 Check that the new vector's length is representable as a fixnum.
16078
16079 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16080 The previous code was bogus. For example, next_almost_prime (32)
16081 returned 39, which is undesirable as it is a multiple of 3; and
16082 next_almost_prime (24) returned 25, which is a multiple of 5 so
16083 why was the code bothering to check for multiples of 7?
16084
16085 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16086
16087 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16088
16089 Variadic C functions now count arguments with ptrdiff_t.
16090 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16091 Back then I didn't know that the Emacs coding style prefers signed int.
16092 Also, in the meantime I found a few more instances where arguments
16093 were being counted with int, which may truncate counts on 64-bit
16094 machines, or EMACS_INT, which may be unnecessarily wide.
16095 * lisp.h (struct Lisp_Subr.function.aMANY)
16096 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16097 Arg counts are now ptrdiff_t, not size_t.
16098 All variadic functions and their callers changed accordingly.
16099 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16100 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16101 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16102 * callint.c (Fcall_interactively): Check arg count for overflow,
16103 to avoid potential buffer overrun. Use signed char, not 'int',
16104 for 'varies' array, so that we needn't bother to check its size
16105 calculation for overflow.
16106 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16107 * eval.c (apply_lambda):
16108 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16109 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16110 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16111
16112 * callint.c (Fcall_interactively): Don't use index var as event count.
16113
16114 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16115 * mem-limits.h (SIZE): Remove; no longer used.
16116
16117 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
16118
16119 Remove unnecessary casts.
16120 * xterm.c (x_term_init):
16121 * xfns.c (x_set_border_pixel):
16122 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16123 These aren't needed now that we assume ANSI C.
16124
16125 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16126 It's more likely to cause problems (due to unsigned overflow)
16127 than to cure them.
16128
16129 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16130
16131 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16132
16133 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16134
16135 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16136
16137 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16138
16139 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16140
16141 GLYPH_CODE_FACE returns EMACS_INT, not int.
16142 * dispextern.h (merge_faces):
16143 * xfaces.c (merge_faces):
16144 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16145 Don't assume EMACS_INT fits in int.
16146
16147 * character.h (CHAR_VALID_P): Remove unused parameter.
16148 * fontset.c, lisp.h, xdisp.c: All uses changed.
16149
16150 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16151
16152 * fns.c (concat): Minor tuning based on overflow analysis.
16153 This doesn't fix any bugs. Use int to hold character, instead
16154 of constantly refetching from Emacs object. Use XFASTINT, not
16155 XINT, for value known to be a character. Don't bother comparing
16156 a single byte to 0400, as it's always less.
16157
16158 * floatfns.c (Fexpt):
16159 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16160
16161 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16162 for characters.
16163
16164 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16165
16166 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16167 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16168 incorrectly succeed when S was a string, because 4294967386 was
16169 truncated before it was used.
16170
16171 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16172 Otherwise, an out-of-range integer could cause undefined behavior
16173 on a 64-bit host.
16174
16175 * composite.c: Use int, not EMACS_INT, for characters.
16176 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16177 EMACS_INT, for values that are known to be in character range.
16178 This doesn't fix any bugs but is the usual style inside Emacs and
16179 may generate better code on 32-bit machines.
16180
16181 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16182 This is for reasons similar to the recent CHAR_STRING fix.
16183 * charset.c (Fencode_char): Check that character arg is actually
16184 a character. Pass an int to ENCODE_CHAR.
16185 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16186 wider than 'int', as a compile-time check to prevent future regressions
16187 in this area.
16188
16189 * character.c (char_string): Remove unnecessary casts.
16190
16191 Make sure a 64-bit char is never passed to CHAR_STRING.
16192 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16193 by silently ignoring the top 32 bits, allowing some values
16194 that were far too large to be valid characters.
16195 * character.h: Include <verify.h>.
16196 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16197 arguments are no wider than unsigned, as a compile-time check
16198 to prevent future regressions in this area.
16199 * data.c (Faset):
16200 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
16201 (Fsubst_char_in_region):
16202 * fns.c (concat):
16203 * xdisp.c (decode_mode_spec_coding):
16204 Adjust to CHAR_STRING's new requirement.
16205 * editfns.c (Finsert_char, Fsubst_char_in_region):
16206 * fns.c (concat): Check that character args are actually
16207 characters. Without this test, these functions did the wrong
16208 thing with wildly out-of-range values on 64-bit hosts.
16209
16210 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16211 These casts should not be needed on 32-bit hosts, either.
16212 * keyboard.c (read_char):
16213 * lread.c (Fload): Remove casts to unsigned.
16214
16215 * lisp.h (UNSIGNED_CMP): New macro.
16216 This fixes comparison bugs on 64-bit hosts.
16217 (ASCII_CHAR_P): Use it.
16218 * casefiddle.c (casify_object):
16219 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
16220 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16221 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16222 * dispextern.h (FACE_FROM_ID):
16223 * keyboard.c (read_char): Use UNSIGNED_CMP.
16224
16225 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16226 not to EMACS_INT, to avoid GCC warning.
16227
16228 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16229
16230 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16231 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16232 isn't needed on 32-bit machines.
16233
16234 * buffer.c (Fgenerate_new_buffer_name):
16235 Use EMACS_INT for count, not int.
16236 (advance_to_char_boundary): Return EMACS_INT, not int.
16237
16238 * data.c (Qcompiled_function): Now static.
16239
16240 * window.c (window_body_lines): Now static.
16241
16242 * image.c (gif_load): Rename local to avoid shadowing.
16243
16244 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16245 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16246 * alloc.c (make_save_value): Integer argument is now of type
16247 ptrdiff_t, not int.
16248 (mark_object): Use ptrdiff_t, not int.
16249 * lisp.h (pD): New macro.
16250 * print.c (print_object): Use it.
16251
16252 * alloc.c: Use EMACS_INT, not int, to count objects.
16253 (total_conses, total_markers, total_symbols, total_vector_size)
16254 (total_free_conses, total_free_markers, total_free_symbols)
16255 (total_free_floats, total_floats, total_free_intervals)
16256 (total_intervals, total_strings, total_free_strings):
16257 Now EMACS_INT, not int. All uses changed.
16258 (Fgarbage_collect): Compute overall total using a double, so that
16259 integer overflow is less likely to be a problem. Check for overflow
16260 when converting back to an integer.
16261 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16262 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16263 These were 'int' variables that could overflow on 64-bit hosts;
16264 they were never used, so remove them instead of repairing them.
16265 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
16266 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16267 Previously, this ceilinged at INT_MAX, but that doesn't work on
16268 64-bit machines.
16269 (allocate_pseudovector): Don't use EMACS_INT when int would do.
16270
16271 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
16272 (allocate_vectorlike): Check for ptrdiff_t overflow.
16273 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16274 when a (possibly-narrower) signed value would do just as well.
16275 We prefer using signed arithmetic, to avoid comparison confusion.
16276
16277 * alloc.c: Catch some string size overflows that we were missing.
16278 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16279 for convenience in STRING_BYTES_MAX.
16280 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16281 The definition here is exact; the one in lisp.h was approximate.
16282 (allocate_string_data): Check for string overflow. This catches
16283 some instances we weren't catching before. Also, it catches
16284 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16285 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16286 and ptrdiff_t and EMACS_INT are both 64 bits.
16287
16288 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16289 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
16290 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
16291
16292 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16293
16294 * alloc.c (Fmake_string): Check for out-of-range init.
16295
16296 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16297
16298 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16299
16300 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16301
16302 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16303 xg_get_default_scrollbar_width.
16304
16305 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16306 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16307 (style_changed_cb): Call update_theme_scrollbar_width and call
16308 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16309 all frames (Bug#8505).
16310 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16311 Call gtk_window_set_resizable if HAVE_GTK3.
16312 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16313 and height if HAVE_GTK3 (Bug#8505).
16314 (scroll_bar_width_for_theme): New variable.
16315 (update_theme_scrollbar_width): New function.
16316 (xg_get_default_scrollbar_width): Move code to
16317 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16318 (xg_initialize): Call update_theme_scrollbar_width.
16319
16320 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16321
16322 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16323
16324 2011-06-12 Martin Rudalics <rudalics@gmx.at>
16325
16326 * frame.c (make_frame): Call other_buffer_safely instead of
16327 other_buffer.
16328
16329 * window.c (temp_output_buffer_show): Call display_buffer with
16330 second argument Vtemp_buffer_show_specifiers and reset latter
16331 immediately after the call.
16332 (Vtemp_buffer_show_specifiers): New variable.
16333 (auto_window_vscroll_p, next_screen_context_lines)
16334 (Vscroll_preserve_screen_position): Remove leading asterisks from
16335 doc-strings.
16336
16337 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
16338
16339 Fix minor problems found by GCC 4.6.0 static checking.
16340 * buffer.c (Qclone_number): Remove for now, as it's unused.
16341 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16342 (record_buffer): Remove unused local.
16343 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16344 (set_frame_buffer_list): Remove; unused.
16345 * frame.h (other_visible_frames): Remove decl.
16346 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16347 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16348 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16349 if HAVE_GPM.
16350 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16351 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16352 Define only if HAVE_GPM.
16353 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16354 (update_hints_inhibit): Remove; never set. All uses removed.
16355 * widgetprv.h (emacsFrameClassRec): Remove decl.
16356 * window.c (delete_deletable_window): Now returns void, since it
16357 wasn't returning anything.
16358 (compare_window_configurations): Remove unused locals.
16359 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16360 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
16361 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16362 the same widths as pointers. This follows up on the 2011-05-06 patch.
16363 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16364 * xterm.h: Likewise.
16365 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16366
16367 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
16368
16369 * makefile.w32-in: Update dependencies.
16370 (LISP_H): Add lib/intprops.h.
16371
16372 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16373
16374 * image.c (gif_load): Add animation frame delay to the metadata.
16375 (syms_of_image): Use DEFSYM. New symbol `delay'.
16376
16377 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16378
16379 * window.c (delete_deletable_window): Re-add.
16380 (Fset_window_configuration): Rewrite to handle dead buffers and
16381 consequently deletable windows.
16382 (window_tree, Fwindow_tree): Remove. Supply functionality in
16383 window.el.
16384 (compare_window_configurations): Simplify code.
16385
16386 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16387
16388 * image.c (imagemagick_load_image): Fix type mismatch.
16389 (Fimagemagick_types): Likewise.
16390
16391 * window.h (replace_buffer_in_windows): Declare.
16392
16393 2011-06-11 Martin Rudalics <rudalics@gmx.at>
16394
16395 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16396 Qclone_number. Remove external declaration of Qdelete_window.
16397 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16398 code.
16399 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16400 Run Qbuffer_list_update_hook if allowed.
16401 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16402 buffer list implementation.
16403 (other_buffer_safely): New function.
16404 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16405 calls to replace_buffer_in_windows and
16406 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16407 if allowed.
16408 (record_buffer): Inhibit quitting and rewrite using quittable
16409 functions. Run Qbuffer_list_update_hook if allowed.
16410 (Frecord_buffer, Funrecord_buffer): New functions.
16411 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16412 Move switch-to-buffer to window.el.
16413 (bury-buffer): Move to window.el.
16414 (Vbuffer_list_update_hook): New variable.
16415
16416 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16417 section.
16418
16419 * window.h (resize_frame_windows): Move up in code.
16420 (Fwindow_frame): Remove EXFUN.
16421 (replace_buffer_in_all_windows): Remove prototype.
16422 (replace_buffer_in_windows_safely): Add prototype.
16423
16424 * window.c: Declare Qdelete_window static again. Move down
16425 declaration of select_count.
16426 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16427 (Fother_window): Move to window.el.
16428 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16429 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16430 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16431 window.el.
16432 (replace_buffer_in_windows): Implement by calling
16433 Qreplace_buffer_in_windows.
16434 (replace_buffer_in_all_windows): Remove with some functionality
16435 moved into replace_buffer_in_windows_safely.
16436 (replace_buffer_in_windows_safely): New function.
16437 (select_window_norecord, select_frame_norecord): Move in front
16438 of run_window_configuration_change_hook. Remove now obsolete
16439 declarations.
16440 (Fset_window_buffer): Rewrite doc-string.
16441 Call Qrecord_window_buffer.
16442 (keys_of_window): Move binding for other-window to window.el.
16443
16444 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
16445
16446 * dispextern.h (struct image): Replace data member, whose int_val
16447 and ptr_val fields were not used by anything, with a single
16448 lisp_val object.
16449
16450 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16451 (gif_clear_image, gif_load, imagemagick_load_image)
16452 (gs_clear_image, gs_load): Callers changed.
16453
16454 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16455
16456 * buffer.h: Include <time.h>, for time_t.
16457 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16458
16459 Fix minor problems found by static checking.
16460
16461 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16462
16463 Make identifiers static if they are not used in other modules.
16464 * data.c (Qcompiled_function, Qframe, Qvector):
16465 * image.c (QimageMagick, Qsvg):
16466 * minibuf.c (Qmetadata):
16467 * window.c (resize_window_check, resize_root_window): Now static.
16468 * window.h (resize_window_check, resize_root_window): Remove decls.
16469
16470 * window.c (window_deletion_count, delete_deletable_window):
16471 Remove; unused.
16472 (window_body_lines): Now static.
16473 (Fdelete_other_windows_internal): Mark vars as initialized.
16474 Make sure 'resize_failed' is initialized.
16475 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16476 (resize_window_apply): Remove unused local.
16477 * window.h (delete_deletable_window): Remove decl.
16478
16479 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
16480 (imagemagick_load_image): Fix pointer signedness problem by changing
16481 last arg from unsigned char * to char *. All uses changed.
16482 Also, fix a local for similar reasons.
16483 Remove unused locals. Remove locals to avoid shadowing.
16484 (fn_rsvg_handle_free): Remove; unused.
16485 (svg_load, svg_load_image): Fix pointer signedness problem.
16486 (imagemagick_load_image): Don't use garbage pointer image_wand.
16487
16488 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16489
16490 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
16491
16492 * image.c (gif_load): Fix omitted cast error introduced by
16493 2011-06-06 change.
16494
16495 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16496
16497 * window.h (resize_proportionally, orig_total_lines)
16498 (orig_top_line): Remove from window structure.
16499 (set_window_height, set_window_width, change_window_heights)
16500 (Fdelete_window): Remove prototypes.
16501 (resize_frame_windows): Remove duplicate declaration.
16502
16503 2011-06-10 Eli Zaretskii <eliz@gnu.org>
16504
16505 * window.h (resize_frame_windows, resize_window_check)
16506 (delete_deletable_window, resize_root_window)
16507 (resize_frame_windows): Declare prototypes.
16508
16509 * window.c (resize_window_apply): Make definition be "static" to
16510 match the prototype.
16511
16512 2011-06-10 Martin Rudalics <rudalics@gmx.at>
16513
16514 * window.c: Remove declarations of Qwindow_size_fixed,
16515 window_min_size_1, window_min_size_2, window_min_size,
16516 size_window, window_fixed_size_p, enlarge_window, delete_window.
16517 Remove static from declaration of Qdelete_window, it's
16518 temporarily needed by Fbury_buffer.
16519 (replace_window): Don't assign orig_top_line and
16520 orig_total_lines.
16521 (Fdelete_window, delete_window): Remove. Window deletion is
16522 handled by window.el.
16523 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16524 Replace Fdelete_window calls with calls to Qdelete_window.
16525 (Fdelete_other_windows): Remove. Deleting other windows is
16526 handled by window.el.
16527 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16528 handled in window.el.
16529 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16530 Window minimum sizes are handled in window.el.
16531 (shrink_windows, size_window, set_window_height)
16532 (set_window_width, change_window_heights, window_height)
16533 (window_width, CURBEG, CURSIZE, enlarge_window)
16534 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16535 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16536 handled in window.el.
16537 (make_dummy_parent): Rename to make_parent_window and give it a
16538 second argument horflag.
16539 (make_window): Don't set resize_proportionally any more.
16540 (Fsplit_window): Remove. Windows are split in window.el.
16541 (save_restore_action, save_restore_orig_size)
16542 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16543 Resize mini windows in window.el.
16544 (grow_mini_window, shrink_mini_window): Implement by calling
16545 Qresize_root_window_vertically, resize_window_check and
16546 resize_window_apply.
16547 (saved_window, Fset_window_configuration, save_window_save):
16548 Do not handle orig_top_line, orig_total_lines, and
16549 resize_proportionally.
16550 (window_min_height, window_min_width): Move to window.el.
16551 (keys_of_window): Move bindings for delete-other-windows,
16552 split-window, delete-window and enlarge-window to window.el.
16553
16554 * buffer.c: Temporarily extern Qdelete_window.
16555 (Fbury_buffer): Temporarily call Qdelete_window instead of
16556 Fdelete_window (Fbury_buffer will move to window.el soon).
16557
16558 * frame.c (set_menu_bar_lines_1): Remove code handling
16559 orig_top_line and orig_total_lines.
16560
16561 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16562 set_window_height but set heights directly.
16563 (change_frame_size_1): Use resize_frame_windows.
16564
16565 * xdisp.c (init_xdisp): Don't use set_window_height but set
16566 heights directly.
16567
16568 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16569 Use resize_frame_windows instead of change_window_heights and run
16570 run_window_configuration_change_hook.
16571
16572 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16573 instead of change_window_heights and run
16574 run_window_configuration_change_hook.
16575
16576 2011-06-09 Martin Rudalics <rudalics@gmx.at>
16577
16578 * window.c (replace_window): Rename second argument REPLACEMENT to
16579 NEW. New third argument SETFLAG. Rewrite.
16580 (delete_window, make_dummy_parent): Call replace_window with
16581 third argument 1.
16582 (window_list_1): Move down in code.
16583 (run_window_configuration_change_hook): Move set_buffer part
16584 before select_frame_norecord part in order to unwind correctly.
16585 Rename count1 to count.
16586 (recombine_windows, delete_deletable_window, resize_root_window)
16587 (Fdelete_other_windows_internal)
16588 (Frun_window_configuration_change_hook, make_parent_window)
16589 (resize_window_check, resize_window_apply, Fresize_window_apply)
16590 (resize_frame_windows, Fsplit_window_internal)
16591 (Fdelete_window_internal, Fresize_mini_window_internal):
16592 New functions.
16593 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16594
16595 2011-06-08 Martin Rudalics <rudalics@gmx.at>
16596
16597 * window.h (window): Add some new members to window structure -
16598 normal_lines, normal_cols, new_total, new_normal, clone_number,
16599 splits, nest, prev_buffers, next_buffers.
16600 (WINDOW_TOTAL_SIZE): Move here from window.c.
16601 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
16602
16603 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16604 Remove.
16605 (make_dummy_parent): Set new members of windows structure.
16606 (make_window): Move down in code. Handle new members of window
16607 structure.
16608 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16609 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16610 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16611 (Fset_window_prev_buffers, Fwindow_next_buffers)
16612 (Fset_window_next_buffers, Fset_window_clone_number):
16613 New functions.
16614 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16615 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16616 Doc-string fixes.
16617 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16618 Argument WINDOW can be now internal window too.
16619 (Fwindow_use_time): Move up in code.
16620 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16621 Rewrite doc-string.
16622 (Fset_window_configuration, saved_window)
16623 (Fcurrent_window_configuration, save_window_save): Handle new
16624 members of window structure.
16625 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16626 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16627 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16628 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16629 Qget_mru_window, Qresize_root_window,
16630 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16631 Qauto_buffer_name; staticpro them.
16632
16633 2011-06-07 Martin Rudalics <rudalics@gmx.at>
16634
16635 * window.c (Fwindow_total_size, Fwindow_left_column)
16636 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16637 (Fwindow_list_1): New functions.
16638 (window_box_text_cols): Replace with window_body_cols.
16639 (Fwindow_width, Fscroll_left, Fscroll_right):
16640 Use window_body_cols instead of window_box_text_cols.
16641 (delete_window, Fset_window_configuration):
16642 Call delete_all_subwindows with window as argument.
16643 (delete_all_subwindows): Take a window as argument and not a
16644 structure. Rewrite.
16645 (window_loop): Remove handling of GET_LRU_WINDOW and
16646 GET_LARGEST_WINDOW.
16647 (Fget_lru_window, Fget_largest_window): Move to window.el.
16648
16649 * window.h: Extern window_body_cols instead of
16650 window_box_text_cols. delete_all_subwindows now takes a
16651 Lisp_Object as argument.
16652
16653 * indent.c (compute_motion, Fcompute_motion):
16654 Use window_body_cols instead of window_box_text_cols.
16655
16656 * frame.c (delete_frame): Call delete_all_subwindows with root
16657 window as argument.
16658
16659 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16660
16661 * fns.c (Fputhash): Document return value.
16662
16663 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
16664
16665 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16666
16667 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16668
16669 Cons<->int and similar integer overflow fixes (Bug#8794).
16670
16671 Check for overflow when converting integer to cons and back.
16672 * charset.c (Fdefine_charset_internal, Fdecode_char):
16673 Use cons_to_unsigned to catch overflow.
16674 (Fencode_char): Use INTEGER_TO_CONS.
16675 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16676 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16677 * data.c (long_to_cons, cons_to_long): Remove.
16678 (cons_to_unsigned, cons_to_signed): New functions.
16679 These signal an error for invalid or out-of-range values.
16680 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16681 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16682 * font.c (Ffont_variation_glyphs):
16683 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16684 * lisp.h: Include <intprops.h>.
16685 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16686 (cons_to_signed, cons_to_unsigned): New decls.
16687 (long_to_cons, cons_to_long): Remove decls.
16688 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16689 (Fprimitive_undo): Use CONS_TO_INTEGER.
16690 * xfns.c (Fx_window_property): Likewise.
16691 * xselect.c: Include <limits.h>.
16692 (x_own_selection, selection_data_to_lisp_data):
16693 Use INTEGER_TO_CONS.
16694 (x_handle_selection_request, x_handle_selection_clear)
16695 (x_get_foreign_selection, Fx_disown_selection_internal)
16696 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16697 (lisp_data_to_selection_data): Use cons_to_unsigned.
16698 (x_fill_property_data): Use cons_to_signed.
16699 Report values out of range.
16700
16701 Check for buffer and string overflow more precisely.
16702 * buffer.h (BUF_BYTES_MAX): New macro.
16703 * lisp.h (STRING_BYTES_MAX): New macro.
16704 * alloc.c (Fmake_string):
16705 * character.c (string_escape_byte8):
16706 * coding.c (coding_alloc_by_realloc):
16707 * doprnt.c (doprnt):
16708 * editfns.c (Fformat):
16709 * eval.c (verror):
16710 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16711 since they may not be the same number.
16712 * editfns.c (Finsert_char):
16713 * fileio.c (Finsert_file_contents):
16714 Likewise for BUF_BYTES_MAX.
16715
16716 * image.c: Use ptrdiff_t, not int, for sizes.
16717 (slurp_file): Switch from int to ptrdiff_t.
16718 All uses changed.
16719 (slurp_file): Check that file size fits in both size_t (for
16720 malloc) and ptrdiff_t (for sanity and safety).
16721
16722 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16723 if b->modtime has its maximal value.
16724
16725 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16726
16727 Don't assume time_t can fit into int.
16728 * buffer.h (struct buffer.modtime): Now time_t, not int.
16729 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16730 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16731
16732 Minor fixes for signed vs unsigned integers.
16733 * character.h (MAYBE_UNIFY_CHAR):
16734 * charset.c (maybe_unify_char):
16735 * keyboard.c (read_char, reorder_modifiers):
16736 XINT -> XFASTINT, since the integer must be nonnegative.
16737 * ftfont.c (ftfont_spec_pattern):
16738 * keymap.c (access_keymap, silly_event_symbol_error):
16739 XUINT -> XFASTINT, since the integer must be nonnegative.
16740 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16741 since it makes no difference and we prefer signed.
16742 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16743 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16744 nonnegative.
16745
16746 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16747
16748 * window.h (Fwindow_frame): Declare.
16749
16750 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16751
16752 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16753 (SPARE_MEMORY): Always define.
16754 (LARGE_REQUEST): Remove.
16755 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16756
16757 2011-06-06 Martin Rudalics <rudalics@gmx.at>
16758
16759 * lisp.h: Move EXFUNS for Fframe_root_window,
16760 Fframe_first_window and Fset_frame_selected_window to window.h.
16761
16762 * window.h: Move EXFUNS for Fframe_root_window,
16763 Fframe_first_window and Fset_frame_selected_window here from
16764 lisp.h.
16765
16766 * frame.c (Fwindow_frame, Fframe_first_window)
16767 (Fframe_root_window, Fframe_selected_window)
16768 (Fset_frame_selected_window): Move to window.c.
16769 (Factive_minibuffer_window): Move to minibuf.c.
16770 (Fother_visible_frames_p): New function.
16771
16772 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
16773
16774 * window.c (decode_window, decode_any_window): Move up in code.
16775 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
16776 (inhibit_frame_unsplittable): Remove unused variable.
16777 (Fwindow_buffer): Move up and rewrite doc-string.
16778 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
16779 (Fwindow_prev): New functions.
16780 (Fwindow_frame): Move here from frame.c. Accept any window as
16781 argument.
16782 (Fframe_root_window, Fframe_first_window)
16783 (Fframe_selected_window): Move here from frame.c. Accept frame
16784 or arbitrary window as argument. Update doc-strings.
16785 (Fminibuffer_window): Move up in code.
16786 (Fwindow_minibuffer_p): Move up in code and simplify.
16787 (Fset_frame_selected_window): Move here from frame.c.
16788 Marginal rewrite.
16789 (Fselected_window, select_window, Fselect_window): Move up in
16790 code. Minor doc-string fixes.
16791
16792 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16793
16794 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
16795 Do not assume that spare memory exists; that assumption is valid
16796 only if SYSTEM_MALLOC.
16797 (LARGE_REQUEST): New macro, so that the issue of large requests
16798 is separated from the issue of spare memory.
16799
16800 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
16801
16802 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
16803 format. (Bug#8806)
16804
16805 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
16806
16807 * xfns.c (x_set_scroll_bar_default_width): Move declarations
16808 before statements.
16809
16810 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
16811
16812 * gtkutil.c (xg_get_default_scrollbar_width): New function.
16813
16814 * gtkutil.h: Declare xg_get_default_scrollbar_width.
16815
16816 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
16817 min width by calling x_set_scroll_bar_default_width (Bug#8505).
16818
16819 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
16820
16821 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
16822
16823 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
16824
16825 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
16826 (x_clipboard_manager_save): Add return value.
16827 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
16828 New error handlers.
16829 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
16830 Obey Vx_select_enable_clipboard_manager. Catch errors in
16831 x_clipboard_manager_save (Bug#8779).
16832 (Vx_select_enable_clipboard_manager): New variable.
16833 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
16834
16835 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
16836
16837 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
16838
16839 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16840
16841 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
16842 in the current matrix if keep_current_p is non-zero.
16843
16844 2011-06-04 Eli Zaretskii <eliz@gnu.org>
16845
16846 * bidi.c (bidi_level_of_next_char): Fix last change.
16847
16848 2011-06-03 Eli Zaretskii <eliz@gnu.org>
16849
16850 Support bidi reordering of text covered by display properties.
16851
16852 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
16853 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
16854 (bidi_cache_search, bidi_cache_iterator_state)
16855 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
16856 (bidi_level_of_next_char, bidi_move_to_visually_next):
16857 Support character positions inside a run of characters covered by a
16858 display string.
16859 (bidi_paragraph_init, bidi_resolve_explicit_1)
16860 (bidi_level_of_next_char): Call bidi_fetch_char and
16861 bidi_fetch_char_advance instead of FETCH_CHAR and
16862 FETCH_CHAR_ADVANCE.
16863 (bidi_init_it): Initialize new members.
16864 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
16865 definitions.
16866 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
16867 instead of using explicit *_CHAR codes.
16868 (bidi_resolve_explicit, bidi_resolve_weak):
16869 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
16870 bidirectional text is supported only in multibyte buffers.
16871 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
16872 it to initialize the frame_window_p member of struct bidi_it.
16873 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
16874 (bidi_resolve_explicit, bidi_resolve_weak)
16875 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
16876 bidi_it->nchars is non-positive.
16877 (bidi_level_of_next_char): Don't try to lookup the cache for the
16878 next/previous character if nothing is cached there yet, or if we
16879 were just reseat()'ed to a new position.
16880
16881 * xdisp.c (set_cursor_from_row): Set start and stop points
16882 according to the row's direction when priming the loop that looks
16883 for the glyph on which to display cursor.
16884 (single_display_spec_intangible_p): Function deleted.
16885 (display_prop_intangible_p): Reimplement to call
16886 handle_display_spec instead of single_display_spec_intangible_p.
16887 Accept 3 additional arguments needed by handle_display_spec.
16888 This fixes incorrect cursor motion across display property with complex
16889 values: lists, `(when COND...)' forms, etc.
16890 (single_display_spec_string_p): Support property values that are
16891 lists with the argument STRING its top-level element.
16892 (display_prop_string_p): Fix the condition for processing a
16893 property that is a list to be consistent with handle_display_spec.
16894 (handle_display_spec): New function, refactored from the
16895 last portion of handle_display_prop.
16896 (compute_display_string_pos): Accept additional argument
16897 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
16898 value of a `display' property is a "replacing spec".
16899 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
16900 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
16901 the display property, but just return a value indicating whether
16902 the display property will replace the characters it covers.
16903 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
16904 frame_window_p members of struct bidi_it.
16905 (compute_display_string_pos, compute_display_string_end):
16906 New functions.
16907 (push_it): Accept second argument POSITION, where pop_it should
16908 jump to continue iteration.
16909 (reseat_1): Initialize bidi_it.disp_pos.
16910
16911 * keyboard.c (adjust_point_for_property): Adjust the call to
16912 display_prop_intangible_p to its new signature.
16913
16914 * dispextern.h (struct bidi_it): New member frame_window_p.
16915 (bidi_init_it): Update prototypes.
16916 (display_prop_intangible_p): Update prototype.
16917 (compute_display_string_pos, compute_display_string_end):
16918 Declare prototypes.
16919 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16920 EMACS_INT.
16921
16922 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
16923
16924 Malloc failure behavior now depends on size of allocation.
16925 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16926 * lisp.h: Change signatures accordingly.
16927 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16928 All callers changed. (Bug#8762)
16929
16930 * gnutls.c: Use Emacs's memory allocators.
16931 Without this change, the gnutls library would invoke malloc etc.
16932 directly, which causes problems on non-SYNC_INPUT hosts, and which
16933 runs afoul of improving memory_full behavior. (Bug#8761)
16934 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16935 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16936 xfree instead of the default malloc, realloc, free.
16937 (Fgnutls_boot): No need to check for memory allocation failure,
16938 since xmalloc does that for us.
16939
16940 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
16941 * category.c (hash_get_category_set):
16942 * ccl.c (ccl_driver):
16943 * charset.c (Fdefine_charset_internal):
16944 * charset.h (struct charset.hash_index):
16945 * composite.c (get_composition_id, gstring_lookup_cache)
16946 (composition_gstring_put_cache):
16947 * composite.h (struct composition.hash_index):
16948 * dispextern.h (struct image.hash):
16949 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16950 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16951 (hashfn_equal, hashfn_user_defined, make_hash_table)
16952 (maybe_resize_hash_table, hash_lookup, hash_put)
16953 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16954 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16955 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16956 * image.c (make_image, search_image_cache, lookup_image)
16957 (xpm_put_color_table_h):
16958 * lisp.h (struct Lisp_Hash_Table):
16959 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
16960 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
16961 for hashes and hash indexes, instead of 'unsigned' and 'int'.
16962 * alloc.c (allocate_vectorlike):
16963 Check for overflow in vector size calculations.
16964 * ccl.c (ccl_driver):
16965 Check for overflow when converting EMACS_INT to int.
16966 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16967 need to be updated by these changes.
16968 * fns.c (make_hash_table, maybe_resize_hash_table):
16969 Check for integer overflow with large hash tables.
16970 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16971 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16972 (SXHASH_REDUCE): New macro.
16973 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16974 Use it instead of discarding useful hash info with large hash values.
16975 (sxhash_float): New function.
16976 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16977 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
16978 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16979 Rewrite to use FIXNUM_BITS, as this simplifies things.
16980 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16981 Adjust signatures to match updated version of code.
16982 (consing_since_gc): Now EMACS_INT, since a single hash table can
16983 use more than INT_MAX bytes.
16984
16985 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16986
16987 Make it possible to build with GCC-4.6+ -O2 -flto.
16988
16989 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16990
16991 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16992
16993 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16994 Call minibuffer-inactive-mode.
16995
16996 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
16997
16998 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16999 Update dependencies.
17000
17001 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17002
17003 * data.c (init_data): Remove code for UTS, this system is not
17004 supported anymore.
17005
17006 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17007
17008 Don't force ./temacs to start in terminal mode.
17009
17010 * frame.c (make_initial_frame): Initialize faces in all cases, not
17011 only when CANNOT_DUMP is defined.
17012 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17013
17014 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17015
17016 * dispnew.c (add_window_display_history): Use const for the string
17017 pointer. Remove declaration, not needed.
17018
17019 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17020
17021 Use 'inline', not 'INLINE'.
17022 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
17023 * alloc.c, fontset.c (INLINE): Remove.
17024 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17025 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17026 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17027 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17028 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17029
17030 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17031
17032 Make it possible to run ./temacs.
17033
17034 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17035 syms_of_callproc does the same thing. Remove test for
17036 "initialized", do it in the caller.
17037 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17038
17039 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17040
17041 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17042 (read_minibuf): Use get_minibuffer.
17043 (syms_of_minibuf): Use DEFSYM.
17044 (Qmetadata): New var.
17045 * data.c (Qbuffer): Don't make it static.
17046 (syms_of_data): Use DEFSYM.
17047
17048 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17049
17050 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17051 (CCL_CODE_MIN): New macro.
17052
17053 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17054
17055 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17056
17057 * eval.c (Qdebug): Now static.
17058 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17059 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17060 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17061
17062 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17063
17064 * image.c: Various fixes to ImageMagick code comments.
17065 (Fimagemagick_types): Doc fix.
17066
17067 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17068
17069 Minor fixes prompted by GCC 4.6.0 warnings.
17070
17071 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17072
17073 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17074 (x_clipboard_manager_save_all): Move extern decl to ...
17075 * xterm.h: ... here, so that it can be checked for consistency.
17076
17077 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
17078
17079 * xselect.c (x_clipboard_manager_save_frame)
17080 (x_clipboard_manager_save_all): New functions.
17081 (Fx_clipboard_manager_save): Lisp function deleted.
17082
17083 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17084 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17085
17086 * xterm.h: Update prototype.
17087
17088 2011-05-28 William Xu <william.xwl@gmail.com>
17089
17090 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17091 exiting (Bug#8239).
17092
17093 2011-05-28 Jim Meyering <meyering@redhat.com>
17094
17095 Avoid a sign-extension bug in crypto_hash_function.
17096 * fns.c (to_uchar): Define.
17097 (crypto_hash_function): Use it to convert some newly-signed
17098 variables to unsigned, to avoid sign-extension bugs. For example,
17099 without this change, (md5 "truc") would evaluate to
17100 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17101 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
17102 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
17103
17104 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17105
17106 Integer overflow fixes.
17107
17108 * dbusbind.c: Serial number integer overflow fixes.
17109 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
17110 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17111 to hold a serial number that is too large for a fixnum.
17112 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17113 Check for serial numbers out of range. Decode any serial number
17114 that was so large that it became a float. (Bug#8722)
17115
17116 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17117 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17118 Use XFASTINT rather than XUINT when numbers are nonnegative.
17119 (xd_append_arg, Fdbus_method_return_internal):
17120 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17121 arguments, check that Lisp number is nonnegative, rather than
17122 silently wrapping negative numbers around. (Bug#8722)
17123 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
17124 (Bug#8722)
17125
17126 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17127
17128 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17129
17130 ccl: Add integer overflow checks.
17131 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17132 (IN_INT_RANGE): New macros.
17133 (ccl_driver): Use them to check for integer overflow when
17134 decoding a CCL program. Many of the new checks are whether XINT (x)
17135 fits in int; it doesn't always, on 64-bit hosts. The new version
17136 doesn't catch all possible integer overflows, but it's an
17137 improvement. (Bug#8719)
17138
17139 * alloc.c (make_event_array): Use XINT, not XUINT.
17140 There's no need for unsigned here.
17141
17142 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17143 This follows up to the 2011-05-06 change that substituted uintptr_t
17144 for EMACS_INT. This case wasn't caught back then.
17145
17146 Rework Fformat to avoid integer overflow issues.
17147 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17148 now (part of C89). Include <verify.h>.
17149 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17150 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17151 (Fformat): Avoid the prepass trying to compute sizes; it was only
17152 approximate and thus did not catch overflow reliably. Instead, walk
17153 through the format just once, formatting and computing sizes as we go,
17154 checking for integer overflow at every step, and allocating a larger
17155 buffer as needed. Keep track separately whether the format is
17156 multibyte. Keep only the most-recently calculated precision, rather
17157 than them all. Record whether each argument has been converted to
17158 string. Use EMACS_INT, not int, for byte and char and arg counts.
17159 Support field widths and precisions larger than INT_MAX. Avoid
17160 sprintf's undefined behavior with conversion specifications such as %#d
17161 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17162 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17163 formatting out-of-range floating point numbers with int
17164 formats. (Bug#8668)
17165
17166 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17167
17168 * data.c: Avoid integer truncation in expressions involving floats.
17169 * data.c: Include <intprops.h>.
17170 (arith_driver): When there's an integer overflow in an expression
17171 involving floating point, convert the integers to floating point
17172 so that the resulting value does not suffer from catastrophic
17173 integer truncation. For example, on a 64-bit host (* 4
17174 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17175 Do not rely on undefined behavior after integer overflow.
17176
17177 merge count_size_as_multibyte, parse_str_to_multibyte
17178 * character.c, character.h (count_size_as_multibyte):
17179 Rename from parse_str_to_multibyte; all uses changed.
17180 Check for integer overflow.
17181 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17182 since it's now a duplicate of the other. This is more of
17183 a character than a buffer op, so better that it's in character.c.
17184 * fns.c, print.c: Adjust to above changes.
17185
17186 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17187
17188 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17189
17190 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17191
17192 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17193 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17194 (x_clipboard_manager_save): Now static.
17195 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17196
17197 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17198 (crypto_hash_function): Now static.
17199 Fix pointer signedness problems. Avoid unnecessary initializations.
17200
17201 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
17202
17203 * termhooks.h (Vselection_alist): Make it terminal-local.
17204
17205 * terminal.c (create_terminal): Initialize it.
17206
17207 * xselect.c: Support for clipboard managers.
17208 (Vselection_alist): Move to termhooks.h as terminal-local var.
17209 (LOCAL_SELECTION): New macro.
17210 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17211 (symbol_to_x_atom): Remove gratuitous arg.
17212 (x_handle_selection_request, lisp_data_to_selection_data)
17213 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
17214 (x_own_selection, x_get_local_selection, x_convert_selection):
17215 New arg, specifying work frame. Use terminal-local Vselection_alist.
17216 (some_frame_on_display): Delete unused function.
17217 (Fx_own_selection_internal, Fx_get_selection_internal)
17218 (Fx_disown_selection_internal, Fx_selection_owner_p)
17219 (Fx_selection_exists_p): New optional frame arg.
17220 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17221 (x_handle_selection_clear): Don't treat other terminals with the
17222 same keyboard specially. Use the terminal-local Vselection_alist.
17223 (x_clear_frame_selections): Use Frun_hook_with_args.
17224
17225 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17226
17227 * xterm.h: Add support for those atoms.
17228
17229 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
17230
17231 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17232 (converted_selections, conversion_fail_tag): New global variables.
17233 (x_selection_request_lisp_error): Free the above.
17234 (x_get_local_selection): Remove unnecessary code.
17235 (x_reply_selection_request): Args changed; handle arbitrary array
17236 of converted selections stored in converted_selections.
17237 Separate the XChangeProperty and SelectionNotify steps.
17238 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17239 (x_convert_selection): New function.
17240 (x_handle_selection_event): Simplify.
17241 (x_get_foreign_selection): Don't ignore incoming requests while
17242 waiting for an answer; this will fail when we implement
17243 SAVE_TARGETS, and seems unnecessary anyway.
17244 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17245 (Vx_sent_selection_functions): Doc fix.
17246
17247 2011-05-26 Leo Liu <sdl.web@gmail.com>
17248
17249 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17250
17251 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17252
17253 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17254
17255 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17256 for fringe update if it has periodic bitmap.
17257 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
17258 and fringe_bitmap_periodic_p.
17259
17260 * fringe.c (get_fringe_bitmap_data): New function.
17261 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17262 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17263 row. Mark glyph row for fringe update if periodicity changed.
17264
17265 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17266 for fringe update unless it has periodic bitmap.
17267
17268 2011-05-25 Kenichi Handa <handa@m17n.org>
17269
17270 * xdisp.c (get_next_display_element): Set correct it->face_id for
17271 a static composition.
17272
17273 2011-05-24 Leo Liu <sdl.web@gmail.com>
17274
17275 * deps.mk (fns.o):
17276 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17277
17278 * fns.c (crypto_hash_function, Fsha1): New function.
17279 (Fmd5): Use crypto_hash_function.
17280 (syms_of_fns): Add Ssha1.
17281
17282 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17283
17284 * gnutls.c: Remove unused macros.
17285 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17286 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17287 Remove macros that are defined and never used.
17288 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17289
17290 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17291
17292 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17293 (Fx_get_selection_internal): Minor cleanup.
17294 (Fx_own_selection_internal): Rename arguments for consistency with
17295 select.el.
17296
17297 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17298
17299 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17300
17301 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
17302
17303 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17304
17305 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17306
17307 * dispnew.c (scrolling_window): Don't exclude the case that the
17308 last enabled row in the desired matrix touches the bottom boundary.
17309
17310 2011-05-21 Glenn Morris <rgm@gnu.org>
17311
17312 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
17313 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17314 and add some more files.
17315
17316 2011-05-20 Eli Zaretskii <eliz@gnu.org>
17317
17318 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17319 report_file_error introduced by the change from 2011-05-07.
17320
17321 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17322
17323 * systime.h (Time): Define only if emacs is defined.
17324 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17325 where the include path doesn't have X11/X.h by default. See
17326 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17327
17328 2011-05-20 Kenichi Handa <handa@m17n.org>
17329
17330 * composite.c (find_automatic_composition): Fix previous change.
17331
17332 2011-05-20 Glenn Morris <rgm@gnu.org>
17333
17334 * lisp.mk: New file, split from Makefile.in.
17335 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17336 (shortlisp): Remove.
17337 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17338
17339 2011-05-19 Glenn Morris <rgm@gnu.org>
17340
17341 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17342 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17343 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17344 (lisp): Set the order to that of loadup.el.
17345 (shortlisp): Make it a copy of $lisp.
17346 (SOME_MACHINE_LISP): Remove.
17347 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17348 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17349
17350 2011-05-18 Kenichi Handa <handa@m17n.org>
17351
17352 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17353 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17354 (find_automatic_composition): Mostly rewrite for efficiency.
17355
17356 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
17357
17358 * makefile.w32-in: Update dependencies.
17359
17360 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17361
17362 * menu.c: Include limits.h (fixes the MS-Windows build broken by
17363 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
17364
17365 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
17366
17367 Fix some integer overflow issues, such as string length overflow.
17368
17369 * insdel.c (count_size_as_multibyte): Check for string overflow.
17370
17371 * character.c (lisp_string_width): Check for string overflow.
17372 Use EMACS_INT, not int, for string indexes and lengths; in
17373 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17374 the resulting string length overflows an EMACS_INT; instead,
17375 report a string overflow if no precision given. When checking for
17376 precision exhaustion, use a check that cannot possibly have
17377 integer overflow. (Bug#8675)
17378 * character.h (lisp_string_width): Adjust to new signature.
17379
17380 * alloc.c (string_overflow): New function.
17381 (Fmake_string): Use it. This doesn't change behavior, but saves
17382 a few bytes and will simplify future changes.
17383 * character.c (string_escape_byte8): Likewise.
17384 * lisp.h (string_overflow): New decl.
17385
17386 Fixups, following up to the user-interface timestamp change.
17387 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17388 for UI timestamps, instead of unsigned long.
17389 * msdos.c (mouse_get_pos): Likewise.
17390 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
17391 * w32gui.h (Time): Define by including "systime.h" rather than by
17392 declaring it ourselves. (Bug#8664)
17393
17394 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17395 * image.c (clear_image_cache): Likewise.
17396
17397 * term.c (term_mouse_position): Don't assume time_t wraparound.
17398
17399 Be more systematic about user-interface timestamps.
17400 Before, the code sometimes used 'Time', sometimes 'unsigned long',
17401 and sometimes 'EMACS_UINT', to represent these timestamps.
17402 This change causes it to use 'Time' uniformly, as that's what X uses.
17403 This makes the code easier to follow, and makes it easier to catch
17404 integer overflow bugs such as Bug#8664.
17405 * frame.c (Fmouse_position, Fmouse_pixel_position):
17406 Use Time, not unsigned long, for user-interface timestamps.
17407 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17408 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17409 * keyboard.h (last_event_timestamp): Likewise.
17410 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17411 * menu.h (xmenu_show): Likewise.
17412 * term.c (term_mouse_position): Likewise.
17413 * termhooks.h (struct input_event.timestamp): Likewise.
17414 (struct terminal.mouse_position_hook): Likewise.
17415 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17416 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17417 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17418 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17419 what it was before.
17420 * menu.h, termhooks.h: Include "systime.h", for Time.
17421
17422 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17423 Don't assume that the difference between two unsigned long values
17424 can fit into an integer. At this point, we know button_down_time
17425 <= event->timestamp, so the difference must be nonnegative, so
17426 there's no need to cast the result if double-click-time is
17427 nonnegative, as it should be; check that it's nonnegative, just in
17428 case. This bug is triggered when events are more than 2**31 ms
17429 apart (about 25 days). (Bug#8664)
17430
17431 * xselect.c (last_event_timestamp): Remove duplicate decl.
17432 (x_own_selection): Remove needless cast to unsigned long.
17433
17434 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17435 that always fit in int. Use a sentinel instead of a counter, to
17436 avoid a temp and to allay GCC's concerns about possible int overflow.
17437 * frame.h (struct frame): Use int for menu_bar_items_used
17438 instead of EMACS_INT, since it always fits in int.
17439
17440 * menu.c (grow_menu_items): Check for int overflow.
17441
17442 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17443
17444 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17445 Before, the code was not consistent. These values cannot exceed
17446 2**31 - 1 so there's no need to make them unsigned.
17447 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17448 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17449 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17450 as modifiers.
17451 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17452
17453 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17454 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17455 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17456 presumably because the widths might not match.
17457
17458 * window.c (size_window): Avoid needless test at loop start.
17459
17460 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17461
17462 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17463
17464 2011-05-12 Drew Adams <drew.adams@oracle.com>
17465
17466 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17467
17468 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17469
17470 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17471 `width' to `bar_area_x' and `bar_area_width', respectively.
17472 (x_scroll_run): Take account of fringe background extension.
17473
17474 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17475 Rename local vars `left' and `width' to `bar_area_x' and
17476 `bar_area_width', respectively.
17477 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17478 background extension.
17479
17480 2011-05-10 Jim Meyering <meyering@redhat.com>
17481
17482 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17483
17484 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
17485
17486 * image.c (Finit_image_library): Return t for built-in image types,
17487 like pbm and xbm. (Bug#8640)
17488
17489 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17490
17491 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17492
17493 2011-05-07 Eli Zaretskii <eliz@gnu.org>
17494
17495 * w32console.c (Fset_screen_color): Doc fix.
17496 (Fget_screen_color): New function.
17497 (syms_of_ntterm): Defsubr it.
17498
17499 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17500 unlink the temporary file if Fcall_process didn't create it in the
17501 first place.
17502 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17503 child process will be redirected to a file specified with `:file'.
17504 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17505 cue to call_process_cleanup not to close that handle.
17506
17507 2011-05-07 Ben Key <bkey76@gmail.com>
17508
17509 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17510 one of two shell specific rules, either bootstrap-temacs-CMD or
17511 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17512 to the previous implementation of the bootstrap-temacs rule.
17513 The bootstrap-temacs-CMD rule is similar to the previous
17514 implementation of the bootstrap-temacs rule except that it
17515 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17516 variable.
17517
17518 These changes, along with some changes to nt/configure.bat,
17519 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17520 earlier fix to add support for --cflags and --ldflags options
17521 that include quotes so that it works whether make uses cmd or
17522 sh as the shell.
17523
17524 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
17525
17526 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17527 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17528 is a constant.
17529 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17530 a string. Handle both cases.
17531 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17532 (Fdbus_register_method): Use Qinvalid_function.
17533
17534 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17535
17536 * makefile.w32-in: Update dependencies.
17537 (LISP_H): Add inttypes.h and stdin.h.
17538 (PROCESS_H): Add unistd.h.
17539
17540 2011-05-06 Eli Zaretskii <eliz@gnu.org>
17541
17542 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17543 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17544
17545 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
17546
17547 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17548
17549 * term.c (vfatal): Remove stray call to va_end.
17550 It's not needed and the C Standard doesn't allow it here anyway.
17551
17552 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17553 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17554
17555 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17556 bytes.
17557
17558 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17559
17560 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17561
17562 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17563
17564 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17565
17566 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17567
17568 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17569 * charset.c (Fdefine_charset_internal): Don't initialize
17570 charset.code_space[15]. The value was garbage, on hosts with
17571 32-bit int (Bug#8600).
17572
17573 * lread.c (read_integer): Be more consistent with string-to-number.
17574 Use string_to_number to do the actual conversion; this avoids
17575 rounding errors and fixes some other screwups. Without this fix,
17576 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17577 (digit_to_number): Move earlier, for benefit of read_integer.
17578 Return -1 if the digit is out of range for the base, -2 if it is
17579 not a digit in any supported base. (Bug#8602)
17580
17581 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17582
17583 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17584 to match comment at start of function. This also removes a
17585 GCC warning about overflow in a 32+64-bit port.
17586
17587 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17588
17589 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17590 Reported by Stefan Monnier in
17591 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
17592 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17593 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
17594
17595 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17596 (EMACS_UINTPTR): Likewise, with uintptr_t.
17597
17598 * lisp.h: Prefer 64-bit EMACS_INT if available.
17599 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17600 on 32-bit hosts that have 64-bit int, so that they can access
17601 large files.
17602 However, temporarily disable this change unless the temporary
17603 symbol WIDE_EMACS_INT is defined.
17604
17605 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17606
17607 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17608 This removes an assumption that EMACS_INT and long are the same
17609 width as pointers. The assumption is true for Emacs porting targets
17610 now, but we want to make other targets possible.
17611 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17612 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17613 In the rest of the code, change types of integers that hold casted
17614 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17615 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17616 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17617 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17618 No need to cast type when ORing.
17619 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17620 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17621 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17622 assume EMACS_INT is the same width as char *.
17623 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17624 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17625 Remove no-longer-needed casts.
17626 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17627 (xg_tool_bar_help_callback, xg_make_tool_item):
17628 Use EMACS_INTPTR to hold an integer
17629 that will be cast to void *; this can avoid a GCC warning
17630 if EMACS_INT is not the same width as void *.
17631 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17632 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17633 (current_message_1, set_message_1):
17634 Use a local to convert to proper width without a cast.
17635 * xmenu.c (dialog_selection_callback): Likewise.
17636
17637 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17638 Also, don't assume VALBITS / RAND_BITS is less than 5,
17639 and don't rely on undefined behavior when shifting a 1 left into
17640 the sign bit.
17641 * lisp.h (get_random): Change signature to match.
17642
17643 * lread.c (hash_string): Use size_t, not int, for hash computation.
17644 Normally we prefer signed values; but hashing is special, because
17645 it's better to use unsigned division on hash table sizes so that
17646 the remainder is nonnegative. Also, size_t is the natural width
17647 for hashing into memory. The previous code used 'int', which doesn't
17648 retain enough info to hash well into very large tables.
17649 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17650
17651 * dbusbind.c: Don't possibly lose pointer info when converting.
17652 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17653 Use XPNTR rather than XHASH, so that the high-order bits of
17654 the pointer aren't lost when converting through void *.
17655
17656 * eval.c (Fautoload): Don't double-shift a pointer.
17657
17658 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17659
17660 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
17661
17662 * gnutls.c (DEF_GNUTLS_FN):
17663 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17664
17665 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17666
17667 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17668 marker. (Bug#8610)
17669
17670 2011-05-05 Eli Zaretskii <eliz@gnu.org>
17671
17672 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17673 New version that can reserve upto 2GB of heap space.
17674
17675 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
17676
17677 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17678
17679 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17680
17681 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17682 `gnutls_certificate_set_x509_key_file'.
17683
17684 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
17685
17686 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17687 Update dependencies.
17688
17689 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17690
17691 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17692 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17693 Remove unused parameter `fildes'.
17694 * process.c (read_process_output, send_process): Don't pass it.
17695
17696 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17697
17698 Fix previous change: the library cache is defined in w32.c.
17699 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17700 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17701
17702 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
17703
17704 Implement dynamic loading of GnuTLS on Windows.
17705
17706 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17707 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17708 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17709 Declare.
17710
17711 * gnutls.c (Qgnutls_dll): Define.
17712 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17713 (gnutls_*): Declare function pointers.
17714 (init_gnutls_functions): New function to initialize function pointers.
17715 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17716 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17717 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17718 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17719 (emacs_gnutls_write, emacs_gnutls_read)
17720 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17721 (Fgnutls_available_p): New function.
17722 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17723 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17724 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17725
17726 * image.c: Include w32.h.
17727 (Vimage_type_cache): Delete.
17728 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17729 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17730 (w32_delayed_load): Move to w32.c.
17731
17732 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17733
17734 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17735 (w32_delayed_load): Move from image.c. When loading a library, record
17736 its filename in the :loaded-from property of the library id.
17737 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17738 Initialize and staticpro them.
17739 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17740
17741 * process.c: Include lisp.h before w32.h, not after.
17742 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17743 instead of gnutls_record_check_pending.
17744
17745 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17746
17747 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17748
17749 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17750 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17751 as passed in.
17752
17753 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17754
17755 * xterm.c (x_set_frame_alpha): Do not set property on anything
17756 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17757
17758 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17759
17760 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17761
17762 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
17763
17764 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17765 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17766 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17767 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17768 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17769 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17770 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
17771 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
17772 (Qgnutls_bootprop_callbacks_verify): Make static.
17773
17774 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
17775
17776 * callproc.c: Indentation fixup.
17777
17778 * sysdep.c (wait_for_termination_1): Make static.
17779 (wait_for_termination, interruptible_wait_for_termination):
17780 Move after wait_for_termination_1.
17781
17782 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
17783
17784 * sysdep.c (interruptible_wait_for_termination): New function
17785 which is like wait_for_termination, but allows keyboard
17786 interruptions.
17787
17788 * callproc.c (Fcall_process): Add (:file "file") as an option for
17789 the STDOUT buffer.
17790 (Fcall_process_region): Ditto.
17791
17792 2011-04-30 Eli Zaretskii <eliz@gnu.org>
17793
17794 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
17795 rather than `XVECTOR (FOO)->size'.
17796
17797 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
17798 inttypes.h, as a gnulib replacement is used if it not available in
17799 system headers.
17800
17801 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17802
17803 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
17804 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
17805 of MOST_POSITIVE_FIXNUM. (Bug#8528)
17806
17807 * coding.c (coding_alloc_by_realloc): Error out if destination
17808 will grow beyond MOST_POSITIVE_FIXNUM.
17809 (decode_coding_emacs_mule): Abort if there isn't enough place in
17810 charbuf for the composition carryover bytes. Reserve an extra
17811 space for up to 2 characters produced in a loop.
17812 (decode_coding_iso_2022): Abort if there isn't enough place in
17813 charbuf for the composition carryover bytes.
17814
17815 2011-04-21 Eli Zaretskii <eliz@gnu.org>
17816
17817 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
17818 aborting when %lld or %lll format is passed.
17819 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
17820 %llo or %llx format is passed. (Bug#8545)
17821
17822 * window.c (window_scroll_line_based): Use a marker instead of
17823 simple variables to record original value of point. (Bug#7952)
17824
17825 * doprnt.c (doprnt): Fix the case where a multibyte sequence
17826 produced by %s or %c overflows available buffer space. (Bug#8545)
17827
17828 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
17829
17830 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
17831 (SIZE_MAX): Move defn after all includes, as they might #define it.
17832
17833 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17834
17835 * w32.c (init_environment): Warn about defaulting HOME to C:\.
17836
17837 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17838
17839 * keyboard.c (Qdelayed_warnings_hook): Define.
17840 (command_loop_1): Run `delayed-warnings-hook'
17841 if Vdelayed_warnings_list is non-nil.
17842 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
17843 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
17844
17845 2011-04-28 Eli Zaretskii <eliz@gnu.org>
17846
17847 * doprnt.c (doprnt): Don't return value smaller than the buffer
17848 size if the message was truncated. (Bug#8545).
17849
17850 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
17851
17852 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
17853 (Fx_window_property): #if-0 the whole functions, not just the bodies.
17854
17855 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17856
17857 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
17858
17859 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
17860
17861 * makefile.w32-in: Update dependencies.
17862
17863 2011-04-27 Eli Zaretskii <eliz@gnu.org>
17864
17865 Improve `doprnt' and its usage. (Bug#8545)
17866 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
17867 `format_end'. Remove support for %l as a conversion specifier.
17868 Don't use xrealloc. Improve diagnostics when the %l size modifier
17869 is used. Update the commentary.
17870
17871 * eval.c (verror): Simplify calculation of size_t.
17872
17873 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
17874 messages.
17875
17876 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
17877
17878 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
17879 change.
17880
17881 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
17882
17883 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
17884 This makes this file independent of the recent pseudovector change.
17885
17886 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
17887
17888 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
17889
17890 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
17891 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
17892 Remove unused local.
17893 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
17894
17895 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
17896 GCC 4.6.0 optimizes based on type-based alias analysis.
17897 For example, if b is of type struct buffer * and v of type struct
17898 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
17899 != &v->size, and therefore "v->size = 1; b->size = 2; return
17900 v->size;" must therefore return 1. This assumption is incorrect
17901 for Emacs, since it type-puns struct Lisp_Vector * with many other
17902 types. To fix this problem, this patch adds a new type struct
17903 vectorlike_header that documents the constraints on layout of vectors
17904 and pseudovectors, and helps optimizing compilers not get fooled
17905 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
17906 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
17907 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
17908 the size member.
17909 (XSETPVECTYPE): Rewrite in terms of new macro.
17910 (XSETPVECTYPESIZE): New macro, specifying both type and size.
17911 This is a bit clearer, and further avoids the possibility of
17912 undesirable aliasing.
17913 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
17914 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
17915 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17916 since Lisp_Subr is a special case (no "next" field).
17917 (ASIZE): Now uses header.size rather than size.
17918 All previous uses of XVECTOR (foo)->size replaced to use this macro,
17919 to avoid the hassle of writing XVECTOR (foo)->header.size.
17920 (struct vectorlike_header): New type.
17921 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17922 object, to help avoid aliasing.
17923 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17924 (SUBRP): Likewise, since Lisp_Subr is a special case.
17925 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17926 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17927 (struct Lisp_Hash_Table): Combine first two members into a single
17928 struct vectorlike_header member. All uses of "size" and "next" members
17929 changed to be "header.size" and "header.next".
17930 * buffer.h (struct buffer): Likewise.
17931 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17932 * frame.h (struct frame): Likewise.
17933 * process.h (struct Lisp_Process): Likewise.
17934 * termhooks.h (struct terminal): Likewise.
17935 * window.c (struct save_window_data, struct saved_window): Likewise.
17936 * window.h (struct window): Likewise.
17937 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17938 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17939 * buffer.c (init_buffer_once): Likewise.
17940 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17941 special case.
17942 * process.c (Fformat_network_address): Use local var for size,
17943 for brevity.
17944
17945 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17946
17947 Make the Lisp reader and string-to-float more consistent (Bug#8525)
17948 * data.c (atof): Remove decl; no longer used or needed.
17949 (digit_to_number): Move to lread.c.
17950 (Fstring_to_number): Use new string_to_number function, to be
17951 consistent with how the Lisp reader treats infinities and NaNs.
17952 Do not assume that floating-point numbers represent EMACS_INT
17953 without losing information; this is not true on most 64-bit hosts.
17954 Avoid double-rounding errors, by insisting on integers when
17955 parsing non-base-10 numbers, as the documentation specifies.
17956 * lisp.h (string_to_number): New decl, replacing ...
17957 (isfloat_string): Remove.
17958 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
17959 (read1): Do not accept +. and -. as integers; this
17960 appears to have been a coding error. Similarly, do not accept
17961 strings like +-1e0 as floating point numbers. Do not report
17962 overflow for integer overflows unless the base is not 10 which
17963 means we have no simple and reliable way to continue.
17964 Break out the floating-point parsing into a new
17965 function string_to_number, so that Fstring_to_number parses
17966 floating point numbers consistently with the Lisp reader.
17967 (digit_to_number): Move here from data.c. Make it static inline.
17968 (E_CHAR, EXP_INT): Remove, replacing with ...
17969 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17970 (string_to_number): New function, replacing isfloat_string.
17971 This function checks for valid syntax and produces the resulting
17972 Lisp float number too. Rework it so that string-to-number
17973 no longer mishandles examples like "1.0e+". Use strtoumax,
17974 so that overflow for non-base-10 numbers is reported only when
17975 there's no portable and simple way to convert to floating point.
17976
17977 * textprop.c (set_text_properties_1): Rewrite for clarity,
17978 and to avoid GCC warning about integer overflow.
17979
17980 * intervals.h (struct interval): Use EMACS_INT for members
17981 where EMACS_UINT might cause problems. See
17982 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17983 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17984 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17985 All uses changed.
17986 (offset_intervals): Tell GCC not to worry about length overflow
17987 when negating a negative length.
17988
17989 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17990 (overrun_check_free): Likewise.
17991
17992 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17993 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17994 word size.
17995
17996 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17997 (gnutls_make_error): Rename local to avoid shadowing.
17998 (gnutls_emacs_global_deinit): ifdef out; not used.
17999 (Fgnutls_boot): Use const for pointer to readonly storage.
18000 Comment out unused local. Fix pointer signedness problems.
18001
18002 * lread.c (openp): Don't stuff size_t into an 'int'.
18003 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18004 about possible signed overflow.
18005
18006 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18007 (GDK_KEY_g): Don't define if already defined.
18008 (xg_prepare_tooltip): Avoid pointer signedness problem.
18009 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18010
18011 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18012 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18013
18014 * xfns.c (Fx_window_property): Simplify a bit,
18015 to make a bit faster and to avoid GCC 4.6.0 warning.
18016 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18017
18018 * fns.c (internal_equal): Don't assume size_t fits in int.
18019
18020 * alloc.c (compact_small_strings): Tighten assertion a little.
18021
18022 Replace pEd with more-general pI, and fix some printf arg casts.
18023 * lisp.h (pI): New macro, generalizing old pEd macro to other
18024 conversion specifiers. For example, use "...%"pI"d..." rather
18025 than "...%"pEd"...".
18026 (pEd): Remove. All uses replaced with similar uses of pI.
18027 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
18028 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18029 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18030 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18031 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18032 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18033 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18034 64-bit hosts.
18035 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18036 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18037 * print.c (safe_debug_print, print_object): Likewise.
18038 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18039 to int.
18040 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18041 avoiding the 0 flag, which is not portable.
18042 * process.c (Fmake_network_process): Use pI to avoid cast.
18043 * region-cache.c (pp_cache): Likewise.
18044 * xdisp.c (decode_mode_spec): Likewise.
18045 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18046 behavior on 64-bit hosts with printf arg.
18047 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
18048 (x_stop_queuing_selection_requests): Likewise.
18049 (x_get_window_property): Don't truncate byte count to an 'int'
18050 when tracing.
18051
18052 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18053 here, since it parses constructs like leading '-' and spaces,
18054 which are not wanted; and it overflows with large numbers.
18055 Instead, simply match F[0-9]+, which is what is wanted anyway.
18056
18057 * alloc.c: Remove unportable assumptions about struct layout.
18058 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18059 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18060 (allocate_vectorlike, make_pure_vector): Use the new macros,
18061 plus offsetof, to remove unportable assumptions about struct layout.
18062 These assumptions hold on all porting targets that I know of, but
18063 they are not guaranteed, they're easy to remove, and removing them
18064 makes further changes easier.
18065
18066 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18067 This doesn't fix a bug but makes the code clearer.
18068 (string_overrun_cookie): Now const. Use initializers that
18069 don't formally overflow signed char, to avoid warnings.
18070 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18071 can cause Emacs to crash when string overrun checking is enabled.
18072 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18073 multiple of sizeof (EMACS_INT); it need not be, if
18074 alignof(EMACS_INT) < sizeof (EMACS_INT).
18075 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
18076
18077 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
18078
18079 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18080
18081 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18082
18083 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
18084 supposed to be handshaking. (Bug#8556)
18085 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18086
18087 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
18088
18089 * lisp.h (Qdebug): List symbol.
18090 * eval.c (Qdebug): Restore global linkage.
18091 * keyboard.c (debug-on-event): New variable.
18092 (handle_user_signal): Break into debugger when debug-on-event
18093 matches the current signal symbol.
18094
18095 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18096
18097 * alloc.c (check_sblock, check_string_bytes)
18098 (check_string_free_list): Convert to standard C.
18099
18100 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18101
18102 * w32.c (emacs_gnutls_push): Fix typo.
18103
18104 2011-04-25 Eli Zaretskii <eliz@gnu.org>
18105
18106 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18107 "cast to pointer from integer of different size".
18108
18109 Improve doprnt and its use in verror. (Bug#8545)
18110 * doprnt.c (doprnt): Document the set of format control sequences
18111 supported by the function. Use SAFE_ALLOCA instead of always
18112 using `alloca'.
18113
18114 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18115 is one byte too soon. Don't use xrealloc; instead xfree and
18116 xmalloc anew.
18117
18118 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18119
18120 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18121 callbacks stage.
18122
18123 * gnutls.c: Renamed global_initialized to
18124 gnutls_global_initialized. Added internals for the
18125 :verify-hostname-error, :verify-error, and :verify-flags
18126 parameters of `gnutls-boot' and documented those parameters in the
18127 docstring. Start callback support.
18128 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18129 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18130 on error. Return error code.
18131 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18132 (emacs_gnutls_read): Likewise.
18133 (Fgnutls_boot): Return handshake error code.
18134 (emacs_gnutls_handle_error): New function.
18135 (wsaerror_to_errno): Likewise.
18136
18137 * w32.h (emacs_gnutls_pull): Add prototype.
18138 (emacs_gnutls_push): Likewise.
18139
18140 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18141 (emacs_gnutls_push): Likewise.
18142
18143 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18144
18145 * process.c (wait_reading_process_output): Check if GnuTLS
18146 buffered some data internally if no FDs are set for TLS
18147 connections.
18148
18149 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18150 (LIBS): Link to USER_LIBS.
18151 ($(BLD)/gnutls.$(0)): New target.
18152
18153 2011-04-24 Eli Zaretskii <eliz@gnu.org>
18154
18155 * xdisp.c (handle_single_display_spec): Rename the
18156 display_replaced_before_p argument into display_replaced_p, to
18157 make it consistent with the commentary. Fix typos in the
18158 commentary.
18159
18160 * textprop.c (syms_of_textprop): Remove dead code.
18161 (copy_text_properties): Delete obsolete commentary about an
18162 interface that was deleted long ago. Fix typos in the description
18163 of arguments.
18164
18165 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18166 to changes in oldXMenu/XMenu.h from 2011-04-16.
18167 <menu_help_message, prev_menu_help_message>: Constify.
18168 (IT_menu_make_room): menu->help_text is now `const char **';
18169 adjust.
18170
18171 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18172 to changes in oldXMenu/XMenu.h from 2011-04-16.
18173 (struct XMenu): Declare `help_text' `const char **'.
18174
18175 * xfaces.c <Qunspecified>: Make extern again.
18176
18177 * syntax.c: Include sys/types.h before including regex.h, as
18178 required by POSIX.
18179
18180 * doc.c (get_doc_string): Improve the format passed to `error'.
18181
18182 * doprnt.c (doprnt): Improve commentary.
18183
18184 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18185
18186 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18187 them with etags.
18188
18189 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18190 changes in globals.h immediately force recompilation.
18191 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18192 $(CURDIR)/s/ms-w32.h.
18193 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
18194
18195 * character.c (Fchar_direction): Function deleted.
18196 (syms_of_character): Don't defsubr it.
18197 <char-direction-table>: Deleted.
18198
18199 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18200
18201 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18202 * doprnt.c: Include limits.h.
18203 (SIZE_MAX): New macro.
18204 (doprnt): Return a size_t value. 2nd arg is now size_t.
18205 Many local variables are now size_t instead of int or unsigned.
18206 Improve overflow protection. Support `l' modifier for integer
18207 conversions. Support %l conversion. Don't assume an EMACS_INT
18208 argument for integer conversions and for %c.
18209
18210 * lisp.h (doprnt): Restore prototype.
18211
18212 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18213 $(SRC)/character.h.
18214
18215 * Makefile.in (base_obj): Add back doprnt.o.
18216
18217 * deps.mk (doprnt.o): Add back prerequisites.
18218 (callint.o): Depend on character.h.
18219
18220 * eval.c (internal_lisp_condition_case): Include the handler
18221 representation in the error message.
18222 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18223 when breaking from the loop.
18224
18225 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18226
18227 * callint.c (Fcall_interactively): When displaying error message
18228 about invalid control letter, pass the character's codepoint, not
18229 a pointer to its multibyte form. Improve display of the character
18230 in octal and display also its hex code.
18231
18232 * character.c (char_string): Use %x to display the (unsigned)
18233 codepoint of an invalid character, to avoid displaying a bogus
18234 negative value.
18235
18236 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18237 `error', not SYMBOL_NAME itself.
18238
18239 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18240 character arguments to `error'.
18241
18242 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18243 to `error' in error message about FINAL_CHAR argument. Make sure
18244 FINAL_CHAR is a character, and use %c when it is passed as
18245 argument to `error'.
18246
18247 2011-04-23 Eli Zaretskii <eliz@gnu.org>
18248
18249 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18250
18251 * w32.c: Include <time.h>.
18252 (sys_localtime): New function.
18253
18254 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
18255
18256 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18257
18258 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
18259
18260 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
18261
18262 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18263 zombies (Bug#8467).
18264
18265 2011-04-19 Eli Zaretskii <eliz@gnu.org>
18266
18267 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18268 gl_state.e_property when gl_state.object is Qt.
18269
18270 * insdel.c (make_gap_larger): Remove limitation of buffer size
18271 to <= INT_MAX.
18272
18273 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
18274
18275 * xdisp.c (lookup_glyphless_char_display)
18276 (produce_glyphless_glyph): Handle cons cell entry in
18277 glyphless-char-display.
18278 (Vglyphless_char_display): Document it.
18279
18280 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18281 glyphless-char-display.
18282
18283 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
18284
18285 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18286
18287 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18288
18289 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18290 definition for no-X builds.
18291
18292 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
18293
18294 Static checks with GCC 4.6.0 and non-default toolkits.
18295
18296 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18297
18298 * process.c (keyboard_bit_set): Define only if SIGIO.
18299 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18300 (send_process): Repair possible setjmp clobbering.
18301
18302 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18303
18304 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18305
18306 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18307
18308 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18309 Define only if needed.
18310
18311 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18312 by pacifying GCC about it. Maybe it's time to retire it?
18313 * xfaces.c (USG, __TIMEVAL__): Likewise.
18314
18315 * dispextern.h (struct redisplay_interface): Rename param
18316 to avoid shadowing.
18317 * termhooks.h (struct terminal): Likewise.
18318 * xterm.c (xembed_send_message): Likewise.
18319
18320 * insdel.c (make_gap_smaller): Define only if
18321 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18322
18323 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18324 it.
18325
18326 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18327 so that we aren't warned about unused symbols.
18328
18329 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18330
18331 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
18332
18333 * xfns.c (x_real_positions): Mark locals as initialized.
18334
18335 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18336
18337 * xterm.c: Fix problems found by static analysis with other toolkits.
18338 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
18339 (x_dispatch_event): Declare static if USE_GTK, and
18340 define if USE_GTK || USE_X_TOOLKIT.
18341 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
18342 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
18343 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18344 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
18345
18346 * xmenu.c (menu_help_callback): Pointer type fixes.
18347 Use const pointers when pointing at readonly data. Avoid pointer
18348 signedness clashes.
18349 (FALSE): Remove unused macro.
18350 (update_frame_menubar): Remove unused decl.
18351
18352 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18353
18354 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18355 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18356 (single_menu_item): Rename local to avoid shadowing.
18357
18358 * keyboard.c (make_lispy_event): Remove unused local var.
18359
18360 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18361 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18362
18363 * bitmaps: Change bitmaps from unsigned char back to the X11
18364 compatible char. Avoid the old compiler warnings about
18365 out-of-range initializers by using, for example, '\xab' rather
18366 than 0xab.
18367
18368 * xgselect.c (xgselect_initialize): Check vs interface
18369 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18370
18371 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18372
18373 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18374 to read-only memory.
18375
18376 * fns.c (vector): Remove; this old hack is no longer needed.
18377
18378 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
18379 Remove unused var.
18380 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
18381
18382 * xrdb.c (x_load_resources): Omit unused local.
18383
18384 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
18385 (x_window): Rename locals to avoid shadowing.
18386 (USG): Use the kludged USG macro, to pacify gcc.
18387
18388 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
18389 (x_term_init): Remove local to avoid shadowing.
18390
18391 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
18392
18393 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18394 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18395
18396 2011-04-16 Eli Zaretskii <eliz@gnu.org>
18397
18398 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18399
18400 Fix regex.c, syntax.c and friends for buffers > 2GB.
18401 * syntax.h (struct gl_state_s): Declare character position members
18402 EMACS_INT.
18403
18404 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18405
18406 * textprop.c (verify_interval_modification, interval_of):
18407 Declare arguments EMACS_INT.
18408
18409 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18410 EMACS_INT.
18411
18412 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18413
18414 * indent.c (Fvertical_motion): Local variable it_start is now
18415 EMACS_INT.
18416
18417 * regex.c (re_match, re_match_2, re_match_2_internal)
18418 (bcmp_translate, regcomp, regexec, print_double_string)
18419 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18420 (re_compile_pattern, re_exec): Declare arguments and local
18421 variables `size_t' and `ssize_t' and return values `regoff_t', as
18422 appropriate.
18423 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18424 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18425 <compile_stack_type>: `size' and `avail' are now `size_t'.
18426
18427 * regex.h <regoff_t>: Use ssize_t, not int.
18428 (re_search, re_search_2, re_match, re_match_2): Arguments that
18429 specify buffer/string position and length are now ssize_t and
18430 size_t. Return type is regoff_t.
18431
18432 2011-04-16 Ben Key <bkey76@gmail.com>
18433
18434 * nsfont.m: Fixed bugs in ns_get_family and
18435 ns_descriptor_to_entity that were caused by using free to
18436 deallocate memory blocks that were allocated by xmalloc (via
18437 xstrdup). This caused Emacs to crash when compiled with
18438 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18439 --enable-checking=xmallocoverrun). xfree is now used to
18440 deallocate these memory blocks.
18441
18442 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
18443
18444 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18445
18446 emacs_write: Accept and return EMACS_INT for sizes.
18447 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18448 et seq.
18449 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18450 Accept and return EMACS_INT.
18451 (emacs_gnutls_write): Return the number of bytes written on
18452 partial writes.
18453 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
18454 (emacs_read, emacs_write): Remove check for negative size, as the
18455 Emacs source code has been audited now.
18456 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18457 (emacs_read, emacs_write): Use it.
18458 * process.c (send_process): Adjust to the new signatures of
18459 emacs_write and emacs_gnutls_write. Do not attempt to store
18460 a byte offset into an 'int'; it might overflow.
18461 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
18462
18463 * sound.c: Don't assume sizes fit in 'int'.
18464 (struct sound_device.period_size, alsa_period_size):
18465 Return EMACS_INT, not int.
18466 (struct sound_device.write, vox_write, alsa_write):
18467 Accept EMACS_INT, not int.
18468 (wav_play, au_play): Use EMACS_INT to store sizes and to
18469 record read return values.
18470
18471 2011-04-15 Ben Key <bkey76@gmail.com>
18472
18473 * keyboard.c (Qundefined): Don't declare static since it is used
18474 in nsfns.m.
18475 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18476 static since they are used in nsfont.m.
18477
18478 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18479
18480 * process.c (Qprocessp): Don't declare static.
18481 * lisp.h (Qprocessp): Declare again.
18482
18483 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
18484
18485 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18486
18487 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18488
18489 Improve C-level modularity by making more things 'static'.
18490
18491 Don't publish debugger-only interfaces to other modules.
18492 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18493 (verify_bytepos, count_markers): Move decls to the only modules
18494 that need them.
18495 * region-cache.h (pp_cache): Likewise.
18496 * window.h (check_all_windows): Likewise.
18497 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18498
18499 * sysdep.c (croak): Now static, if
18500 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18501 * syssignal.h (croak): Declare only if not static.
18502
18503 * alloc.c (refill_memory_reserve): Now static if
18504 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18505 * lisp.h (refill_memory_reserve): Declare only if not static.
18506
18507 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18508 Define only if USE_LUCID.
18509
18510 * xrdb.c (x_customization_string, x_rm_string): Now static.
18511
18512 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18513 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18514
18515 * xdisp.c (draw_row_with_mouse_face): Now static.
18516 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18517
18518 * window.h (check_all_windows): Mark externally visible.
18519
18520 * window.c (window_deletion_count): Now static.
18521
18522 * undo.c: Make symbols static if they're not exported.
18523 (last_undo_buffer, last_boundary_position, pending_boundary):
18524 Now static.
18525
18526 * textprop.c (interval_insert_behind_hooks): Now static.
18527 (interval_insert_in_front_hooks): Likewise.
18528
18529 * term.c: Make symbols static if they're not exported.
18530 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18531 (max_frame_lines, tty_set_terminal_modes):
18532 (tty_reset_terminal_modes, tty_turn_off_highlight):
18533 (get_tty_terminal): Now static.
18534 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18535 * termhooks.h (term_mouse_moveto): Do not declare if
18536 HAVE_WINDOW_SYSTEM.
18537 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18538 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18539
18540 * sysdep.c: Make symbols static if they're not exported.
18541 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18542 Now static.
18543 (sigprocmask_set, full_mask): Remove; unused.
18544 (wait_debugging): Mark as visible.
18545 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18546 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18547
18548 * syntax.c (syntax_temp): Define only if !__GNUC__.
18549
18550 * sound.c (current_sound_device, current_sound): Now static.
18551
18552 * search.c (searchbufs, searchbuf_head): Now static.
18553
18554 * scroll.c (scroll_cost): Remove; unused.
18555 * dispextern.h (scroll_cost): Remove decl.
18556
18557 * region-cache.h (pp_cache): Mark as externally visible.
18558
18559 * process.c: Make symbols static if they're not exported.
18560 (process_tick, update_tick, create_process, chan_process):
18561 (Vprocess_alist, proc_buffered_char, datagram_access):
18562 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18563 (deactivate_process): Mark defn as static, as well as decl.
18564 * lisp.h (create_process): Remove decl.
18565 * process.h (chan_process, Vprocess_alist): Remove decls.
18566
18567 * print.c: Make symbols static if they're not exported.
18568 (print_depth, new_backquote_output, being_printed, print_buffer):
18569 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18570 (print_interval, print_number_index, initial_stderr_stream):
18571 Now static.
18572 * lisp.h (Fprinc): Remove decl.
18573 (debug_output_compilation_hack): Mark as externally visible.
18574
18575 * sysdep.c (croak): Move decl from here to syssignal.h.
18576 * syssignal.h (croak): Put it here, so the API can be checked when
18577 'croak' is called from dissociate_if_controlling_tty.
18578
18579 * minibuf.c: Make symbols static if they're not exported.
18580 (minibuf_save_list, choose_minibuf_frame): Now static.
18581 * lisp.h (choose_minibuf_frame): Remove decl.
18582
18583 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18584
18585 * lread.c: Make symbols static if they're not exported.
18586 (read_objects, initial_obarray, oblookup_last_bucket_number):
18587 Now static.
18588 (make_symbol): Remove; unused.
18589 * lisp.h (initial_obarray, make_symbol): Remove decls.
18590
18591 * keyboard.c: Make symbols static if they're not exported.
18592 (single_kboard, recent_keys_index, total_keys, recent_keys):
18593 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18594 (this_single_command_key_start, echoing, last_auto_save):
18595 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18596 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18597 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18598 (Vlispy_mouse_stem, double_click_count):
18599 Now static.
18600 (force_auto_save_soon): Define only if SIGDANGER.
18601 (ignore_mouse_drag_p): Now static if
18602 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18603 (print_help): Remove; unused.
18604 (stop_character, last_timer_event): Mark as externally visible.
18605 * keyboard.h (ignore_mouse_drag_p): Declare only if
18606 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18607 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18608 * lisp.h (echoing): Remove decl.
18609 (force_auto_save_soon): Declare only if SIGDANGER.
18610 * xdisp.c (redisplay_window): Simplify code, to make it more
18611 obvious that ignore_mouse_drag_p is not accessed if !defined
18612 USE_GTK && !defined HAVE_NS.
18613
18614 * intervals.c: Make symbols static if they're not exported.
18615 (merge_properties_sticky, merge_interval_right, delete_interval):
18616 Now static.
18617 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18618
18619 * insdel.c: Make symbols static if they're not exported.
18620 However, leave prepare_to_modify_buffer alone. It's never
18621 called from outside this function, but that appears to be a bug.
18622 (combine_after_change_list, combine_after_change_buffer):
18623 (adjust_after_replace, signal_before_change): Now static.
18624 (adjust_after_replace_noundo): Remove; unused.
18625 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
18626 (signal_before_change): Remove decls.
18627
18628 * indent.c (val_compute_motion, val_vmotion): Now static.
18629
18630 * image.c: Make symbols static if they're not exported.
18631 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18632 if USE_GTK.
18633 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18634 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18635
18636 * fringe.c (standard_bitmaps): Now static.
18637 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18638
18639 * frame.c: Make symbols static if they're not exported.
18640 (x_report_frame_params, make_terminal_frame): Now static.
18641 (get_frame_param): Now static, unless HAVE_NS.
18642 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18643 (x_get_resource_string): Remove; not used.
18644 * frame.h (make_terminal_frame, x_report_frame_params):
18645 (x_get_resource_string); Remove decls.
18646 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18647 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18648
18649 * font.c, fontset.c: Make symbols static if they're not exported.
18650 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18651 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18652 * font.c (font_close_object): Now static.
18653 * font.h (font_close_object): Remove.
18654 * fontset.c (FONTSET_OBJLIST): Remove.
18655 (free_realized_fontset) #if-0 the body, which does nothing.
18656 (face_suitable_for_char_p): #if-0, as it's never called.
18657 * fontset.h (face_suitable_for_char_p): Remove decl.
18658 * xfaces.c (face_at_string_position):
18659 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
18660 since 0 is always ASCII.
18661
18662 * fns.c (weak_hash_tables): Now static.
18663
18664 * fileio.c: Make symbols static if they're not exported.
18665 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18666 (Vwrite_region_annotation_buffers): Now static.
18667
18668 * eval.c: Make symbols static if they're not exported.
18669 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18670 * lisp.h (backtrace_list): Remove decl.
18671
18672 * emacs.c: Make symbols static if they're not exported.
18673 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18674 (fatal_error_code, fatal_error_signal_hook, standard_args):
18675 Now static.
18676 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18677 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18678 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18679 * lisp.h (fatal_error_signal_hook): Remove decl.
18680 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18681
18682 * editfns.c: Move a (normally-unused) function to its only use.
18683 * editfns.c, lisp.h (get_operating_system_release): Remove.
18684 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18685 worth the hassle of breaking this out.
18686
18687 * xterm.c: Make symbols static if they're not exported.
18688 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18689 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18690 (x_destroy_window, x_delete_display):
18691 Now static.
18692 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18693 (x_mouse_leave): Remove; unused.
18694 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18695 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18696 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18697 Remove decls.
18698 (x_mouse_leave): Declare only if WINDOWSNT.
18699 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18700 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18701 USE_X_TOOLKIT.
18702
18703 * ftxfont.c: Make symbols static if they're not exported.
18704 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18705 HAVE_FREETYPE.
18706 * font.h (ftxfont_driver): Likewise.
18707
18708 * xfns.c: Make symbols static if they're not exported.
18709 (x_last_font_name, x_display_info_for_name):
18710 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18711 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18712 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18713 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18714 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18715 (last_show_tip_args): Now static.
18716 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18717 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18718 (x_screen_planes): Remove; unused.
18719 * dispextern.h (x_screen_planes): Remove decl.
18720
18721 * dispnew.c: Make symbols static if they're not exported.
18722 * dispextern.h (redraw_garbaged_frames, scrolling):
18723 (increment_row_positions): Remove.
18724 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18725 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18726 Now static.
18727 (redraw_garbaged_frames): Remove; unused.
18728
18729 * xfaces.c: Make symbols static if they're not exported.
18730 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18731 Remove decls.
18732 * xterm.h (defined_color): Remove decls.
18733 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18734 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18735 (menu_face_changed_default, defined_color, free_realized_face):
18736 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18737 (ascii_face_of_lisp_face): Remove; unused.
18738
18739 * xdisp.c: Make symbols static if they're not exported.
18740 * dispextern.h (scratch_glyph_row, window_box_edges):
18741 (glyph_to_pixel_coords, set_cursor_from_row):
18742 (get_next_display_element, set_iterator_to_next):
18743 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18744 (show_mouse_face): Remove decls
18745 * frame.h (message_buf_print): Likewise.
18746 * lisp.h (pop_message, set_message, check_point_in_composition):
18747 Likewise.
18748 * xterm.h (set_vertical_scroll_bar): Likewise.
18749 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18750 (message_buf_print, scratch_glyph_row, displayed_buffer):
18751 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18752 (get_next_display_element, show_mouse_face, window_box_edges):
18753 (frame_to_window_pixel_xy, check_point_in_composition):
18754 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18755 (glyph_to_pixel_coords): Remove; unused.
18756
18757 * dired.c (file_name_completion): Now static.
18758
18759 * dbusbind.c (xd_in_read_queued_messages): Now static.
18760
18761 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18762 * data.c (circular_list_error): Remove.
18763
18764 * commands.h (last_point_position, last_point_position_buffer):
18765 (last_point_position_window): Remove decls.
18766 * keyboard.c: Make these variables static.
18767
18768 * coding.h (coding, code_convert_region, encode_coding_gap):
18769 Remove decls.
18770 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
18771 (iso_code_class, detect_coding, code_convert_region): Now static.
18772 (encode_coding_gap): Remove; unused.
18773
18774 * chartab.c (chartab_chars, chartab_bits): Now static.
18775
18776 * charset.h (charset_iso_8859_1): Remove decl.
18777 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
18778 Now static.
18779
18780 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
18781 * ccl.c (Vccl_program_table): Now static.
18782 (check_ccl_update): Remove; unused.
18783
18784 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
18785 * category.h: ... from here.
18786 * category.c (check_category_table, set_category_set): Now static.
18787
18788 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
18789 * lisp.h: Remove these decls.
18790
18791 * buffer.c (buffer_count): Remove unused var.
18792
18793 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
18794 so that it's not optimized away.
18795 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
18796 * dispextern.h (bidi_dump_cached_states): Remove, since it's
18797 exported only to the debugger.
18798
18799 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
18800 * atimer.h (run_all_atimers): Remove; not exported.
18801
18802 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
18803 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
18804 was inaccessible from Lisp.
18805 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
18806 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
18807
18808 alloc.c: Import and export fewer symbols, and remove unused items.
18809 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
18810 is defined.
18811 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
18812 it's not optimized away by whole-program optimization.
18813 (message_enable_multibyte, free_misc): Remove.
18814 (catchlist, handlerlist, mark_backtrace):
18815 Declare only if BYTE_MARK_STACK.
18816 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
18817 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
18818 (message_enable_multibyte): Remove decl.
18819 (free_misc, interval_free_list, float_block, float_block_index):
18820 (n_float_blocks, float_free_list, cons_block, cons_block_index):
18821 (cons_free_list, last_marked_index):
18822 Now static.
18823 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
18824 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
18825 (mark_backtrace): Define only if BYTE_MARK_STACK.
18826 * xdisp.c (message_enable_multibyte): Now static.
18827
18828 Declare Lisp_Object Q* variables to be 'static' if not exported.
18829 This makes it easier for human readers (and static analyzers)
18830 to see whether these variables are used from other modules.
18831 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
18832 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
18833 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
18834 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
18835 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
18836 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
18837 * xmenu.c, xselect.c:
18838 Declare Q* vars static if they are not used in other modules.
18839 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
18840 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
18841 Remove decls of unexported vars.
18842 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
18843
18844 * lisp.h (DEFINE_FUNC): Make sname 'static'.
18845
18846 Make Emacs functions such as Fatom 'static' by default.
18847 This makes it easier for human readers (and static analyzers)
18848 to see whether these functions can be called from other modules.
18849 DEFUN now defines a static function. To make the function external
18850 so that it can be used in other C modules, use the new macro DEFUE.
18851 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
18852 (Finit_image_library):
18853 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
18854 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
18855 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
18856 Remove decls, since these functions are now static.
18857 (Funintern, Fget_internal_run_time): New decls, since these functions
18858 were already external.
18859
18860 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
18861 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
18862 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
18863 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
18864 * keyboard.c, keymap.c, lread.c:
18865 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
18866 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
18867 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
18868 Mark functions with DEFUE instead of DEFUN,
18869 if they are used in other modules.
18870 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
18871 decls for now-static functions.
18872 * buffer.h (Fdelete_overlay): Remove decl.
18873 * callproc.c (Fgetenv_internal): Mark as internal.
18874 * composite.c (Fremove_list_of_text_properties): Remove decl.
18875 (Fcomposition_get_gstring): New forward static decl.
18876 * composite.h (Fcomposite_get_gstring): Remove decl.
18877 * dired.c (Ffile_attributes): New forward static decl.
18878 * doc.c (Fdocumntation_property): New forward static decl.
18879 * eval.c (Ffetch_bytecode): New forward static decl.
18880 (Funintern): Remove extern decl; now in .h file where it belongs.
18881 * fileio.c (Fmake_symbolic_link): New forward static decl.
18882 * image.c (Finit_image_library): New forward static decl.
18883 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
18884 * intervals.h (Fprevious_property_change):
18885 (Fremove_list_of_text_properties): Remove decls.
18886 * keyboard.c (Fthis_command_keys): Remove decl.
18887 (Fcommand_execute): New forward static decl.
18888 * keymap.c (Flookup_key): New forward static decl.
18889 (Fcopy_keymap): Now static.
18890 * keymap.h (Flookup_key): Remove decl.
18891 * process.c (Fget_process): New forward static decl.
18892 (Fprocess_datagram_address): Mark as internal.
18893 * syntax.c (Fsyntax_table_p): New forward static decl.
18894 (skip_chars): Remove duplicate decl.
18895 * textprop.c (Fprevious_property_change): New forward static decl.
18896 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
18897 Now internal.
18898 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
18899 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
18900
18901 * editfns.c (Fformat): Remove unreachable code.
18902
18903 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
18904
18905 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
18906 change. (Bug#8496)
18907
18908 2011-04-13 Eli Zaretskii <eliz@gnu.org>
18909
18910 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
18911 when at ZV. (Bug#8487)
18912
18913 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18914
18915 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18916 (Bug#8437)
18917 * keyboard.c (parse_tool_bar_item): Likewise.
18918 * sound.c (sound_cleanup, alsa_close): Likewise.
18919 * termcap.c (tgetent): Likewise.
18920 * xfns.c (x_default_font_parameter): Likewise.
18921 * xsettings.c (read_and_apply_settings): Likewise.
18922
18923 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18924 (overrun_check_free): Protoize.
18925
18926 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18927
18928 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18929 since callers should never pass a negative size.
18930 Change the signature to match that of plain 'read' and 'write'; see
18931 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18932 * lisp.h: Update prototypes of emacs_write and emacs_read.
18933
18934 2011-04-11 Eli Zaretskii <eliz@gnu.org>
18935
18936 * xdisp.c (redisplay_window): Don't try to determine the character
18937 position of the scroll margin if the window start point w->startp
18938 is outside the buffer's accessible region. (Bug#8468)
18939
18940 2011-04-10 Eli Zaretskii <eliz@gnu.org>
18941
18942 Fix write-region and its subroutines for buffers > 2GB.
18943 * fileio.c (a_write, e_write): Modify declaration of arguments and
18944 local variables to support buffers larger than 2GB.
18945 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18946
18947 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18948 argument, local variables, and return value.
18949
18950 * lisp.h: Update prototypes of emacs_write and emacs_read.
18951
18952 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18953
18954 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
18955
18956 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18957
18958 Fix more problems found by GCC 4.6.0's static checks.
18959
18960 * xdisp.c (vmessage): Use a better test for character truncation.
18961
18962 * charset.c (load_charset_map): <, not <=, for optimization,
18963 and to avoid potential problems with integer overflow.
18964 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
18965 * casetab.c (set_identity, shuffle): Likewise.
18966 * editfns.c (Fformat): Likewise.
18967 * syntax.c (skip_chars): Likewise.
18968
18969 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18970 This also lets GCC 4.6.0 generate slightly better loop code.
18971
18972 * callint.c (Fcall_interactively): <, not <=, for optimization.
18973 (Fcall_interactively): Count the number of arguments produced,
18974 not the number of arguments given. This is simpler and lets GCC
18975 4.6.0 generate slightly better code.
18976
18977 * ftfont.c: Distingish more carefully between FcChar8 and char.
18978 The previous code passed unsigned char * to a functions like
18979 strlen and xstrcasecmp that expect char *, which does not
18980 conform to the C standard.
18981 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18982 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18983 char * when the C standard requires it.
18984
18985 * keyboard.c (read_char): Remove unused var.
18986
18987 * eval.c: Port to Windows vsnprintf (Bug#8435).
18988 Include <limits.h>.
18989 (SIZE_MAX): Define if the headers do not.
18990 (verror): Do not give up if vsnprintf returns a negative count.
18991 Instead, grow the buffer. This ports to Windows vsnprintf, which
18992 does not conform to C99. Problem reported by Eli Zaretskii.
18993 Also, simplify the allocation scheme, by avoiding the need for
18994 calling realloc, and removing the ALLOCATED variable.
18995
18996 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18997
18998 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18999 But keep the doprint source code for now, as we might revamp it
19000 and use it again (Bug#8435).
19001 * lisp.h (doprnt): Remove.
19002 * Makefile.in (base_obj): Remove doprnt.o.
19003 * deps.mk (doprnt.o): Remove.
19004
19005 error: Print 32- and 64-bit integers portably (Bug#8435).
19006 Without this change, on typical 64-bit hosts error ("...%d...", N)
19007 was used to print both 32- and 64-bit integers N, which relied on
19008 undefined behavior.
19009 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
19010 * lisp.h (error, verror): Mark as printf-like functions.
19011 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19012 Report overflow in size calculations when allocating printf buffer.
19013 Do not truncate output string at its first null byte.
19014 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19015 Truncate the output at a character boundary, since vsnprintf does not
19016 do that.
19017 * charset.c (check_iso_charset_parameter): Convert internal
19018 character to string before calling 'error', since %c now has the
19019 printf meaning.
19020 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19021 overflow when computing char to be passed to 'error'. Do not
19022 pass Lisp_Object to 'error'; pass the integer instead.
19023 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19024 formatted with plain %d.
19025
19026 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19027
19028 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19029
19030 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19031
19032 * xterm.c (x_catch_errors): Remove duplicate declaration.
19033
19034 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19035
19036 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19037
19038 2011-04-10 Jim Meyering <meyering@redhat.com>
19039
19040 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19041 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19042 return ssize_t not "int", and use size_t as the buffer length.
19043 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19044 * gnutls.h: Update declarations.
19045 * process.c (read_process_output): Use ssize_t, to match.
19046 (send_process): Likewise.
19047
19048 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19049
19050 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19051
19052 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
19053
19054 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19055 Use unsigned char, to match FcChar8 type definition.
19056
19057 * xterm.c (handle_one_xevent):
19058 * xmenu.c (create_and_show_popup_menu):
19059 * xselect.c (x_decline_selection_request)
19060 (x_reply_selection_request): Avoid type-punned deref of X events.
19061
19062 2011-04-09 Eli Zaretskii <eliz@gnu.org>
19063
19064 Fix some uses of `int' instead of EMACS_INT.
19065 * search.c (string_match_1, fast_string_match)
19066 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19067 (scan_buffer, find_next_newline_no_quit)
19068 (find_before_next_newline, search_command, Freplace_match)
19069 (Fmatch_data): Make some `int' variables be EMACS_INT.
19070
19071 * xdisp.c (display_count_lines): 3rd argument and return value now
19072 EMACS_INT. All callers changed.
19073 (pint2hrstr): Last argument is now EMACS_INT.
19074
19075 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19076 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19077 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19078 (decode_coding_utf_16, decode_coding_emacs_mule)
19079 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19080 (decode_coding_ccl, decode_coding_charset)
19081 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19082 (decode_coding_iso_2022, decode_coding_emacs_mule)
19083 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19084 <char_offset, last_offset>: Declare EMACS_INT.
19085 (encode_coding_utf_8, encode_coding_utf_16)
19086 (encode_coding_emacs_mule, encode_invocation_designation)
19087 (encode_designation_at_bol, encode_coding_iso_2022)
19088 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19089 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19090 Declare EMACS_INT.
19091 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19092 (encode_invocation_designation): Last argument P_NCHARS is now
19093 EMACS_INT.
19094 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19095 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19096
19097 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19098 All users changed.
19099
19100 * ccl.c (Fccl_execute_on_string): Declare some variables
19101 EMACS_INT.
19102
19103 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
19104
19105 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19106
19107 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19108
19109 * process.c (Fformat_network_address): Doc fix.
19110
19111 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19112
19113 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
19114
19115 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
19116
19117 * keyboard.c (read_char): Call Lisp function help-form-show,
19118 instead of using internal_with_output_to_temp_buffer.
19119 (Qhelp_form_show): New var.
19120 (syms_of_keyboard): Use DEFSYM macro.
19121
19122 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19123
19124 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19125
19126 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
19127
19128 * process.c (Flist_processes): Remove to Lisp.
19129 (list_processes_1): Delete.
19130
19131 2011-04-06 Eli Zaretskii <eliz@gnu.org>
19132
19133 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19134
19135 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19136
19137 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
19138
19139 Fix more problems found by GCC 4.6.0's static checks.
19140
19141 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19142
19143 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19144
19145 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
19146
19147 * xdisp.c (vmessage): Mark as a printf-like function.
19148
19149 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19150
19151 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19152
19153 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19154 printf-like functions.
19155 (tiff_load): Add casts to remove these marks before passing them
19156 to system-supplied API.
19157
19158 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19159
19160 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19161 This avoids several warnings with gcc -Wstrict-overflow.
19162 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19163 directly, rather than having caller test rule sign. This avoids
19164 some unnecessary tests.
19165 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19166 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19167 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
19168
19169 * xfont.c (xfont_text_extents): Remove var that was set but not used.
19170 (xfont_open): Avoid unnecessary tests.
19171
19172 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19173
19174 * composite.h, composite.c (composition_gstring_put_cache):
19175 Use EMACS_INT, not int, for length.
19176
19177 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19178 breaking out part of COMPOSITION_DECODE_RULE.
19179 (COMPOSITION_DECODE_RULE): Use it.
19180 * composite.c (get_composition_id): Remove unused local vars,
19181 by using the new macro.
19182
19183 * textprop.c (set_text_properties_1): Change while to do-while,
19184 since the condition is always true at first.
19185
19186 * intervals.c (graft_intervals_into_buffer): Mark var as used.
19187 (interval_deletion_adjustment): Return unsigned value.
19188 All uses changed.
19189
19190 * process.c (list_processes_1, create_pty, read_process_output):
19191 (exec_sentinel): Remove vars that were set but not used.
19192 (create_pty): Remove unnecessary "volatile"s.
19193 (Fnetwork_interface_info): Avoid possibility of int overflow.
19194 (read_process_output): Do adaptive read buffering even if carryover.
19195 (read_process_output): Simplify nbytes computation if buffered.
19196
19197 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19198
19199 * syntax.c (scan_words): Remove var that was set but not used.
19200 (update_syntax_table): Use unsigned instead of int.
19201
19202 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
19203 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
19204 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
19205
19206 * print.c (print_error_message): Avoid int overflow.
19207
19208 * font.c (font_list_entities): Redo for clarity,
19209 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19210
19211 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
19212 (font_score): Avoid potential overflow in diff calculation.
19213
19214 * fns.c (substring_both): Remove var that is set but not used.
19215 (sxhash): Redo loop for clarity and to avoid wraparound warning.
19216
19217 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19218
19219 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19220 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19221 can always succeed if overflow has undefined behavior.
19222
19223 * search.c (boyer_moore, wordify): Remove vars set but not used.
19224 (wordify): Omit three unnecessary tests.
19225
19226 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19227 All callers changed. This avoids the need for an unused var.
19228
19229 * casefiddle.c (casify_region): Remove var that is set but not used.
19230
19231 * dired.c (file_name_completion): Remove var that is set but not used.
19232
19233 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19234
19235 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
19236 (Finsert_file_contents): Remove unnecessary code checking fd.
19237
19238 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19239 Check for integer overflow on size calculations.
19240
19241 * buffer.c (Fprevious_overlay_change): Remove var that is set
19242 but not used.
19243
19244 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19245 Remove vars that are set but not used.
19246 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
19247 (timer_check_2): Mark vars as initialized.
19248
19249 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19250
19251 * image.c (lookup_image): Remove var that is set but not used.
19252 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
19253
19254 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19255 that are set but not used.
19256
19257 * xfns.c (make_invisible_cursor): Don't return garbage
19258 if XCreateBitmapFromData fails (Bug#8410).
19259
19260 * xselect.c (x_get_local_selection, x_handle_property_notify):
19261 Remove vars that are set but not used.
19262
19263 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
19264 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
19265
19266 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19267 Remove var that is set but not used.
19268 (scroll_bar_windows_size): Now size_t, not int.
19269 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19270 Check for overflow.
19271
19272 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19273 (map_tty_color) [!defined MSDOS]: Likewise.
19274
19275 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19276
19277 * coding.c: Remove vars that are set but not used.
19278 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19279 All callers changed.
19280 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19281 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19282 (decode_coding_charset): Remove vars that are set but not used.
19283
19284 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19285 that is set but not used.
19286
19287 * print.c (print_object): Remove var that is set but not used.
19288
19289 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
19290 The gnulib version avoids calling malloc in the usual case,
19291 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19292 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19293 * filelock.c (current_lock_owner): Likewise.
19294 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19295 * sysdep.c: Include allocator.h, careadlinkat.h.
19296 (emacs_no_realloc_allocator): New static constant.
19297 (emacs_readlink): New function.
19298 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19299 ../lib/careadlinkat.h.
19300
19301 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19302
19303 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19304 first non-nil return value).
19305
19306 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19307
19308 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19309 if not defined (Bug#8403).
19310
19311 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19312
19313 * xdisp.c (display_count_lines): Remove parameter `start',
19314 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19315 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19316 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19317 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19318 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19319 and thereabouts. All callers changed.
19320 (get_per_char_metric): Remove parameter `f', unused since
19321 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19322
19323 2011-04-02 Jim Meyering <meyering@redhat.com>
19324
19325 do not dereference NULL upon failed strdup
19326 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19327 (ns_get_family): Likewise.
19328
19329 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
19330
19331 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19332
19333 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19334
19335 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19336 later (Bug#8403).
19337
19338 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19339
19340 Add lexical binding.
19341
19342 * window.c (Ftemp_output_buffer_show): New fun.
19343 (Fsave_window_excursion):
19344 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19345
19346 * lread.c (lisp_file_lexically_bound_p): New function.
19347 (Fload): Bind Qlexical_binding.
19348 (readevalloop): Remove `evalfun' arg.
19349 Bind Qinternal_interpreter_environment.
19350 (Feval_buffer): Bind Qlexical_binding.
19351 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19352 Mark as dynamic.
19353 (syms_of_lread): Declare `lexical-binding'.
19354
19355 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19356
19357 * keyboard.c (eval_dyn): New fun.
19358 (menu_item_eval_property): Use it.
19359
19360 * image.c (parse_image_spec): Use Ffunctionp.
19361
19362 * fns.c (concat, mapcar1): Accept byte-code-functions.
19363
19364 * eval.c (Fsetq): Handle lexical vars.
19365 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19366 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19367 (FletX, Flet): Obey lexical binding.
19368 (Fcommandp): Handle closures.
19369 (Feval): New `lexical' arg.
19370 (eval_sub): New function extracted from Feval. Use it almost
19371 everywhere where Feval was used. Look up vars in lexical env.
19372 Handle closures.
19373 (Ffunctionp): Move from subr.el.
19374 (Ffuncall): Handle closures.
19375 (apply_lambda): Remove `eval_flags'.
19376 (funcall_lambda): Handle closures and new byte-code-functions.
19377 (Fspecial_variable_p): New function.
19378 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19379 but without exporting it to Lisp.
19380
19381 * doc.c (Fdocumentation, store_function_docstring):
19382 * data.c (Finteractive_form): Handle closures.
19383
19384 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19385 interactive spec.
19386
19387 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19388 New byte-codes.
19389 (exec_byte_code): New function extracted from Fbyte_code to handle new
19390 calling convention for byte-code-functions. Add new byte-codes.
19391
19392 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
19393
19394 * alloc.c (Fmake_symbol): Init new `declared_special' field.
19395
19396 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19397
19398 * xdisp.c (redisplay_internal): Fix prototype.
19399
19400 2011-03-31 Eli Zaretskii <eliz@gnu.org>
19401
19402 * xdisp.c (SCROLL_LIMIT): New macro.
19403 (try_scrolling): Use it when setting scroll_limit.
19404 Limit scrolling to 100 screen lines.
19405 (redisplay_window): Even when falling back on "recentering",
19406 position point in the window according to scroll-conservatively,
19407 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19408
19409 (try_scrolling): When point is above the window, allow searching
19410 as far as scroll_max, or one screenful, to compute vertical
19411 distance from PT to the scroll margin position. This prevents
19412 try_scrolling from unnecessarily failing when
19413 scroll-conservatively is set to a value slightly larger than the
19414 window height. Clean up the case of PT below the margin at bottom
19415 of window: scroll_max can no longer be INT_MAX. When aggressive
19416 scrolling is in use, don't let point enter the opposite scroll
19417 margin as result of the scroll.
19418 (syms_of_xdisp) <scroll-conservatively>: Document the
19419 threshold of 100 lines for never-recentering scrolling.
19420
19421 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
19422
19423 * dispextern.h (move_it_by_lines):
19424 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19425 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19426 (message_log_check_duplicate): Remove parameters `prev_bol' and
19427 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19428 (redisplay_internal): Remove parameter `preserve_echo_area',
19429 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19430
19431 * indent.c (Fvertical_motion):
19432 * window.c (window_scroll_pixel_based, Frecenter):
19433 Don't pass `need_y_p' to `move_it_by_lines'.
19434
19435 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19436
19437 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19438 steal a few bits to be more compact.
19439 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19440 Remove unneeded casts.
19441
19442 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19443
19444 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19445
19446 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19447 binding" message (bug#7967).
19448
19449 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19450
19451 Fix more problems found by GCC 4.6.0's static checks.
19452
19453 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19454 Remove unused local var.
19455
19456 * editfns.c (Fmessage_box): Remove unused local var.
19457
19458 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19459 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19460 Omit unused local vars.
19461 * window.c (shrink_windows): Omit unused local var.
19462 * menu.c (digest_single_submenu): Omit unused local var.
19463 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19464 Omit unused local var.
19465
19466 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19467 Don't assume string length fits in int.
19468 (keyremap_step, read_key_sequence): Use size_t for sizes.
19469 (read_key_sequence): Don't check last_real_key_start redundantly.
19470
19471 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19472 instead of alloca (Bug#8344).
19473
19474 * eval.c (Fbacktrace): Don't assume nargs fits in int.
19475 (Fbacktrace_frame): Don't assume nframes fits in int.
19476
19477 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19478
19479 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19480 concerns.
19481
19482 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19483
19484 * cm.c (calccost): Turn while-do into do-while, for clarity.
19485
19486 * keyboard.c (syms_of_keyboard): Use the same style as later
19487 in this function when indexing through an array. This also
19488 works around GCC bug 48267.
19489
19490 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19491
19492 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19493
19494 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19495 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19496
19497 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19498 This avoids undefined behavior on integer overflow, and is a bit
19499 more convenient anyway since it is compared to a size_t variable.
19500
19501 Variadic C functions now count arguments with size_t, not int.
19502 This avoids an unnecessary limitation on 64-bit machines, which
19503 caused (substring ...) to crash on large vectors (Bug#8344).
19504 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19505 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
19506 All variadic functions and their callers changed accordingly.
19507 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19508 * data.c (arith_driver, float_arith_driver): Likewise.
19509 * editfns.c (general_insert_function): Likewise.
19510 * eval.c (struct backtrace.nargs, interactive_p)
19511 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19512 (funcall_lambda, mark_backtrace): Likewise.
19513 * fns.c (concat): Likewise.
19514 * frame.c (x_set_frame_parameters): Likewise.
19515 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19516 0 if not found, not -1. All callers changed.
19517
19518 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19519 (stack_copy_size): Now size_t, not int.
19520 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19521
19522 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19523
19524 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19525 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19526 All callers changed.
19527
19528 * lisp.h (multibyte_char_to_unibyte):
19529 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19530 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19531 * character.h (CHAR_TO_BYTE8):
19532 * cmds.c (internal_self_insert):
19533 * editfns.c (general_insert_function):
19534 * keymap.c (push_key_description):
19535 * search.c (Freplace_match):
19536 * xdisp.c (message_dolog, set_message_1): All callers changed.
19537
19538 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19539
19540 * keyboard.c (safe_run_hook_funcall): New function.
19541 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19542 don't set the hook to nil, but remove the offending function instead.
19543 (Qcommand_hook_internal): Remove, unused.
19544 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19545 Vcommand_hook_internal.
19546
19547 * eval.c (enum run_hooks_condition): Remove.
19548 (funcall_nil, funcall_not): New functions.
19549 (run_hook_with_args): Call each function through a `funcall' argument.
19550 Remove `cond' argument, now redundant.
19551 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19552 (Frun_hook_with_args_until_failure): Adjust accordingly.
19553 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19554
19555 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
19556
19557 * dispextern.h (string_buffer_position): Remove declaration.
19558
19559 * print.c (strout): Remove parameter `multibyte', unused since
19560 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19561
19562 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19563 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19564 All callers changed.
19565
19566 * w32.c (_wsa_errlist): Use braces for struct initializers.
19567
19568 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19569 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19570 All callers changed.
19571 (string_buffer_position): Likewise. Also, make static (it's never
19572 used outside xdisp.c).
19573 (cursor_row_p): Remove parameter `w', unused since
19574 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19575 (decode_mode_spec): Remove parameter `precision', introduced during
19576 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19577 All callers changed.
19578
19579 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19580
19581 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19582
19583 2011-03-27 Anders Lindgren <andlind@gmail.com>
19584
19585 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19586 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19587 (ns_update_auto_hide_menu_bar): New functions.
19588 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19589 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19590 ns_constrain_all_frames.
19591 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19592 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19593
19594 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19595
19596 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19597
19598 2011-03-27 Glenn Morris <rgm@gnu.org>
19599
19600 * syssignal.h: Replace RETSIGTYPE with void.
19601 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19602 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19603 Replace SIGTYPE with void everywhere.
19604 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19605 * s/template.h (SIGTYPE): Remove commented out definition.
19606
19607 2011-03-26 Eli Zaretskii <eliz@gnu.org>
19608
19609 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19610 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19611
19612 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
19613
19614 * w32.c (read_unc_volume): Use parameter `henum', instead of
19615 global variable `wget_enum_handle'.
19616
19617 * keymap.c (describe_vector): Remove parameters `indices' and
19618 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19619 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19620
19621 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19622
19623 * keyboard.c (timer_check): Remove parameter `do_it_now',
19624 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19625 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19626 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19627
19628 * keyboard.c (read_char):
19629 * w32menu.c (w32_menu_display_help):
19630 * xmenu.c (show_help_event, menu_help_callback):
19631 Adjust calls to `show_help_echo'.
19632
19633 * gtkutil.c (xg_maybe_add_timer):
19634 * keyboard.c (readable_events):
19635 * process.c (wait_reading_process_output):
19636 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19637
19638 * insdel.c (adjust_markers_gap_motion):
19639 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19640 (gap_left, gap_right): Don't call it.
19641
19642 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
19643
19644 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19645 incurred during fontification.
19646
19647 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19648
19649 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19650 (DEFVAR_PER_BUFFER): Don't pass it.
19651
19652 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19653 (scrolling_window): Don't pass it.
19654
19655 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
19656
19657 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19658
19659 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19660 and `suffix'.
19661 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19662 of variables specific to SELinux and computation of `encoded_absname'.
19663
19664 * image.c (XPutPixel): Remove unused variable `height'.
19665
19666 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19667
19668 * unexw32.c (get_section_info): Remove unused variable `section'.
19669
19670 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19671 (system_process_attributes): Remove unused variable `sess'.
19672 (sys_read): Remove unused variable `err'.
19673
19674 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19675 (w32_wnd_proc): Remove unused variable `isdead'.
19676 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19677 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19678 (x_create_tip_frame): Remove unused variable `tem'.
19679
19680 * w32inevt.c (w32_console_read_socket):
19681 Remove unused variable `no_events'.
19682
19683 * w32term.c (x_draw_composite_glyph_string_foreground):
19684 Remove unused variable `width'.
19685
19686 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
19687
19688 * w32term.c (x_set_glyph_string_clipping):
19689 Don't pass uninitialized region to CombineRgn.
19690
19691 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
19692
19693 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19694 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19695 (Fx_close_connection): Remove unused variable `i'.
19696
19697 * w32font.c (w32font_draw): Return number of glyphs.
19698 (w32font_open_internal): Remove unused variable `i'.
19699 (w32font_driver): Add missing initializer.
19700
19701 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19702 (fill_in_menu): Remove unused variable `items_added'.
19703
19704 * w32term.c (last_mouse_press_frame): Remove static global variable.
19705 (w32_clip_to_row): Remove unused variable `f'.
19706 (x_delete_terminal): Remove unused variable `i'.
19707
19708 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19709 (NOTHING): Remove unused static global variable.
19710 (uniscribe_check_otf): Remove unused variable `table'.
19711 (uniscribe_font_driver): Add missing initializers.
19712
19713 2011-03-23 Julien Danjou <julien@danjou.info>
19714
19715 * term.c (Fsuspend_tty, Fresume_tty):
19716 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19717 * window.c (temp_output_buffer_show):
19718 * insdel.c (signal_before_change):
19719 * frame.c (Fhandle_switch_frame):
19720 * fileio.c (Fdo_auto_save):
19721 * emacs.c (Fkill_emacs):
19722 * editfns.c (save_excursion_restore):
19723 * cmds.c (internal_self_insert):
19724 * callint.c (Fcall_interactively):
19725 * buffer.c (Fkill_all_local_variables):
19726 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19727 Use Frun_hooks.
19728 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
19729 unconditionally since it does the check itself.
19730
19731 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
19732
19733 Fix more problems found by GCC 4.5.2's static checks.
19734
19735 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19736 the first time through the loop, since we know p0 < p1 then.
19737 This also avoids a gcc -Wstrict-overflow warning.
19738
19739 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19740 leading to a memory leak, possible in functions like
19741 load_charset_map_from_file that can allocate an unbounded number
19742 of objects (Bug#8318).
19743
19744 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19745 that could (at least in theory) be that large.
19746
19747 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19748 This is less likely to overflow, and avoids undefined behavior if
19749 overflow does occur. All callers changed. Use strtoul to scan
19750 for the unsigned long integer.
19751 (pint2hrstr): Simplify and tune code slightly.
19752 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19753
19754 * scroll.c (do_scrolling): Work around GCC bug 48228.
19755 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19756
19757 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19758 This also avoids a warning with gcc -Wstrict-overflow.
19759 (validate_x_resource_name): Simplify count usage.
19760 This also avoids a warning with gcc -Wstrict-overflow.
19761
19762 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19763 fail (Bug#8306).
19764
19765 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
19766
19767 * process.c (Fmake_network_process): Use socklen_t, not int,
19768 where POSIX says socklen_t is required in portable programs.
19769 This fixes a porting bug on hosts like 64-bit HP-UX, where
19770 socklen_t is wider than int (Bug#8277).
19771 (Fmake_network_process, server_accept_connection):
19772 (wait_reading_process_output, read_process_output):
19773 Likewise.
19774
19775 * process.c: Rename or move locals to avoid shadowing.
19776 (list_processes_1, Fmake_network_process):
19777 (read_process_output_error_handler, exec_sentinel_error_handler):
19778 Rename or move locals.
19779 (Fmake_network_process): Define label "retry_connect" only if needed.
19780 (Fnetwork_interface_info): Fix pointer signedness.
19781 (process_send_signal): Add cast to avoid pointer signedness problem.
19782 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
19783 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
19784
19785 Make tparam.h and terminfo.c consistent.
19786 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
19787 Include tparam.h instead, since it declares them.
19788 * cm.h (PC): Remove extern decl; tparam.h now does this.
19789 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
19790 * terminfo.c: Include tparam.h, to check interfaces.
19791 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
19792 (tparam): Adjust signature to match interface in tparam.h;
19793 this removes some undefined behavior. Check that outstring and len
19794 are zero, which they always are with Emacs.
19795 * tparam.h (PC, BC, UP): New extern decls.
19796
19797 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
19798 (xftfont_open): Rename locals to avoid shadowing.
19799
19800 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
19801 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
19802 (OTF_TAG_SYM): Omit macro if not needed.
19803 (ftfont_list): Remove unused local.
19804 (get_adstyle_property, ftfont_pattern_entity):
19805 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
19806 Rename locals to avoid shadowing.
19807
19808 * xfont.c (xfont_list_family): Mark var as initialized.
19809
19810 * xml.c (make_dom): Now static.
19811
19812 * composite.c (composition_compute_stop_pos): Rename local to
19813 avoid shadowing.
19814 (composition_reseat_it): Remove unused locals.
19815 (find_automatic_composition, composition_adjust_point): Likewise.
19816 (composition_update_it): Mark var as initialized.
19817 (find_automatic_composition): Mark vars as initialized,
19818 with a FIXME (Bug#8290).
19819
19820 character.h: Rename locals to avoid shadowing.
19821 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
19822 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
19823 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
19824 (BUF_DEC_POS): Be more systematic about renaming local temporaries
19825 to avoid shadowing.
19826
19827 * textprop.c (property_change_between_p): Remove; unused.
19828
19829 * intervals.c (interval_start_pos): Now static.
19830
19831 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
19832
19833 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
19834 Rename locals to avoid shadowing.
19835
19836 * sound.c (wav_play, au_play, Fplay_sound_internal):
19837 Fix pointer signedness.
19838 (alsa_choose_format): Remove unused local var.
19839 (wav_play): Initialize a variable to 0, to prevent undefined
19840 behavior (Bug#8278).
19841
19842 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
19843
19844 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
19845
19846 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
19847 clobbering (Bug#8298).
19848 * sysdep.c (sys_subshell): Likewise.
19849 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
19850
19851 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
19852 This should get cleaned up, so that child_setup has the
19853 same signature on all platforms.
19854
19855 * callproc.c (call_process_cleanup): Now static.
19856 (relocate_fd): Rename locals to avoid shadowing.
19857
19858 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
19859
19860 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
19861 not to be necessary, and produces flickering.
19862
19863 2011-03-20 Glenn Morris <rgm@gnu.org>
19864
19865 * config.in: Remove file.
19866
19867 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
19868
19869 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
19870 are now in src/globals.h.
19871 (syms_of_minibuf): Remove spurious & from previous change.
19872
19873 2011-03-20 Leo Liu <sdl.web@gmail.com>
19874
19875 * minibuf.c (completing-read-function): New variable.
19876 (completing-read-default): Rename from completing-read.
19877 (completing-read): Call completing-read-function.
19878
19879 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19880
19881 * xfaces.c (Fx_load_color_file):
19882 Read color file from absolute filename (bug#8250).
19883
19884 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
19885
19886 * makefile.w32-in: Update dependencies.
19887
19888 2011-03-17 Eli Zaretskii <eliz@gnu.org>
19889
19890 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
19891
19892 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
19893
19894 Fix more problems found by GCC 4.5.2's static checks.
19895
19896 * process.c (make_serial_process_unwind, send_process_trap):
19897 (sigchld_handler): Now static.
19898
19899 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
19900 That way, the code declares only the vars that it needs.
19901 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
19902 * s/cygwin.h (PTY_ITERATION): Likewise.
19903 * s/darwin.h (PTY_ITERATION): Likewise.
19904 * s/gnu-linux.h (PTY_ITERATION): Likewise.
19905
19906 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
19907 * process.c (allocate_pty): Don't declare stb unless it's needed.
19908
19909 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
19910 (CONSTANTLIM): Remove; unused.
19911 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
19912 Define only if needed.
19913
19914 * unexelf.c (unexec): Name an expression,
19915 to avoid gcc -Wbad-function-cast warning.
19916 Use a different way to cause a compilation error if anyone uses
19917 n rather than nn, a way that does not involve shadowing.
19918 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
19919
19920 * deps.mk (unexalpha.o): Remove; unused.
19921
19922 New file unexec.h, the (simple) interface for unexec (Bug#8267).
19923 * unexec.h: New file.
19924 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19925 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19926 Depend on unexec.h.
19927 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19928 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19929 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
19930 Change as necessary to match prototype in unexec.h.
19931
19932 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19933 shadowing.
19934 (back_comment, skip_chars): Mark vars as initialized.
19935
19936 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19937 Rename locals to avoid shadowing.
19938
19939 * lread.c (read1): Rewrite so as not to use empty "else".
19940 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
19941
19942 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19943
19944 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19945 warning when compiling print.c.
19946
19947 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19948 instead of using an uninitialized var.
19949 (font_sort_entities): Mark var as initialized.
19950
19951 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19952
19953 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19954 pointers to constants.
19955 (font_parse_fcname): Remove unused vars.
19956 (font_delete_unmatched): Now static.
19957 (font_get_spec): Remove; unused.
19958 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19959 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19960 Rename or move locals to avoid shadowing.
19961
19962 * fns.c (require_nesting_list, require_unwind): Now static.
19963 (Ffillarray): Rename locals to avoid shadowing.
19964
19965 * floatfns.c (domain_error2): Define only if needed.
19966 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
19967
19968 * alloc.c (mark_backtrace): Move decl from here ...
19969 * lisp.h: ... to here, so that it can be checked.
19970
19971 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
19972 (Fdefvar): Rewrite so as not to use empty "else".
19973 (lisp_indirect_variable): Name an expression,
19974 to avoid gcc -Wbad-function-cast warning.
19975 (Fdefvar): Rename locals to avoid shadowing.
19976
19977 * callint.c (quotify_arg, quotify_args): Now static.
19978 (Fcall_interactively): Rename locals to avoid shadowing.
19979 Use const pointer when appropriate.
19980
19981 * lisp.h (get_system_name, get_operating_system_release):
19982 Move decls here, to check interfaces.
19983 * process.c (get_operating_system_release): Move decl to lisp.h.
19984 * xrdb.c (get_system_name): Likewise.
19985 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19986 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19987 some of which prompt warnings from gcc -Wbad-function-cast.
19988 (Fformat_time_string, Fencode_time, Finsert_char):
19989 (Ftranslate_region_internal, Fformat):
19990 Rename or remove local vars to avoid shadowing.
19991 (Ftranslate_region_internal): Mark var as initialized.
19992
19993 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19994 avoid shadowing.
19995
19996 * lisp.h (eassert): Check that the argument compiles, even if
19997 ENABLE_CHECKING is not defined.
19998
19999 * data.c (Findirect_variable): Name an expression, to avoid
20000 gcc -Wbad-function-cast warning.
20001 (default_value, arithcompare, arith_driver, arith_error): Now static.
20002 (store_symval_forwarding): Rename local to avoid shadowing.
20003 (Fmake_variable_buffer_local, Fmake_local_variable):
20004 Mark variables as initialized.
20005 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
20006
20007 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
20008 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20009 Rename locals to avoid shadowing.
20010 (mark_stack): Move local variables into the #ifdef region where
20011 they're used.
20012 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20013 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20014 needed otherwise.
20015 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20016 (GC_STRING_CHARS): Remove; not used.
20017 (Fmemory_limit): Cast sbrk's returned value to char *.
20018
20019 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20020 avoids undefined behavior in theory.
20021
20022 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20023
20024 Use functions, not macros, for up- and down-casing (Bug#8254).
20025 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20026 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20027 to use the following functions instead of these macros.
20028 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20029 EMACS_INT, since callers assume the returned value fits in int.
20030 (upcase1): Likewise, for UPCASE_TABLE.
20031 (uppercasep, lowercasep, upcase): New static inline functions.
20032 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
20033 the race-condition problem in the old DOWNCASE.
20034
20035 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20036 Rename locals to avoid shadowing.
20037 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
20038 (regex_compile, re_search_2, re_match_2_internal):
20039 Remove unused local vars.
20040 (FREE_VAR): Rewrite so as not to use empty "else",
20041 which gcc can warn about.
20042 (regex_compile, re_match_2_internal): Mark locals as initialized.
20043 (RETALLOC_IF): Define only if needed.
20044 (WORDCHAR_P): Likewise. This one is never needed, but is used
20045 only in a comment talking about a compiler bug, so put inside
20046 the #if 0 of that comment.
20047 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20048 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20049 Remove; unused.
20050
20051 * search.c (boyer_moore): Rename locals to avoid shadowing.
20052 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20053 (PREV_CHAR_BOUNDARY): Likewise.
20054
20055 * search.c (simple_search): Remove unused var.
20056
20057 * dired.c (compile_pattern): Move decl from here ...
20058 * lisp.h: ... to here, so that it can be checked.
20059 (struct re_registers): New forward decl.
20060
20061 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20062
20063 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20064 All uses changed.
20065 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20066 Rename locals to avoid shadowing.
20067 (Fvertical_motion): Mark locals as initialized.
20068
20069 * casefiddle.c (casify_object, casify_region): Now static.
20070 (casify_region): Mark local as initialized.
20071
20072 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20073
20074 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20075 New macros, so that the caller can use some names other than
20076 gcpro1, gcpro2, etc.
20077 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20078 of the new macros.
20079 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20080 argument, for consistency with GCPRO2_VAR, etc: it is now the
20081 prefix of the variable, not the variable itself. All uses
20082 changed.
20083 * dired.c (directory_files_internal, file_name_completion):
20084 Rename locals to avoid shadowing.
20085
20086 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20087 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20088 dired.c's scmp function, had undefined behavior.
20089 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20090 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20091 * buffer.h: ... to here, because these macros use current_buffer,
20092 and the new implementation with inline functions needs to have
20093 current_buffer in scope now, rather than later when the macros
20094 are used.
20095 (downcase, upcase1): New static inline functions.
20096 (DOWNCASE, UPCASE1): Reimplement using these functions.
20097 This avoids undefined behavior in expressions like
20098 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20099 from race conditions in accessing the global variables
20100 case_temp1 and case_temp2.
20101 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20102 * lisp.h (case_temp1, case_temp2): Remove their decls.
20103 * character.h (ASCII_CHAR_P): Move from here ...
20104 * lisp.h: ... to here, so that the inline functions mentioned
20105 above can use them.
20106
20107 * dired.c (directory_files_internal_unwind): Now static.
20108
20109 * fileio.c (file_name_as_directory, directory_file_name):
20110 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20111 Now static.
20112 (file_name_as_directory): Use const pointers when appropriate.
20113 (Fexpand_file_name): Likewise. In particular, newdir might
20114 point at constant storage, so make it a const pointer.
20115 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
20116 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20117 signedness issues.
20118 (Fset_file_times, Finsert_file_contents, auto_save_error):
20119 Rename locals to avoid shadowing.
20120
20121 * minibuf.c (choose_minibuf_frame_1): Now static.
20122 (Ftry_completion, Fall_completions): Rename or remove locals
20123 to avoid shadowing.
20124
20125 * marker.c (bytepos_to_charpos): Remove; unused.
20126
20127 * lisp.h (verify_bytepos, count_markers): New decls,
20128 so that gcc does not warn that these functions aren't declared.
20129
20130 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20131 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
20132 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
20133 (copy_text): Remove unused local var.
20134
20135 * filelock.c (within_one_second): Now static.
20136 (lock_file_1): Rename local to avoid shadowing.
20137
20138 * buffer.c (fix_overlays_before): Mark locals as initialized.
20139 (fix_start_end_in_overlays): Likewise. This function should be
20140 simplified by using pointers-to-pointers, but that's a different
20141 matter.
20142 (switch_to_buffer_1): Now static.
20143 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20144 (report_overlay_modification): Rename locals to avoid shadowing.
20145
20146 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
20147 Fix pointer signedness issue.
20148 (sys_subshell): Mark local as volatile if checking for lint,
20149 to suppress a gcc -Wclobbered warning that does not seem to be right.
20150 (MAXPATHLEN): Define only if needed.
20151
20152 * process.c (serial_open, serial_configure): Move decls from here ...
20153 * systty.h: ... to here, so that they can be checked.
20154
20155 * fns.c (get_random, seed_random): Move extern decls from here ...
20156 * lisp.h: ... to here, so that they can be checked.
20157
20158 * sysdep.c (reset_io): Now static.
20159 (wait_for_termination_signal): Remove; unused.
20160
20161 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20162 (copy_keymap_item, append_key, push_text_char_description):
20163 Now static.
20164 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
20165 (DENSE_TABLE_SIZE): Remove; unused.
20166 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20167 (describe_map_tree):
20168 Rename locals to avoid shadowing.
20169
20170 * keyboard.c: Declare functions static if they are not used elsewhere.
20171 (echo_char, echo_dash, cmd_error, top_level_2):
20172 (poll_for_input, handle_async_input): Now static.
20173 (read_char, kbd_buffer_get_event, make_lispy_position):
20174 (make_lispy_event, make_lispy_movement, apply_modifiers):
20175 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20176 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20177 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
20178 (read_key_sequence, read_char): Mark locals as initialized.
20179 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
20180
20181 * keyboard.h (make_ctrl_char): New decl.
20182 (mark_kboards): Move decl here ...
20183 * alloc.c (mark_kboards): ... from here.
20184
20185 * lisp.h (force_auto_save_soon): New decl.
20186
20187 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
20188 (DEFINE_DUMMY_FUNCTION): New macro.
20189 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20190 Use it.
20191 (main): Add casts to avoid warnings
20192 if GCC considers string literals to be constants.
20193
20194 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20195
20196 * dbusbind.c: Pointer signedness fixes.
20197 (xd_signature, xd_append_arg, xd_initialize):
20198 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20199 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20200 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20201 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20202
20203 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20204 if GCC considers string literals to be constants.
20205 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
20206
20207 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20208
20209 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20210 (print_preprocess, print_object): New macro to fix last change.
20211
20212 * print.c (print_preprocess): Don't forget font objects.
20213
20214 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
20215
20216 * emacs.c (USAGE3): Doc fixes.
20217
20218 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20219
20220 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20221 structure.
20222
20223 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
20224
20225 * lisp.h (VWindow_system, Qfile_name_history):
20226 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20227 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20228 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20229
20230 * w32select.c: Don't #include "keyboard.h".
20231 (run_protected): Add extern declaration for waiting_for_input.
20232
20233 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20234 * w32console.c (detect_input_pending, read_input_pending)
20235 (encode_terminal_code):
20236 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20237 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20238 (w32_system_caret_y, Qfile_name_history):
20239 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20240 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20241 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20242 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20243 * w32proc.c (Qlocal, report_file_error):
20244 * w32term.c (Vwindow_system, updating_frame):
20245 * w32uniscribe.c (initialized, uniscribe_font_driver):
20246 Remove unneeded extern declarations.
20247
20248 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
20249
20250 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
20251
20252 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
20253
20254 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20255 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20256 These macros can no longer be used for assignment.
20257
20258 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20259 Assign struct members directly, instead of using BUF_BEGV etc.
20260 (record_buffer_markers, fetch_buffer_markers): New functions for
20261 recording and fetching special buffer markers.
20262 (set_buffer_internal_1, set_buffer_temp): Use them.
20263
20264 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20265
20266 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20267
20268 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20269 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20270
20271 * xdisp.c (hscroll_window_tree):
20272 (reconsider_clip_changes): Use PT instead of BUF_PT.
20273
20274 2011-03-13 Eli Zaretskii <eliz@gnu.org>
20275
20276 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20277 $(EMACS_ROOT)/lib/intprops.h.
20278
20279 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20280
20281 Fix more problems found by GCC 4.5.2's static checks.
20282
20283 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20284 to unsigned char * to avoid compiler diagnostic.
20285 (xg_free_frame_widgets): Make it clear that a local variable is
20286 needed only if USE_GTK_TOOLTIP.
20287 (gdk_window_get_screen): Make it clear that this macro is needed
20288 only if USE_GTK_TOOLTIP.
20289 (int_gtk_range_get_value): New function, which avoids a diagnostic
20290 from gcc -Wbad-function-cast.
20291 (xg_set_toolkit_scroll_bar_thumb): Use it.
20292 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20293 diagnostic from gcc -Wbad-function-cast.
20294 (get_utf8_string, xg_get_file_with_chooser):
20295 Rename locals to avoid shadowing.
20296 (create_dialog): Move locals to avoid shadowing.
20297
20298 * xgselect.c (xg_select): Remove unused var.
20299
20300 * image.c (four_corners_best): Mark locals as initialized.
20301 (gif_load): Initialize transparent_p to zero (Bug#8238).
20302 Mark another local as initialized.
20303 (my_png_error, my_error_exit): Mark with NO_RETURN.
20304
20305 * image.c (clear_image_cache): Now static.
20306 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
20307 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
20308 (x_edge_detection): Remove unnecessary cast that
20309 gcc -Wbad-function-cast diagnoses.
20310 (gif_load): Fix pointer signedness.
20311 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20312 (jpeg_load, gif_load): Rename locals to avoid shadowing.
20313
20314 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
20315
20316 Improve quality of tests for time stamp overflow.
20317 For example, without this patch (encode-time 0 0 0 1 1
20318 1152921504606846976) returns the obviously-bogus value (-948597
20319 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20320 reports time overflow. See
20321 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
20322 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20323 * editfns.c: Include limits.h and intprops.h.
20324 (TIME_T_MIN, TIME_T_MAX): New macros.
20325 (time_overflow): Move earlier, to before first use.
20326 (hi_time, lo_time): New functions, for an accurate test for
20327 out-of-range times.
20328 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20329 (Fget_internal_run_time): Don't assume time_t fits in int.
20330 (make_time): Use list2 instead of Fcons twice.
20331 (Fdecode_time): More accurate test for out-of-range times.
20332 (check_tm_member): New function.
20333 (Fencode_time): Use it, to test for out-of-range times.
20334 (lisp_time_argument): Don't rely on undefined left-shift and
20335 right-shift behavior when checking for time stamp overflow.
20336
20337 * editfns.c (time_overflow): New function, refactoring common code.
20338 (Fformat_time_string, Fdecode_time, Fencode_time):
20339 (Fcurrent_time_string): Use it.
20340
20341 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20342 * dired.c (make_time): Move to ...
20343 * editfns.c (make_time): ... here.
20344 * systime.h: Note the move.
20345
20346 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20347
20348 * fringe.c (update_window_fringes): Remove unused variables.
20349
20350 * unexmacosx.c (copy_data_segment): Also copy __got section.
20351 (Bug#8223)
20352
20353 2011-03-12 Eli Zaretskii <eliz@gnu.org>
20354
20355 * termcap.c [MSDOS]: Include "msdos.h".
20356 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20357 Constify `char *' arguments and their references according to
20358 prototypes in tparam.h.
20359
20360 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
20361
20362 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20363 Adapt all references accordingly.
20364
20365 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20366
20367 2011-03-11 Tom Tromey <tromey@redhat.com>
20368
20369 * buffer.c (syms_of_buffer): Remove obsolete comment.
20370
20371 2011-03-11 Eli Zaretskii <eliz@gnu.org>
20372
20373 * termhooks.h (encode_terminal_code): Declare prototype.
20374
20375 * msdos.c (encode_terminal_code): Don't declare prototype.
20376
20377 * term.c (encode_terminal_code): Now external again, used by
20378 w32console.c and msdos.c.
20379
20380 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20381 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
20382
20383 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
20384
20385 Fix some minor problems found by GCC 4.5.2's static checks.
20386
20387 * fringe.c (update_window_fringes): Mark locals as initialized
20388 (Bug#8227).
20389 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
20390
20391 * alloc.c (mark_fringe_data): Move decl from here ...
20392 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20393 to check its interface.
20394 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20395
20396 * fontset.c (free_realized_fontset): Now static.
20397 (Fset_fontset_font): Rename local to avoid shadowing.
20398 (fontset_font): Mark local as initialized.
20399 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
20400
20401 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20402
20403 * xselect.c (x_disown_buffer_selections): Remove; not used.
20404 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
20405 (x_own_selection, Fx_disown_selection_internal): Rename locals
20406 to avoid shadowing.
20407 (x_handle_dnd_message): Remove local to avoid shadowing.
20408
20409 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20410 so that the caller can use some name other than gcpro1.
20411 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
20412 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20413 (Fx_backspace_delete_keys_p):
20414 Use them to avoid shadowing, and rename vars to avoid shadowing.
20415 (x_decode_color, x_set_name, x_window): Now static.
20416 (Fx_create_frame): Add braces to silence GCC warning.
20417 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
20418 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20419 Remove unused locals.
20420 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20421 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20422 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20423 macros.
20424
20425 * xterm.h (x_mouse_leave): New decl.
20426
20427 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20428 Remove unused functions.
20429 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20430 (x_calc_absolute_position): Now static.
20431 (XTread_socket): Don't define label "out" unless it's used.
20432 Don't declare local "event" unless it's used.
20433 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20434 unless they are used.
20435 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20436 (x_fatal_error_signal): Remove; not used.
20437 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20438 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20439 (x_error_catcher, x_connection_closed, x_error_handler):
20440 (x_error_quitter, xembed_send_message, x_iconify_frame):
20441 (my_log_handler): Rename locals to avoid shadowing.
20442 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
20443 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
20444
20445 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20446 Rename or move locals to avoid shadowing.
20447 (tty_defined_color, merge_face_heights): Now static.
20448 (free_realized_faces_for_fontset): Remove; not used.
20449 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20450 does not deduce is never used uninitialized.
20451 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20452 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
20453
20454 * terminal.c (store_terminal_param): Now static.
20455
20456 * xmenu.c (menu_highlight_callback): Now static.
20457 (set_frame_menubar): Remove unused local.
20458 (xmenu_show): Rename parameter to avoid shadowing.
20459 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20460 since they might point to immutable storage.
20461 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20462 since it's unused otherwise.
20463
20464 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
20465 Add a FIXME, since the code still doesn't look right. (Bug#8215)
20466 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20467 avoids a gcc -Wuninitialized diagnostic.
20468 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
20469 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20470 does not deduce are never used uninitialized.
20471
20472 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20473
20474 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
20475 * window.c (window_loop, size_window):
20476 (run_window_configuration_change_hook, enlarge_window): Likewise.
20477
20478 * window.c (display_buffer): Now static.
20479 (size_window): Mark variables that gcc -Wuninitialized
20480 does not deduce are never used uninitialized.
20481 * window.h (check_all_windows): New decl, to forestall
20482 gcc -Wmissing-prototypes diagnostic.
20483 * dispextern.h (bidi_dump_cached_states): Likewise.
20484
20485 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20486 shadowing.
20487 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
20488 Include <limits.h>.
20489 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20490 and to avoid gcc -Wuninitialized warning.
20491 (load_charset_map): Mark variables that gcc -Wuninitialized
20492 does not deduce are never used uninitialized.
20493 (load_charset): Abort instead of using uninitialized var (Bug#8229).
20494
20495 * coding.c (coding_set_source, coding_set_destination):
20496 Use "else { /* comment */ }" rather than "else /* comment */;"
20497 for clarity, and to avoid gcc -Wempty-body warning.
20498 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20499 a block, when the outer 'i' will do.
20500 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20501 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20502 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20503 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20504 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20505 Rename locals to avoid shadowing.
20506 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
20507 * coding.c (emacs_mule_char, encode_invocation_designation):
20508 Now static, since they're not used elsewhere.
20509 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
20510 (decode_coding_object, encode_coding_object, detect_coding_system):
20511 (decode_coding_emacs_mule): Mark variables that gcc
20512 -Wuninitialized does not deduce are never used uninitialized.
20513 (detect_coding_iso_2022): Initialize a local variable that might
20514 be used uninitialized. Leave a FIXME because it's not clear that
20515 this initialization is needed. (Bug#8211)
20516 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20517 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20518 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20519 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20520 Remove unused macros.
20521
20522 * category.c (hash_get_category_set): Remove unused local var.
20523 (copy_category_table): Now static, since it's not used elsewhere.
20524 * character.c (string_count_byte8): Likewise.
20525
20526 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20527 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20528
20529 * chartab.c (copy_sub_char_table): Now static, since it's not used
20530 elsewhere.
20531 (sub_char_table_ref_and_range, char_table_ref_and_range):
20532 Rename locals to avoid shadowing.
20533 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
20534
20535 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
20536 (BIDI_BOB): Remove unused macro.
20537
20538 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20539 deduce are never used uninitialized.
20540 * term.c (encode_terminal_code): Likewise.
20541
20542 * term.c (encode_terminal_code): Now static. Remove unused local.
20543
20544 * tparam.h: New file.
20545 * term.c, tparam.h: Include it.
20546 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20547 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20548 Move these decls to tparam.h, and make them agree with what
20549 is actually in tparam.c. The previous trick of using incompatible
20550 decls in different modules does not conform to the C standard.
20551 All callers of tparam changed to use tparam's actual API.
20552 * tparam.c (tparam1, tparam, tgoto):
20553 Use const pointers where appropriate.
20554
20555 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20556 * cm.h (struct cm): Likewise.
20557 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20558 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20559 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20560 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20561 (turn_on_face, init_tty): Likewise.
20562 * termchar.h (struct tty_display_info): Likewise.
20563
20564 * term.c (term_mouse_position): Rename local to avoid shadowing.
20565
20566 * alloc.c (mark_ttys): Move decl from here ...
20567 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20568
20569 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20570
20571 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20572
20573 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
20574
20575 * search.c (compile_pattern_1): Remove argument regp, unused since
20576 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20577 (compile_pattern): Don't pass it.
20578
20579 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20580
20581 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20582 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20583 for ! HAVE_GTK3.
20584 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20585
20586 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20587
20588 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20589 gdk_window_get_screen, gdk_window_get_geometry,
20590 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20591 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20592 (xg_get_pixbuf_from_pixmap): New function.
20593 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20594 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20595 Call xg_get_pixbuf_from_pixmap instead of
20596 gdk_pixbuf_get_from_drawable.
20597 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20598 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20599 (xg_check_special_colors): Use GtkStyleContext and its functions
20600 for HAVE_GTK3.
20601 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20602 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20603 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
20604 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20605 Call gtk_widget_get_preferred_size.
20606 (xg_frame_resized): gdk_window_get_geometry only takes 5
20607 parameters.
20608 (xg_win_to_widget, xg_event_is_for_menubar):
20609 Call gdk_x11_window_lookup_for_display.
20610 (xg_set_widget_bg): New function.
20611 (delete_cb): New function.
20612 (xg_create_frame_widgets): Connect delete-event to delete_cb.
20613 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
20614 (xg_set_background_color): Call xg_set_widget_bg.
20615 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20616 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20617 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20618 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20619 if ! HAVE_GTK3.
20620 (update_frame_tool_bar): Call gtk_widget_hide.
20621 (xg_initialize): Use GDK_KEY_g.
20622
20623 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20624 if ! HAVE_GTK3
20625 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20626
20627 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20628 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20629 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20630
20631 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
20632
20633 * w32xfns.c (select_palette): Check success of RealizePalette against
20634 GDI_ERROR, not zero.
20635
20636 See ChangeLog.11 for earlier changes.
20637
20638 ;; Local Variables:
20639 ;; coding: utf-8
20640 ;; End:
20641
20642 Copyright (C) 2011-2012 Free Software Foundation, Inc.
20643
20644 This file is part of GNU Emacs.
20645
20646 GNU Emacs is free software: you can redistribute it and/or modify
20647 it under the terms of the GNU General Public License as published by
20648 the Free Software Foundation, either version 3 of the License, or
20649 (at your option) any later version.
20650
20651 GNU Emacs is distributed in the hope that it will be useful,
20652 but WITHOUT ANY WARRANTY; without even the implied warranty of
20653 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20654 GNU General Public License for more details.
20655
20656 You should have received a copy of the GNU General Public License
20657 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.