]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* lread.c (Vload_source_file_function): Doc fix.
[gnu-emacs] / src / ChangeLog
1 2012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
2
3 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
4
5 2012-12-07 Eli Zaretskii <eliz@gnu.org>
6
7 * indent.c (Fvertical_motion): If a display string will be
8 displayed on the left or the right margin, don't consider it as a
9 factor in cursor positioning. (Bug#13108)
10
11 2012-12-07 Martin Rudalics <rudalics@gmx.at>
12
13 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
14
15 2012-12-05 Eli Zaretskii <eliz@gnu.org>
16
17 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
18 fails, signal an error instead of continuing with an empty
19 string. (Bug#13079)
20 Encode expanded temp file pattern before passing it to mkstemp or
21 mktemp.
22
23 2012-12-04 Eli Zaretskii <eliz@gnu.org>
24
25 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
26 Encode the file name before passing it to dostounix_filename, in
27 case it will downcase it (under w32-downcase-file-names).
28 (Bug#12933)
29
30 2012-12-01 Chong Yidong <cyd@gnu.org>
31
32 * fileio.c (Vauto_save_list_file_name): Doc fix.
33
34 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
35
36 * w32fns.c: Remove prototype of atof.
37 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
38 builds.
39 (file_dialog_callback): Declared UINT_PTR.
40
41 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
42 with 64-bit builds.
43
44 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
45 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
46 defined.
47
48 2012-11-27 Glenn Morris <rgm@gnu.org>
49
50 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
51
52 2012-11-26 Eli Zaretskii <eliz@gnu.org>
53
54 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
55 (Bug#11964)
56
57 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
58
59 Revert recent change for Bug#8855.
60 As reported by Harald Hanche-Olsen in
61 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
62 the change introduces a further bug, of creating lots of zombie
63 processes in some cases. Further work is needed to come up with a
64 better fix for Bug#8855.
65
66 2012-11-24 Eli Zaretskii <eliz@gnu.org>
67
68 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
69 highlighting on the frame was cleared. Prevents assertion
70 violations when repeatedly clicking on the "Top" link of the
71 "bread-crumbs" in Info buffers.
72
73 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
74 Eli Zaretskii <eliz@gnu.org>
75
76 Fix a race condition with glib (Bug#8855).
77 The symptom is a diagnostic "GLib-WARNING **: In call to
78 g_spawn_sync(), exit status of a child process was requested but
79 SIGCHLD action was set to SIG_IGN and ECHILD was received by
80 waitpid(), so exit status can't be returned." The diagnostic
81 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
82 The real bug is a race condition between Emacs and glib: Emacs
83 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
84 so that glib can't find it. Work around the bug by invoking
85 waitpid only on subprocesses that Emacs itself creates.
86
87 This is a backport from the trunk, consisting of:
88
89 * w32proc.c (create_child): Don't clip the PID of the child
90 process to fit into an Emacs integer, as this is no longer a
91 restriction.
92 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
93 reaping only the process specified by PID argument, if that is
94 positive. Use PID instead of dead_child to know which process to
95 reap. Wait for the child to die only if WNOHANG is not in
96 OPTIONS.
97 (sys_select): Don't set dead_child.
98
99 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
100 as it is no longer needed.
101
102 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
103 no longer needed.
104 (create_process, record_child_status_change): Don't use special
105 value -1 in pid field, as the caller now must know the pid rather
106 than having the callee infer it. The inference was sometimes
107 incorrect anyway, due to another race.
108 (create_process): Set new 'alive' member if child is created.
109 (process_status_retrieved): New function.
110 (record_child_status_change): Use it.
111 Accept negative 1st argument, which means to wait for the
112 processes that Emacs already knows about. Move special-case code
113 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
114 processes that have already been waited for, by testing and
115 clearing new 'alive' member. Remove the setting of
116 record_at_most_one_child for the !WNOHANG case.
117 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
118 now does this internally.
119 (handle_child_signal): Let record_child_status_change do all
120 the work, since we do not want to reap all exited child processes,
121 only the child processes that Emacs itself created.
122 * process.h (Lisp_Process): New boolean member 'alive'.
123
124 2012-11-23 Eli Zaretskii <eliz@gnu.org>
125
126 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
127 between bpos_covered and bpos_max. This fixes cursor display when
128 several display strings follow each other.
129
130 * .gdbinit (pgx): If the glyph's object is a string, display the
131 pointer to string data, rather than the value of the string object
132 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
133
134 2012-11-21 Eli Zaretskii <eliz@gnu.org>
135
136 * indent.c (Fvertical_motion): If the starting position is covered
137 by a display string, return to one position before that, to avoid
138 overshooting it inside move_it_to. (Bug#12930)
139
140 2012-11-20 Daniel Colascione <dancol@dancol.org>
141
142 * w32fns.c (Fx_file_dialog):
143 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
144 cygwin_convert_file_name*.
145
146 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
147 Rename cygwin_convert_path* to cygwin_convert_file_name*.
148
149 2012-11-20 Ken Brown <kbrown@cornell.edu>
150
151 * emacs.c (main): Set the G_SLICE environment variable for all
152 Cygwin builds, not just GTK builds. See
153 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
154
155 2012-11-19 Eli Zaretskii <eliz@gnu.org>
156
157 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
158 w32_note_current_window with code. (Backport from trunk.)
159
160 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
161 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
162 Define for the MSVC compiler.
163
164 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
165 semi-colon.
166
167 2012-11-18 Eli Zaretskii <eliz@gnu.org>
168
169 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
170 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
171 dostounix_filename. Prevents crashes down the road, because
172 dostounix_filename assumes it gets a unibyte string. Reported by
173 Michel de Ruiter <michel@sentient.nl>, see
174 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
175
176 2012-11-17 Eli Zaretskii <eliz@gnu.org>
177
178 * w32select.c: Include w32common.h before w32term.h, so that
179 windows.h gets included before w32term.h uses some of its
180 features, see below.
181
182 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
183 typedefs.
184 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
185 prototypes.
186 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
187
188 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
189
190 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
191 (ns_select): Return at once if events are held (Bug#12834).
192
193 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
194
195 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
196 Needed following 2012-10-20 change. (Bug#12902)
197
198 2012-11-16 Glenn Morris <rgm@gnu.org>
199
200 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
201
202 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
203
204 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
205
206 2012-11-14 Eli Zaretskii <eliz@gnu.org>
207
208 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
209 use the same value of thread handle.
210 (start_timer_thread): If the timer thread exited (due to error),
211 clean up by closing the two handles it used. Duplicate the caller
212 thread's handle here, so it gets duplicated only once, when
213 launching the timer thread. Set priority of the timer thread, not
214 the caller thread.
215 (getitimer): Don't duplicate the caller thread's handle here.
216 (Bug#12832)
217
218 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
219
220 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
221 called (Bug#12834).
222
223 2012-11-12 Eli Zaretskii <eliz@gnu.org>
224
225 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
226 passed to pint2str and pint2hrstr to be at most the size of the
227 frame's decode_mode_spec_buffer. This avoids crashes with very
228 large values of FIELD_WIDTH argument to decode_mode_spec.
229 (Bug#12867)
230
231 2012-11-07 Martin Rudalics <rudalics@gmx.at>
232
233 * window.c (Fsplit_window_internal): Set combination limit of
234 new parent window to t iff Vwindow_combination_limit is t;
235 fixing a regression introduced with the change from 2012-09-22.
236 (Fwindow_combination_limit, Fset_window_combination_limit):
237 Fix doc-strings.
238
239 2012-11-06 Eli Zaretskii <eliz@gnu.org>
240
241 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
242 amount when the scroll margins are too large. When scrolling
243 backwards in the buffer, give up if cannot reach point or the
244 scroll margin within a reasonable number of screen lines.
245 Fixes point position in window under scroll-up/down-aggressively when
246 point is positioned many lines beyond the window top/bottom.
247 (Bug#12811)
248
249 2012-11-05 Eli Zaretskii <eliz@gnu.org>
250
251 * ralloc.c (relinquish): If real_morecore fails to return memory
252 to the system, don't crash; instead, leave the last heap
253 unchanged and return. (Bug#12774)
254
255 2012-11-03 Eli Zaretskii <eliz@gnu.org>
256
257 * lisp.mk: Adjust comments to the fact that term/internal is now
258 loaded from loadup.el.
259
260 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
261 (msdos_fatal_signal): New function.
262 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
263 its argument list.
264
265 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
266 for GCC versions before 4.
267 (emacs_raise): Define to call msdos_fatal_signal.
268
269 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
270 iterator when starting in the middle of a display or overlay
271 string. (Bug#12745)
272
273 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
274
275 * widget.c (resize_cb): New function.
276 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
277 (EmacsFrameResize): Check if all is up to date before changing frame
278 size.
279
280 2012-11-01 Eli Zaretskii <eliz@gnu.org>
281
282 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
283
284 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
285
286 Fix crash when using Emacs as commit editor for git (Bug#12697).
287 * callproc.c (setpgrp): Remove macro, as we now use setpgid
288 and it is configured in conf_post.h.
289 (Fcall_process): Don't invoke both setsid and setpgid; the former
290 is enough, if it exists.
291 * callproc.c (Fcall_process, child_setup):
292 * process.c (create_process): Use setpgid.
293 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
294 for the real thing.
295 * dispnew.c (init_display): Initialize the foreground group
296 if we are running a tty display.
297 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
298 * lisp.h (init_foreground_group): New decl.
299 * sysdep.c (inherited_pgroup): New static var.
300 (init_foreground_group, tcsetpgrp_without_stopping)
301 (narrow_foreground_group, widen_foreground_group): New functions.
302 (init_sys_modes): Narrow foreground group.
303 (reset_sys_modes): Widen foreground group.
304
305 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
306
307 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
308
309 2012-10-31 Martin Rudalics <rudalics@gmx.at>
310
311 * minibuf.c (read_minibuf): Restore current buffer since
312 choose_minibuf_frame calling Fset_frame_selected_window may
313 change it (Bug#12766).
314
315 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
316
317 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
318
319 2012-10-30 Kenichi Handa <handa@gnu.org>
320
321 * font.c (Ffont_at): If WINDOW is specified and it is not
322 displaying the current buffer, signal an error.
323
324 2012-10-29 Daniel Colascione <dancol@dancol.org>
325
326 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
327 In preparation for fixing bug#12739, move these functions from
328 here...
329
330 * coding.h, coding.c: ... to here, and compile them only when
331 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
332 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
333
334 2012-10-28 Eli Zaretskii <eliz@gnu.org>
335
336 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
337 (timer_loop, getitimer, setitimer): Use it instead of
338 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
339 'clock'.
340 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
341 literal 10000.
342
343 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
344
345 * nsterm.m (NO_APPDEFINED_DATA): New define.
346 (last_appdefined_event_data): New variable
347 (last_appdefined_event): Remove.
348 (ns_select): Initialize t from last_appdefined_event_data instead
349 of [last_appdefined_event data1].
350 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
351 remove last_appdefined_event (Bug#12698).
352
353 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
354
355 * frame.c (x_set_font): Catch internal error.
356
357 2012-10-27 Eli Zaretskii <eliz@gnu.org>
358
359 Avoid overflow in w32 implementation of interval timers.
360 When possible, for ITIMER_PROF count only times the main thread
361 actually executes.
362 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
363 'volatile ULONGLONG' types. All the other data which was
364 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
365 (GetThreadTimes_Proc): New typedef.
366 (w32_get_timer_time): New function, returns a suitable time value
367 for the timer.
368 (timer_loop): Enter critical section when accessing ULONGLONG
369 values of the itimer_data struct, as these accesses are no longer
370 atomic. Call 'w32_get_timer_time' instead of 'clock'.
371 Remove unused variable.
372 (init_timers): Initialize s_pfn_Get_Thread_Times.
373 (start_timer_thread): Don't assign itimer->caller_thread here.
374 (getitimer): Assign itimer->caller_thread here.
375 (setitimer): Always call getitimer to get the value of ticks_now.
376 (sys_spawnve): Avoid compiler warning about format mismatch.
377
378 2012-10-26 Eli Zaretskii <eliz@gnu.org>
379
380 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
381 mouse movement events if the menu bar is active. This avoids
382 producing a busy "hour-glass" cursor by Windows if the mouse
383 pointer is positioned over a tooltip shown for some menu item.
384
385 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
386
387 Don't assume process IDs fit in int.
388 * emacs.c (shut_down_emacs) [!DOS_NT]:
389 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
390 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
391 Use pid_t, not int, to store process IDs, as 'int'
392 is not wide enough on a few platforms (e.g., AIX and IRIX).
393
394 2012-10-23 Kenichi Handa <handa@gnu.org>
395
396 The following change is to make face-font-rescale-alist work
397 correctly for non-ASCII fonts.
398
399 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
400 (font_open_for_lface): Handle Vface_font_rescale_alist.
401
402 2012-10-23 Chong Yidong <cyd@gnu.org>
403
404 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
405
406 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
407
408 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
409 for screen font.
410 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
411
412 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
413 event (Bug#12681).
414
415 2012-10-21 Glenn Morris <rgm@gnu.org>
416
417 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
418
419 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
420
421 Port to OpenBSD 5.1.
422 * frame.c (Fmouse_position, Fmouse_pixel_position):
423 * xdisp.c (produce_stretch_glyph):
424 Declare local vars only when they're needed.
425 This is clearer and avoids a warning on OpenBSD about unused vars.
426 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
427 This is safer, and avoids OpenBSD warnings about unused vars.
428 * keyboard.c (record_menu_key): Remove unnecessary decl.
429 (poll_timer): Define only if POLL_FOR_INPUT is defined.
430 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
431 as our definition clashes with OpenBSD's.
432 * xfaces.c (load_face_colors, check_lface_attrs)
433 (get_lface_attributes_no_remap, get_lface_attributes)
434 (lface_fully_specified_p, x_supports_face_attributes_p)
435 (tty_supports_face_attributes_p, face_fontset, realize_face)
436 (realize_x_face, realize_tty_face):
437 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
438 merely Lisp_Object *. This is more informative and avoids
439 a warning on OpenBSD about accessing beyond an object's size.
440
441 2012-10-20 Chong Yidong <cyd@gnu.org>
442
443 * lread.c (Fload): Doc fix (Bug#12592).
444
445 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
446
447 * font.c (Ffont_at): Fix previous change.
448
449 2012-10-19 Eli Zaretskii <eliz@gnu.org>
450
451 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
452 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
453 for the reasons.
454
455 * alloc.c (NSTATICS): Decrease to 0x800.
456
457 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
458
459 * fns.c (Fnreverse): Include the problem element when signalling an
460 error (bug#12677).
461
462 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
463
464 * nsterm.m (ns_select): Check writefds before call to
465 FD_ISSET (Bug#12668).
466
467 2012-10-18 Daniel Colascione <dancol@dancol.org>
468
469 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
470 (staticpro): If we run out of staticpro slots, die with an
471 informative error instead of just calling emacs_abort.
472
473 2012-10-18 Martin Rudalics <rudalics@gmx.at>
474
475 Fix two flaws reported by Dmitry Antipov.
476 * window.c (Ftemp_output_buffer_show): Remove.
477 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
478 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
479
480 2012-10-17 Eli Zaretskii <eliz@gnu.org>
481
482 * makefile.w32-in ($(BLD)/w32.$(O)):
483 ($(BLD)/vm-limit.$(O)):
484 ($(BLD)/term.$(O)):
485 ($(BLD)/unexw32.$(O)):
486 ($(BLD)/fileio.$(O)):
487 ($(BLD)/dispnew.$(O)): Update dependencies.
488
489 * w32term.h (w32_initialize_display_info, initialize_w32_display):
490 Add prototypes.
491
492 * w32proc.c: Include ctype.h.
493
494 * w32.h (init_environment, check_windows_init_file)
495 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
496 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
497 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
498 (sys_link): Add prototypes.
499
500 * w32.c: Include w32select.h.
501 (sys_access, e_malloc, sys_select): Add prototypes.
502 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
503
504 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
505
506 * unexw32.c: Include lisp.h and w32.h.
507
508 * term.c [WINDOWSNT]: Include w32term.h.
509
510 * process.c [WINDOWSNT]: Add prototype of sys_select.
511
512 * fileio.c [WINDOWSNT]: Include w32.h.
513
514 * dispnew.c [WINDOWSNT]: Include w32.h.
515
516 * cygw32.c (Fcygwin_convert_path_to_windows)
517 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
518 Lisp_Object values. (Bug#12661)
519
520 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
521 to Lisp_Object. (Bug#12661)
522
523 2012-10-17 Kenichi Handa <handa@gnu.org>
524
525 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
526 invalidate.
527
528 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
529
530 * buffer.c (Fkill_buffer): When unchaining the marker,
531 reset its buffer pointer to NULL (Bug#12652).
532
533 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
534
535 Do not verify indirection counters of killed buffers (Bug#12579).
536 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
537 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
538
539 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
540
541 * alloc.c (Fmake_byte_code): Fix typo in comment.
542 * print.c (print_interval): Define as static to match prototype.
543 * indent.c (disptab_matches_widthtab, recompute_width_table):
544 Convert to eassert.
545
546 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
547
548 * editfns.c (get_system_name): Remove.
549 * lisp.h (get_system_name): Remove prototype.
550 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
551 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
552
553 2012-10-15 Daniel Colascione <dancol@dancol.org>
554
555 * dbusbind.c: Add comment explaining reason for previous change.
556
557 2012-10-15 Martin Rudalics <rudalics@gmx.at>
558
559 * window.c (Fwindow_end): Rewrite check whether cached position
560 can be used (Bug#12600).
561 (resize_frame_windows, grow_mini_window, shrink_mini_window):
562 Set windows_or_buffers_changed.
563
564 2012-10-15 Daniel Colascione <dancol@dancol.org>
565
566 * dbusbind.c: Fix cygw32 build break when compiling with dbus
567 enabled by undefining the symbol "interface", which the platform
568 headers define to something incompatible.
569
570 2012-10-14 Daniel Colascione <dancol@dancol.org>
571
572 * image.c (init_tiff_functions, init_imagemagick_functions)
573 (init_svg_functions): Fix cygw32 build break by using these
574 functions only when WINDOWSNT _and_ HAVE_NTGUI.
575
576 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
577
578 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
579
580 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
581
582 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
583
584 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
585
586 * coding.c (detect_coding): Set coding->id before calling
587 this->detector.
588
589 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
590
591 * fileio.c: Formatting fixes.
592
593 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
594
595 Fix some stat-related races.
596 * fileio.c (Fwrite_region): Avoid race condition if a file is
597 removed or renamed by some other process immediately after Emacs
598 writes it but before Emacs stats it. Do not assume that stat (or
599 fstat) succeeds.
600 * image.c (slurp_file): Resolve the file name with fopen + fstat
601 rather than stat + fopen.
602 (pbm_read_file) [0]: Remove unused code with stat race.
603 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
604 Remove ineffective code with stat race.
605
606 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
607
608 * doc.c (get_doc_string): Don't signal an error if the file is missing.
609
610 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
611
612 * nsterm.m (hold_event_q): New static variable.
613 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
614 ! q_event_ptr.
615 (hold_event): New function.
616 (ns_read_socket): If hold_event_q have events, store them and
617 return (Bug#12384).
618 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
619 is zero (Bug#12384).
620
621 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
622
623 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
624
625 2012-10-12 Eli Zaretskii <eliz@gnu.org>
626
627 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
628
629 * fileio.c (check_existing): New function.
630 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
631 instead of calling 'stat', when what's needed is to check whether
632 a file exists. This avoids expensive system calls on MS-Windows.
633 (Bug#12587)
634
635 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
636
637 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
638 determine whether a file exists and is not a directory.
639
640 * lisp.h (check_existing): Add prototype.
641
642 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
643
644 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
645
646 2012-10-12 Glenn Morris <rgm@gnu.org>
647
648 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
649
650 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
651
652 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
653
654 * eval.c (Fautoload): Remember previous autoload status in load-history.
655
656 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
657
658 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
659 * lread.c (load_each_byte, new_backquote_flag, readchar)
660 (read_filtered_event, lisp_file_lexically_bound_p)
661 (safe_to_load_version, Fload, complete_filename_p, openp)
662 (build_load_history, readevalloop, read_escape, read1)
663 (string_to_number, read_vector, read_list):
664 * macros.c (Fstart_kbd_macro):
665 * marker.c (CONSIDER):
666 * menu.c (parse_single_submenu, digest_single_submenu)
667 (find_and_return_menu_selection, Fx_popup_menu):
668 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
669 (Ftry_completion):
670 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
671 (ns_menu_show):
672 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
673 (xmenu_show, xdialog_show):
674 Use bool for booleans.
675 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
676 as it's not a predicate. All uses changed. Omit unnecessary
677 buffer termination.
678
679 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
680
681 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
682 (save_excursion_restore): Do not restore mark if it was not saved.
683
684 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
685
686 * marker.c (cached_modiff): EMACS_INT, not int.
687
688 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
689 instead of having a wrong decl.
690 * nsmenu.m (waiting_for_input): Remove wrong decl.
691
692 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
693
694 keyboard.c, keymap.c: Use bool for booleans.
695 * dispnew.c (sit_for): Distinguish between 3-way display_option
696 and boolean do_display.
697 * keyboard.c (single_kboard, this_command_key_count_reset)
698 (waiting_for_input, echoing, immediate_quit, input_pending)
699 (interrupt_input, interrupts_deferred, pop_kboard)
700 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
701 (command_loop_1, adjust_point_for_property)
702 (safe_run_hooks_error, input_polling_used, read_char):
703 (help_char_p, readable_events, kbd_buffer_events_waiting)
704 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
705 (lucid_event_type_list_p, get_input_pending):
706 (gobble_input, menu_separator_name_p, menu_bar_item)
707 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
708 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
709 (keyremap_step, test_undefined, read_key_sequence)
710 (detect_input_pending, detect_input_pending_ignore_squeezables)
711 (detect_input_pending_run_timers, requeued_events_pending_p)
712 (quit_throw_to_read_char, Fset_input_interrupt_mode):
713 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
714 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
715 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
716 (accessible_keymaps_1, Fkey_description, push_key_description):
717 (shadow_lookup, struct where_is_internal_data)
718 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
719 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
720 (describe_map, describe_vector):
721 * menu.c (single_menu_item):
722 * nsmenu.m (ns_update_menubar):
723 * process.c (wait_reading_process_output):
724 * search.c (scan_buffer, scan_newline):
725 Use bool for boolean.
726 * keyboard.c (timers_run, swallow_events)
727 (detect_input_pending_run_timers):
728 * process.c (wait_reading_process_output):
729 Use unsigned for counter where wraparound-on-overflow is desired,
730 since unsigned is guaranteed to have that behavior and signed is not.
731 (read_char): Use ptrdiff_t for string length.
732 (get_input_pending): Remove first argument, since it was always
733 the same pointer-to-int (now pointer-to-boolean) &input_pending,
734 and behave as if it had that value. Return new value of
735 input_pending. All callers changed.
736 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
737 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
738 a string length.
739 * keymap.c (push_key_description): Omit last arg, which was always 1.
740 All callers changed.
741
742 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
743
744 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
745
746 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
747 ($(BLD)/term.$(O)): Update dependencies.
748
749 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
750
751 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
752 * lisp.h (enum pvec_type): Adjust comments and omit explicit
753 initializer for PVEC_NORMAL_VECTOR.
754
755 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
756
757 Clean out old termopts cruft.
758 * termopts.h (flow_control, meta_key): Remove unused decls.
759 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
760 Don't include termopts.h.
761
762 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
763
764 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
765
766 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
767
768 * commands.h (immediate_quit): Remove duplicate decl.
769
770 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
771
772 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
773 caching.
774 (nsfont_open): Remove setting of Vfonts_in_cache.
775 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
776
777 2012-10-09 Eli Zaretskii <eliz@gnu.org>
778
779 * w32fns.c (w32_last_error): Change the return value to DWORD, to
780 match what GetLastError returns. Explain why the function is
781 needed.
782
783 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
784 'is_tooltip_frame', to avoid confusion with its global namesake.
785
786 2012-10-08 Daniel Colascione <dancol@dancol.org>
787
788 * xdisp.c (start_hourglass): Call w32_note_current_window when
789 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
790 build that caused Emacs to display the hourglass cursor forever.
791
792 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
793 which is broken under remote desktop, calculate the number of
794 colors available for a display based on the display's number of
795 planes and number of bits per pixel per plane. (bug#10397).
796
797 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
798
799 * nsfont.m (Vfonts_in_cache): New variable.
800 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
801 are used. Add cached fonts to Vfonts_in_cache.
802 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
803
804 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
805
806 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
807 in nt/config.nt.
808 (FONT_H): Define after FRAME_H.
809 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
810 Update dependencies.
811
812 * w32term.c: Remove leftover declaration of keyboard_codepage.
813
814 2012-10-08 Eli Zaretskii <eliz@gnu.org>
815
816 * makefile.w32-in (FONT_H): Add $(FRAME_H).
817 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
818 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
819 (GLOBAL_SOURCES): Add cygw32.c.
820 ($(BLD)/unexw32.$(O)):
821 ($(BLD)/w32.$(O)):
822 ($(BLD)/w32console.$(O)):
823 ($(BLD)/w32fns.$(O)):
824 ($(BLD)/w32heap.$(O)):
825 ($(BLD)/w32menu.$(O)):
826 ($(BLD)/w32proc.$(O)): Add w32common.h.
827
828 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
829 'const char *'.
830 (x_to_w32_color): Don't modify the argument, modify a copy instead.
831
832 2012-10-08 Daniel Colascione <dancol@dancol.org>
833
834 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
835 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
836 accidental message numbering hole. Change other messages to
837 match.
838
839 * w32select.h (HAVE_W32SELECT): Remove.
840
841 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
842 w32common.h instead of w32heap.h.
843
844 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
845 (get_allocation_unit, get_processor_type, get_w32_major_version)
846 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
847 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
848 (OS_NT, os_subtype, cache_system_info): Move declarations to
849 w32common.
850
851 * w32heap.c: Include w32common.h.
852 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
853 (w32_minor_version, w32_build_number, w32_subtype):
854 Remove duplicate definitions.
855
856 * w32fns.c: Include w32common.h; include w32heap.h only in
857 WINDOWSNT.
858
859 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
860 Use `report_file_error' instead of `error' in order to better
861 inform users of what went wrong. Increase NTGUI_UNICODE file
862 dialog box file name length to 32k, the maximum allowed by the NT
863 kernel.
864
865 * w32common.h: New file.
866 (ROUND_UP, ROUND_DOWN, get_page_size)
867 (get_allocation_unit, get_processor_type, get_w32_major_version)
868 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
869 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
870 (OS_NT, os_subtype, cache_system_info): Move here.
871
872 * unexw32.c, unexcw.c: Include w32common.h.
873
874 * emacs.c (main): Use (defined (WINDOWSNT) || defined
875 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
876 to call syms_of_w32select.
877
878 * cygw32.h: Remove obsolete EXFUN declarations.
879
880 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
881
882 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
883 of w32inevt.o from SOME_MACHINE_OBJECTS.
884
885 2012-10-08 Daniel Colascione <dancol@dancol.org>
886
887 * image.c: Permanent fix for JPEG compilation issue --- limit
888 jpeglib `boolean' redefinition to Cygwin builds.
889
890 2012-10-08 Eli Zaretskii <eliz@gnu.org>
891
892 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
893
894 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
895 Cygwin.
896
897 2012-10-08 Daniel Colascione <dancol@dancol.org>
898
899 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
900 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
901 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
902 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
903 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
904 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
905 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
906 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
907 now a supported configuration.
908
909 * Makefile.in: consolidate image variables into LIBIMAGE; add
910 W32_OBJ and W32_LIBS. Compile new files.
911
912 * conf_post.h:
913 (_DebPrint) declare tracing facility for W32 debugging. We need
914 to unify tracing later.
915
916 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
917 unconditional use of W32 Unicode functions. Cygwin runs only on
918 100% Unicode operating systems.
919
920 * cygw32.c: New file. Define Cygwin-specific facilities.
921 (Fcygwin_convert_path_to_windows)
922 (Fcygwin_convert_path_from_windows): New user functions for
923 accessing Cygwin path-munging routines.
924
925 * cygw32.h: New file.
926 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
927 UTF-16LE strings temporarily inside non-Lisp-visible string
928 objects.
929
930 (w32_strerror): Just what it says on the tin.
931
932 * emacs.c: Make the NS fork-then-exec code for daemon-launching
933 also run for Cygwin; both systems have the same problem with using
934 GUI facilities in a forked child. Also call syms_of_cygw32,
935 syms_of_w32select in correct places.
936
937 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
938 needs fork-then-exec for daemon launching.
939
940 * font.h: Include frame.h.
941
942 * image.c: Use the image library cache machinery only when we're
943 compiling for native WINDOWSNT; Cygwin can use shared libraries
944 like any other Unixlike system.
945
946 * keyboard.c: Clarify a comment regarding the input loop.
947
948 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
949 functions directly instead of trying to detect at runtime that our
950 host operating system supports them. We make this change for two
951 reasons: Cygwin lacks support for the multibyte character
952 conversion functions used by the legacy menu code, and Cygwin
953 never needs to rely on non-Unicode APIs.
954
955 * unexw32.c (hinst): Declare extern.
956
957 * w32.c: Change header order;
958 (w32_strerror): Move to w32fns.c because we need it for
959 non-WINDOWSNT builds.
960
961 * w32.h: Add #error macro to make sure we don't include w32.h for
962 Cygwin builds. Remove w32select declarations.
963
964 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
965 w32fns.c. w32console.c is WINDOWSNT-only.
966
967 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
968 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
969 POSIXy alternative.
970 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
971 (w32_major_version, w32_minor_version, w32_build_number)
972 (os_subtype, sound_type): Define here
973 (w32_defined_color): Make color parameter const for consistency
974 with other _defined_color functions.
975 (w32_createwindow): Unconditionally call w32_init_class instead of
976 doing so only when hprevinst is non-NULL. Plumbing hprevinst
977 through the code is complex and unnecessary because class
978 registration is practically free.
979 (w32_name_of_message): New EMACSDEBUG-only function.
980 (Fset_message_beep): Move here
981 (Fx_open_connection): Require that the display name for Windows be
982 "w32" for consistency, emacsclient disambiguation, and maybe, one
983 day, multi-window-system support.
984 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
985 Cygwin files for W32 GUI facilities, since these clearly don't
986 expect Cygwin names.
987 (_DebPrint): Define.
988 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
989 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
990 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
991 (w32_last_error): Remove.
992
993 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
994
995 * w32heap.c (syspage_mask): Declare here.
996 (cache_system_info): Remove.
997
998 * w32inevt.c (faked_key): Define globally, not statically.
999 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1000 (w32_console_toggle_lock_key): Move to w32fns.c.
1001
1002 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1003
1004 * w32proc.c (_DebPrint): Move to w32fns.c.
1005 * w32select.c: Include string.h, stdio.h for Cygwin.
1006 * w32select.h: New File.
1007
1008 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1009 get_osfhandle.
1010 (w32_message_fd): New variable. Under Cygwin, holds the file
1011 descriptor the system used to tell us about pending thread
1012 messages.
1013
1014 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1015 that prevented compilation under non-WINDOWSNT systems.
1016
1017 (w32_initialize): Open /dev/windows and assign it to
1018 w32_message_fd. Provide w32 feature.
1019
1020 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1021 (WM_EMACS_INPUT_READY): add.
1022 (prepend_msg, w32_message_fd): Declare globally.
1023
1024 * w32xfns.c:
1025 (keyboard_handle): Use only when WINDOWSNT.
1026 (notify_msg_ready): New function. Posts a message to the main
1027 thread's message queue under CYGWIN, which wakes up the main
1028 thread from select(2) by making the /dev/windows file descriptor
1029 ready. Under WINDOWSNT, it sets an event the same way the old
1030 code did.
1031
1032 (post, prepend_msg): Actually call notify_msg_ready instead of
1033 setting the input event directly.
1034
1035 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1036
1037 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1038 but it still has blocs in it, don't return it to the system,
1039 instead of aborting. (Bug#12402)
1040
1041 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1042
1043 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1044
1045 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1046 MAC_OS_X_VERSION_10_6.
1047 (syms_of_nsterm): Remove comment about Panther and above for
1048 ns-antialias-text.
1049 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1050 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1051 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1052
1053 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1054 MAC_OS_X_VERSION_10_4.
1055
1056 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1057 MAC_OS_X_VERSION_10_2.
1058
1059 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1060
1061 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1062 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1063
1064 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1065 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1066 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1067 Remove ns_in_resize check.
1068 (ns_clear_frame_area): Remove resize handle code.
1069
1070 * nsfns.m (ns_in_resize): Remove.
1071 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1072 Remove ns_in_resize check.
1073
1074 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1075
1076 Improve sys_siglist detection.
1077 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1078 defined as a macro, as is done in Solaris.
1079 (sys_siglist_entries): New macro.
1080 (save_strsignal): Use it.
1081 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1082 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1083
1084 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1085
1086 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1087 fullscreen/Fullscreen.
1088
1089 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1090 tobar_height is new.
1091
1092 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1093 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1094 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1095 (windowDidResize:): Check for correct window if old style fullscreen.
1096 Capitalize word in comment. Remove incorrect comment.
1097 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1098 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1099 error in drawing background.
1100 (toggleFullScreen:): Remove comment. Rearrange calls.
1101 Set toolbar values to zero, save old height in tobar_height.
1102 Restore tool bar height when leaving fullscreen.
1103 (canBecomeMainWindow): New function.
1104
1105 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1108
1109 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1110
1111 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1112
1113 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1114 that time stamps of directories could also be changed.
1115 Don't request the too broad GENERIC_WRITE, only the more restrictive
1116 FILE_WRITE_ATTRIBUTES access rights.
1117
1118 * fileio.c (Fset_file_times): Special-case ignoring errors for
1119 directories only on MSDOS, not on MS-Windows.
1120
1121 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1122
1123 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1124
1125 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1126
1127 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1128 see whether CreateFile failed.
1129
1130 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1131
1132 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1133 to avoid similar races.
1134 * keyboard.c (pending_signals): Now bool, not int.
1135
1136 Port timers to OpenBSD, plus check for timer failures.
1137 OpenBSD problem reported by Han Boetes.
1138 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1139 and/or setitimer.
1140 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1141 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1142 like OpenBSD, which has timer_settime but does not declare it.
1143 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1144 whether to use itimerspec-related primitives. All uses of
1145 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1146
1147 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 * profiler.c (handle_profiler_signal): Fix a malloc race
1150 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1151
1152 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1153
1154 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1155
1156 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1157
1158 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1159 consistent with the change in return value of 'safe_strsignal'.
1160
1161 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1162
1163 Prefer plain 'static' to 'static inline' (Bug#12541).
1164 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1165 (bidi_set_sor_type, bidi_push_embedding_level)
1166 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1167 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1168 (bidi_cache_search, bidi_cache_ensure_space)
1169 (bidi_cache_iterator_state, bidi_cache_find)
1170 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1171 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1172 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1173 Now 'static', not 'static inline'.
1174
1175 Count overruns when profiling; change units to ns.
1176 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1177 Give extra weight to samples after overruns, to attempt to count
1178 the time more accurately.
1179 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1180 the underlying primitives nominally do ns.
1181 (Fprofiler_cpu_start): Document the change. Mention that
1182 the sampling intervals are only approximate.
1183
1184 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1185
1186 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1187
1188 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1189 case for the special 0 coding-system.
1190
1191 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1192 (Fmake_overlay): Remove redundant tests.
1193 (fix_start_end_in_overlays): Remove redundant recentering.
1194
1195 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1196
1197 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1198 Update dependencies.
1199
1200 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1201
1202 Fix a malloc race condition involving strsignal.
1203 A signal can arrive in the middle of a malloc, and Emacs's signal
1204 handler can invoke strsignal, which can invoke malloc, which is
1205 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1206 Fix it by altering the signal handler so that it does not invoke
1207 strsignal.
1208 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1209 * process.c (status_message): Use const pointer, in case strsignal
1210 is #defined to safe_strsignal.
1211 * sysdep.c (sys_siglist, init_signals): Always define and
1212 initialize a substitute sys_siglist if the system does not define
1213 one, even if HAVE_STRSIGNAL.
1214 (safe_strsignal): Rename from strsignal. Always define,
1215 using sys_siglist. Return a const pointer.
1216 * syssignal.h (safe_strsignal): New decl.
1217 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1218
1219 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1220
1221 * w32proc.c (timer_loop): Fix code that waits for timer
1222 expiration, to avoid high CPU usage.
1223
1224 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1225
1226 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1227 (sweep_weak_table): Remove redundant prototypes.
1228
1229 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1230
1231 * emacs.c: Move the inclusion of TERM_HEADER after including
1232 windows.h on WINDOWSNT. This avoids compilation problems with
1233 MSVC.
1234
1235 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1236
1237 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1238 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1239 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1240 as the previous version used 'void *'.
1241
1242 * ralloc.c (ROUNDUP): Fix last change.
1243 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1244 'size_t'.
1245
1246 * w32proc.c <disable_itimers>: New static flag.
1247 (init_timers): Initialize it to zero, after creating the critical
1248 sections used by the timer threads.
1249 (term_timers): Set to 1 before deleting the critical sections.
1250 (getitimer, setitimer): If disable_itimers is non-zero, return an
1251 error indication without doing anything. Reported by Fabrice
1252 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1253 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1254 return results.
1255 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1256 support timers.
1257
1258 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1259 term_ntproc after all the other bookkeeping, to get timers working
1260 as long as possible.
1261
1262 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1263
1264 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1265 Suggested by Juri Linkov in
1266 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1267
1268 Prefer plain 'static' to 'static inline' (Bug#12541).
1269 With static functions, modern compilers inline pretty well by
1270 themselves; advice from programmers often hurts as much as it helps.
1271 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1272 this change shrinks the text size of the Emacs executable by 1.1%
1273 without affecting CPU significantly in my benchmark.
1274 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1275 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1276 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1277 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1278 (bset_auto_fill_function, bset_auto_save_file_format)
1279 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1280 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1281 (bset_cache_long_line_scans, bset_case_fold_search)
1282 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1283 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1284 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1285 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1286 (bset_header_line_format, bset_indicate_buffer_boundaries)
1287 (bset_indicate_empty_lines, bset_invisibility_spec)
1288 (bset_left_fringe_width, bset_major_mode, bset_mark)
1289 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1290 (bset_name, bset_overwrite_mode, bset_pt_marker)
1291 (bset_right_fringe_width, bset_save_length)
1292 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1293 (bset_scroll_up_aggressively, bset_selective_display)
1294 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1295 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1296 (set_buffer_overlays_after):
1297 * category.c (bset_category_table):
1298 * charset.c (read_hex):
1299 * coding.c (produce_composition, produce_charset)
1300 (handle_composition_annotation, handle_charset_annotation)
1301 (char_encodable_p):
1302 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1303 (assign_row, set_frame_matrix_frame, make_current)
1304 (add_row_entry):
1305 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1306 * fns.c (maybe_resize_hash_table):
1307 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1308 * gmalloc.c (register_heapinfo):
1309 * image.c (lookup_image_type):
1310 * intervals.c (set_interval_object, set_interval_left)
1311 (set_interval_right, copy_interval_parent, rotate_right)
1312 (rotate_left, balance_possible_root_interval):
1313 * keyboard.c (kset_echo_string, kset_kbd_queue)
1314 (kset_keyboard_translate_table, kset_last_prefix_arg)
1315 (kset_last_repeatable_command, kset_local_function_key_map)
1316 (kset_overriding_terminal_local_map, kset_real_last_command)
1317 (kset_system_key_syms, clear_event, set_prop):
1318 * lread.c (digit_to_number):
1319 * marker.c (attach_marker, live_buffer, set_marker_internal):
1320 * nsterm.m (ns_compute_glyph_string_overhangs):
1321 * process.c (pset_buffer, pset_command)
1322 (pset_decode_coding_system, pset_decoding_buf)
1323 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1324 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1325 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1326 * syntax.c (bset_syntax_table, dec_bytepos):
1327 * terminal.c (tset_param_alist):
1328 * textprop.c (interval_has_some_properties)
1329 (interval_has_some_properties_list):
1330 * window.c (wset_combination_limit, wset_dedicated)
1331 (wset_display_table, wset_hchild, wset_left_fringe_width)
1332 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1333 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1334 (wset_right_fringe_width, wset_right_margin_cols)
1335 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1336 (wset_vertical_scroll_bar_type, wset_window_parameters):
1337 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1338 (wset_column_number_displayed, wset_region_showing)
1339 (window_box_edges, run_window_scroll_functions)
1340 (append_glyph_string_lists, prepend_glyph_string_lists)
1341 (append_glyph_string, set_glyph_string_background_width)
1342 (append_glyph, append_composite_glyph)
1343 (take_vertical_position_into_account):
1344 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1345 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1346 (lface_hash, lface_same_font_attributes_p, lookup_face):
1347 * xml.c (libxml2_loaded_p):
1348 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1349 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1350 Now 'static', not 'static inline'.
1351
1352 * bidi.c: Tune.
1353 (bidi_copy_it): Do the whole copy with a single memcpy.
1354 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1355
1356 Revert the FOLLOW-SYMLINKS change for file-attributes.
1357 Doing it right would require several changes to Tramp, and there's
1358 not enough time to get that tested before the freeze today.
1359 * dired.c (directory_files_internal, Ffile_attributes):
1360 Undo last change.
1361
1362 * frame.c (x_report_frame_params): Port better to wider ints.
1363 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1364 or that pointers can be printed in 15 decimal digits.
1365 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1366
1367 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1368
1369 Support x64 build on MS-Windows.
1370 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1371 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1372 compatibility with x64.
1373 (x_get_focus_frame): Add prototype.
1374
1375 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1376 defining an XRectangle structure.
1377
1378 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1379 arithmetics for compatibility with x64.
1380
1381 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1382 compatibility with x64.
1383
1384 * w32heap.h: Adjust prototypes and declarations.
1385
1386 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1387 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1388 DWORD, long, and unsigned long, for compatibility with x64.
1389 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1390 (sbrk): Argument is now of type ptrdiff_t.
1391
1392 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1393 less than 0x0500.
1394 (w32_msg_pump): Use WPARAM type for 'result'.
1395
1396 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1397 architecture.
1398 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1399 compatibility with x64.
1400
1401 * vm-limit.c (lim_data): Now size_t.
1402 (check_memory_limits): Adjust prototypes of real_morecore and
1403 __morecore to receive argument of type ptrdiff_t. Use size_t for
1404 five_percent and data_size.
1405
1406 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1407 variables, for compatibility with x64.
1408 (rva_to_section, offset_to_section, relocate_offset)
1409 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1410 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1411 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1412 for compatibility with x64.
1413
1414 * sysdep.c (STDERR_FILENO): Define if not already defined.
1415
1416 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1417 (__morecore): Argument type is now ptrdiff_t.
1418 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1419 (relinquish): Use ptrdiff_t type for 'excess'.
1420 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1421
1422 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1423 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1424 instead of a literal number.
1425
1426 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1427 (min): Define only if not already defined.
1428
1429 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1430 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1431 hosts.
1432
1433 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1434 'bitmaps' is a pointer.
1435
1436 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1437
1438 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1439
1440 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1441
1442 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1443 * dired.c (directory_files_internal, Ffile_attributes):
1444 New arg follow_symlinks. All uses changed.
1445
1446 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1447
1448 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1449
1450 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1451
1452 Support atimers and CPU profiler via profile.c on MS-Windows.
1453 * w32proc.c (sig_mask, crit_sig): New static variables.
1454 (sys_signal): Support SIGALRM and SIGPROF.
1455 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1456 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1457 sigfillset, and sigprocmask are no longer no-ops.
1458 (sigismember): New function.
1459 (struct itimer_data): New definition.
1460 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1461 (crit_prof): New static variables.
1462 (MAX_SINGLE_SLEEP): New definition.
1463 (timer_loop, stop_timer_thread, term_timers, init_timers)
1464 (start_timer_thread, getitimer, setitimer): New functions.
1465 (alarm): No longer a no-op, calls setitimer.
1466
1467 * w32.c (term_ntproc): Call term_timers.
1468 (init_ntproc): Make sure all signals are unblocked at startup, to
1469 erase any traces of dumping. Call init_timers.
1470
1471 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1472 Windows-specific code to display the hourglass mouse pointer is no
1473 longer used.
1474 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1475 to hourglass timer expiration.
1476 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1477 Remove, no longer used.
1478 (w32_note_current_window, show_hourglass, hide_hourglass):
1479 New functions, in support of hourglass cursor display similar to other
1480 window systems.
1481 (syms_of_w32fns): Don't initialize hourglass_timer.
1482
1483 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1484 WINDOWSNT as well.
1485 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1486
1487 * w32.h (init_timers, term_timers): Add prototypes.
1488
1489 2012-09-30 Kenichi Handa <handa@gnu.org>
1490
1491 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1492 to the buffer relocation which may be caused by ccl_driver.
1493
1494 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1495
1496 * xfns.c (Fx_file_dialog): Update comment.
1497
1498 * w32fns.c (Fx_file_dialog): Update comment.
1499
1500 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1501 Initialize panel name field if OSX >= 10.6.
1502
1503 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1504
1505 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1506
1507 * nsterm.m (NEW_STYLE_FS): New define.
1508 (ns_fullscreen_hook, windowWillEnterFullScreen)
1509 (windowDidEnterFullScreen, windowWillExitFullScreen)
1510 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1511 (setFSValue): New functions.
1512 (EmacsFSWindow): New implementation.
1513 (canBecomeKeyWindow): New function for EmacsFSWindow.
1514 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1515 (dealloc): Release nonfs_window if in fullscreen.
1516 (updateFrameSize:): Call windowDidMove to update top/left.
1517 (windowWillResize:toSize:): Check if frame is still maximized.
1518 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1519 next_maximized, maximized_width, maximized_height and nonfs_window.
1520 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1521 tbar_height.
1522 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1523 fullscreen. Set maximized_width/height. Act on next_maximized.
1524
1525 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1526 (EmacsView): Add variables for fullscreen.
1527 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1528 (EmacsFSWindow): New interface for fullscreen.
1529
1530 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1531
1532 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1533
1534 2012-09-30 Chong Yidong <cyd@gnu.org>
1535
1536 * fns.c (Frandom): Doc fix.
1537
1538 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1539
1540 * window.c (Vwindow_combination_limit): New default value.
1541 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1542
1543 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1544
1545 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1546 Suggested by Eli Zaretskii in
1547 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1548
1549 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1550
1551 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1552 HAVE_TIMER_SETTIME is defined.
1553
1554 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 Profiler improvements: more-accurate timers, overflow checks.
1557 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1558 signal.h, setjmp.h. Include systime.h instead.
1559 (saturated_add): New function.
1560 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1561 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1562 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1563 New static vars.
1564 (enum profiler_cpu_running): New enum.
1565 (profiler_cpu_running): Now of that enum type, not bool.
1566 All uses changed to store the new value.
1567 (handle_profiler_signal): Rename from sigprof_handler_1,
1568 for consistency with other handlers. Do not check whether
1569 cpu_log is a hash-table if garbage collecting, since it
1570 doesn't matter in that case.
1571 (deliver_profiler_signal): Rename from sigprof_handler,
1572 for consistency with other handlers.
1573 (setup_cpu_timer): New function, with much of what used to be in
1574 Fprofiler_cpu_start. Check for out-of-range argument.
1575 Prefer timer_settime if available, and prefer
1576 thread cputime clocks, then process cputime clocks, then
1577 monotonic clocks, to the old realtime clock. Use make_timeval
1578 to round more-correctly when falling back to setitimer.
1579 (Fprofiler_cpu_start): Use it.
1580 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1581 Don't assume that passing NULL as the 2nd argument of setitimer
1582 is the same as passing a pointer to all-zero storage.
1583 Ignore SIGPROF afterwards.
1584 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1585 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1586 non-fatal signal handlers. Ignore SIGPROF on startup.
1587 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1588 in profiler.c, since sysdep.c now uses it.
1589
1590 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1591 Suggested by Eli Zaretskii in
1592 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1593
1594 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1595
1596 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1597
1598 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1599
1600 * lisp.h (struct backtrace): Remove indirection for `function' field.
1601 * xdisp.c (redisplay_internal):
1602 * profiler.c (record_backtrace, sigprof_handler_1):
1603 * alloc.c (Fgarbage_collect):
1604 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1605 (Fbacktrace_frame): Adjust accordingly.
1606
1607 2012-09-28 Glenn Morris <rgm@gnu.org>
1608
1609 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1610 (Frun_hook_with_args_until_failure): Doc fixes.
1611
1612 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1613
1614 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1615 Qautomatic_redisplay and change the symbol name. All users changed.
1616
1617 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1618
1619 * profiler.c (sigprof_handler): Fix race condition.
1620
1621 2012-09-28 Glenn Morris <rgm@gnu.org>
1622
1623 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1624
1625 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 Check more robustly for timer_settime.
1628 * Makefile.in (LIB_TIMER_TIME): New macro.
1629 (LIBES): Add it.
1630 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1631 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1632 call timer_settime.
1633
1634 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1635
1636 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1637
1638 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1639
1640 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1641
1642 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 * character.h (MAYBE_UNIFY_CHAR): Remove.
1645 * charset.c, charset.h (maybe_unify_char): Now static.
1646 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1647 Since this stuff is now private to charset.c, there's no need for
1648 a public macro and no need to inline by hand.
1649
1650 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1651 Stefan Monnier <monnier@iro.umontreal.ca>
1652 Juanma Barranquero <lekktu@gmail.com>
1653
1654 * profiler.c: New file.
1655 * Makefile.in (base_obj): Add profiler.o.
1656 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1657 ($(BLD)/profiler.$(O)): New target.
1658 * emacs.c (main): Call syms_of_profiler.
1659 * alloc.c (Qautomatic_gc): New constant.
1660 (MALLOC_PROBE): New macro.
1661 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1662 (total_bytes_of_live_objects): New function.
1663 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1664 Call malloc_probe for the memory profiler.
1665 (syms_of_alloc): Define Qautomatic_gc.
1666 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1667 race condition.
1668 (struct backtrace): Move definition...
1669 * lisp.h (struct backtrace): ..here.
1670 (Qautomatic_gc, profiler_memory_running): Declare vars.
1671 (malloc_probe, syms_of_profiler): Declare functions.
1672 * xdisp.c (Qautomatic_redisplay): New constant.
1673 (redisplay_internal): Record itself in backtrace_list.
1674 (syms_of_xdisp): Define Qautomatic_redisplay.
1675
1676 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1677 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1678
1679 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1680
1681 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 Prefer POSIX timers if available.
1684 They avoid a race if the timer is too close to the current time.
1685 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1686 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1687 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1688
1689 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1690
1691 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1692 CHAR_STRING_ADVANCE.
1693 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1694 STRING_CHAR_ADVANCE.
1695
1696 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1697
1698 Move Vlibrary_cache to emacs.c and reset before dumping.
1699
1700 * lisp.h (reset_image_types): Declare.
1701 [WINDOWSNT] (Vlibrary_cache): Declare.
1702
1703 * image.c (reset_image_types): New function.
1704
1705 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1706 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1707 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1708
1709 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1710 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1711
1712 * w32.h (Vlibrary_cache): Do not declare.
1713
1714 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1715
1716 * w32proc.c (sys_signal): Handle all signals defined by the
1717 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1718 handlers for signals supported by Windows. Don't override
1719 term_ntproc as the handler for SIGABRT.
1720 (sigaction): Rewrite to call sys_signal instead of duplicating its
1721 code.
1722 (sys_kill): Improve commentary.
1723
1724 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1725 consistency with a signature of a signal handler. All callers
1726 changed.
1727 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1728 install term_ntproc as a signal handler for SIGABRT, as that
1729 should be done by the dumped Emacs.
1730
1731 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1732
1733 * w32select.c (term_w32select): Protect against repeated
1734 invocation by setting clipboard_owner to NULL after calling
1735 DestroyWindow.
1736
1737 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1738 and term_ntproc to their modified signatures.
1739
1740 * character.c (char_string, string_char): Remove calls to
1741 MAYBE_UNIFY_CHAR. See the discussion starting at
1742 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1743 for the details.
1744
1745 2012-09-25 Chong Yidong <cyd@gnu.org>
1746
1747 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1748
1749 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1750
1751 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1752 when encountering an unknown bytecode.
1753
1754 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1755
1756 image.c, indent.c: Use bool for booleans.
1757 * dispextern.h (struct image_type): Members valid_p, load, init
1758 now return bool, not int. All uses changed.
1759 * image.c: Omit unnecessary static decls.
1760 (x_create_bitmap_mask, x_build_heuristic_mask):
1761 Return void, not int, since callers don't care about the return value.
1762 (x_create_bitmap_mask, define_image_type, valid_image_p)
1763 (struct image_keyword, parse_image_spec, image_spec_value)
1764 (check_image_size, image_background)
1765 (image_background_transparent, x_clear_image_1)
1766 (postprocess_image, lookup_image, x_check_image_size)
1767 (x_create_x_image_and_pixmap, xbm_image_p)
1768 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1769 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1770 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1771 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1772 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1773 (png_image_p, init_png_functions, png_load_body, png_load)
1774 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1775 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1776 (init_gif_functions, gif_load, imagemagick_image_p)
1777 (imagemagick_load_image, imagemagick_load, svg_image_p)
1778 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1779 (gs_load):
1780 * nsimage.m (ns_load_image):
1781 * nsterm.m (ns_defined_color):
1782 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1783 * xfns.c (x_defined_color):
1784 * xterm.c (x_alloc_lighter_color_for_widget)
1785 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1786 (x_alloc_lighter_color):
1787 * indent.c (disptab_matches_widthtab, current_column)
1788 (scan_for_column, string_display_width, indented_beyond_p)
1789 (compute_motion, vmotion, Fvertical_motion):
1790 Use bool for booleans.
1791
1792 2012-09-24 Chong Yidong <cyd@gnu.org>
1793
1794 * chartab.c (Fset_char_table_default): Obsolete function removed.
1795
1796 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1797
1798 Move pid_t related decls out of lisp.h.
1799 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1800 (interruptible_wait_for_termination):
1801 Move these decls from lisp.h to syswait.h, since they use pid_t.
1802 Needed on FreeBSD; see Herbert J. Skuhra in
1803 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1804 * callproc.c: Include syswait.h.
1805
1806 gnutls.c, gtkutil.c: Use bool for boolean.
1807 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1808 (emacs_gnutls_handle_error):
1809 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1810 (xg_hide_tooltip, xg_create_frame_widgets)
1811 (create_dialog, xg_uses_old_file_dialog)
1812 (xg_get_file_with_chooser, xg_get_file_with_selection)
1813 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1814 (xg_item_label_same_p, xg_update_menubar)
1815 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1816 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1817 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1818 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1819 (update_frame_tool_bar, free_frame_tool_bar):
1820 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1821 * nsmenu.m (ns_update_menubar):
1822 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1823 * xfns.c (Fx_show_tip) [USE_GTK]:
1824 Use bool for boolean.
1825 * gtkutil.c (xg_update_frame_menubar):
1826 * xmenu.c (update_frame_menubar):
1827 Return void, not int, since caller ignores return value.
1828 * gtkutil.c (xg_change_toolbar_position):
1829 Return void, not 1.
1830
1831 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1832
1833 * makefile.w32-in (BLOCKINPUT_H): Remove.
1834 (SYSSIGNAL_H): New macro.
1835 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1836 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1837 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1838 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1839 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1840 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1841 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1842 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1843 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1844 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1845 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1846 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1847 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1848 ($(BLD)/w32xfns.$(O)): Update dependencies.
1849
1850 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1851
1852 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1853 fatal_error_backtrace.
1854
1855 * w32proc.c (sys_kill): Undo last change: don't do anything when
1856 invoked to deliver SIGABRT to our own process. This is now
1857 handled by emacs_raise.
1858
1859 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1860
1861 * w32term.c (w32_read_socket): Remove leftover reference to
1862 interrupt_input_pending.
1863
1864 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1865
1866 Do not use SA_NODEFER.
1867 Problem reported by Dani Moncayo in
1868 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1869 * alloc.c (die):
1870 * sysdep.c (emacs_abort): Do not reset signal handler.
1871 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1872 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1873 wanted even on POSIXish hosts, and it doesn't work on Windows.
1874
1875 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1876
1877 * xterm.c (x_term_init): Call fixup_locale before and after calling
1878 gtk_init (Bug#12392).
1879
1880 2012-09-23 Chong Yidong <cyd@gnu.org>
1881
1882 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1883 Vdynamic_library_alist.
1884
1885 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1886 (Fgnutls_available_p): Caller changed.
1887
1888 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1889 (Flibxml_parse_xml_region): Likewise.
1890
1891 * dispextern.h (struct image_type): Remove arg from init function.
1892
1893 * image.c (Finit_image_library, lookup_image_type)
1894 (define_image_type): Remove now-unneeded second arg.
1895 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1896 (init_tiff_functions, init_gif_functions, init_svg_functions):
1897 Arglist and w32_delayed_load calling convention changed.
1898 (gs_type): Remove init_gs_functions; there is no such function.
1899 (valid_image_p, make_image): Fix caller to lookup_image_type.
1900
1901 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1902
1903 Simplify and avoid signal-handling races (Bug#12471).
1904 * alloc.c (die):
1905 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1906 Avoid recursive loop if there's a fatal error in the function itself.
1907 * atimer.c (pending_atimers):
1908 * blockinput.h: Don't include "atimer.h"; no longer needed.
1909 (interrupt_input_pending): Remove. All uses removed.
1910 pending_signals now counts both atimers and ordinary interrupts.
1911 This is less racy than having three separate pending-signal flags.
1912 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1913 (input_blocked_p):
1914 Rename from their upper-case counterparts BLOCK_INPUT,
1915 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1916 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1917 This makes it easier to access volatile variables more accurately.
1918 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1919 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1920 that's more reliable if the code is buggy and sets
1921 interrupt_input_blocked to a negative value. All uses changed.
1922 * atimer.c (deliver_alarm_signal):
1923 Remove. No need to deliver this to the parent; any thread can
1924 handle this signal now. All uses replaced by underlying handler.
1925 * atimer.c (turn_on_atimers):
1926 * dispnew.c (handle_window_change_signal):
1927 * emacs.c (handle_danger_signal):
1928 * keyboard.c (kbd_buffer_get_event):
1929 Don't reestablish signal handler; not needed with sigaction.
1930 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1931 (UNBLOCK_INPUT_TO):
1932 Rework to avoid unnecessary accesses to volatile variables.
1933 (UNBLOCK_INPUT_TO): Now a function.
1934 (totally_unblock_input, unblock_input): New decls.
1935 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1936 (init_data): Remove. Necessary stuff now done in init_signal.
1937 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1938 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1939 (fatal_error_code): Remove; no longer needed.
1940 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1941 it doesn't always backtrace. All uses changed. No need to reset
1942 signal to default, since sigaction and/or die does that for us now.
1943 Use emacs_raise (FOO), not kill (getpid (), FOO).
1944 (main): Check more-accurately whether we're dumping.
1945 Move fatal-error setup to sysdep.c
1946 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1947 * gtkutil.c (xg_get_file_name, xg_get_font):
1948 Remove no-longer-needed signal-mask manipulation.
1949 * keyboard.c, process.c (POLL_FOR_INPUT):
1950 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1951 * keyboard.c (read_avail_input): Remove.
1952 All uses replaced by gobble_input.
1953 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1954 (kbd_buffer_store_event_hold, gobble_input):
1955 (record_asynch_buffer_change) [USABLE_SIGIO]:
1956 (store_user_signal_events):
1957 No need to mess with signal mask.
1958 (gobble_input): If blocking input and there are terminals, simply
1959 set pending_signals to 1 and return. All hooks changed to not
1960 worry about whether input is blocked.
1961 (process_pending_signals): Clear pending_signals before processing
1962 them, in case a signal comes in while we're processing.
1963 By convention callers now test pending_signals before calling us.
1964 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1965 New functions, to support changes to blockinput.h.
1966 (handle_input_available_signal): Now extern.
1967 (reinvoke_input_signal): Remove. All uses replaced by
1968 handle_async_input.
1969 (quit_count): Now volatile, since a signal handler uses it.
1970 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1971 All callers changed. Block SIGINT only if not already blocked.
1972 Clear sigmask reliably, even if Fsignal returns, which it can.
1973 Omit unnecessary accesses to volatile var.
1974 (quit_throw_to_read_char): No need to restore sigmask.
1975 * keyboard.c (gobble_input, handle_user_signal):
1976 * process.c (wait_reading_process_output):
1977 Call signal-handling code rather than killing ourselves.
1978 * lisp.h: Include <float.h>, for...
1979 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1980 (pending_signals): Now volatile.
1981 (syms_of_data): Now const if IEEE floating point.
1982 (handle_input_available_signal) [USABLE_SIGIO]:
1983 (terminate_due_to_signal, record_child_status_change): New decls.
1984 * process.c (create_process): Avoid disaster if memory is exhausted
1985 while we're processing a vfork, by tightening the critical section
1986 around the vfork.
1987 (send_process_frame, process_sent_to, handle_pipe_signal)
1988 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1989 ignores SIGPIPE.
1990 (send_process): No need for setjmp/longjmp any more, since the
1991 SIGPIPE stuff is now gone. Instead, report an error if errno
1992 is EPIPE.
1993 (record_child_status_change): Now extern. PID and W are now args.
1994 Return void, not bool. All callers changed.
1995 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1996 Remove. All uses removed. This bug should be fixed now in a
1997 different way.
1998 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1999 and record the child status change directly. This avoids the
2000 need to futz with the signal mask.
2001 (process_fatal_action): Move here from emacs.c.
2002 (emacs_sigaction_flags): New function, containing
2003 much of what used to be in emacs_sigaction_init.
2004 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2005 caught by emacs, to make races less likely.
2006 (deliver_process_signal): Rename from handle_on_main_thread.
2007 All uses changed.
2008 (BACKTRACE_LIMIT_MAX): Now at top level.
2009 (thread_backtrace_buffer, threadback_backtrace_pointers):
2010 New static vars.
2011 (deliver_thread_signal, deliver_fatal_thread_signal):
2012 New functions, for more-accurate delivery of thread-specific signals.
2013 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2014 (deliver_arith_signal): Handle in this thread, not
2015 in the main thread, since it's triggered by this thread.
2016 (maybe_fatal_sig): New function.
2017 (init_signals): New arg DUMPING so that we can be more accurate
2018 about whether we're dumping. Caller changed.
2019 Treat thread-specific signals differently from process-general signals.
2020 Block all signals while handling fatal error; that's safer.
2021 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2022 on IEEE hosts.
2023 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2024 Ignore SIGPIPE unless batch.
2025 (emacs_backtrace): Output backtrace for the appropriate thread,
2026 which is not necessarily the main thread.
2027 * syssignal.h: Include <stdbool.h>.
2028 (emacs_raise): New macro.
2029 * xterm.c (x_connection_signal): Remove; no longer needed
2030 now that we use sigaction.
2031 (x_connection_closed): No need to mess with sigmask now.
2032 (x_initialize): No need to reset SIGPIPE handler here, since
2033 init_signals does this for us now.
2034
2035 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2036
2037 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2038 background rect may be larger (Bug#12245).
2039
2040 2012-09-23 Chong Yidong <cyd@gnu.org>
2041
2042 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2043
2044 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2045
2046 * .gdbinit: Just stop at fatal_error_backtrace.
2047 See Stefan Monnier's request in
2048 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2049 Remove no-longer-used query of system type.
2050
2051 2012-09-22 Chong Yidong <cyd@gnu.org>
2052
2053 * search.c (Freplace_match): Doc fix (Bug#12325).
2054
2055 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2056
2057 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2058 (Fline_end_position): Doc fix.
2059
2060 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2061
2062 2012-09-22 Chong Yidong <cyd@gnu.org>
2063
2064 * dispextern.h (struct image_type): Add new slot, storing a type
2065 initialization function.
2066
2067 * image.c (define_image_type): Call the image initializer function
2068 if it is defined. Arguments and return value changed.
2069 (valid_image_p, make_image): Callers changed.
2070 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2071 (gif_type, imagemagick_type, svg_type, gs_type):
2072 Add initialization functions.
2073 (Finit_image_library): Call lookup_image_type.
2074 (CHECK_LIB_AVAILABLE): Macro deleted.
2075 (lookup_image_type): Call define_image_type here, rather than via
2076 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2077 (syms_of_image): Move define_image_type calls for xbm_type and
2078 pbm_type to lookup_image_type.
2079
2080 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2081
2082 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2083 'idle_timers' from here ...
2084 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2085 lists, to avoid infloops when the timer does something stupid,
2086 like reinvoke itself with the same or smaller time-out.
2087 (Bug#12447)
2088
2089 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2090
2091 * window.c (Fsplit_window_internal): Handle only Qt value of
2092 Vwindow_combination_limit separately.
2093 (Qtemp_buffer_resize): New symbol.
2094 (Vwindow_combination_limit): New default value.
2095 Rewrite doc-string.
2096
2097 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2098
2099 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2100 the new overlay string. (Bug#10159)
2101
2102 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2105 or that fprintf is async-signal-safe. POSIX doesn't require
2106 either assumption.
2107
2108 2012-09-22 Chong Yidong <cyd@gnu.org>
2109
2110 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2111 (Bug#8207).
2112
2113 2012-09-22 Kenichi Handa <handa@gnu.org>
2114
2115 * composite.c (composition_reseat_it): Handle the case that a
2116 grapheme cluster is not covered by a single font (Bug#12352).
2117
2118 2012-09-21 Chong Yidong <cyd@gnu.org>
2119
2120 * image.c (define_image_type): Avoid adding duplicate types to
2121 image_types (Bug#12463). Suggested by Jörg Walter.
2122
2123 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2124
2125 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2126 (print_load_command_name): Add case LC_DATA_IN_CODE.
2127 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2128
2129 2012-09-21 Glenn Morris <rgm@gnu.org>
2130
2131 * eval.c (Frun_hook_with_args_until_success)
2132 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2133
2134 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2135
2136 * fileio.c (Ffile_selinux_context): Only call freecon when
2137 lgetfilecon succeeded.
2138 (Fset_file_selinux_context): Likewise. (Bug#12444)
2139
2140 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2141
2142 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2143 reordering, locate the cursor by calling set_cursor_from_row; if
2144 that fails, clear the desired glyph matrix before returning a
2145 failure indication to the caller. Fixes leaving garbled display
2146 when fast scrolling with a down-key. (Bug#12403)
2147 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2148 scrolling through multibyte text.
2149
2150 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2151
2152 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2153 calling mark_vectorlike since that's the one that marks the window.
2154 (mark_discard_killed_buffers): Mark the final cdr.
2155 * window.h (struct window): Move prev/next_buffers to the
2156 non-standard fields.
2157 * window.c (make_window): Initialize prev/next_buffers manually.
2158
2159 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 Omit unused arg EXPECTED from socket hooks.
2162 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2163 * nsterm.m (ns_term_init):
2164 * termhooks.h (struct terminal.read_socket_hook):
2165 * w32inevt.c (w32_console_read_socket):
2166 * w32term.c (w32_read_socket):
2167 * xterm.c (XTread_socket):
2168 Omit unused arg EXPECTED. All callers changed.
2169 (store_user_signal_events): Return void, not int, since callers no
2170 longer care about the return value. All uses changed.
2171
2172 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2173
2174 * w32gui.h (XParseGeometry): Do not declare.
2175
2176 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2177
2178 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2179 Ignore 'expected'. See Eli Zaretskii in
2180 <http://bugs.gnu.org/12471#8> (last line).
2181
2182 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2183 (XParseGeometry): Now static. Substitute extremal values for
2184 values that are out of range.
2185
2186 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2187
2188 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2189
2190 * nsfns.m (XParseGeometry): Remove.
2191 (Fx_create_frame): Call x_set_offset to correctly interpret
2192 top_pos in geometry.
2193
2194 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2195 (Fx_parse_geometry): If there is a space in string, call
2196 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2197
2198 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2199
2200 * search.c (scan_buffer): Use character positions in calls to
2201 region_cache_forward and region_cache_backward, not byte
2202 positions. (Bug#12196)
2203
2204 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2205 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2206
2207 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2208 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2209 emacs_blocked_malloc, now deleted.
2210
2211 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2212
2213 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2214 The workaround was for improving performance on Solaris 2.4, but
2215 is getting in the way now. Emacs will still work if someone is
2216 still running Solaris 2.4 in a museum somewhere; Sun dropped
2217 support for Solaris 2.4 in 2003.
2218 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2219 * process.c (create_process) [HAVE_WORKING_VFORK]:
2220 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2221 since Emacs no longer uses vfork on that platform.
2222
2223 2012-09-17 Glenn Morris <rgm@gnu.org>
2224
2225 * emacs.c: Use COPYRIGHT.
2226
2227 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2228
2229 Remove configure's --without-sync-input option (Bug#12450).
2230 When auditing signal-handling in preparation for cleaning it up,
2231 I found that SYNC_INPUT has race conditions and would be a real
2232 pain to fix. Since it's an undocumented and deprecated
2233 configure-time option, now seems like a good time to remove it.
2234 Also see <http://bugs.gnu.org/11080#16>.
2235 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2236 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2237 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2238 (malloc_hysteresis):
2239 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2240 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2241 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2242 (dont_register_blocks, bytes_used_when_reconsidered)
2243 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2244 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2245 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2246 Remove. All uses removed.
2247 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2248 implementation, one that depends on whether the new macro
2249 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2250 is defined.
2251 * atimer.c (run_timers, handle_alarm_signal):
2252 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2253 (handle_async_input, process_pending_signals)
2254 (handle_input_available_signal, init_keyboard):
2255 * nsterm.m (ns_read_socket):
2256 * process.c (wait_reading_process_output):
2257 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2258 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2259 (emacs_write):
2260 * xterm.c (XTread_socket):
2261 Assume SYNC_INPUT.
2262 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2263 * eval.c (handling_signal): Remove. All uses removed.
2264 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2265 All uses replaced with the SYNC_INPUT version.
2266 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2267 Remove decls.
2268 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2269 Now static.
2270
2271 * font.c (Ffont_shape_gstring): Remove unused local.
2272
2273 2012-09-16 Glenn Morris <rgm@gnu.org>
2274
2275 * Makefile.in (clean): No longer run nextstep's clean.
2276
2277 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2278 (ns_frag): Remove.
2279 (ns-app): Move here from ns.mk, and simplify.
2280 (clean): Simplify nextstep entry.
2281 * ns.mk: Remove file.
2282
2283 2012-09-17 Kenichi Handa <handa@gnu.org>
2284
2285 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2286 not covert the last few charactes.
2287
2288 2012-09-16 Kenichi Handa <handa@gnu.org>
2289
2290 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2291 here, but just check the validity of glyphs in the glyph-string.
2292
2293 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2294
2295 * window.c (Fwindow_parameter, Fset_window_parameter):
2296 Accept any window as argument (Bug#12452).
2297
2298 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2299
2300 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2301 to ns_term_init to avoid memory leak.
2302
2303 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2304 explicit retain/release.
2305 (ns_term_init): Only allow one display. Initialize outerpool and
2306 ns_*_types.
2307
2308 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2309
2310 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2311 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2312 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2313 the Microsoft problem in a different way, by altering ../nt/config.nt.
2314
2315 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2316
2317 * w32xfns.c:
2318 * w32uniscribe.c:
2319 * w32term.c:
2320 * w32select.c:
2321 * w32reg.c:
2322 * w32proc.c:
2323 * w32menu.c:
2324 * w32inevt.c:
2325 * w32heap.c:
2326 * w32font.c:
2327 * w32fns.c:
2328 * w32console.c:
2329 * w32.c:
2330 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2331 by lisp.h. This completes removal of setjmp.h inclusion
2332 erroneously announced in the previous commit. (Bug#12446)
2333
2334 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2335 more accurate.
2336
2337 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2338 not defined as a macro. The latter happens on MS-Windows.
2339 (Bug#12446)
2340
2341 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2344 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2345 Some instances of '#include <setjmp.h>' removed, if the
2346 only reason for the instance was because "lisp.h" was included.
2347 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2348 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2349 and _longjmp with the new symbols. Emacs already uses _setjmp if
2350 available, so this change affects only POSIXish hosts that have
2351 sigsetjmp but not _setjmp, such as some versions of Solaris and
2352 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2353 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2354 (png_load_body) [HAVE_PNG]:
2355 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2356 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2357 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2358 since PNG requires jmp_buf. This is the only exception to the
2359 general rule that we now use sys_setjmp and sys_longjmp.
2360 This exception is OK since this code does not change the signal
2361 mask or longjmp out of a signal handler.
2362
2363 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2366 Include "syssignal.h", for 'main_thread'.
2367
2368 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2369
2370 Avoid out-of-range marker position (Bug#12426).
2371 * insdel.c (replace_range, replace_range_2):
2372 Adjust markers before overlays, as suggested by comments.
2373 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2374 Remove redundant check before calling offset_intervals.
2375
2376 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2377
2378 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2379 current buffer (Bug#12387).
2380
2381 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2382
2383 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2384
2385 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2386
2387 Use a more backwards-compatible timer format (Bug#12430).
2388 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2389 vector element, not from the 4th, since PSECS is now at the end.
2390 (Fcurrent_idle_time): Doc fix.
2391
2392 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 Function to mark objects and remove killed buffers at once.
2395 * alloc.c (discard_killed_buffers): Rename to ...
2396 (mark_discard_killed buffers) ... new name. Add marking
2397 of remaining objects. Fix comment. Adjust users.
2398 (mark_object): Do not touch frame buffer lists here.
2399 * frame.c (delete_frame): Reset frame buffer lists here.
2400
2401 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2402
2403 Better workaround for GNOME bug when --enable-gcc-warnings.
2404 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2405 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2406 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2407
2408 Simplify SIGIO usage (Bug#12408).
2409 The code that dealt with SIGIO was crufty and confusing, e.g., it
2410 played tricks like "#undef SIGIO" but these tricks were not used
2411 consistently. Simplify mostly by not #undeffing standard symbols,
2412 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2413 or not as we please) rather than "defined SIGIO" (standard symbol
2414 that we probably shouldn't #undef).
2415 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2416 Modules that need it can include it.
2417 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2418 * dispextern.h (ignore_sigio): New decl.
2419 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2420 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2421 * emacs.c (shut_down_emacs):
2422 * keyboard.c (kbd_buffer_store_event_hold):
2423 Use ignore_sigio rather than invoking 'signal' directly.
2424 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2425 for FIONREAD.
2426 (FIONREAD, SIGIO): Do not #undef.
2427 (tty_read_avail_input): Use #error rather than a syntax error.
2428 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2429 for I_PIPE, used by SETUP_SLAVE_PTY.
2430 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2431 * sysdep.c (croak): Remove; no longer needed. This bit of
2432 temporary code, with Fred N. Fish's comment that it's temporary,
2433 has been in Emacs since at least 1992!
2434 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2435 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2436 * syssignal.h (croak): Remove decl.
2437 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2438 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2439 now that we're termios-only.
2440 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2441 * term.c (dissociate_if_controlling_tty): Use #error rather than
2442 a run-time error.
2443
2444 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2445 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2446 to work around GNOME bug 683906.
2447 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2448 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2449 This works around GCC bug 54561.
2450
2451 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 More fixes for 'volatile' and setjmp/longjmp.
2454 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2455 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2456 (png_load_body) [HAVE_PNG]:
2457 (jpeg_load_body) [HAVE_JPEG]:
2458 New function, with most of the old parent function's body.
2459 (png_load) [HAVE_PNG]:
2460 (jpeg_load) [HAVE_JPEG]:
2461 Invoke the new function, to avoid longjmp munging our locals.
2462 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2463 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2464 longjmp is passed 2, as the C standard doesn't guarantee this.
2465 Instead, store the failure code into mgr->failure_code.
2466
2467 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2468
2469 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2470 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2471 (syms_of_keyboard): Remove support for unread-command-char.
2472
2473 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2474
2475 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2476 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2477 violation. (Bug#12426)
2478
2479 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2480
2481 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2482
2483 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2484
2485 * eval.c: Add `inhibit-debugger'.
2486 (Qinhibit_debugger): New symbol.
2487 (call_debugger): Bind it instead of Qdebug_on_error.
2488 (maybe_call_debugger): Test Vinhibit_debugger.
2489 (syms_of_eval): Define inhibit-debugger.
2490 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2491 (syms_of_xdisp): Remove inhibit-debug-on-message.
2492
2493 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2494
2495 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2496 If a nonvolatile local variable is written before a _longjmp to
2497 the frame containing the variable, and is read after the _longjmp,
2498 the value read is indeterminate. Some local variables of type
2499 'struct handler' and 'struct catchtag' are used in this way, so
2500 mark each of their slots as volatile if the slot can be set before
2501 _longjmp and read afterwards.
2502 * lisp.h (struct handler): var and chosen_clause are now volatile.
2503 (struct catchtag): val, next, and pdlcount are now volatile.
2504
2505 * bidi.c (bidi_push_it, bidi_pop_it):
2506 * fns.c (copy_hash_table):
2507 * image.c (define_image_type):
2508 * keyboard.c (kbd_buffer_store_event_hold):
2509 * process.c (Fprocess_send_eof):
2510 * xfaces.c (x_create_gc) [HAVE_NS]:
2511 * xgselect.c (xg_select):
2512 Prefer assignment to memcpy when either will do.
2513
2514 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2515 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2516 time an item is removed. No need to mark this function 'inline';
2517 the compiler knows better than we do.
2518
2519 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2520
2521 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2522 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2523 to change_frame_size (Bug#12388).
2524 (windowDidResize:): Pass YES to updateFrameSize.
2525
2526 * nsterm.h: Add delay parameter to updateFrameSize.
2527
2528 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2529
2530 Discard killed buffers from deleted window and frame objects.
2531 This reduces an amount of references to killed buffers and
2532 helps GC to reclaim them faster.
2533 * alloc.c (discard_killed_buffers): New function.
2534 (mark_object): Use it for deleted windows and frames.
2535 (mark_object): If symbol's value is set up for a killed buffer
2536 or deleted frame, restore its global binding.
2537 * data.c (swap_in_global_binding): Add GC notice.
2538 (swap_in_symval_forwarding): Use convenient set_blv_where.
2539 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2540 * window.h: ... to here.
2541
2542 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 Convenient macro to check whether the buffer is live.
2545 * buffer.h (BUFFER_LIVE_P): New macro.
2546 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2547 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2548
2549 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2550
2551 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2552 composition cases (Bug#12364).
2553
2554 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2555 overhang of succeeding glyphs overlapping box cursor.
2556
2557 * w32term.c (x_draw_glyph_string): Likewise.
2558
2559 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2560
2561 Simplify, document, and port floating-point (Bug#12381).
2562 The porting part of this patch fixes bugs on non-IEEE platforms
2563 with frexp, ldexp, logb.
2564 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2565 Now static.
2566 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2567 support, by removing commented-out code and briefly listing the
2568 C89 functions excluded. The commented-out stuff was confusing
2569 maintenance, e.g., we thought we needed cbrt but it was commented out.
2570 (logb): Remove decl; no longer needed.
2571 (isfinite): New macro, if not already supplied.
2572 (isnan): Don't replace any existing macro.
2573 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2574 are present on all C89 platforms.
2575 (Ffrexp): Do not special-case zero, as frexp does the right thing
2576 for that case.
2577 (Flogb): Do not use logb, as it doesn't have the desired meaning
2578 on hosts that use non-base-2 floating point. Instead, stick with
2579 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2580 frexp, to avoid getting an unspecified result.
2581
2582 * xdisp.c (Qinhibit_debug_on_message): Now static.
2583
2584 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2585
2586 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2587 NSBezierPath (Bug#12131).
2588
2589 2012-09-10 Chong Yidong <cyd@gnu.org>
2590
2591 * fns.c (Fdelq, Fdelete): Doc fix.
2592
2593 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2594
2595 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2596 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2597
2598 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2599
2600 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2601 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2602 Use it.
2603
2604 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2605
2606 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2607 left fringe if the window has a left margin. This avoids leaving
2608 traces of the cursor because its leftmost pixel is not drawn over.
2609
2610 * dispnew.c (update_window_line): When the left margin area of a
2611 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2612 that screen line. (Bug#12277)
2613
2614 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 Assume C89 or later for math functions (Bug#12381).
2617 This simplifies the code, and makes it a bit smaller and faster,
2618 and (most important) makes it easier to clean up signal handling
2619 since we can stop worring about floating-point exceptions in
2620 library code. That was a problem before C89, but the problem
2621 went away many years ago on all practical Emacs targets.
2622 * data.c, image.c, lread.c, print.c:
2623 Don't include <math.h>; no longer needed.
2624 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2625 might be autoconfigured, as that never happens.
2626 * data.c (fmod):
2627 * doprnt.c (DBL_MAX_10_EXP):
2628 * print.c (DBL_DIG):
2629 Remove. C89 or later always defines these.
2630 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2631 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2632 (arith_error, domain_error, domain_error2):
2633 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2634 no longer needed -- we simply return what C returns. All uses removed.
2635 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2636 the wrapped code.
2637 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2638 Remove. All uses expanded, as these macros are no longer used
2639 more than once and are now more trouble than they're worth.
2640 (Ftan): Use tan, not sin / cos.
2641 (Flogb): Assume C89 frexp.
2642 (fmod_float): Assume C89 fmod.
2643 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2644 (init_floatfns): Remove. All uses removed.
2645
2646 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2647
2648 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2649 compositeToPoint for OSX < 10.6 (Bug#12390).
2650
2651 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2654 This produces more-accurate results.
2655
2656 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2657
2658 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2659 changes (Bug#12088).
2660
2661 2012-09-08 Chong Yidong <cyd@gnu.org>
2662
2663 * syntax.c (Fstring_to_syntax): Doc fix.
2664
2665 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2666
2667 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2668 in the internal border.
2669 (x_set_window_size): Remove static variables and their usage.
2670 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2671 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2672 Remove fringe/internal border adjustment (Bug#11052).
2673 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2674 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2675 (ns_fix_rect_ibw): Remove.
2676 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2677 (ns_dumpglyphs_box_or_relief): Ditto.
2678 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2679 adjustment.
2680 (ns_dumpglyphs_image): Ditto.
2681 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2682 border adjustment.
2683 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2684 their usage. Add fringe_extended_p and its use as in other terms.
2685 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2686 scroll bar was removed.
2687 (updateFrameSize): New function.
2688 (windowDidResize): Move code to updateFrameSize and call it.
2689
2690 * nsterm.h (EmacsView): Add updateFrameSize.
2691
2692 2012-09-07 Chong Yidong <cyd@gnu.org>
2693
2694 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2695
2696 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2697
2698 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 More signal-handler cleanup (Bug#12327).
2701 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2702 Problem introduced when merging patches. Noted by Eli Zaretskii in
2703 <http://bugs.gnu.org/12327#67>.
2704 * floatfns.c: Comment fix.
2705 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2706 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2707 and anyway the declaration is harmless even if SIGDANGER is not defined.
2708 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2709 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2710 source files not surprisingly expected syssignal.h to define, or
2711 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2712 Include <sys/ioctl.h>, for FIONREAD.
2713 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2714 This eliminates a problem whereby other files mysteriously had
2715 to include "syssignal.h" before including "systty.h" if they
2716 wanted to use "#ifdef SIGIO".
2717
2718 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2719
2720 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2721
2722 * w32.c (sigemptyset): Empty the set.
2723 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2724
2725 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2726
2727 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2728
2729 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2730 (mark_object): Likewise for frame objects.
2731
2732 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2733
2734 * syssignal.h (handle_on_main_thread): Always declare,
2735 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2736 This ports to platforms without HAVE_PTHREAD.
2737
2738 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 Signal-handler cleanup (Bug#12327).
2741 Emacs's signal handlers were written in the old 4.2BSD style with
2742 sigblock and sigmask and so forth, and this led to some
2743 inefficiencies and confusion. Rewrite these to use
2744 pthread_sigmask etc. without copying signal sets around. Also,
2745 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2746 'signal', and instead use functions that do not attempt to take
2747 over the system name space. This patch causes Emacs's text
2748 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2749 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2750 Do not include <signal.h> or "syssignal.h", as these
2751 modules do not use signals.
2752 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2753 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2754 Do not include <signal.h>, as "syssignal.h" does that for us now.
2755 * atimer.c (sigmask_atimers): New function.
2756 (block_atimers, unblock_atimers): New functions,
2757 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2758 All uses replaced.
2759 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2760 no longer needed here.
2761 * emacs.c (main): Inspect existing signal handler with sigaction,
2762 so that there's no need to block and unblock SIGHUP.
2763 * sysdep.c (struct save_signal): New member 'action', replacing
2764 old member 'handler'.
2765 (save_signal_handlers, restore_signal_handlers):
2766 Use sigaction instead of 'signal' to save and restore.
2767 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2768 New function. All users of 'signal' modified to use set_sighandler
2769 if they're writeonly, and to use sys_signal if they're read+write.
2770 (emacs_sigaction_init, forwarded_signal): New functions.
2771 (sys_signal): Remove. All uses replaced by calls to sigaction
2772 and emacs_sigaction_init, or by direct calls to 'signal'.
2773 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2774 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2775 all uses replaced by pthread_sigmask etc. calls.
2776 * syssignal.h: Include <signal.h>.
2777 (emacs_sigaction_init, forwarded_signal): New decls.
2778 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2779 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2780 (sigmask, sys_sigmask): Remove; no longer needed.
2781 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2782 (sigblock, sigunblock, sigfree):
2783 (sigsetmask) [!defined sigsetmask]:
2784 Remove. All uses replaced by pthread_sigmask.
2785 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2786 no longer need to be replaced, and its typical old uses
2787 are now done via emacs_sigaction_init and sigaction.
2788 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2789 (sys_sigdel): Remove; unused.
2790 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2791
2792 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2793
2794 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2795 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2796
2797 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 Explicitly mark buffer_defaults and buffer_local_symbols.
2800 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2801 mark_local_symbols here.
2802 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2803 since special buffers aren't marked here any more.
2804 (allocate_buffer): Chain new buffer with all_buffers here...
2805 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2806 not here.
2807 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2808 (syms_of_buffer): Remove staticpro of the above.
2809 (init_buffer_once): Set names for buffer_defaults and
2810 buffer_local_symbols.
2811
2812 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2813
2814 Use bool for booleans in font-related modules.
2815 * font.c (font_intern_prop, font_style_to_value)
2816 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2817 (generate_otf_features, font_check_otf_features, font_check_otf)
2818 (font_match_p, font_list_entities, font_at):
2819 * fontset.c (fontset_id_valid_p, reorder_font_vector
2820 (fontset_find_font, Fset_fontset_font)
2821 (face_suitable_for_char_p) [0]:
2822 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2823 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2824 (m17n_flt_initialized, ftfont_shape_by_flt):
2825 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2826 * nsfont.m (nsfont_draw):
2827 * w32font.c (w32font_draw):
2828 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2829 Use bool for booleans.
2830 * font.h: Adjust to above API changes.
2831 (struct font, struct font_driver, struct font_driver_list):
2832 Use bool for booleans.
2833 (struct font): Remove useless member encoding_type.
2834 All users removed.
2835 * fontset.c, xftfont.c: Omit unnecessary static decls.
2836
2837 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 * alloc.c (mark_object): Revert window marking code
2840 since it's unsafe for the Fset_window_configuration.
2841
2842 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 Fix race conditions with signal handlers and errno (Bug#12327).
2845 Be more systematic about preserving errno whenever a signal
2846 handler returns, even if it's not in the main thread. Do this by
2847 renaming signal handlers to distinguish between signal delivery
2848 and signal handling. All uses changed.
2849 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2850 * data.c (deliver_arith_signal): Rename from arith_error.
2851 * dispnew.c (deliver_window_change_signal): Rename from
2852 window_change_signal.
2853 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2854 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2855 * keyboard.c (deliver_input_available_signal): Rename from
2856 input_available_signal.
2857 (deliver_user_signal): Rename from handle_user_signal.
2858 (deliver_interrupt_signal): Rename from interrupt_signal.
2859 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2860 (deliver_child_signal): Rename from sigchld_handler.
2861 * atimer.c (handle_alarm_signal):
2862 * data.c (handle_arith_signal):
2863 * dispnew.c (handle_window_change_signal):
2864 * emacs.c (handle_fatal_signal, handle_danger_signal):
2865 * keyboard.c (handle_input_available_signal):
2866 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2867 * process.c (handle_pipe_signal, handle_child_signal):
2868 New functions, with the actual signal-handling code taken from the
2869 original respective signal handlers, sans the sporadic attempts to
2870 preserve errno, since that's now done by handle_on_main_thread.
2871 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2872 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2873 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2874 Move to sysdep.c.
2875 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2876 Move initialization of main_thread to sysdep.c's init_signals.
2877 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2878 our usage, and simplifies the mainline code.
2879 (record_child_status_change): New static function, as a helper
2880 for handle_child_signal, and with most of the old child handler's
2881 contents.
2882 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2883 (handle_child_signal): Use the above.
2884 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2885 Moved here from emacs.c.
2886 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2887 code moved here from emacs.c's main function.
2888 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2889 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2890 This lets callers save and restore errno properly.
2891
2892 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Remove redundant or unused things here and there.
2895 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2896 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2897 * editfns.c (Fcompare_buffer_substrings): Likewise.
2898 * frame.h (struct terminal, struct font_driver_list):
2899 Remove redundant declarations.
2900 * window.h (Qleft, Qright): Likewise.
2901
2902 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2903
2904 Do not mark objects from deleted buffers, windows and frames.
2905 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2906 (mark_object): Likewise for windows and frames.
2907
2908 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2909
2910 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2911 buffer_defaults and buffer_local_symbols as valid objects.
2912 Return special value to denote them.
2913
2914 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2915
2916 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2917 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2918 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2919 (file_name_absolute_p, Fsubstitute_in_file_name):
2920 (check_executable, check_writable, Ffile_accessible_directory_p)
2921 (Fset_file_selinux_context, Fdefault_file_modes)
2922 (Finsert_file_contents, choose_write_coding_system)
2923 (Fwrite_region, build_annotations, a_write, e_write)
2924 (Fdo_auto_save):
2925 * filelock.c (boot_time_initialized, get_boot_time)
2926 (get_boot_time_1, lock_file_1, within_one_second):
2927 * floatfns.c (in_float):
2928 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2929 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2930 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2931 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2932 * window.c (compare_window_configurations):
2933 Use bool for booleans.
2934 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2935 (Fdefault_file_modes): Now mode_t, not int, for modes.
2936 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2937 (internal_delete_file): Now returns void, not a (boolean) int,
2938 since nobody was looking at the return value.
2939 * lisp.h, window.h: Adjust to above API changes.
2940
2941 * xdisp.c (set_message): Simplify and reindent last change.
2942
2943 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2944
2945 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2946
2947 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2948
2949 * eval.c (call_debugger): Make the function non-static so that we
2950 can call it from set_message.
2951
2952 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2953 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2954
2955 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 Give more-useful info on a fatal error (Bug#12328).
2958 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2959 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2960 of doing the work ourselves.
2961 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2962 do most of the work.
2963 (fatal_error_backtrace): New function, taken from the guts
2964 of the old fatal_error_signal, but with a new option to output
2965 a backtrace.
2966 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2967 info about the signal than just its number.
2968 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2969 * sysdep.c: Include <execinfo.h>
2970 (emacs_backtrace): New function, taken partly from the previous
2971 code of the 'die' function.
2972 (emacs_abort): Call fatal_error_backtrace rather than abort.
2973
2974 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2975
2976 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2977 eager (load-time) macro-expansion.
2978 * lisp.mk (lisp): Add macroexp.
2979
2980 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2981
2982 Simplify redefinition of 'abort' (Bug#12316).
2983 Do not try to redefine the 'abort' function. Instead, redo
2984 the code so that it calls 'emacs_abort' rather than 'abort'.
2985 This removes the need for the NO_ABORT configure-time macro
2986 and makes it easier to change the abort code to do a backtrace.
2987 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2988 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2989 Remove; sysdep.c's emacs_abort now takes its place.
2990 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2991 'abort' changed to use 'emacs_abort'.
2992 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2993 (abort) [!defined abort]: Rename to ...
2994 (emacs_abort): ... new name.
2995 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2996 the place of the old 'abort' in emacs.c.
2997 * w32.c, w32fns.c (abort): Do not #undef.
2998 * w32.c (emacs_abort): Rename from w32_abort.
2999
3000 2012-09-04 Eli Zaretskii <eliz@gnu.org>
3001
3002 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3003 offsets[j].dv, since the y axis of the screen coordinates points
3004 down, while the y axis of the font definition coordinates points
3005 up. This fixes display of Arabic diacritics such as KASRA and
3006 KASRATAN. (Bug#11860)
3007
3008 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3009
3010 Be more systematic about _setjmp vs setjmp.
3011 * alloc.c (test_setjmp, mark_stack):
3012 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3013 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3014 (png_load, my_error_exit, jpeg_load):
3015 * process.c (send_process_trap, send_process):
3016 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3017 The underscored versions are up to 30x faster on some hosts.
3018 Formerly, the code used setjmp+longjmp sometimes and
3019 _setjmp+_longjmp at other times, with no particular reason to
3020 prefer setjmp+longjmp.
3021
3022 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3023
3024 Fix minor problem found by static checking.
3025 * buffer.c (Fdelete_all_overlays): Return nil.
3026
3027 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3028
3029 * buffer.c (Fdelete_all_overlays): New function.
3030
3031 2012-09-03 Chong Yidong <cyd@gnu.org>
3032
3033 * gtkutil.c: Add extern decl for Qxft.
3034
3035 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3036
3037 * emacs.c, eval.c: Use bool for boolean.
3038 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3039 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3040 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3041 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3042 (main, decode_env_path, Fdaemon_initialized):
3043 * eval.c (call_debugger, Finteractive_p, interactive_p):
3044 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3045 (maybe_call_debugger, Fbacktrace):
3046 * process.c (read_process_output, exec_sentinel):
3047 Use bool for booleans.
3048 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3049 All callers changed.
3050 * eval.c (interactive_p): Omit always-true boolean argument
3051 EXCLUDE_SUBRS_P. All callers changed.
3052 * dispextern.h, lisp.h: Reflect above API changes.
3053 * firstfile.c (dummy): Use the address of 'main', whose signature
3054 won't change, instead of the address of 'initialize', whose
3055 signature just changed from int to bool.
3056 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3057 * msdos.c (fatal_error_in_progress): ... from here.
3058 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3059 of incrementing it.
3060 (redisplay_internal, unwind_redisplay): Simply clear
3061 REDISPLAYING_P when unwinding, instead of saving its previous,
3062 always-false value and then restoring it.
3063
3064 Clean up some extern decls.
3065 Mostly, this hoists extern decls out of .c files and into .h files.
3066 That way, we're more likely to catch errors if the interfaces change.
3067 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3068 declare xg_mark_data.
3069 * dispextern.h (x_frame_parm_handlers):
3070 * font.h (Qxft):
3071 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3072 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3073 (Qultra_bold, Qoblique, Qitalic):
3074 Move extern decl here from .c file.
3075 * alloc.c (xg_mark_data) [USE_GTK]:
3076 * doc.c (Qclosure):
3077 * eval.c (Qlexical_binding):
3078 * fns.c (time) [!HAVE_UNISTD_H]:
3079 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3080 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3081 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3082 * lread.c (Qinternal_interpreter_environment):
3083 * minibuf.c (Qbuffer):
3084 * process.c (QCfamily, QCfilter):
3085 * widget.c (free_frame_faces):
3086 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3087 * xfont.c (x_clear_errors):
3088 * xterm.c (x_frame_parm_handlers):
3089 Remove now-redundant extern decls.
3090 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3091 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3092 Now static.
3093 * xfaces.c: Remove unnecessary static decls.
3094 * xterm.c (updating_frame): Remove decl of nonexistent object.
3095
3096 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3097 when building globals.h, as the objects that are not built on
3098 this host are not needed to compile C files on this host.
3099
3100 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3101
3102 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3103
3104 * frame.h: Add missing prototype for x_wm_set_size_hint.
3105
3106 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3107
3108 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3109 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3110 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3111 (Fsubstitute_command_keys):
3112 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3113 (save_excursion_save, save_excursion_restore)
3114 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3115 (format_time_string, general_insert_function)
3116 (make_buffer_string, make_buffer_string_both)
3117 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3118 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3119 (copy_text, insert_1, insert_1_both, insert_from_string)
3120 (insert_from_string_before_markers, insert_from_string_1)
3121 (insert_from_buffer, insert_from_buffer_1, replace_range)
3122 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3123 (del_range_2, modify_region):
3124 * intervals.c (intervals_equal, balance_possible_root_interval)
3125 (adjust_intervals_for_insertion, merge_properties_sticky)
3126 (graft_intervals_into_buffer, lookup_char_property)
3127 (adjust_for_invis_intang, set_point_both)
3128 (get_property_and_range, compare_string_intervals)
3129 (set_intervals_multibyte_1, set_intervals_multibyte):
3130 * keyboard.c (decode_timer):
3131 Use bool for boolean.
3132 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3133 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3134
3135 2012-09-02 Chong Yidong <cyd@gnu.org>
3136
3137 * keymap.c (push_key_description): Print M-TAB as C-M-i
3138 (Bug#11758).
3139
3140 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3141
3142 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3143 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3144 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3145 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3146 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3147 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3148 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3149
3150 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3151
3152 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3153 more than one grapheme cluster passed to the shaper: compute the
3154 offset adjustment values separately for each cluster. (Bug#11860)
3155
3156 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3157 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3158 about implicit conversions from integer to pointer.
3159
3160 2012-09-01 Daniel Colascione <dancol@dancol.org>
3161
3162 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3163 system used too early.
3164
3165 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3166
3167 Better seed support for (random).
3168 * emacs.c (main): Call init_random.
3169 * fns.c (Frandom): Set the seed from a string argument, if given.
3170 Remove long-obsolete Gentzel cruft.
3171 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3172 (init_random): New function.
3173
3174 2012-09-01 Daniel Colascione <dancol@dancol.org>
3175
3176 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3177 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3178 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3179 x_wm_set_size_hint, x_query_colors, x_real_positions,
3180 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3181 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3182 all of which have been moved to common code.
3183
3184 * xfaces.c: Include TERM_HEADER instead of listing all possible
3185 window-system headers.
3186
3187 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3188 to match header.
3189
3190 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3191 directly accessing frame internals.
3192
3193 * w32font.h: Include font.h. Define syms_of_w32font and
3194 globals_of_w32font.
3195
3196 * process.c: Include TERM_HEADER instead of listing all possible
3197 window-system headers.
3198
3199 * nsterm.h: Remove declarations now in frame.h.
3200 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3201
3202 * menu.c: Include TERM_HEADER instead of listing all possible
3203 window-system headers.
3204
3205 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3206 window system.
3207
3208 * keyboard.c: Include TERM_HEADER instead of listing all possible
3209 window-system headers.
3210
3211 * image.c: Include TERM_HEADER instead of listing all possible
3212 window-system headers. Declare Vlibrary_cache when compiling for
3213 Windows.
3214
3215 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3216 window system declarations.
3217
3218 * frame.h: Move common functions here: set_frame_menubar,
3219 x_set_window_size, x_sync, x_get_focus_frame,
3220 x_set_mouse_position, x_set_mouse_pixel_position,
3221 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3222 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3223 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3224 x_activate_menubar, x_real_positions, x_bitmap_icon,
3225 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3226 and x_query_colors.
3227
3228 * frame.c: Include TERM_HEADER instead of listing all possible
3229 window-system headers.
3230
3231 * font.c: Include TERM_HEADER instead of listing all possible
3232 window-system headers.
3233
3234 * emacs.c: Include TERM_HEADER.
3235
3236 * dispnew.c: Include TERM_HEADER instead of listing all possible
3237 window-system headers.
3238
3239 * ccl.h: Include character.h.
3240
3241 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3242 the current window system; include in list of objects to link into
3243 Emacs.
3244
3245 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3246
3247 Remove mark_ttys function and fix tty_display_info initialization.
3248 * lisp.h (mark_ttys): Remove prototype.
3249 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3250 to mark_ttys because all possible values of 'top_frame' slot are
3251 the frames which are reachable from Vframe_list.
3252 * term.c (mark_ttys): Remove.
3253 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3254
3255 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3256
3257 Change struct frame bitfields from unsigned char to unsigned.
3258 * frame.h (struct frame): Change type of 'display_preempted',
3259 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3260 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3261 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3262 bitfields from unsigned char to unsigned.
3263
3264 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3265
3266 Remove unused member of struct x_output and struct w32_output.
3267 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3268 * w32term.h (struct w32_output): Likewise.
3269
3270 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3271
3272 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3273 does not become zero (Bug#12234).
3274
3275 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3276
3277 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3278 for GCC 4.7.1 x86-64.
3279
3280 2012-08-30 Glenn Morris <rgm@gnu.org>
3281
3282 * lread.c (init_lread): For out-of-tree builds, only add the
3283 source directory's site-lisp dir to the load-path if it exists,
3284 consistent with in-tree builds. (Bug#12302)
3285
3286 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3287
3288 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3289 button_values to NULL. Call setStykeMask so dialogs get a close button.
3290 (windowShouldClose:): Set window_closed.
3291 (dealloc): New member, free button_values.
3292 (process_dialog:): Make member function. Remove window argument,
3293 replace window with self. Count buttons and allocate and store values
3294 in button_values.
3295 (addButton:value:row:): value is int with the name tag. Call setTag
3296 with tag. Remove return self, declare return value as void.
3297 (addString:row:): Remove return self, declare return value as void.
3298 (addSplit): Remove return self, declare return value as void.
3299 (clicked:): Remove return self, declare return value as void.
3300 Set dialog_return to button_values[seltag]. Code formatting change.
3301 (initFromContents:isQuestion:): Adjust call to process_dialog.
3302 Code formatting change.
3303 (timeout_handler:): Set timer_fired to YES.
3304 (runDialogAt:): Set timer_fired to NO.
3305 Handle click on close button as quit.
3306
3307 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3308 Add window_closed and button_values. Add void as return value for
3309 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3310 Add process_dialog as new member.
3311
3312 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3313
3314 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3315 is not one of the heaps we manage. (Bug#12242)
3316
3317 2012-08-28 Glenn Morris <rgm@gnu.org>
3318
3319 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3320
3321 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3322
3323 * window.c (Fset_window_configuration): Remove handling of
3324 auto-buffer-name window parameter. Install revision of reverted
3325 fix.
3326
3327 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3328
3329 Do not allow to set major mode for a dead buffer.
3330 * buffer.c (Fset_buffer_major_mode): Signal an error
3331 if the buffer is dead.
3332 (Fother_buffer, other_buffer_safely): Remove redundant
3333 nested declaration.
3334
3335 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Always use set_buffer_if_live to restore original buffer at unwind.
3338 * buffer.h (record_unwind_current_buffer): New function.
3339 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3340 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3341 * undo.c, window.c: Adjust users.
3342 * buffer.c (set_buffer_if_live): Fix comment.
3343
3344 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3345
3346 Fix usage of set_buffer_internal.
3347 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3348 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3349 * coding.c (decode_coding): Omit redundant test.
3350 * fileio.c (decide_coding_unwind): Likewise.
3351 * fns.c (secure_hash): Likewise.
3352 * insdel.c (modify_region): Likewise.
3353 * keyboard.c (command_loop_1): Likewise.
3354 * print.c (PRINTFINISH): Likewise.
3355 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3356
3357 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 * dispnew.c: Use bool for boolean.
3360 (frame_garbaged, display_completed, delayed_size_change)
3361 (fonts_changed_p, add_window_display_history)
3362 (add_frame_display_history, verify_row_hash)
3363 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3364 (row_equal_p, realloc_glyph_pool)
3365 (allocate_matrices_for_frame_redisplay)
3366 (showing_window_margins_p)
3367 (adjust_frame_glyphs_for_frame_redisplay)
3368 (build_frame_matrix_from_leaf_window, make_current)
3369 (mirrored_line_dance, mirror_line_dance, update_frame)
3370 (update_window_tree, update_single_window)
3371 (check_current_matrix_flags, update_window, update_text_area)
3372 (update_window_line, set_window_update_flags, scrolling_window)
3373 (update_frame_1, scrolling, buffer_posn_from_coords)
3374 (do_pending_window_change, change_frame_size)
3375 (change_frame_size_1, sit_for):
3376 Use bool for boolean.
3377 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3378 and remove last int (actually boolean) argument, which was always 0.
3379 All callers changed.
3380 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3381 * dispextern.h (struct composition_it): Use bool for boolean.
3382 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3383 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3384 * dired.c (file_name_completion):
3385 Use bool for boolean. (This was missed in an earlier change.)
3386
3387 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3388
3389 * window.c (Fset_window_configuration): Revert first part of
3390 last change.
3391
3392 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3393
3394 * nsterm.h (NSPanel): New class variable dialog_return.
3395
3396 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3397 Initialize dialog_return.
3398 (windowShouldClose:): Use stop instead of stopModalWithCode.
3399 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3400 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3401 event.
3402 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3403 modal loop returns.
3404
3405 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3406
3407 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3408 * composite.c (find_composition, composition_gstring_p)
3409 (composition_reseat_it, find_automatic_composition):
3410 * data.c (let_shadows_buffer_binding_p)
3411 (let_shadows_global_binding_p, set_internal, make_blv)
3412 (Fmake_variable_buffer_local, Fmake_local_variable)
3413 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3414 (cons_to_signed, arith_driver):
3415 * dbusbind.c (xd_in_read_queued_messages):
3416 * dired.c (directory_files_internal, file_name_completion):
3417 Use bool for booleans.
3418 * dired.c (file_name_completion):
3419 * process.h (fd_callback):
3420 Omit int (actually boolean) argument. It wasn't being used.
3421 All uses changed.
3422 * composite.h, lisp.h: Reflect above API changes.
3423
3424 * cmds.c, coding.c: Use bool for booleans.
3425 * cmds.c (move_point, Fself_insert_command):
3426 * coding.h (struct composition status, struct coding_system):
3427 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3428 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3429 (emacs_mule_char, decode_coding_emacs_mule)
3430 (encode_coding_emacs_mule, detect_coding_iso_2022)
3431 (decode_coding_iso_2022, encode_invocation_designation)
3432 (encode_designation_at_bol, encode_coding_iso_2022)
3433 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3434 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3435 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3436 (encode_coding_raw_text, detect_coding_charset)
3437 (decode_coding_charset, encode_coding_charset, detect_eol)
3438 (detect_coding, get_translation_table, produce_chars)
3439 (consume_chars, reused_workbuf_in_use)
3440 (make_conversion_work_buffer, code_conversion_save)
3441 (decode_coding_object, encode_coding_object)
3442 (detect_coding_system, char_encodable_p)
3443 (Funencodable_char_position, code_convert_region)
3444 (code_convert_string, code_convert_string_norecord)
3445 (Fset_coding_system_priority):
3446 * fileio.c (Finsert_file_contents):
3447 Use bool for booleans.
3448 * coding.h, lisp.h: Reflect above API changes.
3449 * coding.c: Remove unnecessary static function decls.
3450 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3451 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3452 not a boolean 'int', since callers never look at the return value.
3453 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3454 * coding.h (decoding_buffer_size, encoding_buffer_size)
3455 (emacs_mule_string_char): Remove unused extern decls.
3456 (struct iso_2022_spec, struct coding_system):
3457 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3458 (struct emacs_mule_spec): Remove unused field 'full_support'.
3459 All initializations removed.
3460 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3461
3462 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3463
3464 Fix spare memory change (Bug#12286).
3465 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3466 (valid_lisp_object_p): Likewise.
3467
3468 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3469
3470 * window.c (Fset_window_configuration): Record any window's old
3471 buffer if it's replaced (see Bug#8789). If the new current
3472 buffer doesn't appear in the selected window, go to its old
3473 point (Bug#12208).
3474
3475 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3476
3477 Special MEM_TYPE_SPARE to denote reserved memory.
3478 * alloc.c (enum mem_type): New memory type.
3479 (refill_memory_reserve): Use new type for spare memory.
3480 This prevents live_cons_p and live_string_p from incorrect
3481 detection of uninitialized objects from spare memory as live.
3482
3483 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 Spelling fixes.
3486 * Makefile.in (.PHONY): versioclean -> versionclean.
3487
3488 Remove unused external symbols.
3489 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3490 * window.c (Qwindow_valid_p, decode_valid_window):
3491 Now static, not extern.
3492 * data.c (Qinterval): Remove; unused.
3493 (syms_of_data): Do not define 'interval'.
3494 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3495 * window.h (decode_valid_window):
3496 Remove decls.
3497
3498 * character.c, charset.c, chartab.c: Use bool for booleans.
3499 * character.c (lisp_string_width, string_count_byte8)
3500 (string_escape_byte8):
3501 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3502 (load_charset_map_from_file, map_charset_chars)
3503 (Fdefine_charset_internal, define_charset_internal)
3504 (Fdeclare_equiv_charset, find_charsets_in_text)
3505 (Ffind_charset_region, char_charset, Fiso_charset):
3506 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3507 (sub_char_table_set, sub_char_table_set_range)
3508 (char_table_set_range, optimize_sub_char_table)
3509 (map_sub_char_table):
3510 Use bool for boolean.
3511 * character.c (str_to_unibyte): Omit last boolean argument; it was
3512 always 0. All callers changed.
3513 * character.h, charset.h: Adjust to match previous changes.
3514 * character.h (char_printable_p): Remove decl of nonexistent function.
3515 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3516 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3517 are all boolean, so make them single-bit bitfields.
3518
3519 * lisp.h (ASET): Remove attempt to detect side effects.
3520 It was meant to be temporary and it often doesn't work,
3521 because when IDX has side effects the behavior of IDX==IDX
3522 is undefined. See Stefan Monnier in
3523 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3524
3525 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3526
3527 * lisp.h (functionp): New function (extracted from Ffunctionp).
3528 (FUNCTIONP): Use it.
3529 * eval.c (Ffunctionp): Use it.
3530
3531 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3532
3533 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3534 as that's faster and simpler than static storage. Don't bother
3535 with the g_main_context_query overhead if g_main_context_pending
3536 says no events are pending.
3537 (gfds, gfds_size): Remove these static vars.
3538 (xgselect_initialize): Remove; no longer needed.
3539 All uses and decls removed.
3540
3541 * emacs.c (fatal_error_signal_hook): Remove.
3542 All uses removed. This leftover from old code was always 0.
3543
3544 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3545 * casefiddle.c (casify_object, casify_region):
3546 * casetab.c (set_case_table):
3547 * category.c, category.h (word_boundary_p):
3548 * category.h (CHAR_HAS_CATEGORY):
3549 Use bool for booleans, instead of int.
3550
3551 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3552
3553 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3554
3555 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3556
3557 On assertion failure, print backtrace if available.
3558 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3559 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3560 * Makefile.in (LIB_EXECINFO): New macro.
3561 (LIBES): Use it.
3562
3563 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3564 * bytecode.c (exec_byte_code):
3565 * callint.c (check_mark, Fcall_interactively):
3566 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3567 (getenv_internal, sync_process_alive, call_process_exited):
3568 * lisp.h (USE_SAFE_ALLOCA):
3569 Use bool for booleans, instead of int.
3570 * lisp.h, process.h: Adjust prototypes to match above changes.
3571 * callint.c (Fcall_interactively): Don't assume the mark's
3572 offset fits in 'int'.
3573
3574 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 * buffer.c, buffer.h: Use bool for boolean.
3577 * buffer.c (reset_buffer_local_variables)
3578 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3579 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3580 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3581 (overlay_touches_p, overlay_strings, Foverlay_put)
3582 (report_overlay_modification, call_overlay_mod_hooks):
3583 (mmap_enlarge, mmap_set_vars):
3584 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3585 Use bool for booleans, instead of int.
3586 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3587 since the 1-or-0 return value is always ignored anyway.
3588 (mmap_initialized_p):
3589 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3590 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3591
3592 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3593
3594 * bidi.c: Use bool for boolean.
3595 This is a bit more readable, and makes the text segment of bidi.o
3596 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3597 Presumably it's faster too.
3598 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3599 Now bool.
3600 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3601 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3602 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3603 (bidi_explicit_dir_char, bidi_level_of_next_char)
3604 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3605 Use bool for booleans, instead of int.
3606 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3607 (bidi_unshelve_cache): Adjust decls to match code.
3608
3609 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3610
3611 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3612 argument.
3613
3614 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3615
3616 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3617 * atimer.h: Include <stdbool.h>.
3618
3619 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3620
3621 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3622 compile time tests instead of run time tests on systems that do
3623 not use them.
3624 (FRAME_MAC_P): Remove leftover from deleted code.
3625 * frame.c (syms_of_frame): Remove leftover from deleted code.
3626
3627 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3630
3631 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3634 Otherwise, the compiler complains about (A?B:C) where B is void
3635 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3636 (fontset_add): Return void, for FONTSET_ADD.
3637
3638 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3639
3640 * alloc.c: Use bool for booleans.
3641 (gc_in_progress, abort_on_gc)
3642 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3643 (dont_register_blocks) [GC_MALLOC_CHECK]:
3644 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3645 (check_string_bytes, make_specified_string, memory_full)
3646 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3647 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3648 (mark_stack, valid_pointer_p, make_pure_string)
3649 (Fgarbage_collect, survives_gc_p, gc_sweep):
3650 Use bool for booleans, instead of int.
3651 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3652 Remove unused local.
3653 * alloc.c (PURE_POINTER_P):
3654 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3655 * editfns.c (Fformat):
3656 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3657 (Fdo_auto_save):
3658 * fns.c (sweep_weak_table):
3659 * lisp.h (suppress_checking, push_message, survives_gc_p)
3660 (make_pure_string, gc_in_progress, abort_on_gc):
3661 * lread.c (readchar, read1):
3662 * print.c (Fprin1_to_string):
3663 * xdisp.c (push_message):
3664 Use bool for booleans affected directly or indirectly by
3665 alloc.c's changes.
3666
3667 Make recently-introduced setters macros.
3668 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3669 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3670 (set_fontset_default, set_fontset_fallback): Rename from their
3671 upper-case counterparts, and make them functions rather than macros.
3672 This is more consistent with the other recently-introduced setters.
3673 These don't need to be inline, since they're local.
3674
3675 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3676
3677 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3678 the loop (Bug#12247).
3679
3680 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3681
3682 * lisp.h (vcopy): Use memcpy rather than our own loop.
3683 This fixes a performance regression introduced by the recent
3684 addition of vcopy. This means 'vcopy' will need to be modified
3685 for a copying collector, but that's OK. Also, tighten the
3686 checking in the assertion.
3687
3688 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3689
3690 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3691 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3692 non-base glyph for the width of the base character, according to
3693 what x_draw_composite_glyph_string_foreground expects.
3694 Generate WADJUST value according to composition_gstring_width's
3695 expectations, to produce correct width of the composed character.
3696 Reverse the sign of the DU offset produced by ScriptPlace.
3697
3698 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3701
3702 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3703
3704 Avoid direct writes to contents member of struct Lisp_Vector.
3705 * lisp.h (vcopy): New function to copy data into vector.
3706 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3707 * fns.c (Ffillarray): Use ASET.
3708 * keyboard.c (timer_check_2): Use AREF and ASET.
3709 (append_tool_bar_item, Frecent_keys): Use vcopy.
3710 * lread.c (read_vector): Use ASET.
3711 * msdos.c (Frecent_doskeys): Use vcopy.
3712 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3713 (Finternal_merge_in_global_face): Use ASET and vcopy.
3714 * xfont.c (xfont_list_pattern): Likewise.
3715
3716 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3717
3718 * window.c (Fwindow_point): For the selected window always return
3719 the position of its buffer's point.
3720 (Fset_window_point): For the selected window always go in its
3721 buffer to the specified position.
3722
3723 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3724
3725 Setter macros for fontsets.
3726 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3727 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3728 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3729 Adjust users.
3730
3731 2012-08-20 Glenn Morris <rgm@gnu.org>
3732
3733 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3734 Don't assume that `ln -f' works.
3735
3736 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3737
3738 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3739 and later about non-assignments with no effect. See discussion at
3740 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3741 details.
3742
3743 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3744
3745 Inline setter functions for Lisp_Objects slots of struct specbinding.
3746 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3747 Adjust users.
3748
3749 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3750
3751 * window.c (select_window): Always make selected window's buffer
3752 current.
3753
3754 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3755
3756 Use AREF and ASET for docstrings of category tables.
3757 * category.h (CATEGORY_DOCSTRING): Use AREF.
3758 (SET_CATEGORY_DOCSTRING): Use ASET.
3759 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3760
3761 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3762
3763 Inline setter functions for hash table members.
3764 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3765 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3766 (set_hash_key_and_value, set_hash_index, set_hash_next)
3767 (set_hash_hash): New functions.
3768 * charset.c, fns.c: Adjust users.
3769
3770 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3771
3772 Inline getter and setter functions for per-buffer values.
3773 * buffer.h (per_buffer_default, set_per_buffer_default)
3774 (per_buffer_value, set_per_buffer_value): New functions.
3775 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3776 * buffer.c, data.c: Adjust users.
3777
3778 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3779
3780 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3781
3782 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 Rely on <config.h> + <unistd.h> to declare 'environ',
3785 as gnulib does this if the system doesn't.
3786 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3787 Remove declaration. MS-Windows declares it on stdlib.h which is
3788 included by conf_post.h.
3789 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3790 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3791 * vm-limit.c: Include <unistd.h>, for 'environ'.
3792
3793 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3794 (start_of_data): Remove decl; mem-limits.h provides it.
3795
3796 * xdisp.c (handle_invisible_prop): Make it a bit faster
3797 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3798
3799 2012-08-19 Chong Yidong <cyd@gnu.org>
3800
3801 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3802 ends (Bug#3874).
3803
3804 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3805
3806 * .gdbinit: Use call instead of set when calling a function in the
3807 inferior.
3808
3809 * data.c (set_internal): Don't use set_blv_found.
3810 (Fkill_local_variable): Likewise.
3811
3812 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3813
3814 * nsfont.m (ns_ascii_average_width): Ensure the string
3815 ascii_printable is initialized with a null-terminated character
3816 array. Otherwise, it can contain undesired extra characters.
3817
3818 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3819
3820 port new setting code to Sun C 5.8 2005/10/13
3821 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3822 Return void, not Lisp_Object. Otherwise, the compiler
3823 complains about (A?B:C) where B is void and C is Lisp_Object
3824 when compiling CHAR_TABLE_SET, due to the recent change to
3825 the API of sub_char_table_set_contents.
3826
3827 2012-08-18 Chong Yidong <cyd@gnu.org>
3828
3829 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3830 for the string case (Bug#3874).
3831
3832 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3833
3834 * buffer.h (BSET): Remove (Bug#12215).
3835 Replace all uses with calls to new setter functions.
3836 (bset_bidi_paragraph_direction, bset_case_canon_table)
3837 (bset_case_eqv_table, bset_directory, bset_display_count)
3838 (bset_display_time, bset_downcase_table)
3839 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3840 (bset_last_selected_window, bset_local_var_alist)
3841 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3842 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3843 (bset_width_table):
3844 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3845 (bset_auto_fill_function, bset_auto_save_file_format)
3846 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3847 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3848 (bset_cache_long_line_scans, bset_case_fold_search)
3849 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3850 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3851 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3852 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3853 (bset_header_line_format, bset_indicate_buffer_boundaries)
3854 (bset_indicate_empty_lines, bset_invisibility_spec)
3855 (bset_left_fringe_width, bset_major_mode, bset_mark)
3856 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3857 (bset_name, bset_overwrite_mode, bset_pt_marker)
3858 (bset_right_fringe_width, bset_save_length)
3859 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3860 (bset_scroll_up_aggressively, bset_selective_display)
3861 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3862 (bset_word_wrap, bset_zv_marker):
3863 * category.c (bset_category_table):
3864 * syntax.c (bset_syntax_table):
3865 New setter functions.
3866
3867 * process.h (PSET): Remove (Bug#12215).
3868 Replace all uses with calls to new setter functions.
3869 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3870 (PROCESS_INLINE): New macro.
3871 (pset_childp): New setter function.
3872 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3873 * process.c (PROCESS_INLINE):
3874 Define to EXTERN_INLINE, so that the corresponding functions
3875 are compiled into code.
3876 (pset_buffer, pset_command, pset_decode_coding_system)
3877 (pset_decoding_buf, pset_encode_coding_system)
3878 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3879 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3880 (pset_type, pset_write_queue): New setter functions.
3881
3882 * window.h (WSET): Remove (Bug#12215).
3883 Replace all uses with calls to new setter functions.
3884 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3885 (WINDOW_INLINE): New macro.
3886 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3887 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3888 (wset_total_lines, wset_vertical_scroll_bar)
3889 (wset_window_end_pos, wset_window_end_valid)
3890 (wset_window_end_vpos): New setter functions.
3891 * window.c (WINDOW_INLINE):
3892 Define to EXTERN_INLINE, so that the corresponding functions
3893 are compiled into code.
3894 (wset_combination_limit, wset_dedicated, wset_display_table)
3895 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3896 (wset_new_normal, wset_new_total, wset_next_buffers)
3897 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3898 (wset_prev_buffers, wset_right_fringe_width)
3899 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3900 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3901 (wset_window_parameters):
3902 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3903 (wset_column_number_displayed, wset_region_showing):
3904 New setter functions.
3905
3906 * termhooks.h (TSET): Remove (Bug#12215).
3907 Replace all uses with calls to new setter functions.
3908 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3909 (TERMHOOKS_INLINE): New macro.
3910 (tset_charset_list, tset_selection_alist): New setter functions.
3911 * terminal.c (TERMHOOKS_INLINE):
3912 Define to EXTERN_INLINE, so that the corresponding functions
3913 are compiled into code.
3914 (tset_param_alist): New setter function.
3915
3916 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3917
3918 * keyboard.h (KSET): Remove (Bug#12215).
3919 Replace all uses with calls to new setter functions.
3920 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3921 (KEYBOARD_INLINE): New macro.
3922 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3923 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3924 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3925 New setter functions.
3926 * keyboard.c (KEYBOARD_INLINE):
3927 Define to EXTERN_INLINE, so that the corresponding functions
3928 are compiled into code.
3929 (kset_echo_string, kset_kbd_queue)
3930 (kset_keyboard_translate_table, kset_last_prefix_arg)
3931 (kset_last_repeatable_command, kset_local_function_key_map)
3932 (kset_overriding_terminal_local_map, kset_real_last_command)
3933 (kset_system_key_syms): New setter functions.
3934
3935 * frame.h (FSET): Remove (Bug#12215).
3936 Replace all uses with calls to new setter functions.
3937 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3938 (FRAME_INLINE): New macro.
3939 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3940 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3941 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3942 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3943 (fset_param_alist, fset_root_window, fset_scroll_bars)
3944 (fset_selected_window, fset_title, fset_tool_bar_items)
3945 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3946 * frame.c (FRAME_INLINE):
3947 Define to EXTERN_INLINE, so that the corresponding functions
3948 are compiled into code.
3949 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3950
3951 A few more naming-convention fixes for getters and setters.
3952 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3953 and rename from buffer_overlays_set_before.
3954 (set_buffer_overlays_after): Move here from buffer.h, and rename
3955 from buffer_overlays_set_after.
3956 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3957 All uses changed.
3958 (set_buffer_intervals): Rename from buffer_set_intervals.
3959 * intervals.c (set_interval_object): Move here from intervals.h,
3960 and rename from interval_set_object.
3961 (set_interval_left): Move here from intervals.h, and rename from
3962 interval_set_left.
3963 (set_interval_right): Move here from intervals.h, and rename from
3964 interval_set_right.
3965 (copy_interval_parent): Move here from intervals.h, and rename from
3966 interval_copy_parent.
3967 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3968 (set_interval_plist): Rename from interval_set_plist.
3969 Return void, not Lisp_Object, since no caller uses the result.
3970 * lisp.h (string_intervals): Rename from string_get_intervals.
3971 (set_string_intervals): Rename from string_set_intervals.
3972
3973 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3974 (set_char_table_contents): Rename from char_table_set_contents.
3975 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3976 All uses changed. See the end of
3977 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3978
3979 * lisp.h (CSET): Remove (Bug#12215).
3980 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3981 (set_char_table_purpose): New functions,
3982 replacing CSET. All uses changed. For example, replace
3983 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3984 "set_char_table_parent (char_table, parent);".
3985 The old version was confusing because it used the same name
3986 'parent' for two different things.
3987
3988 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3989
3990 Functions to get and set Lisp_Object fields of buffer-local variables.
3991 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3992 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3993 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3994 * data.c, eval.c, frame.c: Adjust users.
3995
3996 2012-08-17 Chong Yidong <cyd@gnu.org>
3997
3998 * xfaces.c (merge_face_vectors): If the target font specfies a
3999 font spec, make the font's attributes take precedence over
4000 directly-specified attributes.
4001 (merge_face_ref): Recognize :font.
4002
4003 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Do not use memcpy for copying intervals.
4006 * intervals.c (reproduce_interval): New function.
4007 (reproduce_tree, reproduce_tree_obj): Use it.
4008 (reproduce_tree_obj): Remove prototype.
4009
4010 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4011
4012 * lisp.h (duration_to_sec_usec): Remove unused decl.
4013
4014 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4015
4016 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4017 to an allocated instance of NSString, not to the class itself.
4018
4019 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4020
4021 * makefile.w32-in (C_CTYPE_H): New macro.
4022 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4023 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4024 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4025
4026 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4027
4028 Use ASCII tests for character types.
4029 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4030 * xfns.c, xterm.c:
4031 Don't include <ctype.h>; was not needed.
4032 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4033 * sysdep.c, xfaces.c:
4034 Include <c-ctype.h> instead of <ctype.h>.
4035 * nsterm.m: Include <c-ctype.h>.
4036 * charset.c (read_hex):
4037 * doc.c (Fsnarf_documentation):
4038 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4039 (DRIVE_LETTER) [DOS_NT]:
4040 (Ffile_name_directory, Fexpand_file_name)
4041 (Fsubstitute_in_file_name):
4042 * font.c (font_parse_xlfd, font_parse_fcname):
4043 * frame.c (x_set_font_backend):
4044 * gtkutil.c (xg_get_font):
4045 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4046 * nsimage.m (hexchar):
4047 * nsterm.m (ns_xlfd_to_fontname):
4048 * sysdep.c (system_process_attributes):
4049 * xfaces.c (hash_string_case_insensitive):
4050 Use C-locale tests instead of locale-specific tests for character
4051 types, since we want the ASCII interpretation here, not the
4052 interpretation suitable for whatever happens to be the current locale.
4053
4054 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4055
4056 Consistently check windows for validity/liveness
4057 (Bug#11984, Bug#12025, Bug#12026).
4058 * lisp.h (CHECK_VALID_WINDOW): New macro.
4059 * window.c (decode_window): Rename to decode_live_window.
4060 (decode_valid_window, Fwindow_valid_p): New functions.
4061 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4062 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4063 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4064 (Fwindow_prev_sibling, Fwindow_combination_limit)
4065 (Fset_window_combination_limit, Fwindow_use_time)
4066 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4067 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4068 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4069 (Fwindow_hscroll, Fset_window_hscroll)
4070 (Fwindow_redisplay_end_trigger)
4071 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4072 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4073 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4074 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4075 (Fwindow_end, Fset_window_point, Fset_window_start)
4076 (Fpos_visible_in_window_p, Fwindow_line_height)
4077 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4078 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4079 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4080 (Fset_window_parameter, Fwindow_display_table)
4081 (Fset_window_display_table, Fdelete_other_windows_internal)
4082 (Fset_window_buffer, Fset_window_new_total)
4083 (Fset_window_new_normal, Fdelete_window_internal)
4084 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4085 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4086 (Fwindow_scroll_bars): Check whether argument window is a valid or
4087 live window. Update doc-strings.
4088 (syms_of_window): New symbol Qwindow_valid_p.
4089 * keyboard.c (Fposn_at_x_y): Check whether argument
4090 frame_or_window denotes a valid window.
4091
4092 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4093
4094 Fix previous char table change.
4095 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4096 * chartab.c (optimize_sub_char_table): Likewise.
4097
4098 2012-08-16 Chong Yidong <cyd@gnu.org>
4099
4100 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4101
4102 * xfont.c (xfont_open):
4103 * xftfont.c (xftfont_open): Set the font's max_width field.
4104
4105 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4106 min_width to space_width and average_width to the average over
4107 printable ASCII characters.
4108 (ns_char_width): Code cleanup.
4109 (ns_ascii_average_width): New utility function.
4110
4111 * font.h (struct font): Update comments.
4112
4113 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4114
4115 Simple interface to set Lisp_Object fields of character tables.
4116 * lisp.h (CSET): New macro.
4117 (char_table_set_extras, char_table_set_contents)
4118 (sub_char_table_set_contents): New function.
4119 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4120 * syntax.c: Adjust users.
4121
4122 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4123
4124 * eval.c (eval_sub): Bind lexical-binding.
4125 * lread.c (Qlexical_binding): Make non-static.
4126
4127 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4128
4129 * nsmenu.m (popupSession): Remove.
4130 (pop_down_menu): Remove endModalSession.
4131 (timeout_handler:): New method.
4132 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4133 Call runModalForWindow. Check timer_fired when it returns.
4134 If not set, cancel timer and break out of loop.
4135 Otherwise loop again, with a new timeout.
4136
4137 * nsterm.m: Include fcntl.h if present.
4138 (fd_entry, t_readfds, inNsSelect): Remove.
4139 (select_writefds, select_valid, select_timeout, selfds)
4140 (select_mutex, apploopnr): Add.
4141 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4142 Otherwise call kbd_buffer_store_event.
4143 (ns_send_appdefined): Remove release of fd_entry.
4144 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4145 Increment and decrement apploopnr.
4146 (ns_select): If no file descriptors, just do a NSTimer.
4147 Otherwise copy read/write masks and start select thread (fd_handler).
4148 Start main loop and wait for application defined event.
4149 Inform select thread to stop selecting after main loop is exited.
4150 (ns_term_init): Create selfds pipe and set non-blocking.
4151 Initialize select_mutex. Start the select thread (fd_handler).
4152 (fd_handler:): Loop forever, wait for info from the main thread
4153 to either start or stop selecting. When select returns, send
4154 and appdefined event.
4155 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4156 If not call kbd_buffer_store_event.
4157
4158 * nsterm.h (EmacsApp): fd_handler takes id argument.
4159 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4160
4161 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4162
4163 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4164
4165 * region-cache.c (move_cache_gap): Update gap_len using the actual
4166 growth of the boundaries array. Do not change cache_len.
4167 (Bug#12196)
4168
4169 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4170
4171 Generalize and cleanup font subsystem checks.
4172 * font.h (FONT_DEBUG, font_assert): Remove.
4173 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4174 Change font_assert to eassert. Use eassert where appropriate.
4175
4176 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4177
4178 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4179
4180 2012-08-15 Chong Yidong <cyd@gnu.org>
4181
4182 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4183 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4184 extract the font descriptor instead of just the font name.
4185 In that case, return a font spec instead of a string.
4186 (x_last_font_name): Move to this file from xfns.c.
4187
4188 * xfns.c (Fx_select_font): The return value can also be a font
4189 spec. Move x_last_font_name management to gtkutil.c.
4190
4191 * xfaces.c: Make font weight and style symbols non-static.
4192
4193 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4194
4195 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4196 (bug#12117).
4197
4198 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4199
4200 * alloc.c (Fgarbage_collect): Use plural form consistently.
4201
4202 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4203
4204 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4205 iteration through the command loop. Fixes a problem whereby mouse
4206 movements are ignored until the first mouse click.
4207
4208 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4209
4210 Use bool, not int, for Lisp booleans.
4211 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4212 makes Emacs a bit smaller and presumably a bit faster.
4213 * lisp.h: Include <stdbool.h>.
4214 (struct Lisp_Boolfwd, defvar_bool):
4215 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4216 * regex.c [!emacs]: Include <stdbool.h>.
4217 (false, true): Remove; <stdbool.h> does this for us now.
4218
4219 2012-08-14 Chong Yidong <cyd@gnu.org>
4220
4221 * character.c (Fcharacterp): Doc fix (Bug#12076).
4222
4223 * data.c (Findirect_variable): Doc fix (Bug#11040).
4224
4225 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4226
4227 * editfns.c (Fformat): Doc fix (Bug#12059).
4228 (Fsave_current_buffer): Doc fix (Bug#11542).
4229
4230 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4231
4232 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4233 (bug#12022).
4234
4235 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4236
4237 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4238 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4239 * minibuf.c (choose_minibuf_frame, read_minibuf):
4240 * w32fns.c (x_create_tip_frame):
4241 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4242 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4243
4244 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4245
4246 * intervals.c (offset_intervals): Remove obsolete comment.
4247
4248 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4249
4250 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4251
4252 2012-08-14 Gergely Risko <gergely@risko.hu>
4253
4254 * coding.c (decode_coding): Record buffer modification before
4255 disabling undo_list (Bug#11773).
4256
4257 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4258
4259 Revert and cleanup some recent overlay changes.
4260 * buffer.h (enum overlay_type): Remove.
4261 (buffer_get_overlays, buffer_set_overlays): Likewise.
4262 (buffer_set_overlays_before, buffer_set_overlays_after):
4263 New function. Adjust users.
4264 (unchain_both): Add eassert.
4265
4266 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4267
4268 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4269
4270 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 * gtkutil.c (xg_mark_data): Don't assume C99.
4273
4274 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4275
4276 * gtkutil.c (xg_frame_tb_info): New struct.
4277 (TB_INFO_KEY): New define.
4278 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4279 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4280 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4281 if not present.
4282 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4283 is up to date. Otherwise store new data.
4284 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4285
4286 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4287
4288 Use KSET for write access to Lisp_Object members of struct kboard.
4289 * keyboard.h (KSET): New macro.
4290 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4291 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4292 * xterm.c: Adjust users.
4293
4294 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4295
4296 Use BSET for write access to Lisp_Object members of struct buffer.
4297 * buffer.h (BSET): New macro.
4298 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4299 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4300 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4301 * window.c, xdisp.c, xfns.c: Adjust users.
4302
4303 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4304
4305 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4306
4307 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4308
4309 * nsterm.m (not_in_argv): New function.
4310 (application:openFile, application:openTempFile:):
4311 (application:openFileWithoutUI:, application:openFiles:): Open file
4312 if not_in_argv returns non-zero (bug#12171).
4313
4314 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4315 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4316 Define for Gtk+ versions less than 3.2.
4317 (xg_get_font_name): Use those functions/macros here.
4318 Reported by Frans Oilinki <moilinki@gmail.com>.
4319
4320 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4321
4322 * unexmacosx.c (copy_data_segment): Copy initialized data in
4323 statically linked libraries from input file rather than memory.
4324
4325 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4326 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4327 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4328
4329 2012-08-10 Glenn Morris <rgm@gnu.org>
4330
4331 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4332 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4333
4334 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4335
4336 Fix last change to allow compilation with low optimization levels.
4337 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4338 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4339
4340 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4341
4342 Use common inline syntax in intervals.h.
4343 * intervals.h (INTERVALS_INLINE): New macro.
4344 Change all users from LISP_INLINE.
4345
4346 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Define Qnone once for all platforms.
4349 * frame.c (Qnone): Define here.
4350 (syms_of_frame): DEFSYM it.
4351 * lisp.h (Qnone): New declaration.
4352 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4353 * xfns.c: Remove duplication. Adjust users.
4354
4355 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4356
4357 Remove unused macros from intervals.h.
4358 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4359 * intervals.c: Adjust comment.
4360
4361 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4362
4363 * w32fns.c <w32_unicode_gui>: New static variable.
4364 (globals_of_w32fns): Initialize it according to os_subtype.
4365 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4366 testing os_subtype.
4367
4368 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4369 Eli Zaretskii <eliz@gnu.org>
4370
4371 Fix bug #10299 with Unicode characters sent by customized
4372 keyboards created by MSKLC.
4373 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4374 (w32_init_class): Use it to initialize the Emacs class with either
4375 ANSI or Unicode API calls.
4376 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4377 later.
4378 (w32_wnd_proc): If the character code sent by WM_CHAR or
4379 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4380 original message. Call DefWindowProcW on NT and later.
4381
4382 2012-08-10 Glenn Morris <rgm@gnu.org>
4383
4384 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4385
4386 * lisp.h (DIRECTORY_SEP): Let configure set it.
4387
4388 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4389
4390 Use TSET for write access to Lisp_Object slots of struct terminal.
4391 * termhooks.h (TSET): New macro.
4392 * coding.c, terminal.c, xselect.c: Adjust users.
4393
4394 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4395
4396 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4397 the failing expression, include them in the error message.
4398 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4399 * lisp.h (internal_condition_case_n): Update declaration.
4400
4401 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4402
4403 Inline functions to examine and change buffer overlays.
4404 * buffer.c (unchain_both): New function.
4405 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4406 (buffer_has_overlays): New function.
4407 (enum overlay_type): New enum.
4408 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4409 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4410
4411 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4412
4413 Inline functions to examine and change buffer intervals.
4414 * alloc.c (mark_interval_tree): Remove.
4415 (MARK_INTERVAL_TREE): Simplify.
4416 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4417 * intervals.c (buffer_balance_intervals): New function.
4418 (graft_intervals_into_buffer): Adjust indentation.
4419 (set_intervals_multibyte): Simplify.
4420 * buffer.h (BUF_INTERVALS): Remove.
4421 (buffer_get_intervals, buffer_set_intervals): New function.
4422 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4423 * intervals.c, textprop.c: Adjust users.
4424
4425 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4426
4427 Inline functions to examine and change string intervals.
4428 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4429 (string_get_intervals, string_set_intervals): New function.
4430 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4431 * lread.c, print.c, textprop.c: Adjust users.
4432
4433 2012-08-08 Glenn Morris <rgm@gnu.org>
4434
4435 * lisp.mk (lisp): Remove language/persian.elc.
4436
4437 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 Cleanup intervals.
4440 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4441 (NULL_INTERVAL_P): Likewise. Adjust users.
4442 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4443 Adjust comment. Move under #if 0.
4444 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4445 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4446
4447 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4448
4449 Check total length of intervals with eassert.
4450 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4451 * intervals.c: Change all users to eassert.
4452
4453 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4454
4455 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4456 Rename fields to match removal of FGET and WGET and disuse of
4457 INTERNAL_FIELD in Lisp_Cons.
4458
4459 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4460
4461 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4462 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4463 name since all xname users are fixed long time ago. Do not
4464 use INTERNAL_FIELD.
4465 (set_symbol_name, set_symbol_function, set_symbol_plist):
4466 (set_symbol_next, set_overlay_plist): New function.
4467 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4468 (struct Lisp_Overlay): Likewise.
4469 (CVAR, MVAR, SVAR): Remove.
4470 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4471 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4472 * xterm.c: Adjust users.
4473 * .gdbinit: Change to use name field of struct Lisp_Symbol
4474 where appropriate.
4475
4476 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4477
4478 Basic functions to set Lisp_Object and pointer slots of intervals.
4479 * intervals.h (interval_set_parent, interval_set_object):
4480 (interval_set_left, interval_set_right, interval_set_plist):
4481 (interval_copy_parent): New function.
4482 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4483 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4484 Adjust indentation.
4485 (INTERVAL_SIZE): Remove. Adjust users.
4486 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4487
4488 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4489
4490 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4491 * process.h (PGET): Remove.
4492 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4493 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4494
4495 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4498 * window.h (WGET): Remove.
4499 (struct window): Do not use INTERNAL_FIELD.
4500 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4501 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4502 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4503 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4504 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4505 Adjust users.
4506
4507 2012-08-07 Chong Yidong <cyd@gnu.org>
4508
4509 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4510 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4511 (Fdelete_window_internal): Signal an error if the window is not on
4512 a live frame (Bug#12025).
4513
4514 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4515
4516 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4517 * frame.h (FGET): Remove.
4518 (struct frame): Do not use INTERNAL_FIELD.
4519 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4520 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4521 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4522 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4523
4524 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4525
4526 * w32.c: Silence compiler warnings.
4527 (map_w32_filename): Remove unused variable `is_fat'.
4528 (chase_symlinks): Add parentheses around expression.
4529
4530 2012-08-06 Glenn Morris <rgm@gnu.org>
4531
4532 * sysdep.c: Respect BROKEN_GETWD.
4533
4534 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4535 Let configure handle it.
4536 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4537
4538 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 Use GCALIGNMENT where appropriate.
4541 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4542 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4543 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4544
4545 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4546
4547 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4548 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4549
4550 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4551
4552 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4553 that should be sufficient for everyone.
4554
4555 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4556
4557 * keyboard.c (timer_check_2): Add break so timer_check returns next
4558 timeout.
4559
4560 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4561
4562 Fix Windows build errors introduced after converting to WGET and WSET.
4563 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4564 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4565
4566 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4567
4568 * nsterm.m (ns_frame_rehighlight): Use FSET.
4569
4570 * nsmenu.m (ns_update_menubar): Use FSET.
4571
4572 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4573
4574 Separate read and write access to Lisp_Object slots of Lisp_Process.
4575 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4576 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4577
4578 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4579
4580 Separate read and write access to Lisp_Object slots of struct window.
4581 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4582 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4583 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4584 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4585 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4586 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4587 Adjust users.
4588
4589 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4590
4591 Fix Windows build errors introduced after converting to FGET and FSET.
4592 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4593 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4594 (w32_judge_scroll_bars): Change to use FSET.
4595 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4596
4597 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Fix replacement typo.
4600 * window.c (replace_window): Set root_window instead of
4601 selected_window. This fixes a total window subsystem
4602 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4603
4604 2012-08-06 Glenn Morris <rgm@gnu.org>
4605
4606 * lisp.mk (lisp): Add language/persian.elc.
4607
4608 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4609
4610 Separate read and write access to Lisp_Object slots of struct frame.
4611 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4612 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4613 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4614 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4615 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4616
4617 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4618
4619 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4620
4621 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4622
4623 Generalize common compile-time constants.
4624 * lisp.h (header_size, bool_header_size, word_size): Now here.
4625 (struct Lisp_Vector): Add comment.
4626 (struct Lisp_Bool_Vector): Move up to define handy constants.
4627 (VECSIZE, PSEUDOVECSIZE): Simplify.
4628 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4629 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4630 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4631 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4632 * xfont.c, xmenu.c: Use word_size where appropriate.
4633
4634 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4635
4636 * search.c (Freplace_match): Treat \? in the replacement text
4637 literally (Bug#8161).
4638
4639 2012-08-05 Chong Yidong <cyd@gnu.org>
4640
4641 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4642 * frame.c (Vdelete_frame_functions):
4643 * emacs.c (Vkill_emacs_hook): Doc fix.
4644
4645 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4646
4647 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4648 --with-x-toolkit=no builds.
4649 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4650
4651 2012-08-04 Chong Yidong <cyd@gnu.org>
4652
4653 * syntax.c (Fmodify_syntax_entry): Doc fix.
4654
4655 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4656
4657 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4658 * w32.c (init_environment): Change the default values of many
4659 environment variables in dflt_envvars[] to NULL, to avoid pushing
4660 them into environment when they were not already defined.
4661 Remove the code that deletes site-lisp subdirectories from the default
4662 value of EMACSLOADPATH, as it is no longer needed.
4663 (check_windows_init_file): Now external, not static.
4664 Use Vload_path as is, without adding anything, as this function is now
4665 called when Vload_path is already set up.
4666
4667 * w32.h (check_windows_init_file): Add prototype.
4668
4669 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4670 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4671 compatibility with Posix platforms.
4672 (main): Move the call to check_windows_init_file to here from
4673 w32.c.
4674 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4675 any, in the DEFALT argument into the root of the Emacs build or
4676 installation tree, as appropriate.
4677
4678 * callproc.c (init_callproc_1): Call decode_env_path instead of
4679 doing its equivalent by hand.
4680 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4681 the code that sets Vexec_path run on MS-Windows.
4682
4683 * lread.c (init_lread): Add comments to #ifdef's.
4684
4685 * msdos.c (dos_set_window_size, IT_update_begin)
4686 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4687 instead of direct references.
4688
4689 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 Export DEFAULT_REHASH_* to GDB.
4692 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4693 Now constants, not macros.
4694
4695 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4696
4697 Remove unnecessary casts involving pointers.
4698 These casts are no longer needed now that we assume C89 or later,
4699 since they involve casting to or from void *.
4700 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4701 (make_pure_float, make_pure_vector):
4702 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4703 * macros.c (Fstart_kbd_macro):
4704 * menu.c (find_and_return_menu_selection):
4705 * minibuf.c (read_minibuf_noninteractive):
4706 * sysdep.c (closedir):
4707 * xdisp.c (x_produce_glyphs):
4708 * xfaces.c (compare_fonts_by_sort_order):
4709 * xfns.c (x_real_positions, select_visual):
4710 * xselect.c (x_stop_queuing_selection_requests)
4711 (x_get_window_property, x_get_window_property_as_lisp_data):
4712 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4713 Remove unnecessary pointer casts.
4714 * alloc.c (record_xmalloc): New function.
4715 * lisp.h (record_xmalloc): New decl.
4716 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4717 more like a function. This is because the pointer cast is not
4718 needed. All uses changed.
4719 * print.c (print_string, print_error_message): Avoid length recalc.
4720
4721 Improve fix for macroexp crash with debugging (Bug#12118).
4722 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4723 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4724 not supposed to be invoked from the garbage collector.
4725 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4726 (gc_aset): New function, which is like ASET but can be
4727 used in the garbage collector.
4728 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4729 (set_hash_index): Use it instead of ASET.
4730
4731 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4732
4733 Support symlinks on latest versions of MS-Windows.
4734 * w32.c: Include winioctl.h and aclapi.h.
4735 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4736 (revert_to_self): Forward declarations of static functions.
4737 <static BOOL g_b_init_get_security_info>:
4738 <g_b_init_create_symbolic_link>: New static flags.
4739 (globals_of_w32): Initialize them to zero.
4740 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4741 (map_w32_filename): Improve commentary. Simplify switch.
4742 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4743 headers (most versions of MinGW w32api don't).
4744 (get_security_info, create_symbolic_link)
4745 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4746 New functions.
4747 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4748 in the argument file name.
4749 (sys_access): Call unc_volume_file_attributes only if
4750 GetFileAttributes fails with network-related error codes.
4751 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4752 have the required privileges.
4753 (get_file_security_desc_by_name): Rename from
4754 get_file_security_desc.
4755 (stat_worker): New function, with most of the guts of 'stat', and
4756 with addition of handling of symlinks and support for 'lstat'.
4757 If possible, get file's attributes and security information by
4758 handle, not by name. Produce S_IFLNK bit for symlinks, when
4759 called from 'lstat'.
4760 (stat, lstat): New functions, call 'stat_worker'.
4761 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4762 symlinks when the underlying filesystem supports them.
4763
4764 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4765
4766 Fix macroexp crash on Windows with debugging (Bug#12118).
4767 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4768 checking subscripts; problem introduced with the recent
4769 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4770 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4771 since it's used in non-static inline functions now.
4772
4773 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4774 Don't assume buffer size fits in 'int'. Remove unused local.
4775
4776 Use C99-style 'extern inline' if available.
4777 * buffer.h (BUFFER_INLINE):
4778 * category.h (CATEGORY_INLINE):
4779 * character.h (CHARACTER_INLINE):
4780 * charset.h (CHARSET_INLINE):
4781 * composite.h (COMPOSITE_INLINE):
4782 * dispextern.h (DISPEXTERN_INLINE):
4783 * lisp.h (LISP_INLINE):
4784 * systime.h (SYSTIME_INLINE):
4785 New macro, replacing 'static inline' in this header.
4786 * buffer.h, category.h, character.h, charset.h, composite.h:
4787 * dispextern.h, lisp.h, systime.h:
4788 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4789 * alloc.c (LISP_INLINE):
4790 * buffer.c (BUFFER_INLINE):
4791 * category.c (CATEGORY_INLINE):
4792 * character.c (CHARACTER_INLINE):
4793 * charset.c (CHARSET_INLINE):
4794 * composite.c (COMPOSITE_INLINE):
4795 * dispnew.c (DISPEXTERN_INLINE):
4796 * sysdep.c (SYSTIME_INLINE):
4797 Define to EXTERN_INLINE, so that the corresponding functions
4798 are compiled into code.
4799 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4800 (INLINE_HEADER_END): New macros.
4801 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4802 since it's used in non-static inline functions now.
4803 (VALMASK) [!USE_LSB_TAG]: Likewise.
4804
4805 2012-08-02 Glenn Morris <rgm@gnu.org>
4806
4807 * s/: Remove empty directory.
4808
4809 * s/ms-w32.h: Move to ../nt/inc.
4810 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4811 Update for new ms-w32.h location.
4812
4813 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4814
4815 Port to Solaris 8.
4816 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4817
4818 2012-08-02 Glenn Morris <rgm@gnu.org>
4819
4820 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4821 hard-coding the path separator.
4822
4823 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4826 This how ASET and AREF are supposed to work, and makes
4827 it easier to think about future improvements. See
4828 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4829 * charset.h (set_charset_attr): New function.
4830 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4831 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4832 (aref_addr): New function. All uses of &AREF(...) changed.
4833 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4834 (set_hash_index): New functions. All lvalue-style uses of
4835 HASH_KEY etc. changed.
4836 * keyboard.c (set_prop): New function. All lvalue-style uses
4837 of PROP changed.
4838
4839 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4840
4841 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4842 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4843 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4844 * nsfns.m (ns_set_name_as_filename): Likewise.
4845 * nsmenu.m (ns_update_menubar): Likewise.
4846 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4847
4848 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4849
4850 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4851 Adapt to latest changes in field names of the corresponding Lisp
4852 objects.
4853
4854 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4855
4856 2012-08-01 Glenn Morris <rgm@gnu.org>
4857
4858 * s/msdos.h: Remove file.
4859 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4860 * Makefile.in (S_FILE): Remove.
4861 (config_h): Remove S_FILE.
4862
4863 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4864
4865 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4866 Remove; moved to nt/config.nt.
4867
4868 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4869
4870 Use INTERNAL_FIELD for conses and overlays.
4871 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4872 Remove obsolete comment.
4873 (MVAR): New macro.
4874 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4875 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4876
4877 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4878
4879 Use INTERNAL_FIELD for symbols.
4880 * lisp.h (SVAR): New macro. Adjust users.
4881 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4882 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4883
4884 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4885
4886 Use INTERNAL_FIELD for processes.
4887 * process.h (PVAR): New macro. Adjust style.
4888 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4889 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4890
4891 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Use INTERNAL_FIELD for windows.
4894 * window.h (WVAR): New macro.
4895 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4896 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4897 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4898 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4899 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4900 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4901
4902 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4905
4906 2012-08-01 Glenn Morris <rgm@gnu.org>
4907
4908 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4909 Move to configure.ac.
4910
4911 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4912
4913 * makefile.w32-in (CONFIG_H): Update dependencies.
4914 (CONF_POST_H): New macro.
4915
4916 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4917
4918 2012-07-31 Glenn Morris <rgm@gnu.org>
4919
4920 * Makefile.in (S_FILE): No longer set by configure.
4921
4922 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4923 is available.
4924 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4925
4926 * process.h (NULL_DEVICE):
4927 * emacs.c (SEPCHAR):
4928 * editfns.c (USER_FULL_NAME): Let configure set them.
4929
4930 * s/README, s/template.h: Remove files.
4931
4932 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4933
4934 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4935 Move to configure.ac.
4936
4937 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4938
4939 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4940 resulting renaming of 'struct frame' members.
4941
4942 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4943
4944 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4945 after introduction of FVAR.
4946
4947 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4948
4949 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4950
4951 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4952 instead of compositeToPoint.
4953 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4954
4955 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4956
4957 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4960 * lisp.h (INTERNAL_FIELD): New macro.
4961 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4962 (BVAR): Change to use INTERNAL_FIELD.
4963 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4964 (KVAR): Change to use INTERNAL_FIELD.
4965 * frame.h (FVAR): New macro.
4966 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4967 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4968 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4969 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4970 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4971
4972 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4973
4974 Miscellaneous fixes for non-default X toolkits.
4975 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4976 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4977 Move under #ifdef USE_LUCID.
4978 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4979 definition and usage to avoid warnings.
4980
4981 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4982
4983 * nsterm.m (openFiles): Fix previous checkin.
4984
4985 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4986
4987 * indent.c (compute_motion): Remove unused local.
4988
4989 2012-07-31 Glenn Morris <rgm@gnu.org>
4990
4991 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4992
4993 * conf_post.h [USG5_4]:
4994 Move remaining contents of s/usg5-4-common.h here.
4995 * s/usg5-4-common.h: Remove file.
4996
4997 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4998 * s/irix6-5.h: Remove file.
4999
5000 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5001 * s/darwin.h: Remove file.
5002
5003 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5004 * s/hpux10-20.h: Remove file, which is now empty.
5005
5006 2012-07-30 Glenn Morris <rgm@gnu.org>
5007
5008 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5009 * Makefile.in (config_h): Add conf_post.h.
5010 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5011
5012 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5013
5014 * nsterm.m (ns_do_open_file): New variable.
5015 (ns_term_init): Set ns_do_open_file to YES after run returns.
5016 (openFile, openTempFile, openFileWithoutUI, openFiles):
5017 Open files only if ns_do_open_file.
5018
5019 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5020
5021 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5022 This no-op macro hasn't been needed for many years.
5023 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5024
5025 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5026 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5027 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5028 gdb_make_enums_visible.
5029 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5030 (DIRECTORY_SEP): Now a constant, not a macro.
5031
5032 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5033
5034 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5035 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5036
5037 * w32term.c <w32_keyboard_codepage>: Renamed from
5038 keyboard_codepage and now external. All users changed.
5039
5040 * w32term.h: Add declaration of w32_keyboard_codepage.
5041
5042 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5043 the codepage to translate keys to Unicode. If this argument is
5044 -1, use the value returned by GetConsoleCP. All callers changed.
5045
5046 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5047
5048 Update .PHONY listings in makefiles.
5049 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5050 bootstrap-clean, distclean, maintainer-clean, versioclean,
5051 extraclean, frc.
5052
5053 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5054 This is a bit clearer. Fix some commentary typos.
5055
5056 2012-07-30 Glenn Morris <rgm@gnu.org>
5057
5058 * s/netbsd.h: Let configure include signal.h if needed.
5059 Remove file, which is now empty.
5060
5061 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5062 Let configure set them.
5063 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5064 No more need to undefine.
5065
5066 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5067
5068 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5069 non-single-byte char when adding meta modifier. (Bug#12090)
5070
5071 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5072
5073 Convert safe_call to use variable number of arguments.
5074 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5075 (safe_call2): Fix comment.
5076 * lisp.h (safe_call): Adjust prototype.
5077 * coding.c (encode_coding_object): Change to use safe_call2.
5078 * xfaces.c (merge_face_heights): Change to use safe_call1.
5079
5080 2012-07-30 Glenn Morris <rgm@gnu.org>
5081
5082 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5083 does that unconditionally. Remove file, which is now empty.
5084
5085 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5086 Remove empty files.
5087
5088 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5089
5090 Export to GDB most of lisp.h's remaining object-like macros.
5091 * lisp.h (min, max): Move earlier, because they're used earlier now.
5092 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5093 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5094 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5095 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5096 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5097 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5098 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5099 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5100 Now constants, for GDB. They need not be macros.
5101 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5102 Now constants, for GDB, as well as macros, for static initializers.
5103 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5104 Move to after the definition of struct Lisp_Char_Table,
5105 since the former now needs that type defined.
5106 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5107 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5108 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5109 New enums, for gdb_make_enums_visible.
5110 (GLYPH_MODE_LINE_FACE): Remove; unused.
5111 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5112 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5113 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5114 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5115 enum maxargs, enum MAX_ALLOCA.
5116 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5117 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5118 no longer needed, now that they are done in lisp.h.
5119
5120 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5121
5122 Cleanup string bytes checking.
5123 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5124 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5125 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5126 (check_sblock, compact_small_strings): Simplify.
5127
5128 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5129
5130 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5131 These macros are confusing and no longer need to be defined, as
5132 the enum values now suffice. All uses replaced with definiens.
5133 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5134
5135 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5136
5137 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5138 ($(BLD)/w32console.$(O)): Update dependencies.
5139
5140 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5141
5142 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5143 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5144 time. Adjust users.
5145 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5146
5147 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5148
5149 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5150 setting sitelisp (Bug#12010).
5151
5152 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5153
5154 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5155
5156 * w32heap.c (cache_system_info):
5157 * w32.c (sys_rename):
5158 * w32proc.c (find_child_console, sys_kill): All users changed.
5159
5160 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5161
5162 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5163
5164 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5165
5166 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5167
5168 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5169
5170 Cleanup statistics calculation in Fgarbage_collect.
5171 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5172 Fix zombies percentage calculation. Simplify elapsed time calculation.
5173
5174 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5175
5176 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5177 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5178 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5179 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5180 (replace_range, replace_range_2, del_range_2): Change to eassert.
5181 * marker.c (byte_char_debug_check): Adjust style.
5182
5183 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5186 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5187 long-ago-commented-out code that talks about "WIN32".
5188 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5189 All uses changed.
5190
5191 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5192
5193 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5194 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5195 Simplify by using alignof.
5196 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5197 * lisp.h: Include <stdalign.h>.
5198 (GCALIGNMENT): New macro and constant.
5199 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5200 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5201 (stdalign): New macro, if not already defined.
5202
5203 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5204
5205 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5206 * w32inevt.c: Include w32inevt.h.
5207 (w32_read_console_input): New inline function, calls either
5208 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5209 w32_console_unicode_input.
5210 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5211 (w32_kbd_patch_key, key_event): Use the codepage returned by
5212 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5213 (key_event): use uChar.UnicodeChar only if
5214 w32_console_unicode_input is non-zero.
5215
5216 * w32console.c: Include w32heap.h.
5217 <w32_console_unicode_input>: New global variable.
5218 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5219 family of Windows, zero otherwise.
5220
5221 * w32inevt.h: Declare w32_console_unicode_input.
5222
5223 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5224 --without-x. (Bug#11742)
5225
5226 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5227
5228 Adjust GDB to reflect pvec_type changes (Bug#12036).
5229 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5230 2012-07-04 changes to pseudovector representation.
5231 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5232
5233 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5234
5235 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5236 bus address.
5237 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5238
5239 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5240
5241 * alloc.c (listn): Fix the order the arguments are consed onto the
5242 list.
5243
5244 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5245 enumeration constants, as PURE and HEAP are too general, and clash
5246 with other headers and sources, such as gmalloc.c and the
5247 MS-Windows system headers. All users changed.
5248
5249 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Revert last save_excursion_save and save_excursion_restore changes.
5252 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5253 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5254
5255 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5256
5257 Fix recently-introduced typos in Windows port.
5258 Reported by Martin Rudalics <rudalics@gmx.at>.
5259 * w32.c (init_environment): Replace comma with semicolon.
5260 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5261
5262 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 Improve GDB symbol export (Bug#12036).
5265 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5266 arms of an 'if', not using conditional expressions; otherwise GDB
5267 complains about the types in the unevaluated arm when the argument
5268 is an integer literal.
5269 (xgetint): Simplify expression.
5270 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5271 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5272 Zaretskii in <http://bugs.gnu.org/12036#13>.
5273 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5274 needed now that we have gdb_make_enums_visible.
5275 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5276 (enum enum_USE_LSB_TAG):
5277 New enum types, packaging up enums that need to be exported to GDB.
5278
5279 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5280
5281 Utility function to make a list from specified amount of objects.
5282 * lisp.h (enum constype): New datatype.
5283 (listn): New prototype.
5284 * alloc.c (listn): New function.
5285 (Fmemory_use_count, syms_of_alloc): Use it.
5286 * buffer.c (syms_of_buffer): Likewise.
5287 * callint.c (syms_of_callint): Likewise.
5288 * charset.c (define_charset_internal): Likewise.
5289 * coding.c (syms_of_coding): Likewise.
5290 * keymap.c (syms_of_keymap): Likewise.
5291 * search.c (syms_of_search): Likewise.
5292 * syntax.c (syms_of_syntax): Likewise.
5293 * w32.c (init_environment): Likewise.
5294 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5295 * xdisp.c (syms_of_xdisp): Likewise.
5296 * xfns.c (syms_of_xfns): Likewise.
5297
5298 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5299
5300 Fast save_excursion_save and save_excursion_restore.
5301 * lisp.h (struct Lisp_Excursion): New data type.
5302 (PVEC_EXCURSION): New pseudovector type.
5303 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5304 to deal with it. Adjust comments.
5305 (init_marker, attach_marker): New prototype.
5306 (unchain_marker): Adjust prototype.
5307 * marker.c (attach_marker): Change to global.
5308 (init_marker): New function.
5309 * alloc.c (Fmake_marker, build_marker): Use it.
5310 (build_marker): More easserts.
5311 (mark_object): Handle struct Lisp_Excursion.
5312 * editfns.c (save_excursion_save, save_excursion_restore):
5313 Reimplement to use struct Lisp_Excursion. Add comments.
5314
5315 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 Fix export of symbols to GDB (Bug#12036).
5318 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5319 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5320 emacs.c, as this is a more-suitable home. Had this been done earlier
5321 the fix for 12036 would have avoided some of the problems noted in
5322 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5323 would have been more obvious.
5324 * emacs.c: Do not include <verify.h>; no longer needed.
5325 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5326 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5327 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5328 Remove; now done in lisp.h.
5329 * lisp.h (PUBLISH_TO_GDB): New macro.
5330 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5331 (DATA_SEG_BITS): Use it.
5332 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5333 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5334 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5335 not be usable in #if. This simplifies things.
5336
5337 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5338
5339 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5340
5341 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5342
5343 Simplify export of symbols to GDB (Bug#12036).
5344 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5345 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5346 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5347 Adjust to changes in lisp.h and emacs.c, by using
5348 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5349 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5350 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5351 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5352 instead of gdb_valbits.
5353 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5354 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5355 instead of gdb_array_mark_flag.
5356 (xboolvector): Get size from $->size, not $->header.size.
5357 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5358 (xreload, hook-run, hookpost-run): Remove.
5359 * emacs.c: Include <verify.h>.
5360 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5361 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5362 Remove.
5363 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5364 (gdb_USE_LSB_TAG): New enum constants.
5365 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5366 Also define these as enum constants, so they're visible to GDB.
5367 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5368 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5369 as constants, so they're visible to GDB.
5370 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5371 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5372 Now enum constants, not macros, so they're visible to GDB.
5373 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5374 more convenient now. All uses changed.
5375 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5376 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5377
5378 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5379
5380 Explicitly free restriction data that are not needed anymore.
5381 * editfns.c (save_restriction_restore): Free restriction data.
5382
5383 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5384
5385 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5386 add argument, tune behavior, and adjust all callers.
5387
5388 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5389
5390 Use typedef for EMACS_INT, EMACS_UINT.
5391 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5392 than macros. This simplifies debugging in the usual case, since
5393 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5394 and it allows expressions involving EMACS_INT casts.
5395 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5396
5397 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5398
5399 * nsterm.m (ns_read_socket): Return early if there is a modal
5400 window (Bug#12043).
5401
5402 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5403
5404 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5405 that FOCUS-FRAME can be omitted.
5406
5407 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5408
5409 Adjust buffer text indirection counters at the end of Fkill_buffer.
5410 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5411 buffer is definitely dead. This should really fix an issue reported
5412 by Christoph Scholtes again. (Bug#12007).
5413 (init_buffer_once): Initialize indirection counters of
5414 buffer_defaults and buffer_local_symbols (for sanity and safety).
5415
5416 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5417
5418 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5419 and continuation glyphs on tooltip frames, leave them at zero.
5420 Avoids continued lines in tooltips. (Bug#11832)
5421
5422 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Simplify copy_overlay.
5425 * buffer.c (copy_overlay): Simplify. Use build_marker.
5426 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5427
5428 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5429
5430 * print.c (print_object): Don't crash when a frame's name is nil
5431 or invalid. (Bug#12025)
5432
5433 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5434 it signals an error when a tooltip frame is being created.
5435
5436 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5437
5438 Cleanup miscellaneous objects allocation and initialization.
5439 * alloc.c (allocate_misc): Change to static. Add argument to
5440 specify the subtype. Adjust comment and users.
5441 (build_overlay): New function.
5442 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5443 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5444 (allocate_misc): Remove prototype.
5445 (build_overlay): Add prototype.
5446
5447 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5448
5449 Swap buffer text indirection counters in Fbuffer_swap_text.
5450 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5451 This avoids crash reported by Christoph Scholtes at
5452 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5453
5454 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5455
5456 * nsmenu.m (Popdown_data): New struct.
5457 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5458 free Popdown_data.
5459 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5460 (initWithContentRect): Make imgView and contentView non-static
5461 and autorelease them. Also autorelease img and matrix (Bug#12005).
5462 (dealloc): Remove (Bug#12005).
5463
5464 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 Adjust consing_since_gc when objects are explicitly freed.
5467 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5468 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5469 (free_cons, free_misc): Subtract object size from consing_since_gc.
5470
5471 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5472
5473 Simplify and cleanup markers positioning code.
5474 * marker.c (attach_marker): More useful eassert.
5475 (live_buffer, set_marker_internal): New function.
5476 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5477 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5478
5479 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5482 as it's limited by the amount of memory, not by INT_MAX.
5483
5484 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5485
5486 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5487 in special-event-map. See the discussion at
5488 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5489 for the reasons.
5490
5491 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5492 info.dwItemData. Fixes crashes on 64-bit Windows.
5493 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5494
5495 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5496
5497 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5498 (conversationIdentifier): Return value is NSInteger.
5499 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5500
5501 2012-07-21 Chong Yidong <cyd@gnu.org>
5502
5503 * window.c (decode_any_window): Signal an error if the window is
5504 on a dead frame (Bug#11984).
5505
5506 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 Add indirection counting to speed up Fkill_buffer.
5509 * buffer.h (struct buffer): New member.
5510 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5511 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5512 base buffer indirection counter.
5513 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5514 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5515 through buffer list if indirection counter is 0.
5516
5517 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5518
5519 Extend the value returned by Fgarbage_collect with heap statistics.
5520 * alloc.c (Qheap): New symbol.
5521 (syms_of_alloc): DEFSYM it.
5522 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5523 (Fmemory_free): Remove.
5524 (syms_of_alloc): Don't defsubr it.
5525 * buffer.c (Fcompact_buffer): Remove.
5526 (syms_of_buffer): Don't defsubr it.
5527
5528 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5529
5530 Make maybe_gc inline.
5531 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5532 * lisp.h (consing_since_gc, gc_relative_threshold)
5533 (memory_full_cons_threshold): Revert declaration.
5534 (maybe_gc): Remove prototype, define as inline.
5535 * alloc.c: Remove old commented-out code.
5536 (consing_since_gc, gc_relative_threshold)
5537 (memory_full_cons_threshold): Revert to global.
5538 (maybe_gc): Remove.
5539
5540 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5541
5542 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5543 * lisp.h (build_unibyte_string): New function.
5544 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5545 * sysdep.c, w32fns.c, xfns.c: Use it.
5546 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5547 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5548 Adjust users accordingly.
5549 * font.h (font_open_by_name): Adjust prototype.
5550
5551 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5552
5553 Cleanup calls to Fgarbage_collect.
5554 * lisp.h (maybe_gc): New prototype.
5555 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5556 Remove declarations.
5557 * alloc.c (maybe_gc): New function.
5558 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5559 Make them static.
5560 * bytecode.c (MAYBE_GC): Use maybe_gc.
5561 * eval.c (eval_sub, Ffuncall): Likewise.
5562 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5563 to avoid dependency from auto-save feature.
5564
5565 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5568 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5569 'for_each_per_buffer_object_at'.
5570 All uses changed. It's better to use upper-case for macros that
5571 cannot be implemented as functions, to give the reader a clue
5572 that they're special.
5573
5574 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5575
5576 * alloc.c (Fgarbage_collect): Tweak docstring.
5577
5578 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5579
5580 Tweak the value returned from Fgarbage_collect again.
5581 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5582 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5583 Adjust documentation.
5584 (total_vector_bytes): Rename to total_vector_slots, adjust
5585 accounting.
5586 (total_free_vector_bytes): Rename to total_free_vector_slots,
5587 adjust accounting.
5588 (Qstring_bytes, Qvector_slots): New symbols.
5589 (syms_of_alloc): DEFSYM them.
5590
5591 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5592
5593 Buffer compaction primitive which may be used from Lisp.
5594 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5595 (syms_of_buffer): Register Fcompact_buffer.
5596 * alloc.c (Fgarbage_collect): Use compact_buffer.
5597 * buffer.h (compact_buffer): New prototype.
5598 (struct buffer_text): New member.
5599
5600 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5601
5602 New macro to iterate over all buffers, miscellaneous cleanups.
5603 * lisp.h (all_buffers): Remove declaration.
5604 * buffer.h (all_buffers): Add declaration, with comment.
5605 (for_each_buffer): New macro.
5606 * alloc.c (Fgarbage_collect, mark_object): Use it.
5607 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5608 (init_buffer): Likewise.
5609 * data.c (Fset_default): Likewise.
5610 * coding.c (code_conversion_restore): Remove redundant check
5611 for dead buffer.
5612 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5613
5614 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5615
5616 Fix bug that created negative-length intervals.
5617 * intervals.c (merge_interval_right, merge_interval_left):
5618 Do not zero out this interval if it is absorbed by its children,
5619 as this interval's total length doesn't change in that case. See
5620 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5621
5622 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5623
5624 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5625 when invoking (make-bool-vector N t) and N is a positive
5626 multiple of 8 -- the last 8 bits were mistakenly cleared.
5627
5628 Remove some struct layout assumptions in bool vectors.
5629 * alloc.c (bool_header_size): New constant.
5630 (header_size, word_size): Move earlier, as they're now used earlier.
5631 Use 'word_size' in a few more places, where it's appropriate.
5632 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5633 padding before the data member of a bool vector.
5634 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5635 than doing the check by hand with an abort ().
5636
5637 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5638
5639 * eval.c (Fdefvar): Don't check constants since we only set the var if
5640 it's not yet defined anyway (bug#11904).
5641
5642 * lisp.h (last_undo_boundary): Declare new var.
5643 * keyboard.c (command_loop_1): Set it.
5644 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5645 were auto-added by the command loop (bug#11774).
5646
5647 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5648
5649 * w32font.c (Qsymbol): Remove local definition.
5650 (syms_of_w32font): Don't DEFSYM it.
5651
5652 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5653
5654 Fix sweep_vectors to handle large bool vectors correctly.
5655 * alloc.c (sweep_vectors): Account total_vector_bytes for
5656 bool vectors larger than VBLOCK_BYTES_MAX.
5657
5658 2012-07-18 Chong Yidong <cyd@gnu.org>
5659
5660 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5661 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5662
5663 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5664
5665 Return more descriptive data from Fgarbage_collect.
5666 Suggested by Stefan Monnier in
5667 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5668 * alloc.c (bounded_number): New function.
5669 (total_buffers, total_vectors): New variable.
5670 (total_string_size): Rename to total_string_bytes, adjust users.
5671 (total_vector_size): Rename to total_vector_bytes, adjust users.
5672 (sweep_vectors): Account total_vectors and total_vector_bytes.
5673 (Fgarbage_collect): New return value. Adjust documentation.
5674 (gc_sweep): Account total_buffers.
5675 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5676 (VECTOR_SIZE): Remove.
5677 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5678 (Qinterval, Qmisc): New symbols.
5679 (syms_of_data): Initialize them.
5680 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5681 (Qcons, Qbuffer): New declarations.
5682
5683 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5684
5685 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5686 Round up, not down. Improve doc.
5687
5688 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5689
5690 Restore old code in allocate_string_data to avoid Faset breakage.
5691 Reported by Julien Danjou <julien@danjou.info> in
5692 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5693 * alloc.c (allocate_string_data): Restore old code with minor
5694 adjustments, fix comment to explain this subtle issue.
5695
5696 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5697
5698 Remove FILE_SYSTEM_CASE.
5699 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5700
5701 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5702 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5703 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5704 call-process-region passes it through expand-file-name.
5705
5706 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5707
5708 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5709
5710 Fix crash when creating indirect buffer (Bug#11917)
5711 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5712 Don't handle unbound variables specially if non-zero.
5713 (Fbuffer_local_variables): Pass zero.
5714 (clone_per_buffer_values): Pass non-zero.
5715
5716 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5717
5718 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5719 to make the loop interruptible.
5720
5721 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5722
5723 * gnutls.c (emacs_gnutls_handshake): Only retry if
5724 GNUTLS_E_INTERRUPTED.
5725
5726 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Cleanup and convert miscellaneous checks to eassert.
5729 * alloc.c (mark_interval): Fix comment, partially rephrase
5730 old comment from intervals.h (see below).
5731 * intervals.c (find_interval, adjust_intervals_for_insertion)
5732 (delete_interval, adjust_intervals_for_deletion)
5733 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5734 Convert to eassert.
5735 (adjust_intervals_for_insertion, make_new_interval):
5736 Remove obsolete and unused code.
5737 * intervals.h (struct interval): Remove obsolete comment.
5738 * textprotp.c (erase_properties): Remove unused code.
5739 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5740 (Fremove_list_of_text_properties): Convert to eassert.
5741
5742 2012-07-17 Chong Yidong <cyd@gnu.org>
5743
5744 * editfns.c (Finsert_char): Doc fix.
5745
5746 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5747
5748 Fix previous change to make Fmemory_free always accurate.
5749 * alloc.c (make_interval): Update total_free_intervals.
5750 (make_float): Likewise for total_free_floats.
5751 (free_cons, Fcons): Likewise for total_free_conses.
5752 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5753 Likewise for total_free_vector_bytes.
5754 (Fmake_symbol): Likewise for total_free_symbols.
5755 (bytes_free): Remove.
5756
5757 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5758
5759 Simple free memory accounting feature.
5760 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5761 (sweep_vectors): Accumulate size of free vectors.
5762 (Fgarbage_collect): Setup bytes_free.
5763 (Fmemory_free): New function.
5764 (syms_of_alloc): Register it.
5765
5766 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5767
5768 Cleanup overlays checking.
5769 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5770 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5771 eassert and OVERLAYP.
5772 (sort_overlays): Change to use OVERLAYP.
5773
5774 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5775
5776 * editfns.c (Finsert_char): Make it interactive, and make the
5777 second arg optional. Copy interactive spec and docstring from
5778 ucs-insert.
5779
5780 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5781
5782 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5783 Unlike the other wrapped functions, fabs has an unspecified
5784 effect on errno.
5785
5786 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5787
5788 * nsterm.m (keyDown): Interpret flags without left/right bits
5789 as the left key (Bug#11670).
5790
5791 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5792
5793 Remove empty and useless init functions.
5794 * lisp.h (init_character_once, init_fns, init_image)
5795 (init_filelock, init_sound): Remove prototype.
5796 * character.c (init_character_once): Remove.
5797 * filelock.c (init_filelock): Likewise.
5798 * fns.c (init_fns): Likewise.
5799 * image.c (init_image): Likewise.
5800 * sound.c (init_sound): Likewise.
5801 * emacs.c (main): Adjust accordingly.
5802
5803 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5804
5805 * gtkutil.h: Tiny cleanups.
5806 (use_old_gtk_file_dialog): Remove useless declaration.
5807 (xg_uses_old_file_dialog): Add suggested const attribute.
5808
5809 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5810
5811 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5812 (bidi_paragraph_init): Use it to limit search forward for a strong
5813 directional character in abnormally large paragraphs full of
5814 neutral or weak characters. (Bug#11943)
5815
5816 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5817
5818 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5819 the toolbar (Bug#9451).
5820 (xg_make_tool_item): Give the widget event box a transparent
5821 background.
5822
5823 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5824
5825 Cleanup basic allocation variables and functions.
5826 * alloc.c (ignore_warnings, init_intervals, init_float)
5827 (init_cons, init_symbol, init_marker): Remove.
5828 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5829 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5830 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5831 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5832 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5833 (staticidx, init_alloc_once, init_strings, free_ablock):
5834 Remove redundant initialization.
5835 * fns.c (init_weak_hash_tables): Remove.
5836 * lisp.h (init_weak_hash_tables): Remove prototype.
5837
5838 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5839
5840 Use zero_vector where appropriate.
5841 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5842 accordingly.
5843 * lisp.h (zero_vector): New declaration.
5844 * font.c (null_vector): Remove.
5845 (syms_of_font): Remove initialization and staticpro.
5846 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5847 * keymap.c (Faccessible_keymaps): Likewise.
5848
5849 2012-07-15 Leo Liu <sdl.web@gmail.com>
5850
5851 * fringe.c: Fix typo in comments.
5852
5853 2012-07-14 Leo Liu <sdl.web@gmail.com>
5854
5855 * fringe.c: Add a new bitmap exclamation-mark.
5856
5857 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5858
5859 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5860
5861 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5862 (HAVE_MENUS): Don't define, defined by editing config.in with
5863 msdos/sed2v2.inp.
5864 (GMALLOC_INHIBIT_VALLOC): Don't define.
5865 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5866
5867 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5868
5869 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5870
5871 2012-07-14 Glenn Morris <rgm@gnu.org>
5872
5873 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5874 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5875 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5876
5877 2012-07-13 Glenn Morris <rgm@gnu.org>
5878
5879 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5880
5881 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5882 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5883
5884 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5885
5886 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5887 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5888 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5889 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5890 where appropriate.
5891 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5892 as boolean expression.
5893 (x_set_window_size): Remove unused variable toolbar.
5894 (ns_get_color_default, ns_mod_to_lisp): Remove.
5895 (ns_mouse_position): Remove unused variables xchar and ychar.
5896 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5897 (ns_set_vertical_scroll_bar): Remove unused variable count.
5898 (ns_delete_terminal): Remove unused variable i.
5899 (ns_term_init): Remove unused variables r, g and b.
5900 (mouseDown): Remove unused variable window.
5901 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5902 (initFrameFromEmacs): Remove unused variable vbextra.
5903 (mouseEntered): Remove unused variables p and dpyinfo.
5904 (mouseExited): Remove unused variables p and r.
5905 (ns_define_frame_cursor, ns_clear_frame_area)
5906 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5907 (menuDown): Assign [sender tag] to variable and cast the variable.
5908
5909 * nsterm.h (menuDown): Add id as type to argument sender.
5910 (ns_display_info_for_name): Add Lisp_Object argument.
5911 (ns_term_init): Add Lisp_Object argument.
5912 (ns_map_event_to_object): Add void argument.
5913 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5914 prototype with arguments and only declare if __OBJC__.
5915 (nxatoms_of_nsselect): Add void argument.
5916 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5917 (ns_alloc_autorelease_pool): Add void argument.
5918 (ns_release_autorelease_pool): Add void* argument.
5919 (ns_get_defaults_value): Add const char* argument.
5920
5921 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5922 (initFromContents): Use SSDATA where appropriate.
5923 (ns_update_menubar): Add braces to ambigous if-else.
5924 (initWithTitle): Put () around assignment in if statement.
5925 (ns_menu_show): Remove unused variables window and keymap.
5926 (update_frame_tool_bar): Remove unused variable selected_p.
5927 (initWithContentRect): Remove unused variable this_cmd_name.
5928
5929 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5930 appropriate.
5931 (setXBMColor): Remove unused variable len.
5932 (setPixmapData): Put () around assignment in loop statement.
5933
5934 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5935 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5936 where appropriate.
5937 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5938 around assignment in loop statement.
5939 (nsfont_open): Remove unused variable i.
5940 (nsfont_open): Remove unused variable len.
5941 (nsfont_draw): Remove unused variable cs.
5942
5943 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5944 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5945 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5946 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5947 (Fns_font_name, Fns_perform_service)
5948 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5949 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5950 (ns_set_name): Remove unused variable view.
5951 (x_set_menu_bar_lines): Remove unused variable olines.
5952 (x_set_tool_bar_lines): Remove unused variable root_window.
5953 (Fns_list_colors): Put () around assignment in while statement.
5954 (Fns_perform_service): Remove unused variable len.
5955 (Fns_display_usable_bounds): Remove unused variable top.
5956 (syms_of_nsfns): Remove unused variable i.
5957
5958 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5959 memcpy (Bug#11907).
5960
5961 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5962
5963 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5964 and free it with DestroyExceptionInfo (Bug#11558).
5965
5966 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5967
5968 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5969 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5970 Set here, not in nt/config.nt.
5971
5972 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5973
5974 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5975 cursor overflow into the last glyph on display line when the right
5976 fringe is off. (Bug#11832)
5977
5978 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5979
5980 * xdisp.c (produce_special_glyphs): Now static.
5981 * dispextern.h (produce_special_glyphs): Remove decl.
5982
5983 2012-07-13 Glenn Morris <rgm@gnu.org>
5984
5985 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5986 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5987
5988 * s/usg5-4-common.h (USG, USG5):
5989 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5990 * s/sol2-6.h (SOLARIS2):
5991 * s/irix6-5.h (IRIX6_5):
5992 * s/hpux10-20.h (USG, USG5, HPUX):
5993 * s/gnu-linux.h (USG, GNU_LINUX):
5994 * s/freebsd.h (BSD_SYSTEM):
5995 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5996 * s/cygwin.h (CYGWIN):
5997 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5998 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5999
6000 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
6001
6002 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
6003
6004 2012-07-13 Glenn Morris <rgm@gnu.org>
6005
6006 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6007
6008 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6009
6010 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6011 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6012
6013 2012-07-12 Glenn Morris <rgm@gnu.org>
6014
6015 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6016
6017 * process.c (init_process_emacs): Rename from init_process.
6018 The old name is also the name of a Mach system call.
6019 * lisp.h, emacs.c: Update for this name change.
6020 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6021 longer needed.
6022
6023 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6024
6025 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6026 memmove call that removes glyphs covered by the left truncation
6027 glyph. Improve commentary.
6028 (display_line): Fix display of continuation glyphs on GUI frames
6029 when the right fringe is turned off and variable-size fonts are
6030 used in the window. Move the code that appends a stretch glyph to
6031 produce_special_glyphs, so that it could be used for truncation
6032 and continuation glyphs alike.
6033 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6034 glyph of a suitably computed width, to align the special glyphs at
6035 the window margin. Code moved from display_line. (Bug#11832)
6036
6037 2012-07-12 Glenn Morris <rgm@gnu.org>
6038
6039 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6040
6041 * s/gnu-linux.h, s/hpux10-20.h:
6042 Do not unconditionally define HAVE_XRMSETDATABASE.
6043
6044 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6045
6046 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 Fix typos that broke OS X build.
6049 Reported by Randal L. Schwartz in
6050 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6051 * nsterm.m (ns_timeout): Add missing local decl.
6052 (ns_get_color): snprintf -> sprintf, to fix typo.
6053
6054 2012-07-12 Glenn Morris <rgm@gnu.org>
6055
6056 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6057 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6058 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6059 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6060
6061 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6062 Move PTY_OPEN to configure.
6063
6064 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6065 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6066 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6067
6068 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6069
6070 Use empty_unibyte_string where applicable.
6071 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6072 * lread.c (read1): Likewise.
6073 * xsettings.c (syms_of_xsettings): Likewise.
6074
6075 2012-07-12 Glenn Morris <rgm@gnu.org>
6076
6077 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6078 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6079 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6080 * s/hpux10-20.h (RUN_TIME_REMAP):
6081 * s/bsd-common.h (TABDLY): Move to configure.
6082
6083 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6084
6085 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6086
6087 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6088 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6089
6090 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6091
6092 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6093 * s/template.h: Move NARROWPROTO to configure.
6094
6095 2012-07-11 Glenn Morris <rgm@gnu.org>
6096
6097 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6098 unused since 2011-01-17 change to systty.h.
6099
6100 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6101 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6102 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6103
6104 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6105
6106 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6107
6108 2012-07-11 Glenn Morris <rgm@gnu.org>
6109
6110 * s/darwin.h, s/gnu-linux.h, s/template.h:
6111 Move INTERRUPT_INPUT to configure.
6112
6113 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6114
6115 Minor adjustments to interning code.
6116 * lisp.h (intern, intern_c_string): Redefine as static inline
6117 wrappers for intern_1 and intern_c_string_1, respectively.
6118 (intern_1, intern_c_string_1): Rename prototypes.
6119 * lread.c (intern_1, intern_c_string_1, oblookup):
6120 Simplify Vobarray checking.
6121 * font.c (font_intern_prop): Likewise. Adjust comment.
6122 * w32font.c (intern_font_name): Likewise.
6123
6124 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6125
6126 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6127
6128 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6129 of Fcar/Fcdr if possible.
6130 * font.c (check_otf_features): Likewise.
6131 * fontset.c (Fnew_fontset): Likewise.
6132 * gnutls.c (Fgnutls_boot): Likewise.
6133 * minibuf.c (read_minibuf): Likewise.
6134 * msdos.c (IT_set_frame_parameters): Likewise.
6135 * xmenu.c (Fx_popup_dialog): Likewise.
6136 * w32menu.c (Fx_popup_dialog): Likewise.
6137
6138 2012-07-11 Glenn Morris <rgm@gnu.org>
6139
6140 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6141 since nothing has defined it on these platforms.
6142
6143 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6144 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6145
6146 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6147 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6148 Move CLASH_DETECTION to configure.
6149
6150 * s/gnu.h: Remove file, which is now empty.
6151
6152 * s/gnu.h, s/gnu-linux.h:
6153 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6154
6155 2012-07-11 John Wiegley <johnw@newartisans.com>
6156
6157 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6158 function attribute, so we only use it if it exists in the
6159 compiler.
6160
6161 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6162
6163 Avoid call to strlen in fast_c_string_match_ignore_case.
6164 * search.c (fast_c_string_match_ignore_case): Change to use
6165 length argument. Adjust users accordingly.
6166 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6167
6168 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 Assume mkdir, rmdir.
6171 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6172 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6173
6174 Assume rename.
6175 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6176
6177 Assume perror.
6178 * s/hpux10-20.h (HAVE_PERROR): Remove.
6179 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6180 Remove dummy definition, as this problem was obsolete long ago.
6181
6182 Assume strerror.
6183 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6184
6185 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6186
6187 Avoid calls to strlen in font processing functions.
6188 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6189 (font_open_by_name): Change to use length argument.
6190 Adjust users accordingly.
6191 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6192 Adjust prototypes.
6193 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6194 Change to return ptrdiff_t.
6195 (xfont_list_pattern, xfont_match): Use length returned by
6196 xfont_decode_coding_xlfd.
6197 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6198
6199 2012-07-11 Glenn Morris <rgm@gnu.org>
6200
6201 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6202 Move DONT_REOPEN_PTY to configure.
6203
6204 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6205 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6206
6207 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 Remove "#define unix" that is no longer needed (Bug#11905).
6210 * s/aix4-2.h (unix): Remove; no longer needed.
6211
6212 EMACS_TIME simplification (Bug#11875).
6213 This replaces macros (which typically do not work in GDB)
6214 with functions, typedefs and enums, making the code easier to debug.
6215 The functional style also makes code easier to read and maintain.
6216 * systime.h: Include <sys/time.h> on all hosts, not just if
6217 WINDOWSNT, since 'struct timeval' is needed in general.
6218 (EMACS_TIME): Now a typedef, not a macro.
6219 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6220 not macros.
6221 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6222 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6223 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6224 (EMACS_TIME_LE): Now functions, not macros.
6225 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6226 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6227 which are not functions. All uses rewritten to use:
6228 (make_emacs_time): New function.
6229 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6230 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6231 not functions. All uses rewritten to use the following, respectively:
6232 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6233 (add_emacs_time, sub_emacs_time): New functions.
6234 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6235 * fileio.c (Fcopy_file):
6236 * xterm.c (XTflash): Get the current time closer to when it's used.
6237 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6238
6239 * bytecode.c (targets): Suppress -Woverride-init warnings.
6240
6241 Simplify by avoiding confusing use of strncpy etc.
6242 * doc.c (Fsnarf_documentation):
6243 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6244 * frame.c (Fmake_terminal_frame):
6245 * gtkutil.c (get_utf8_string):
6246 * lread.c (openp):
6247 * nsmenu.m (ns_update_menubar):
6248 * regex.c (regerror):
6249 Prefer memcpy to strncpy and strncat when either will do.
6250 * fileio.c (Fsubstitute_in_file_name):
6251 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6252 (menu_separator_name_p):
6253 * nsmenu.m (ns_update_menubar):
6254 Prefer memcmp to strncmp when either will do.
6255 * nsterm.m: Include <ftoastr.h>.
6256 (ns_get_color):
6257 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6258 Prefer snprintf to strncpy.
6259 * nsterm.m (ns_term_init):
6260 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6261 * nsterm.m (ns_term_init):
6262 Avoid the need for strncpy, by using build_string or
6263 make_unibyte_string directly. Use dtoastr, not snprintf.
6264 * process.c (Fmake_network_process): Diagnose service names that
6265 are too long, rather than silently truncating them or creating
6266 non-null-terminated names.
6267 (Fnetwork_interface_info): Likewise, for interface names.
6268 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6269 Prefer sprintf to strncat.
6270 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6271 Prefer vsnprintf to vsprintf + strncpy.
6272
6273 2012-07-10 Glenn Morris <rgm@gnu.org>
6274
6275 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6276 Clarify fallback case.
6277
6278 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6281 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6282 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6283 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6284 where argument type is known to be a Lisp_Cons.
6285
6286 2012-07-10 Tom Tromey <tromey@redhat.com>
6287
6288 * bytecode.c (BYTE_CODE_THREADED): New macro.
6289 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6290 (enum byte_code_op): New type.
6291 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6292 (exec_byte_code): Use them. Use token threading when applicable.
6293
6294 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6295
6296 Optimize pure C strings initialization.
6297 * lisp.h (make_pure_string): Fix prototype.
6298 (build_pure_c_string): New function, defined as static inline. This
6299 provides a better opportunity to optimize away calls to strlen when
6300 the function is called with compile-time constant argument.
6301 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6302 argument, adjust users accordingly. Use build_pure_c_string where
6303 appropriate.
6304 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6305 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6306 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6307
6308 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6309
6310 Avoid calls to strlen in miscellaneous functions.
6311 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6312 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6313 * lread.c (openp): Likewise.
6314
6315 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6316
6317 Avoid calls to strlen in path processing functions.
6318 * fileio.c (file_name_as_directory): Add comment. Change to add
6319 srclen argument and return the length of result. Adjust users
6320 accordingly.
6321 (directory_file_name): Fix comment. Change to add srclen argument,
6322 swap 1st and 2nd arguments to obey the common convention.
6323 Adjust users accordingly.
6324 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6325
6326 2012-07-10 Glenn Morris <rgm@gnu.org>
6327
6328 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6329 Move PENDING_OUTPUT_COUNT definition to configure.
6330
6331 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6332 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6333 * s/gnu.h (DATA_START): Move definitions to configure.
6334
6335 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6336 We include usg5-4-common.h, which defines them both.
6337
6338 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6339 O_RDONLY already includes it).
6340
6341 Stop ns builds setting the EMACSLOADPATH environment variable.
6342 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6343 Now it does not set EMACSLOADPATH, just returns the load-path string.
6344 * nsterm.h: Update accordingly.
6345 * lread.c [HAVE_NS]: Include nsterm.h.
6346 (init_lread) [HAVE_NS]: Use ns_load_path.
6347 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6348
6349 2012-07-09 Glenn Morris <rgm@gnu.org>
6350
6351 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6352 since the included bsd-common.h does so.
6353
6354 Stop ns builds setting the EMACSPATH environment variable.
6355 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6356 (ns_init_paths): Do not set EMACSPATH.
6357 * nsterm.h (ns_exec_path): Add it.
6358 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6359 Use ns_exec_path.
6360
6361 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6362
6363 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6364
6365 * process.c (wait_reading_process_output): 'waitchannels' was unset
6366 when read_kbd || !NILP (wait_for_cell); fix this.
6367
6368 Add GCC-style 'const' attribute to functions that can use it.
6369 * character.h (char_resolve_modifier_mask):
6370 * keyboard.h (make_ctrl_char):
6371 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6372 (init_character_once, next_almost_prime, init_fns, init_image)
6373 (flush_pending_output, init_sound):
6374 * mem-limits.h (start_of_data):
6375 * menu.h (finish_menu_items):
6376 Add ATTRIBUTE_CONST.
6377 * emacs.c (DEFINE_DUMMY_FUNCTION):
6378 Declare the dummy function with ATTRIBUTE_CONST.
6379 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6380 Add decls with ATTRIBUTE_CONST.
6381
6382 Minor improvements to make_formatted_string.
6383 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6384 where int is good enough, as vsprintf returns an int.
6385 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6386
6387 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6388
6389 Use make_formatted_string to avoid double length calculation.
6390 * lisp.h (make_formatted_string): New prototype.
6391 * alloc.c (make_formatted_string): New function.
6392 * buffer.c (Fgenerate_new_buffer_name): Use it.
6393 * dbusbind.c (syms_of_dbusbind): Likewise.
6394 * editfns.c (Fcurrent_time_zone): Likewise.
6395 * filelock.c (get_boot_time): Likewise.
6396 * frame.c (make_terminal_frame, set_term_frame_name)
6397 (x_report_frame_params): Likewise.
6398 * image.c (gs_load): Likewise.
6399 * minibuf.c (get_minibuffer): Likewise.
6400 * msdos.c (dos_set_window_size): Likewise.
6401 * process.c (make_process): Likewise.
6402 * xdisp.c (ensure_echo_area_buffers): Likewise.
6403 * xsettings.c (apply_xft_settings): Likewise.
6404
6405 2012-07-09 Glenn Morris <rgm@gnu.org>
6406
6407 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6408 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6409 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6410 * nsterm.h (ns_etc_directory): Add it.
6411 * callproc.c [HAVE_NS]: Include nsterm.h.
6412 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6413
6414 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6415
6416 Move marker debugging code under MARKER_DEBUG.
6417 * marker.c (MARKER_DEBUG): Move marker debugging code under
6418 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6419 for bootstrap with --enable-checking (~3x slowdown reported
6420 by Juanma Barranquero <lekktu@gmail.com>).
6421 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6422
6423 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6424
6425 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6426 See <http://bugs.gnu.org/11825#29>.
6427
6428 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6429
6430 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6431 has no font, use the frame's font. (Bug#11813)
6432 (display_line): Add commentary about displaying truncation glyphs
6433 on GUI frames.
6434 (produce_special_glyphs): Move here from term.c.
6435
6436 * term.c (produce_special_glyphs): Move to xdisp.c.
6437
6438 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6439 section.
6440
6441 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6442
6443 * xdisp.c (display_line): Avoid warning about implicit declaration
6444 of FRAME_FONT.
6445
6446 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6447
6448 * lisp.h: Remove empty conditional.
6449
6450 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6451
6452 * lread.c (load_path_check): Now static.
6453
6454 Fix some minor --with-ns problems found by static checking.
6455 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6456 (x_set_font) [!HAVE_X_WINDOWS]:
6457 * image.c (xpm_load_image) [HAVE_NS]:
6458 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6459 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6460 Remove unused local.
6461 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6462 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6463 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6464 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6465 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6466 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6467 Fix pointer signedness problem.
6468 * xfaces.c (FRAME_X_FONT_TABLE):
6469 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6470
6471 2012-07-07 Glenn Morris <rgm@gnu.org>
6472
6473 * lread.c (load_path_check): New function, split from init_lread.
6474 (init_lread): Reorganize. Motivation:
6475 If EMACSLOADPATH is set, check/warn about that rather than the
6476 defaults, which we are not going to use. Hence we can remove
6477 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6478 Don't warn if site-lisp directories are missing.
6479 If not installed, start from a blank load-path, since
6480 PATH_LOADSEARCH refers to the eventual installation directories.
6481
6482 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6483
6484 Support truncation and continuation glyphs on GUI frames, when
6485 fringes are disabled. (Bug#11832)
6486 * xdisp.c (init_iterator): Get dimensions of truncation and
6487 continuation glyphs even if on GUI frames.
6488 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6489 or both, are absent.
6490 (start_display, move_it_in_display_line_to): Handle the case of a
6491 GUI frame without a fringe to display continuation or truncation
6492 glyphs.
6493 (insert_left_trunc_glyphs): Support GUI frames: make sure
6494 truncation glyphs overwrite enough glyphs from the current line to
6495 have sufficient space in pixels.
6496 (display_line): Support truncation and continuation glyphs on GUI
6497 frames. If some spare pixels are left on the line after inserting
6498 the truncation glyphs, fill that space with a stretch glyph of a
6499 suitably computed width.
6500
6501 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6502 produce_glyphs, to support GUI sessions.
6503
6504 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6505
6506 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6507
6508 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6509
6510 Do not require float-time's arg to fit in time_t (Bug#11825).
6511 This works better on hosts where time_t is unsigned, and where
6512 float-time is applied to the (negative) difference between two times.
6513 * editfns.c (decode_time_components): Last arg is now double *,
6514 not int *, and means to store all the result as a double, without
6515 worrying about whether the seconds part fits in time_t.
6516 All callers changed.
6517 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6518 All callers changed.
6519 (Ffloat_time): Do not fail merely because the specified time falls
6520 outside of time_t range.
6521
6522 2012-07-07 Glenn Morris <rgm@gnu.org>
6523
6524 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6525 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6526 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6527
6528 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6529
6530 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6531 Update dependencies.
6532
6533 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6534
6535 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6536
6537 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6538 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6539 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6540 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6541 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6542 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6543
6544 * xfont.c (compare_font_names): Redo to omit the need for casts.
6545
6546 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6547
6548 * xfns.c (Fx_change_window_property): Doc fix.
6549 * w32fns.c (Fx_change_window_property): Doc fix.
6550
6551 * w32fns.c (Fx_window_property): Accept the same arguments as the
6552 X Windows version. Doc fix.
6553 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6554
6555 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6556 Eli Zaretskii <eliz@gnu.org>
6557
6558 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6559 Windows-specific code from nt/config.nt moved here.
6560 Obsolete settings removed.
6561
6562 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6563
6564 * process.c: Avoid unnecessary calls to gettime.
6565 (wait_reading_process_output): Don't get the time of day
6566 when gobbling data immediately and not waiting, as there's no need
6567 for it in that case. This removes a FIXME.
6568
6569 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6570
6571 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6572 is defined (Bug#11768).
6573
6574 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6575
6576 Fix marker debugging code.
6577 * marker.c (byte_char_debug_check): Do not perform the check
6578 if buffer is not multibyte.
6579 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6580 Call byte_char_debug_check with correct arguments.
6581
6582 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6583
6584 Compile marker debugging code only if ENABLE_CHECKING is defined.
6585 * marker.c (byte_char_debug_check, count_markers):
6586 Use only if ENABLE_CHECKING is defined.
6587 (byte_debug_flag): Remove.
6588 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6589 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6590
6591 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6592
6593 Avoid code repetition in marker-related functions.
6594 * marker.c (attach_marker): New function.
6595 (Fset_marker, set_marker_restricted, set_marker_both)
6596 (set_marker_restricted_both): Use it.
6597 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6598 Consistently rename charno to charpos.
6599 (marker_position): Add eassert.
6600 (marker_byte_position): Convert to eassert.
6601
6602 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6603
6604 Simplify list operations in unchain_overlay and unchain_marker.
6605 * buffer.c (unchain_overlay): Simplify. Add comment.
6606 * marker.c (unchain_marker): Simplify. Fix comments.
6607
6608 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6609
6610 Introduce fast path for the widely used marker operation.
6611 * alloc.c (build_marker): New function.
6612 * lisp.h (build_marker): New prototype.
6613 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6614 * composite.c (autocmp_chars): Likewise.
6615 * editfns.c (buildmark): Remove.
6616 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6617 (save_restriction_save): Use build_marker.
6618 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6619 * window.c (save_window_save): Likewise.
6620
6621 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Do not use Fdelete_overlay in delete_all_overlays
6624 to avoid redundant calls to unchain_overlay.
6625 * buffer.c (drop_overlay): New function.
6626 (delete_all_overlays, Fdelete_overlay): Use it.
6627 * minibuf.c (get_minibuffer): Fix comment.
6628
6629 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 Port to OpenBSD 5.1 amd64.
6632 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6633 This is needed for OpenBSD, and should be harmless on all BSD systems.
6634 Also, include <sys/sysctl.h>, as it should be available on all
6635 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6636 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6637 use p_pid member, not kp_proc.pid.
6638
6639 2012-07-06 Glenn Morris <rgm@gnu.org>
6640
6641 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6642
6643 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 More xmalloc and related cleanup.
6646 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6647 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6648 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6649 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6650 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6651 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6652 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6653 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6654 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6655 * xterm.c:
6656 Omit needless casts involving void * pointers and allocation.
6657 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6658 as the former is more robust if P's type is changed.
6659 Prefer xzalloc to xmalloc + memset 0.
6660 Simplify malloc-or-realloc to realloc.
6661 Don't worry about xmalloc returning a null pointer.
6662 Prefer xstrdup to xmalloc + strcpy.
6663 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6664 growing it.
6665 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6666 alloca of a constant.
6667
6668 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6669
6670 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6671 hscroll is larger than the line width. Fixes long and futile
6672 looping inside extend_face_to_end_of_line (on a TTY) producing
6673 glyphs that are not needed and thrown away.
6674
6675 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6676
6677 * marker.c (set_marker_restricted_both): Simplify by using
6678 clip_to_bounds.
6679
6680 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6681
6682 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6683
6684 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6685
6686 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6687 not defined (Bug#11768).
6688 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6689 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6690 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6691 followed by gtk_box_set_homogeneous (Bug#11768).
6692 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6693 (update_theme_scrollbar_width, xg_create_scroll_bar):
6694 Use gtk_scrollbar_new (Bug#11768).
6695 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6696 (is_box_type): New function (Bug#11768).
6697 (xg_tool_item_stale_p): Call is_box_type.
6698 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6699 with default display (Bug#11768).
6700
6701 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6702
6703 * xdisp.c (window_hscroll_limited): New function.
6704 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6705 coordinates when window's hscroll is set to insanely large
6706 values. (Bug#11857)
6707
6708 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6709
6710 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6711 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6712
6713 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6714
6715 Cleanup xmalloc.
6716 * lisp.h (xzalloc): New prototype. Omit needless casts.
6717 * alloc.c (xzalloc): New function. Omit needless casts.
6718 * charset.c: Omit needless casts. Convert all calls to
6719 xmalloc with following memset to xzalloc.
6720 * dispnew.c: Likewise.
6721 * fringe.c: Likewise.
6722 * image.c: Likewise.
6723 * sound.c: Likewise.
6724 * term.c: Likewise.
6725 * w32fns.c: Likewise.
6726 * w32font.c: Likewise.
6727 * w32term.c: Likewise.
6728 * xfaces.c: Likewise.
6729 * xfns.c: Likewise.
6730 * xterm.c: Likewise.
6731 * atimer.c: Omit needless casts.
6732 * buffer.c: Likewise.
6733 * callproc.c: Likewise.
6734 * ccl.c: Likewise.
6735 * coding.c: Likewise.
6736 * composite.c: Likewise.
6737 * doc.c: Likewise.
6738 * doprnt.c: Likewise.
6739 * editfns.c: Likewise.
6740 * emacs.c: Likewise.
6741 * eval.c: Likewise.
6742 * filelock.c: Likewise.
6743 * fns.c: Likewise.
6744 * gtkutil.c: Likewise.
6745 * keyboard.c: Likewise.
6746 * lisp.h: Likewise.
6747 * lread.c: Likewise.
6748 * minibuf.c: Likewise.
6749 * msdos.c: Likewise.
6750 * print.c: Likewise.
6751 * process.c: Likewise.
6752 * region-cache.c: Likewise.
6753 * search.c: Likewise.
6754 * sysdep.c: Likewise.
6755 * termcap.c: Likewise.
6756 * terminal.c: Likewise.
6757 * tparam.c: Likewise.
6758 * w16select.c: Likewise.
6759 * w32.c: Likewise.
6760 * w32reg.c: Likewise.
6761 * w32select.c: Likewise.
6762 * w32uniscribe.c: Likewise.
6763 * widget.c: Likewise.
6764 * xdisp.c: Likewise.
6765 * xmenu.c: Likewise.
6766 * xrdb.c: Likewise.
6767 * xselect.c: Likewise.
6768
6769 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6770
6771 * fileio.c (time_error_value): Check the right error number.
6772 Problem reported by Troels Nielsen in
6773 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6774
6775 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6778 This should be fixed in a better way; see Eli Zaretskii in
6779 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6780 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6781
6782 * fileio.c (time_error_value): Rename from special_mtime.
6783 The old name's problems were noted by Eli Zaretskii in
6784 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6785
6786 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6787 This variable's comment says Emacs needs at least one GDB-visible
6788 symbol of type enum pvec_type, to work around GDB problems.
6789 The symbol's value doesn't matter.
6790
6791 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6792 that causes compilation to fail on pre-C99 compilers.
6793
6794 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6795
6796 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6797 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6798
6799 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6800
6801 * buffer.c (init_buffer_once): Fix initialization of
6802 headers for buffer_defaults and buffer_local_symbols.
6803 Reported by Juanma Barranquero <lekktu@gmail.com>.
6804
6805 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6806
6807 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6808 * lisp.h (enum pvec_type): Use fewer bits.
6809 (PSEUDOVECTOR_SIZE_BITS): New constant.
6810 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6811 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6812 change in pvec_type.
6813 (PSEUDOVECTOR_TYPEP): New macro.
6814 (TYPED_PSEUDOVECTORP): Use it.
6815 * fns.c (internal_equal): Adapt code to extract pvectype.
6816 * emacs.c (gdb_pvec_type): Update type.
6817 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6818 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6819 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6820 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6821 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6822 abusing vector->header.next.nbytes.
6823 (live_vector_p): Use PVEC_TYPE.
6824 (mark_object): Adapt code to extract pvectype. Use switch.
6825
6826 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6827
6828 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6829 Tighten new eassert a bit.
6830
6831 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6832
6833 Fix compilation with --enable-gcc-warnings and -O1
6834 optimization level.
6835 * doprnt.c (doprnt): Change type of tem to int, initialize
6836 to avoid compiler warning. Add eassert.
6837 * search.c (simple_search): Initialize match_byte to avoid
6838 compiler warning. Add eassert.
6839
6840 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6841
6842 Avoid weird behavior with large horizontal scrolls.
6843 Without this change, for example, large hscroll values would
6844 mess up Emacs's display on Fedora 15 x86, presumably due to
6845 overflows in int calculations in the display code.
6846 Also, if buffers had long lines, Emacs would freeze.
6847 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6848 (set_window_hscroll): New function, containing the old guts of
6849 Fset_window_hscroll. Return the clipped value.
6850 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6851 This avoids the need to check against PTRDIFF_MAX.
6852
6853 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6854
6855 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6856
6857 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6858
6859 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6862 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6863 since GCC 4.4.6 issues a bogus warning for them.
6864
6865 Fix bugs in file timestamp newness comparisons.
6866 * fileio.c (Ffile_newer_than_file_p):
6867 * lread.c (Fload): Use full timestamp resolution of files,
6868 not just the 1-second resolution, so that files that are only
6869 slightly newer still count as newer.
6870 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6871 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6872
6873 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6874
6875 * fileio.c: Improve handling of file time marker. (Bug#11852)
6876 (special_mtime): New function.
6877 (Finsert_file_contents, Fverify_visited_file_modtime):
6878 Use it to set special mtime values consistently.
6879
6880 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6881
6882 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6883 marker for non-existing file. (Bug#11852)
6884
6885 2012-07-03 Glenn Morris <rgm@gnu.org>
6886
6887 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6888 and did not make it into globals.h).
6889
6890 2012-07-03 Tom Tromey <tromey@redhat.com>
6891
6892 * window.c (Fset_window_margins, Fset_window_fringes)
6893 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6894 * textprop.c (Fprevious_property_change): No longer static.
6895 * syntax.c (Fsyntax_table_p): No longer static.
6896 * process.c (Fget_process, Fprocess_datagram_address): No longer
6897 static.
6898 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6899 * keyboard.c (Fcommand_execute): No longer static.
6900 Remove EXFUN.
6901 * insdel.c (Fcombine_after_change_execute): No longer static.
6902 * image.c (Finit_image_library): No longer static.
6903 * fileio.c (Fmake_symbolic_link): No longer static.
6904 * eval.c (Ffetch_bytecode): No longer static.
6905 * editfns.c (Fuser_full_name): No longer static.
6906 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6907 No longer static.
6908 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6909 static.
6910 * dired.c (Ffile_attributes): No longer static.
6911 * composite.c (Fcomposition_get_gstring): No longer static.
6912 * callproc.c (Fgetenv_internal): No longer static.
6913
6914 * ccl.h: Remove EXFUNs.
6915 * buffer.h: Remove EXFUNs.
6916 * dispextern.h: Remove EXFUNs.
6917 * intervals.h: Remove EXFUNs.
6918 * fontset.h: Remove EXFUN.
6919 * font.h: Remove EXFUNs.
6920 * dosfns.c (system_process_attributes): Remove EXFUN.
6921 * keymap.h: Remove EXFUNs.
6922 * lisp.h: Remove EXFUNs.
6923 * w32term.h: Remove EXFUNs.
6924 * window.h: Remove EXFUNs.
6925 * xsettings.h: Remove EXFUN.
6926 * xterm.h: Remove EXFUN.
6927
6928 2012-07-03 Glenn Morris <rgm@gnu.org>
6929
6930 * lisp.h (Frandom): Make it visible to C.
6931 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6932 buffer for invisible buffers. (Bug#1229)
6933
6934 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6935
6936 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6937 values which aren't power of 2.
6938 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6939 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6940 accordingly.
6941
6942 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6943
6944 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6945
6946 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6947
6948 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6949
6950 * alloc.c (allocate_vector_block): Remove redundant
6951 calls to mallopt if DOUG_LEA_MALLOC is defined.
6952 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6953 avoid calls to mallopt if zero_vector is returned.
6954
6955 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6956
6957 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6958 is enabled, avoid dereferencing NULL current_sblock if
6959 running undumped.
6960
6961 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6962
6963 Cleanup basic buffer management.
6964 * buffer.h (struct buffer): Change layout to use generic vector
6965 marking code. Fix some comments. Change type of 'clip_changed'
6966 to bitfield. Remove unused #ifndef old.
6967 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6968 (GET_OVERLAYS_AT): Fix indentation.
6969 (for_each_per_buffer_object_at): New macro.
6970 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6971 (Fbuffer_local_variables): Use it.
6972 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6973 * alloc.c (allocate_buffer): Adjust to match new layout of
6974 struct buffer. Fix comment.
6975 (mark_overlay): New function.
6976 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6977 Lisp area of struct buffer.
6978 (mark_object): Use it. Adjust marking of misc objects
6979 and related comments.
6980
6981 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6982
6983 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6984 wrapper that is not needed because the wrapped code is a no-op (zero
6985 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6986 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6987
6988 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6989
6990 * alloc.c (mark_buffer): Simplify. Remove prototype.
6991 (mark_object): Add comment. Reorganize marking of vector-like
6992 objects. Use CHECK_LIVE for all vector-like objects except buffers
6993 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6994 Avoid redundant calls to mark_vectorlike for bool vectors.
6995
6996 2012-06-30 Glenn Morris <rgm@gnu.org>
6997
6998 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6999
7000 * epaths.in (PATH_SITELOADSEARCH): New.
7001 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7002 This is rather than relying on --enable-locallisppath elements
7003 having "site-lisp" in their names. (Bug#10208#25, 11658)
7004
7005 2012-06-30 Eli Zaretskii <eliz@gnu.org>
7006
7007 * w32proc.c (sys_select): Accept and ignore one more argument.
7008
7009 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7010
7011 * sysselect.h [DOS_NT]: Don't include sys/select.h.
7012 (pselect) [!MS_DOS]: Redirect to sys_select.
7013
7014 * sysdep.c: Don't include dos.h and dosfns.h.
7015
7016 * process.c (sys_select):
7017 * msdos.c (sys_select): Accept one more argument and ignore it.
7018
7019 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7020 adapt data types and code to that.
7021
7022 * dosfns.c:
7023 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7024 which clashes with the gnulib function of the same name.
7025
7026 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7027
7028 * font.c (font_style_to_value, font_style_symbolic)
7029 (font_prop_validate_style): Add type checks for values in
7030 font_style_table.
7031
7032 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7033 argument.
7034 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7035 uses.
7036
7037 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7038
7039 * xdisp.c (try_window_id): Undo last change.
7040
7041 * w32.c (getwd): Adjust commentary about startup_dir.
7042 (init_environment): Always call sys_access, even in non-MSVC
7043 builds. Don't chdir to the directory of the Emacs executable.
7044 This undoes code from 1997 which was justified by the need to
7045 "avoid conflicts when removing and renaming directories". But its
7046 downside was that every relative file name was being interpreted
7047 relative to the directory of the Emacs executable, which can never
7048 be TRT. In particular, it broke sys_access when called with
7049 relative file names.
7050 (sys_access): Map GetLastError to errno.
7051
7052 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7053
7054 * window.h (struct window): Change type of 'fringes_outside_margins'
7055 to bitfield. Fix comment. Adjust users accordingly.
7056 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7057 Adjust comment.
7058 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7059 to ptrdiff_t.
7060
7061 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7062
7063 * gnutls.c (emacs_gnutls_handshake):
7064 Add QUIT to make the loop interruptible.
7065
7066 2012-06-29 Glenn Morris <rgm@gnu.org>
7067
7068 * charset.c (init_charset): Make lack of etc/charsets fatal.
7069
7070 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7071
7072 * editfns.c (region_limit): Fix type mismatch.
7073
7074 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7075
7076 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7077 undefined. Convert from xassert to eassert.
7078 * nsmenu.m: Convert from xassert to eassert.
7079 * nsterm.m: Likewise.
7080
7081 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7082
7083 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7084
7085 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7086
7087 Avoid integer overflow on scroll-left and scroll-right.
7088 * window.c (HSCROLL_MAX): New macro.
7089 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7090 overflow when requested scroll falls outside ptrdiff_t range.
7091
7092 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7093
7094 * window.h (struct window): Change type of 'hscroll',
7095 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7096 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7097 Adjust users accordingly.
7098 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7099 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7100 from EMACS_INT to ptrdiff_t.
7101 (make_window): Omit redundant initialization.
7102
7103 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7104
7105 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7106
7107 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7108
7109 * window.h (struct window): Change type of 'use_time' and
7110 'sequence_number' from Lisp_Object to int.
7111 * frame.c (make_frame): Adjust users accordingly.
7112 * print.c (print_object): Likewise.
7113 * window.c (select_window, Fwindow_use_time, make_parent_window)
7114 (make_window): Likewise.
7115
7116 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7117
7118 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7119 enabled with --enable-checking=[all,glyphs] configure option.
7120 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7121 adjust comments accordingly.
7122 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7123 undefined, adjust comments accordingly.
7124 * image.c: Likewise.
7125 * scroll.c: Likewise.
7126 * w32fns.c: Likewise.
7127 * w32term.c: Likewise.
7128 * xdisp.c: Likewise.
7129 * xfaces.c: Likewise.
7130 * xfns.c: Likewise.
7131 * xterm.c: Likewise.
7132
7133 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7134
7135 Generalize run-time debugging checks.
7136 * dispextern.h (XASSERTS): Remove.
7137 * fontset.c (xassert): Remove.
7138 Convert from xassert to eassert.
7139 * alloc.c: Convert from xassert to eassert.
7140 * bidi.c: Likewise.
7141 * dispnew.c: Likewise.
7142 * fns.c: Likewise.
7143 * fringe.c: Likewise.
7144 * ftfont.c: Likewise.
7145 * gtkutil.c: Likewise.
7146 * image.c: Likewise.
7147 * keyboard.c: Likewise.
7148 * menu.c: Likewise.
7149 * process.c: Likewise.
7150 * scroll.c: Likewise.
7151 * sound.c: Likewise.
7152 * term.c: Likewise.
7153 * w32console.c: Likewise.
7154 * w32fns.c: Likewise.
7155 * w32term.c: Likewise.
7156 * window.c: Likewise.
7157 * xdisp.c: Likewise.
7158 * xfaces.c: Likewise.
7159 * xfns.c: Likewise.
7160 * xselect.c: Likewise.
7161 * xterm.c: Likewise.
7162
7163 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7164
7165 * fns.c (maybe_resize_hash_table): Output message when growing the
7166 purify-hashtable.
7167
7168 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7169
7170 * alloc.c (allocate_string_data): Remove dead code.
7171 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7172 avoid GCC warning about unused macro.
7173
7174 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7175
7176 * alloc.c (allocate_string): Omit intervals initialization.
7177 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7178 as in make_pure_string and make_pure_c_string.
7179
7180 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7181
7182 * alloc.c (allocate_string): Fix last change.
7183
7184 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7185
7186 * alloc.c (allocate_string): Remove two redundant calls
7187 to memset, add explicit initialization where appropriate.
7188
7189 2012-06-27 Glenn Morris <rgm@gnu.org>
7190
7191 * lisp.mk (lisp): Remove paths.elc.
7192
7193 2012-06-27 Chong Yidong <cyd@gnu.org>
7194
7195 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7196
7197 2012-06-26 John Wiegley <johnw@newartisans.com>
7198
7199 * unexmacosx.c (copy_data_segment): Add two section names used
7200 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7201
7202 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7203 when building with Clang.
7204
7205 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7206
7207 * eval.c (Fapply): Allow calling it with a single argument.
7208
7209 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7210
7211 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7212 _stricmp and _strnicmp.
7213 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7214
7215 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7216
7217 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7218 allocated window.
7219 (allocate_process): Likewise for new process.
7220 (allocate_terminal): Change to use offsetof.
7221 (allocate_frame): Likewise.
7222 * frame.c (make_frame): Omit redundant initialization.
7223 * window.c (make_parent_window): Use memset.
7224 (make_window): Omit redundant initialization.
7225 * process.c (make_process): Omit redundant initialization.
7226 * terminal.c (create_terminal): Likewise.
7227
7228 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7229
7230 * term.c (delete_tty): Remove redundant call to memset.
7231
7232 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7233
7234 * alloc.c: Remove build_string.
7235 * lisp.h: Define build_string as static inline. This provides
7236 a better opportunity to optimize away calls to strlen when the
7237 function is called with compile-time constant argument.
7238 * image.c (imagemagick_error): Convert to build_string.
7239 * w32proc.c (sys_spawnve): Likewise.
7240 * xterm.c (x_term_init): Likewise.
7241
7242 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7243
7244 Use sprintf return value instead of invoking strlen on result.
7245 In the old days this wasn't portable, since some sprintf
7246 implementations returned char *. But they died out years ago and
7247 Emacs already assumes sprintf returns int.
7248 Similarly for float_to_string.
7249 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7250 * ccl.c (ccl_driver):
7251 * character.c (string_escape_byte8):
7252 * data.c (Fnumber_to_string):
7253 * doprnt.c (doprnt):
7254 * print.c (print_object):
7255 * xdisp.c (message_dolog):
7256 * xfns.c (syms_of_xfns):
7257 Use sprintf or float_to_string result to avoid need to call strlen.
7258 * data.c (Fnumber_to_string):
7259 Use make_unibyte_string, since the string must be ASCII.
7260 * lisp.h, print.c (float_to_string): Now returns int length.
7261 * term.c (produce_glyphless_glyph):
7262 Use sprintf result rather than recomputing it.
7263
7264 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7265 * Makefile.in (ALL_CFLAGS):
7266 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7267 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7268
7269 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7270
7271 * dispextern.h (xstrcasecmp): Define to library function
7272 strcasecmp if available.
7273 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7274
7275 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7276
7277 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7278 Avoid comma operator.
7279 * menu.c (push_submenu_start, push_submenu_end)
7280 (push_left_right_boundary, push_menu_pane): Likewise.
7281 * msdos.c (dos_rawgetc): Likewise.
7282
7283 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7284
7285 * xfns.c (xic_create_fontsetname): Remove redundant calls
7286 to memset.
7287
7288 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7291 sprintf already null-terminates its output.
7292
7293 * xfns.c (x_window): Remove redundant cast.
7294
7295 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7296
7297 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7298 `const char *' to `char *' to avoid compiler warning.
7299
7300 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7303 instead of truncating it to 63 (admittedly a generous limit).
7304
7305 * process.c: Fix spelling and caps in comments.
7306
7307 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7308
7309 * emacs.c (setpgrp): Remove definition, unused.
7310 * sysdep.c (setpgrp): Remove definition, not used in this file.
7311
7312 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7313
7314 * makefile.w32-in: Update dependencies.
7315
7316 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7317
7318 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7319 (SYSTIME_H): Add nt/inc/sys/time.h.
7320
7321 * systime.h [WINDOWSNT]: Include sys/time.h.
7322
7323 * s/ms-w32.h (struct timespec): Definition moved from
7324 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7325
7326 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7327
7328 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7329 * buffer.h (buffer_slot_type_mismatch):
7330 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7331 * eval.c (unwind_to_catch):
7332 * image.c (my_png_error, my_error_exit):
7333 * keyboard.c (quit_throw_to_read_char, user_error)
7334 (Fexit_recursive_edit, Fabort_recursive_edit):
7335 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7336 (wrong_type_argument, buffer_overflow, __executable_start)
7337 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7338 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7339 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7340 (fatal):
7341 (child_setup) [!DOS_NT]:
7342 * lread.c (end_of_file_error, invalid_syntax):
7343 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7344 * puresize.h (pure_write_error):
7345 * search.c (matcher_overflow):
7346 * sound.c (sound_perror, alsa_sound_perror):
7347 * sysdep.c, syssignal.h (croak):
7348 * term.c (maybe_fatal, vfatal):
7349 * textprop.c (text_read_only):
7350 * undo.c (user_error):
7351 * unexmacosx.c (unexec_error):
7352 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7353 Use _Noreturn rather than NO_RETURN.
7354 No need for separate decl merely because of _Noreturn.
7355 * sound.c (sound_warning, parse_sound):
7356 Remove unnecessary forward decls.
7357
7358 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7361 * lisp.h (WAIT_READING_MAX): New macro.
7362 * dispnew.c (Fsleep_for, sit_for):
7363 * keyboard.c (kbd_buffer_get_event):
7364 * process.c (Faccept_process_output):
7365 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7366 This improves on the previous patch, which introduced a bug
7367 when time_t is unsigned and as wide as intmax_t.
7368 See <http://bugs.gnu.org/9000#51>.
7369
7370 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7371
7372 * dispnew.c (sit_for, Fsleep_for):
7373 * keyboard.c (kbd_buffer_get_event):
7374 * process.c (Faccept_process_output): Avoid compiler warnings when
7375 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7376
7377 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7378
7379 * makefile.w32-in: Update dependencies.
7380
7381 * w32.c (ltime): Add return type and declare static.
7382 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7383
7384 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7387 Privately reported by Herbert J. Skuhra.
7388 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7389 All uses changed.
7390 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7391 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7392
7393 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7394
7395 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7396 last argument of make_unibyte_string.
7397
7398 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7399 language ID in the event parameters.
7400
7401 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7402 event.code, not the obscure "character set ID".
7403
7404 2012-06-23 Chong Yidong <cyd@gnu.org>
7405
7406 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7407
7408 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7409
7410 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7411 * w32.c (fdutimens): New function.
7412
7413 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7414
7415 * s/ms-w32.h (pselect): Redirect to sys_select.
7416
7417 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7418
7419 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7420 in the logic of incrementing and decrementing the value of
7421 use_relocatable_buffers.
7422
7423 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7426 Privately reported by Herbert J. Skuhra.
7427 [__FreeBSD__]: Remove "*/" typo after "#include".
7428 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7429 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7430 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7431 Don't assume EMACS_TIME and struct timeval are the same type.
7432
7433 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7434
7435 Support higher-resolution time stamps (Bug#9000).
7436 The time stamps are only nanosecond-resolution at the C level,
7437 since that's the best that any real-world system supports now.
7438 But they are picosecond-resolution at the Lisp level, as that's
7439 easy, and leaves room for future OS improvements.
7440
7441 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7442 (LIBES): Use it.
7443
7444 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7445 Don't get current time unless it's needed.
7446
7447 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7448 now provides it if it's absent.
7449 (start_atimer): Port to higher-res time stamps.
7450 Check for time stamp overflow. Don't get current time more
7451 often than is needed.
7452
7453 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7454 Include systime.h, not time.h.
7455 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7456
7457 * dired.c: Include stat-time.h.
7458 (Ffile-attributes): File times now have higher resolution.
7459
7460 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7461 (struct image): Timestamp now has higher resolution.
7462
7463 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7464 has at least microseconds now. All uses removed.
7465 (update_frame, update_single_window, update_window, update_frame_1)
7466 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7467 (duration_to_sec_usec): Remove; no longer needed.
7468
7469 * editfns.c (time_overflow): Now extern.
7470 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7471 (float-time, Fformat_time_string, Fcurrent_time_string)
7472 (Fcurrent_time_zone): Accept and generate higher-resolution
7473 time stamps.
7474 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7475 (decode_time_components, lisp_seconds_argument): New functions.
7476 (make_time): Now static.
7477 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7478 Report an error if the time is invalid, rather than having the caller
7479 do that.
7480
7481 * fileio.c: Include <stat-time.h>
7482 (Fcopy_file): Copy higher-resolution time stamps.
7483 Prefer to set the time stamp via a file descriptor if that works.
7484 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7485 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7486 (Fvisited_file_modtime, Fset_visited_file_modtime):
7487 Support higher-resolution time stamps.
7488
7489 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7490
7491 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7492
7493 * image.c (prepare_image_for_display, clear_image_cache)
7494 (lookup_image): Port to higer-resolution time stamps.
7495
7496 * keyboard.c (start_polling, bind_polling_period):
7497 Check for time stamp overflow.
7498 (read_char, kbd_buffer_get_event, timer_start_idle)
7499 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7500 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7501 Port to higher-resolution time stamps. Do not assume time_t is signed.
7502 (decode_timer): New function. Timers are now vectors of length 9,
7503 not 8, to accommodate the picosecond component.
7504 (timer_check_2): Use it.
7505
7506 * nsterm.m (select_timeout, timeval_subtract): Remove.
7507 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7508 as they're a bit more accurate and handle overflow better.
7509 (ns_select): Change prototype to be compatible with pselect.
7510 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7511 * nsterm.h (ns_select): Adjust prototype.
7512
7513 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7514 us-resolution time stamps.
7515 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7516
7517 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7518
7519 * lisp.h (time_overflow): New decl.
7520 (wait_reading_process_output): First arg is now intmax_t, not int,
7521 to accommodate larger waits.
7522
7523 * process.h (struct Lisp_Process.read_output_delay):
7524 Now counts nanoseconds, not microseconds.
7525 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7526 EMACS_HAS_USECS.
7527 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7528 (wait_reading_process_output):
7529 Port to ns-resolution time stamps.
7530 (Faccept_process_output, wait_reading_process_output):
7531 Check for time stamp overflow. Do not assume time_t is signed.
7532 (select_wrapper): Remove; we now use pselect.
7533 (Fprocess_attributes): Now generates ns-resolution time stamps.
7534
7535 * sysdep.c: Include utimens.h. Don't include utime.h
7536 or worry about struct utimbuf; gnulib does that for us now.
7537 (gettimeofday): Remove; gnulib provides a substitute.
7538 (make_timeval): New function.
7539 (set_file_times): Now sets ns-resolution time stamps.
7540 New arg FD; all uses changed.
7541 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7542 (system_process_attributes):
7543 Now returns ns-resolution time stamp. All uses changed.
7544 Check for time stamp overflow.
7545
7546 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7547 provides a substitute now.
7548
7549 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7550 since it guarantees struct timespec.
7551 (EMACS_TIME): Now struct timespec, so that we can support
7552 ns-resolution time stamps.
7553 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7554 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7555 (EMACS_USECS): Remove.
7556 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7557 so multiply the arg by 1000 before storing it.
7558 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7559 New macros.
7560 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7561 Port to ns-resolution time stamps.
7562 (EMACS_TIME_NEG_P): Remove; replaced by....
7563 (EMACS_TIME_SIGN): New macro.
7564 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7565 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7566 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7567 (make_timeval, make_lisp_time, decode_time_components): New decls.
7568 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7569 that it mishandled time_t overflow. You can't compare by subtracting!
7570 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7571 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7572
7573 * term.c: Include <sys/time.h>.
7574 (timeval_to_Time): New function, for proper overflow wraparound.
7575 (term_mouse_position, term_mouse_click): Use it.
7576
7577 * undo.c (record_first_change): Support higher-resolution time stamps
7578 in the undo buffer.
7579 (Fprimitive_undo): Use them when restoring time stamps.
7580
7581 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7582 (w32_get_internal_run_time):
7583 Port to higher-resolution Emacs time stamps.
7584 (ltime): Now accepts single 64-bit integer, as that's more convenient
7585 for callers.
7586
7587 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7588
7589 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7590 for compatibility with pselect. Support ns-resolution time stamps.
7591
7592 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7593
7594 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7595 Check for time stamp overflow, and support ns-resolution time stamps.
7596
7597 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7598 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7599 (timeval_subtract): Remove; no longer needed.
7600 (XTflash, XTring_bell, x_wait_for_event):
7601 Port to ns-resolution time stamps. Don't assume time_t is signed.
7602
7603 2012-06-22 Chong Yidong <cyd@gnu.org>
7604
7605 * xdisp.c (x_consider_frame_title): Revert last change.
7606
7607 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7608
7609 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7610 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7611 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7612 staticidx goes up to 1597 out of 1600 = 0x640.)
7613
7614 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7617 Otherwise, the umask might be mistakenly 0 while handling input signals.
7618
7619 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7620
7621 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7622
7623 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7624
7625 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7626 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7627 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7628 access to `contents' member of Lisp_Vector objects with AREF and ASET
7629 where appropriate.
7630
7631 2012-06-19 Chong Yidong <cyd@gnu.org>
7632
7633 * frame.c (delete_frame): When selecting a frame on a different
7634 text terminal, do not alter the terminal's top-frame.
7635
7636 * xdisp.c (format_mode_line_unwind_data): Record the target
7637 frame's selected window and its terminal's top-frame.
7638 (unwind_format_mode_line): Restore them.
7639 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7640 Callers changed.
7641 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7642 since tty frames can be explicitly named.
7643 (prepare_menu_bars): Likewise.
7644
7645 * term.c (Ftty_top_frame): New function.
7646
7647 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7648
7649 Port byte-code-meter to modern targets.
7650 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7651 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7652 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7653 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7654 (METER_1, METER_2): Simplify.
7655
7656 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7657
7658 * data.c (Fdefalias): Return `symbol' (bug#11686).
7659
7660 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7661
7662 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7663 gets killed during executing of this function (Bug#11665).
7664 Try to always return Qt when the buffer has been actually killed.
7665 (Vkill_buffer_query_functions): In doc-string say that functions
7666 run by this hook should not change the current buffer.
7667
7668 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7669
7670 Fix recently-introduced process.c problems found by static checking.
7671 * process.c (write_queue_push, write_queue_pop, send_process):
7672 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7673 (write_queue_pop): Fix pointer signedness problem.
7674 (send_process): Remove unused local.
7675
7676 2012-06-17 Chong Yidong <cyd@gnu.org>
7677
7678 * xdisp.c (redisplay_internal): No need to redisplay terminal
7679 frames that are not on top.
7680
7681 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7682
7683 * process.c (make_process): Initialize write_queue.
7684 (write_queue_push, write_queue_pop): New functions.
7685 (send_process): Use them to maintain correct ordering of process
7686 writes (Bug#10815).
7687
7688 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7689
7690 * lisp.h (eassert): Assume C89 or later.
7691 This removes the need for CHECK.
7692 (CHECK): Remove. Its comments about always evaluating its
7693 argument were confusing, as 'eassert' typically does not evaluate
7694 its argument.
7695
7696 * coding.c (produce_chars): Use ptrdiff_t, not int.
7697
7698 * xterm.c (x_draw_underwave): Check for integer overflow.
7699 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7700
7701 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7702
7703 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7704 referenced (Bug#11583).
7705
7706 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7707
7708 Implement wave-style variant of underlining.
7709 * dispextern.h (face_underline_type): New enum.
7710 (face): Add field for underline type.
7711 * nsterm.m (ns_draw_underwave): New function.
7712 (ns_draw_text_decoration): Use it.
7713 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7714 New functions.
7715 (x_draw_glyph_string): Use them.
7716 * xfaces.c (Qline, Qwave): New Lisp objects.
7717 (check_lface_attrs, merge_face_ref)
7718 (Finternal_set_lisp_face_attribute, realize_x_face):
7719 Handle wave-style underline face attributes.
7720 * xterm.c (x_draw_underwave): New function.
7721 (x_draw_glyph_string): Use it.
7722
7723 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7724
7725 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7726 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7727 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7728 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7729 ($(BLD)/w32select.$(O)): Update dependencies.
7730
7731 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7732
7733 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7734 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7735 * character.c (_fetch_multibyte_char_p): Remove.
7736 * alloc.c: Include "character.h" before "buffer.h".
7737 * bidi.c: Likewise.
7738 * buffer.c: Likewise.
7739 * bytecode.c: Likewise.
7740 * callint.c: Likewise.
7741 * callproc.c: Likewise.
7742 * casefiddle.c: Likewise.
7743 * casetab.c: Likewise.
7744 * category.c: Likewise.
7745 * cmds.c: Likewise.
7746 * coding.c: Likewise.
7747 * composite.c: Likewise.
7748 * dired.c: Likewise.
7749 * dispnew.c: Likewise.
7750 * doc.c: Likewise.
7751 * dosfns.c: Likewise.
7752 * editfns.c: Likewise.
7753 * emacs.c: Likewise.
7754 * fileio.c: Likewise.
7755 * filelock.c: Likewise.
7756 * font.c: Likewise.
7757 * fontset.c: Likewise.
7758 * fringe.c: Likewise.
7759 * indent.c: Likewise.
7760 * insdel.c: Likewise.
7761 * intervals.c: Likewise.
7762 * keyboard.c: Likewise.
7763 * keymap.c: Likewise.
7764 * lread.c: Likewise.
7765 * macros.c: Likewise.
7766 * marker.c: Likewise.
7767 * minibuf.c: Likewise.
7768 * nsfns.m: Likewise.
7769 * nsmenu.m: Likewise.
7770 * print.c: Likewise.
7771 * process.c: Likewise.
7772 * regex.c: Likewise.
7773 * region-cache.c: Likewise.
7774 * search.c: Likewise.
7775 * syntax.c: Likewise.
7776 * term.c: Likewise.
7777 * textprop.c: Likewise.
7778 * undo.c: Likewise.
7779 * unexsol.c: Likewise.
7780 * w16select.c: Likewise.
7781 * w32fns.c: Likewise.
7782 * w32menu.c: Likewise.
7783 * window.c: Likewise.
7784 * xdisp.c: Likewise.
7785 * xfns.c: Likewise.
7786 * xmenu.c: Likewise.
7787 * xml.c: Likewise.
7788 * xselect.c: Likewise.
7789
7790 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7791
7792 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7793 If all the glyphs of the glyph row came from strings, and we have no
7794 cursor positioning clues, put the cursor on the first glyph of the
7795 row.
7796 (handle_face_prop): Use chunk-relative overlay string index when
7797 indexing into it->string_overlays array. (Bug#11653)
7798 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7799 the rightmost. (Bug#11720)
7800
7801 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7802
7803 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7804 (CATEGORY_MEMBER): Enforce 1/0 value.
7805 * category.c (_temp_category_set): Remove.
7806
7807 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7808
7809 * window.c (Fdelete_other_windows_internal)
7810 (Fdelete_window_internal): Don't access frame's mouse highlight
7811 info of the initial frame. (Bug#11677)
7812
7813 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7814
7815 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7816 Assume USE_2_TAGS_FOR_INTS.
7817 (xreload): Adjust $tagmask width to match recent lisp.h change.
7818
7819 Simplify lisp.h in minor ways that should not affect code.
7820 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7821 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7822 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7823 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7824 (INTTYPEBITS): New macro, for clarity.
7825 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7826 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7827 Simplify now that USE_LSB_TAG is always defined.
7828 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7829 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7830
7831 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7832
7833 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7834
7835 2012-06-13 Glenn Morris <rgm@gnu.org>
7836
7837 * s/bsd-common.h (BSD4_3):
7838 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7839
7840 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7841
7842 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7843 instead of union.
7844 (XLI, XIL): Define.
7845 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7846 Use them.
7847 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7848 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7849 * alloc.c (widen_to_Lisp_Object): Remove.
7850 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7851 * frame.c (delete_frame): Remove outdated comment.
7852 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7853 USE_LISP_UNION_TYPE.
7854 (Fw32_unregister_hot_key): Likewise.
7855 (Fw32_toggle_lock_key): Likewise.
7856 * w32menu.c (add_menu_item): Likewise.
7857 (w32_menu_display_help): Use XIL instead of checking
7858 USE_LISP_UNION_TYPE.
7859 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7860 (init_heap): Likewise.
7861 * w32term.c (w32_read_socket): Update comment.
7862
7863 2012-06-13 Glenn Morris <rgm@gnu.org>
7864
7865 * s/usg5-4-common.h, src/s/unixware.h:
7866 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7867
7868 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7869
7870 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7871
7872 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7873 * alloc.c (make_number) [!defined make_number]:
7874 Remove, as lisp.h always defines this now.
7875 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7876 (roundup_size): Verify that it is a power of 2.
7877 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7878 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7879 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7880 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7881 USE_LSB_TAG now is always defined to be either 0 or 1.
7882 All uses changed.
7883 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7884 code works fine either way, and efficiency is not a concern here,
7885 as the union type is for debugging, not for production.
7886 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7887 Use an inline function on all platforms when using the union type,
7888 since this is simpler and 'static inline' can be used portably
7889 within Emacs now.
7890 (LISP_INITIALLY_ZERO): New macro.
7891 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7892 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7893
7894 2012-06-12 Glenn Morris <rgm@gnu.org>
7895
7896 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7897
7898 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7899
7900 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7901 Move BROKEN_SIGIO to configure.
7902
7903 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7904 Move NO_TERMIO to configure.
7905
7906 2012-06-12 Chong Yidong <cyd@gnu.org>
7907
7908 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7909 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7910 MagickExportImagePixels is undefined.
7911
7912 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7913
7914 * image.c (imagemagick_load_image): Remove unused label.
7915
7916 2012-06-11 Glenn Morris <rgm@gnu.org>
7917
7918 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7919 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7920 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7921 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7922
7923 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7924
7925 * alloc.c (make_byte_code): New function.
7926 (Fmake_byte_code): Use it. Don't purify here.
7927 * lread.c (read1): Use it as well to avoid extra allocation.
7928
7929 2012-06-11 Chong Yidong <cyd@gnu.org>
7930
7931 * image.c (imagemagick_load_image): Implement transparency.
7932
7933 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7934
7935 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7936 account for preceding backslashes. (Bug#11663)
7937
7938 2012-06-09 Chong Yidong <cyd@gnu.org>
7939
7940 * term.c: Support italics in capable terminals (Bug#9652).
7941 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7942 (turn_on_face): Output using TS_enter_italic_mode if available.
7943 Don't handle unused blinking and alt-charset cases.
7944 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7945 and tty_alt_charset_p cases.
7946 (tty_capable_p, init_tty): Support italics.
7947
7948 * termchar.h (struct tty_display_info): Add field for italics.
7949 Remove unused blink field.
7950
7951 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7952 Handle slant.
7953
7954 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7955 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7956 tty_alt_charset_p. Add tty_italic_p.
7957
7958 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7959
7960 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7961 dbus_type_is_basic if available.
7962 (xd_extract_signed, xd_extract_unsigned): Rename from
7963 extract_signed and extract_unsigned, respectively. Adapt callers.
7964
7965 2012-06-09 Chong Yidong <cyd@gnu.org>
7966
7967 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7968
7969 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7970 case (Bug#9752).
7971
7972 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7973
7974 * xdisp.c (vmessage): Treat frame message as multibyte.
7975 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7976 would generate the diagnostic "Making \302\247 buffer-local while
7977 let-bound!".
7978
7979 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7980
7981 * dispnew.c (showing_window_margins_p): Undo last change, which
7982 was done due to an inadvertent commit.
7983 (adjust_frame_glyphs_for_frame_redisplay): Do call
7984 showing_window_margins_p.
7985
7986 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7987
7988 * eval.c (Fmake_var_non_special): New primitive.
7989 (syms_of_eval): Defsubr it.
7990 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7991
7992 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7993
7994 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7995 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7996
7997 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7998
7999 * alloc.c (allocate_vectorlike): Fix last change.
8000
8001 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8002
8003 Block-based vector allocation of small vectors.
8004 * lisp.h (struct vectorlike_header): New field `nbytes',
8005 adjust comment accordingly.
8006 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
8007 to denote vector blocks. Adjust users (live_vector_p,
8008 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8009 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8010 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8011 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8012 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8013 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8014 (roundup_size): New constant.
8015 (struct vector_block): New data type.
8016 (vector_blocks, vector_free_lists, zero_vector): New variables.
8017 (all_vectors): Rename to `large_vectors'.
8018 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8019 (sweep_vectors): New functions.
8020 (allocate_vectorlike): Return `zero_vector' as the only vector of
8021 0 items. Allocate new vector from block if vector size is less than
8022 or equal to VBLOCK_BYTES_MAX.
8023 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8024 (init_alloc_once): Add call to init_vectors.
8025
8026 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8027
8028 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8029
8030 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * doprnt.c (doprnt): Truncate multibyte char correctly.
8033 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8034 would mishandle a string argument "Xc" if X was a multibyte
8035 character of length 2: it would truncate after X's first byte
8036 rather than including all of X.
8037
8038 2012-06-06 Chong Yidong <cyd@gnu.org>
8039
8040 * buffer.c (word_wrap): Doc fix.
8041
8042 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8043
8044 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8045
8046 2012-06-03 Glenn Morris <rgm@gnu.org>
8047
8048 * xdisp.c (tool-bar-style): Doc fix.
8049
8050 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8051
8052 * Makefile.in (PAXCTL): Define.
8053 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8054 binary via PaX flags if the paxctl utility is available.
8055 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8056 Restore PaX flags to their default. (Bug#11398)
8057
8058 2012-06-03 Chong Yidong <cyd@gnu.org>
8059
8060 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8061 buffer (Bug#11226).
8062
8063 2012-06-03 Chong Yidong <cyd@gnu.org>
8064
8065 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8066 (note_mode_line_or_margin_highlight): If there is no help echo,
8067 use mode-line-default-help-echo. Handle the case where the mouse
8068 position is past the end of the mode line string.
8069
8070 * buffer.c (buffer_local_value_1): New function, split from
8071 Fbuffer_local_value; can return Qunbound.
8072 (Fbuffer_local_value): Use it.
8073 (Vmode_line_format): Docstring tweaks.
8074
8075 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 * sysdep.c (system_process_attributes): Improve comment.
8078
8079 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8080
8081 * keyboard.c: Export real-this-command to Elisp.
8082 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8083 and DEFVAR it. Update all users.
8084
8085 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8088
8089 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8090 Convert pctcpu and pctmem to Lisp float properly.
8091 Let the compiler fold better, as 100.0/0x8000 is exact.
8092
8093 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8094
8095 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8096 cons_block.
8097
8098 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8099
8100 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8101
8102 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8103
8104 For a 'struct window', replace some Lisp_Object fields to
8105 bitfields where appropriate, remove unused fields.
8106 * window.h (struct window): Remove unused 'last_mark_x' and
8107 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8108 change its type from Lisp_Object to bitfield.
8109 Change type of 'force_start', 'optional_new_start',
8110 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8111 fields from Lisp_Object to bitfield. Adjust users accordingly.
8112
8113 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 Pacify gcc -Wdouble-precision when using Xaw.
8116 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8117 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8118 Use 'float' consistently, rather than 'float' in most places
8119 and 'double' in a couple of places.
8120
8121 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8122
8123 * xdisp.c (handle_stop): Detect whether we have overlay strings
8124 loaded by testing it->current.overlay_string_index to be
8125 non-negative, instead of checking whether n_overlay_strings is
8126 positive. (Bug#11587)
8127
8128 2012-05-31 Chong Yidong <cyd@gnu.org>
8129
8130 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8131
8132 * doc.c (Fsubstitute_command_keys): Doc fix.
8133
8134 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8135
8136 * search.c (search_buffer): Remove calls to
8137 r_alloc_inhibit_buffer_relocation, as it is now called by
8138 maybe_unify_char, which was the cause of relocation of buffer text
8139 in bug#11519.
8140
8141 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8142
8143 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8144 for the duration of call to load_charset, to avoid problems with
8145 callers of maybe_unify_char that access buffer text through C
8146 pointers.
8147
8148 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8149 decrement the inhibition flag, instead of just setting or
8150 resetting it.
8151
8152 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 Remove obsolete '#define static' cruft.
8155 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8156 This #undef was "temporary" in 2000; it is no longer needed
8157 now that '#define static' has gone away.
8158 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8159 (gray_bitmap_bits): Remove; no longer needed.
8160 All uses replaced with definiens.
8161 * xterm.c: Include "bitmaps/gray.xbm".
8162
8163 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8164
8165 Clean up __executable_start, monstartup when --enable-profiling.
8166 The following changes affect the code only when profiling.
8167 * dispnew.c (__executable_start): Rename from safe_bcopy.
8168 Define only on platforms that need it.
8169 * emacs.c: Include <sys/gmon.h> when profiling.
8170 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8171 (__executable_start): Remove decl, since lisp.h does it now.
8172 (safe_bcopy): Remove decl; no longer has that name.
8173 (main): Coalesce #if into single bit of code, for simplicity.
8174 Cast pointers to uintptr_t, since standard libraries want integers
8175 and not pointers.
8176 * lisp.h (__executable_start): New decl.
8177
8178 2012-05-31 Glenn Morris <rgm@gnu.org>
8179
8180 * image.c (Fimagemagick_types): Doc fix.
8181
8182 2012-05-30 Jim Meyering <meyering@redhat.com>
8183
8184 * callproc.c (Fcall_process_region): Include directory component
8185 in mkstemp error message (Bug#11586).
8186
8187 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8188
8189 * alloc.c, lisp.h (make_pure_vector): Now static.
8190
8191 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8192
8193 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8194 Move to byte-run.el.
8195 (Fautoload): Do the hash-doc more carefully.
8196 * data.c (Fdefalias): Purify definition, except for keymaps.
8197 (Qdefun): Move from eval.c.
8198 * lisp.h (Qdefun): Remove.
8199 * lread.c (read1): Tiny simplification.
8200
8201 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8202
8203 Do not create empty overlays with the evaporate property (Bug#9642).
8204 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8205 Bug#9642, but explicitly check that the buffer the overlay would
8206 be moved to is live and rearrange lines to make sure that errors
8207 will not put the overlay in an inconsistent state.
8208 (Fdelete_overlay): Cosmetics.
8209
8210 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8211
8212 * w32term.c (my_bring_window_to_top): New function.
8213 (x_raise_frame): Use handle returned by DeferWindowPos, which
8214 could be different from the original one.
8215 Call my_bring_window_to_top instead of my_set_foreground_window.
8216 (Bug#11513)
8217
8218 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8219 by calling BringWindowToTop.
8220
8221 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8222 (WM_EMACS_END): Increase by one.
8223
8224 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8225
8226 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8227 This avoids undefined behavior that might cause the eassert
8228 to not catch an out-of-range value.
8229
8230 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8231
8232 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8233 Update dependencies.
8234
8235 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8236
8237 * bidi.c (bidi_mirror_char): Fix last change.
8238
8239 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8240
8241 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8242 when referring to sectname field in printf format.
8243
8244 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8245
8246 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8247 Only r_alloc_inhibit_buffer_relocation needed to be added;
8248 the others were already declared.
8249
8250 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8251 before checking whether it's out of range. Put the check inside
8252 eassert. See
8253 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8254
8255 2012-05-27 Ken Brown <kbrown@cornell.edu>
8256
8257 * callproc.c (Fcall_process): Restore a line that was accidentally
8258 commented out in the 2011-02-13 change (bug#11547).
8259
8260 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8261
8262 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8263 defined on ralloc.c.
8264
8265 * buffer.c [REL_ALLOC]: Remove prototypes of
8266 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8267 they are now on lisp.h.
8268
8269 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8270
8271 * search.c (search_buffer): Use it to inhibit relocation of buffer
8272 text while re_search_2 is doing its job, because re_search_2 is
8273 passed C pointers to buffer text. (Bug#11519)
8274
8275 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8276 Update value to 24.
8277
8278 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8279 state after an additional call to move_it_in_display_line_to, keep
8280 the values of it->max_ascent and it->max_descent found for the
8281 entire line.
8282 (pos_visible_p): Revert the comparison against bottom_y to what it
8283 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8284 (Bug#11464)
8285
8286 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8287
8288 Fix coding-related core dumps with gcc -ftrapv.
8289 The code was computing A - B, where A and B are pointers, and B is
8290 random garbage. This can lead to core dumps on platforms that
8291 have special pointer registers, and it also leads to core dumps on
8292 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8293 A - B only when B is initialized properly.
8294 * coding.c (coding_set_source, coding_set_destination): Return void.
8295 (coding_change_source, coding_change_destinations): New functions,
8296 with the old behaviors of coding_set_source and coding_set_destination.
8297 All callers that need an offset changed to use these new functions.
8298
8299 2012-05-26 Glenn Morris <rgm@gnu.org>
8300
8301 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8302
8303 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8304
8305 Extend mouse support on W32 text-mode console.
8306 * xdisp.c (draw_row_with_mouse_face):
8307 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8308
8309 * w32console.c: Include window.h.
8310 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8311 New functions.
8312 (initialize_w32_display): Initialize mouse-highlight data.
8313
8314 * w32inevt.c: Include termchar.h and window.h.
8315 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8316 moves, call note_mouse_highlight. If help_echo changed, call
8317 gen_help_event to produce help-echo message in the echo area.
8318 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8319 highlight info.
8320
8321 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 * lread.c (read1): Simplify slightly to avoid an overflow warning
8324 with GCC 4.7.0 on x86-64.
8325
8326 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8327
8328 * bidi.c (bidi_mirror_char): Revert last change: an int is
8329 definitely wide enough here.
8330
8331 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8332
8333 Fix integer width and related bugs (Bug#9874).
8334 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8335 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8336 (string_bytes, check_sblock, allocate_string_data):
8337 (compact_small_strings, Fmake_bool_vector, make_string)
8338 (make_unibyte_string, make_multibyte_string)
8339 (make_string_from_bytes, make_specified_string)
8340 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8341 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8342 (mark_vectorlike):
8343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8344 (allocate_pseudovector):
8345 Use int, not EMACS_INT, where int is wide enough.
8346 (inhibit_garbage_collection, Fgarbage_collect):
8347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8348 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8349 int might not be wide enough.
8350 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8351 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8352 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8353 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8354 (bidi_level_of_next_char, bidi_move_to_visually_next):
8355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8356 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8357 (Fkill_buffer, Fset_buffer_major_mode)
8358 (advance_to_char_boundary, Fbuffer_swap_text)
8359 (Fset_buffer_multibyte, overlays_at, overlays_in)
8360 (overlay_touches_p, struct sortvec, record_overlay_string)
8361 (overlay_strings, recenter_overlay_lists)
8362 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8363 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8364 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8365 (Foverlay_recenter, last_overlay_modification_hooks_used)
8366 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8368 (validate_region): Omit unnecessary test for b <= e,
8369 since that's guaranteed by the previous test.
8370 (adjust_overlays_for_delete): Avoid pos + length overflow.
8371 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8372 (report_overlay_modification):
8373 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8374 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8375 Omit pointer cast, which isn't needed anyway, and doesn't work
8376 after the EMACS_INT -> ptrdiff_t change.
8377 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8378 * buffer.h: Adjust decls to match defn changes elsewhere.
8379 (struct buffer_text, struct buffer):
8380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8381 Use EMACS_INT, not int, where int might not be wide enough.
8382 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8383 not int, to avoid needless 32-bit limit on 64-bit hosts.
8384 (exec_byte_code): Use tighter memory-full test, one that checks
8385 for alloca overflow. Don't compute the address of the object just
8386 before an array, as that's not portable. Use EMACS_INT, not
8387 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8388 * callint.c (Fcall_interactively):
8389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8390 * callproc.c (call_process_kill, Fcall_process):
8391 Don't assume pid_t fits into an Emacs fixnum.
8392 (call_process_cleanup, Fcall_process, child_setup):
8393 Don't assume pid_t fits into int.
8394 (call_process_cleanup, Fcall_process, delete_temp_file)
8395 (Fcall_process_region):
8396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8397 (Fcall_process): Simplify handling of volatile integers.
8398 Use int, not EMACS_INT, where int will do.
8399 * casefiddle.c (casify_object, casify_region, operate_on_word)
8400 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8402 (casify_object): Avoid integer overflow when overallocating buffer.
8403 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8404 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8405 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8406 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8407 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8408 integers are now checked earlier. All uses replaced with XINT.
8409 (ccl_driver):
8410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8411 For CCL_MapSingle, check that content and value are in int range.
8412 (ccl_driver, Fregister_code_conversion_map):
8413 Check that Vcode_version_map_vector is a vector.
8414 (resolve_symbol_ccl_program): Check that vector header is in range.
8415 Always copy the vector, so that we can check its contents reliably
8416 now rather than having to recheck each instruction as it's being
8417 executed. Check that vector words fit in 'int'.
8418 (ccl_get_compiled_code, Fregister_ccl_program)
8419 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8420 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8421 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8422 contents are in range.
8423 (Fccl_execute_on_string): Check that status is in range.
8424 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8425 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8426 Accept and return EMACS_INT, not int, because callers can pass values
8427 out of 'int' range.
8428 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8429 (multibyte_chars_in_text, parse_str_as_multibyte)
8430 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8431 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8432 (string_escape_byte8, Fget_byte):
8433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8434 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8435 avoid mishandling large integers.
8436 * character.h: Adjust decls to match defn changes elsewhere.
8437 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8438 (Ffind_charset_region):
8439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8440 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8441 (load_charset_map_from_vector, Fdefine_charset_internal):
8442 Don't assume fixnum fits in int.
8443 (load_charset_map_from_vector, Fmap_charset_chars):
8444 Remove now-unnecessary CHECK_NATNUMs.
8445 (Fdefine_charset_internal): Check ranges here, more carefully.
8446 Don't rely on undefined behavior with signed left shift overflow.
8447 Don't assume unsigned int fits into fixnum, or that fixnum fits
8448 into unsigned int. Don't require max_code to be a valid fixnum;
8449 that's not true for gb10830 4-byte on a 32-bit host. Allow
8450 invalid_code to be a cons, for the same reason. Require code_offset
8451 to be a character. Avoid int overflow if max_char is close
8452 to INT_MAX.
8453 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8454 this is intended anyway and avoids some undefined behavior.
8455 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8456 INDEX_TO_CODE_POINT, as that's what it expects.
8457 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8458 * charset.h (DECODE_CHAR): Return int, not unsigned;
8459 this is what was intended anyway, and it avoids undefined behavior.
8460 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8461 integer-overflow issues.
8462 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8463 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8464 where the argument is EMACS_INT, and this behavior is not intended.
8465 * chartab.c (Fmake_char_table, Fset_char_table_range)
8466 (uniprop_get_decoder, uniprop_get_encoder):
8467 Don't assume fixnum fits in int.
8468 * cmds.c (move_point): New function, that does the gist of
8469 Fforward_char and Fbackward_char, but does so while checking
8470 for integer overflow more accurately.
8471 (Fforward_char, Fbackward_char): Use it.
8472 (Fforward_line, Fend_of_line, internal_self_insert)
8473 (internal_self_insert):
8474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8475 Fix a FIXME, by checking for integer overflow when calculating
8476 target_clm and actual_clm.
8477 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8478 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8479 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8480 (coding_alloc_by_making_gap, alloc_destination)
8481 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8482 (encode_coding_utf_16, detect_coding_emacs_mule)
8483 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8484 (detect_coding_iso_2022, decode_coding_iso_2022)
8485 (encode_invocation_designation, encode_designation_at_bol)
8486 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8487 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8488 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8489 (encode_coding_ccl, encode_coding_raw_text)
8490 (detect_coding_charset, decode_coding_charset)
8491 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8492 (produce_composition, produce_charset, produce_annotation)
8493 (decode_coding, handle_composition_annotation)
8494 (handle_charset_annotation, consume_chars, decode_coding_gap)
8495 (decode_coding_object, encode_coding_object, detect_coding_system)
8496 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8497 (code_convert_region, code_convert_string)
8498 (Fdefine_coding_system_internal)
8499 (coding_set_source, coding_set_destination):
8500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8501 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8502 (Fdefine_coding_system_internal):
8503 Don't assume fixnums fit in int.
8504 (decode_coding_gap, decode_coding_object, encode_coding_object)
8505 (Fread_coding_system, Fdetect_coding_region)
8506 (Funencodable_char_position, Fcheck_coding_systems_region)
8507 (get_translation, handle_composition_annotation, consume_chars):
8508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8509 (consume_chars): Rewrite to not calculate an address outside buffer.
8510 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8511 Don't access memory outside of the args array.
8512 (Fdefine_coding_system_internal): Check for charset-id overflow.
8513 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8514 result of ENCODE_CHAR.
8515 * coding.h: Adjust decls to match defn changes elsewhere.
8516 (struct coding_system):
8517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8518 * composite.c (get_composition_id, find_composition)
8519 (run_composition_function, update_compositions)
8520 (compose_text, composition_gstring_put_cache)
8521 (composition_gstring_p, composition_gstring_width)
8522 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8523 (composition_compute_stop_pos, composition_reseat_it)
8524 (composition_update_it, struct position_record)
8525 (find_automatic_composition, composition_adjust_point)
8526 (Fcomposition_get_gstring, Ffind_composition_internal):
8527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8528 (update_compositions):
8529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8530 * composite.h: Adjust decls to match defn changes elsewhere.
8531 (struct composition):
8532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8533 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8534 Do not attempt to compute the address of the object just before a
8535 buffer; this is not portable.
8536 (Faref, Faset):
8537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8538 (Faset): Use int, not EMACS_INT, where int is wide enough.
8539 (Fstring_to_number): Don't assume fixnums fit in int.
8540 (Frem): Don't assume arg is nonnegative.
8541 * dbusbind.c (xd_append_arg): Check for integers out of range.
8542 (Fdbus_call_method): Don't overflow the timeout int.
8543 (extract_signed, extract_unsigned): New functions.
8544 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8545 (xd_get_connection_references): Return ptrdiff_t, not int.
8546 All uses changed.
8547 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8548 (xd_read_message_1):
8549 Use int, not unsigned, where the dbus API uses int.
8550 (Fdbus_message_internal): Don't overflow mtype.
8551 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8552 * dired.c (directory_files_internal, file_name_completion, scmp)
8553 (file_name_completion_stat):
8554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8555 (file_name_completion): Don't overflow matchcount.
8556 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8557 * dispextern.h: Adjust decls to match defn changes elsewhere.
8558 (struct text_pos, struct glyph, struct bidi_saved_info)
8559 (struct bidi_string_data, struct bidi_it, struct composition_it)
8560 (struct it):
8561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8562 (struct display_pos, struct composition_it, struct it):
8563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8564 * dispnew.c (increment_matrix_positions)
8565 (increment_row_positions, mode_line_string)
8566 (marginal_area_string):
8567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8568 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8569 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8570 (duration_to_sec_usec): New function, to check for overflow better.
8571 (Fsleep_for, sit_for): Use it.
8572 * doc.c (get_doc_string, store_function_docstring):
8573 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8574 (get_doc_string, Fsnarf_documentation):
8575 Use int, not EMACS_INT, where int is wide enough.
8576 (get_doc_string):
8577 Use SAFE_ALLOCA, not alloca.
8578 Check for overflow when converting EMACS_INT to off_t.
8579 * doprnt.c (doprnt):
8580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8581 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8582 Don't assume uid_t fits into fixnum.
8583 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8584 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8585 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8586 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8587 (general_insert_function)
8588 (Finsert_char, make_buffer_string, make_buffer_string_both)
8589 (update_buffer_properties, Fbuffer_substring)
8590 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8591 (Fsubst_char_in_region, check_translation)
8592 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8593 (transpose_markers, Ftranspose_regions):
8594 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8595 (clip_to_bounds): Move to lisp.h as an inline function).
8596 (Fconstrain_to_field): Don't assume integers are nonnegative.
8597 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8598 (Fsubst_char_in_region, Fsave_restriction):
8599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8600 (Femacs_pid): Don't assume pid_t fits into fixnum.
8601 (lo_time): Use int, not EMACS_INT, when int suffices.
8602 (lisp_time_argument): Check for usec out of range.
8603 (Fencode_time): Don't assume fixnum fits in int.
8604 (Fuser_login_name, Fuser_full_name): Signal an error
8605 if a uid argument is out of range, rather than relying on
8606 undefined behavior.
8607 (Fformat_time_string): Remove now-unnecessary check.
8608 lisp_time_argument checks for out-of-range usec now.
8609 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8610 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8611 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8612 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8613 (init_cmdargs, Fdump_emacs):
8614 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8615 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8616 the bottom (typically) 32 bits of the fixnum.
8617 * eval.c (specpdl_size, call_debugger):
8618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8619 (when_entered_debugger, Fbacktrace_debug):
8620 Don't assume fixnum can fit in int.
8621 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8622 the object just before a buffer; this is not portable.
8623 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8624 (grow_specpdl, unbind_to):
8625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8626 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8627 (grow_specpdl): Simplify allocation by using xpalloc.
8628 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8629 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8630 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8632 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8633 (a_write, e_write):
8634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8635 (Fcopy_file, non_regular_nbytes, read_non_regular)
8636 (Finsert_file_contents):
8637 Use int, not EMACS_INT, where int is wide enough.
8638 (READ_BUF_SIZE): Verify that it fits in int.
8639 (Finsert_file_contents): Check that counts are in proper range,
8640 rather than assuming fixnums fit into ptrdiff_t etc.
8641 Don't assume fixnums fit into int.
8642 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8643 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8644 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8645 (string_char_to_byte, string_byte_to_char)
8646 (string_make_multibyte, string_to_multibyte)
8647 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8648 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8649 (substring_both, Fdelete, internal_equal, Ffillarray)
8650 (Fclear_string, mapcar1)
8651 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8652 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8653 (larger_vector, make_hash_table, maybe_resize_hash_table)
8654 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8655 (Fmaphash, secure_hash):
8656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8657 (concat): Check for string index and length overflow.
8658 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8659 (Frequire):
8660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8661 (larger_vector): New API (vec, incr_min, size_max) replaces old
8662 one (vec, new_size, init). This catches size overflow.
8663 INIT was removed because it was always Qnil.
8664 All callers changed.
8665 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8666 the upper bound on a hash table index size.
8667 (make_hash_table, maybe_resize_hash_table): Use it.
8668 (secure_hash): Computer start_byte and end_byte only after
8669 they're known to be in ptrdiff_t range.
8670 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8671 (Ffont_get_glyphs, Ffont_at):
8672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8673 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8674 (Flist_fonts, Fopen_font):
8675 Don't assume fixnum can fit in int.
8676 (check_gstring): Don't assume index can fit in int.
8677 (font_match_p): Check that fixnum is a character, not a nonnegative
8678 fixnum, since the later code needs to stuff it into an int.
8679 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8680 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8681 conversion overflow issues.
8682 (Fopen_font): Check for integer out of range.
8683 (Ffont_get_glyphs): Don't assume index can fit in int.
8684 * font.h: Adjust decls to match defn changes elsewhere.
8685 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8686 integer overflow.
8687 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8688 printmax_t, where ptrdiff_t is wide enough.
8689 (Finternal_char_font):
8690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8691 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8692 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8693 (Fset_frame_position, x_set_frame_parameters)
8694 (x_set_line_spacing, x_set_border_width)
8695 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8696 Check that fixnums are in proper range for system types.
8697 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8698 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8699 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8700 Use SAFE_ALLOCA_LISP, not alloca.
8701 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8702 intptr_t is wide enough.
8703 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8704 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8705 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8706 Check for fixnum out of range.
8707 * ftfont.c (ftfont_list): Don't assume index fits in int.
8708 Check that fixnums are in proper range for system types.
8709 (ftfont_shape_by_flt):
8710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8711 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8713 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8714 Check that fixnums are in proper range for system types.
8715 * gnutls.h: Adjust decls to match defn changes elsewhere.
8716 * gtkutil.c (xg_dialog_run):
8717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8718 (update_frame_tool_bar):
8719 Check that fixnums are in proper range for system types.
8720 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8721 (lookup_image): Check that fixnums are in range for system types.
8722 * indent.c (last_known_column, last_known_column_point):
8723 (current_column_bol_cache):
8724 (skip_invisible, current_column, check_display_width):
8725 (check_display_width, scan_for_column, current_column_1)
8726 (Findent_to, Fcurrent_indentation, position_indentation)
8727 (indented_beyond_p, Fmove_to_column, compute_motion):
8728 (Fcompute_motion, Fvertical_motion):
8729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8730 (last_known_column_modified): Use EMACS_INT, not int.
8731 (check_display_width):
8732 (Fcompute_motion):
8733 Check that fixnums and floats are in proper range for system types.
8734 (compute_motion): Don't assume index or fixnum fits in int.
8735 (compute_motion, Fcompute_motion):
8736 Use int, not EMACS_INT, when it is wide enough.
8737 (vmotion): Omit local var start_hpos that is always 0; that way
8738 we don't need to worry about overflow in expressions involving it.
8739 * indent.h: Adjust decls to match defn changes elsewhere.
8740 (struct position):
8741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8742 Use int, not EMACS_INT, where int is wide enough.
8743 Remove unused members ovstring_chars_done and tab_offset;
8744 all uses removed.
8745 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8746 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8747 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8748 (make_gap, copy_text, insert, insert_and_inherit)
8749 (insert_before_markers, insert_before_markers_and_inherit)
8750 (insert_1, count_combining_before, count_combining_after)
8751 (insert_1_both, insert_from_string)
8752 (insert_from_string_before_markers, insert_from_string_1)
8753 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8754 (adjust_after_replace, adjust_after_insert, replace_range)
8755 (replace_range_2, del_range, del_range_1, del_range_byte)
8756 (del_range_both, del_range_2, modify_region)
8757 (prepare_to_modify_buffer, signal_before_change)
8758 (signal_after_change, Fcombine_after_change_execute):
8759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8760 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8761 (balance_an_interval, split_interval_right, split_interval_left)
8762 (find_interval, next_interval, update_interval)
8763 (adjust_intervals_for_insertion, delete_node, delete_interval)
8764 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8765 (static_offset_intervals, offset_intervals)
8766 (merge_interval_right, merge_interval_left, make_new_interval)
8767 (graft_intervals_into_buffer, temp_set_point_both)
8768 (temp_set_point, set_point, adjust_for_invis_intang)
8769 (set_point_both, move_if_not_intangible, get_property_and_range)
8770 (get_local_map, copy_intervals, copy_intervals_to_string)
8771 (compare_string_intervals, set_intervals_multibyte_1):
8772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8773 * intervals.h: Adjust decls to match defn changes elsewhere.
8774 (struct interval):
8775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8776 * keyboard.c (this_command_key_count, this_single_command_key_start)
8777 (before_command_key_count, before_command_echo_length, echo_now)
8778 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8779 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8780 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8781 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8783 (last_non_minibuf_size, last_point_position, echo_truncate)
8784 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8785 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8786 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8787 (stuff_buffered_input):
8788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8789 (last_auto_save, command_loop_1, read_char):
8790 Use EMACS_INT, not int, to avoid integer overflow.
8791 (record_char): Avoid overflow in total_keys computation.
8792 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8793 * keyboard.h: Adjust decls to match defn changes elsewhere.
8794 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8795 (Fkey_description, Fdescribe_vector, Flookup_key):
8796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8797 (click_position): New function, to check that positions are in range.
8798 (Fcurrent_active_maps):
8799 (describe_command):
8800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8801 (Faccessible_keymaps, Fkey_description):
8802 (preferred_sequence_p):
8803 Don't assume fixnum can fit into int.
8804 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8805 Check for integer overflow in size calculations.
8806 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8807 avoid mishandling large integers.
8808 * lisp.h: Adjust decls to match defn changes elsewhere.
8809 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8810 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8811 (struct Lisp_Marker):
8812 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8813 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8814 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8815 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8816 All callers changed.
8817 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8818 Assume the arg has valid form, since it always does.
8819 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8820 unsigned integer system type.
8821 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8822 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8824 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8825 (duration_to_sec_usec): New decl.
8826 * lread.c (read_from_string_index, read_from_string_index_byte)
8827 (read_from_string_limit, readchar, unreadchar, openp)
8828 (read_internal_start, read1, oblookup):
8829 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8830 (Fload, readevalloop, Feval_buffer, Feval_region):
8831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8832 (openp): Check for out-of-range argument to 'access'.
8833 (read1): Use int, not EMACS_INT, where int is wide enough.
8834 Don't assume fixnum fits into int.
8835 Fix off-by-one error that can read outside a buffer.
8836 (read_filtered_event): Use duration_to_sec_usec
8837 to do proper overflow checking on durations.
8838 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8839 in size calculation.
8840 (Fexecute_kbd_macro):
8841 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8842 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8843 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8844 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8845 (set_marker_both, set_marker_restricted_both, marker_position)
8846 (marker_byte_position, Fbuffer_has_markers_at):
8847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8848 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8849 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8850 It now merely ensures that the menu is large enough, without
8851 necessarily growing it, as this avoids some integer overflow issues.
8852 All callers changed.
8853 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8855 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8856 Use SAFE_ALLOCA_LISP, not alloca.
8857 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8858 to EMACS_INT. Check that fixnums are in proper range for system types.
8859 * minibuf.c (minibuf_prompt_width, string_to_object)
8860 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8861 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8863 (get_minibuffer, read_minibuf_unwind):
8864 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8865 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8866 this simplifies overflow checking. All callers changed.
8867 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8868 (Ftest_completion):
8869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8870 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8871 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8872 Check that fixnums are in proper range for system types.
8873 (Fx_create_frame, Fx_show_tip):
8874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8875 * nsfont.m (ns_findfonts, nsfont_list_family):
8876 Don't assume fixnum fits in long.
8877 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8879 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8880 wide enough.
8881 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8882 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8883 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8884 (PRINTDECLARE, PRINTPREPARE):
8885 (strout, print_string):
8886 (print, print_preprocess, print_check_string_charset_prop)
8887 (print_object):
8888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8889 (PRINTDECLARE):
8890 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8892 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8893 (printchar, strout): Use xpalloc to catch size calculation overflow.
8894 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8895 (print_error_message): Use SAFE_ALLOCA, not alloca.
8896 (print_object): Use int, not EMACS_INT, where int is wide enough.
8897 (print_depth, new_backquote_output, print_number_index):
8898 Use ptrdiff_t, not int, where int might not be wide enough.
8899 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8900 (Fset_process_window_size, Fformat_network_address)
8901 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8902 (sigchld_handler):
8903 Check that fixnums are in proper range for system types.
8904 (Fsignal_process): Simplify by avoiding a goto.
8905 Check for process-ids out of pid_t range rather than relying on
8906 undefined behavior.
8907 (process_tick, update_tick): Use EMACS_INT, not int.
8908 (Fformat_network_address, read_process_output, send_process)
8909 (Fprocess_send_region, status_notify):
8910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8911 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8912 (wait_reading_process_output, read_process_output, exec_sentinel):
8913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8914 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8915 (Faccept_process_output): Use duration_to_sec_usec to do proper
8916 overflow checking on durations.
8917 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8918 Don't assume pid_t fits in int.
8919 * process.h (struct Lisp_Process): Members tick and update_tick
8920 are now of type EMACS_INT, not int.
8921 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8922 configured --with-wide-int.
8923 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8924 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8925 * search.c (looking_at_1, string_match_1):
8926 (fast_string_match, fast_c_string_match_ignore_case)
8927 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8928 (scan_newline, find_before_next_newline, search_command)
8929 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8930 (set_search_regs, wordify):
8931 (Freplace_match):
8932 (Fmatch_data):
8933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8934 (string_match_1, search_buffer, set_search_regs):
8935 (Fmatch_data):
8936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8937 (wordify): Check for overflow in size calculation.
8938 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8939 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8940 Check that fixnums are in proper range for system types.
8941 * sound.c (struct sound_device)
8942 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8944 (Fplay_sound_internal):
8945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8946 * syntax.c (struct lisp_parse_state, find_start_modiff)
8947 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8948 (Fparse_partial_sexp):
8949 Don't assume fixnums can fit in int.
8950 (struct lisp_parse_state, find_start_pos, find_start_value)
8951 (find_start_value_byte, find_start_begv)
8952 (update_syntax_table, char_quoted, dec_bytepos)
8953 (find_defun_start, prev_char_comend_first, back_comment):
8954 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8955 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8957 (Finternal_describe_syntax_value): Check that match_lisp is a
8958 character, not an integer, since the code stuffs it into int.
8959 (scan_words, scan_sexps_forward):
8960 Check that fixnums are in proper range for system types.
8961 (Fforward_word):
8962 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8963 (scan_sexps_forward):
8964 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8965 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8966 * syntax.h: Adjust decls to match defn changes elsewhere.
8967 (struct gl_state_s):
8968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8969 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8970 MOST_POSITIVE_FIXNUM.
8971 * sysdep.c (wait_for_termination_1, wait_for_termination)
8972 (interruptible_wait_for_termination, mkdir):
8973 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8974 (emacs_read, emacs_write):
8975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8976 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8977 and double all fit in int.
8978 * term.c (set_tty_color_mode):
8979 Check that fixnums are in proper range for system types.
8980 * termhooks.h (struct input_event):
8981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8982 * textprop.c (validate_interval_range, interval_of)
8983 (Fadd_text_properties, set_text_properties_1)
8984 (Fremove_text_properties, Fremove_list_of_text_properties)
8985 (Ftext_property_any, Ftext_property_not_all)
8986 (copy_text_properties, text_property_list, extend_property_ranges)
8987 (verify_interval_modification):
8988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8989 (Fnext_single_char_property_change)
8990 (Fprevious_single_char_property_change):
8991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8992 (copy_text_properties):
8993 Check for integer overflow in index calculation.
8994 * undo.c (last_boundary_position, record_point, record_insert)
8995 (record_delete, record_marker_adjustment, record_change)
8996 (record_property_change):
8997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8998 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9000 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9001 (Fx_hide_tip, Fx_file_dialog):
9002 * w32menu.c (set_frame_menubar):
9003 Use ptrdiff_t, not int, for consistency with rest of code.
9004 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9005 (select_window, Fdelete_other_windows_internal)
9006 (window_scroll_pixel_based, window_scroll_line_based)
9007 (Frecenter, Fset_window_configuration):
9008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9009 (Fset_window_hscroll, run_window_configuration_change_hook)
9010 (set_window_buffer, temp_output_buffer_show, scroll_command)
9011 (Fscroll_other_window, Frecenter):
9012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9013 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9014 Don't assume fixnum fits in int.
9015 (Fset_window_scroll_bars):
9016 Check that fixnums are in proper range for system types.
9017 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9018 (string_pos, c_string_pos, number_of_chars, init_iterator)
9019 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9020 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9021 (compute_display_string_end, handle_face_prop)
9022 (face_before_or_after_it_pos, handle_invisible_prop)
9023 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9024 (display_prop_intangible_p, string_buffer_position_lim)
9025 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9026 (get_overlay_strings_1, get_overlay_strings)
9027 (iterate_out_of_display_property, forward_to_next_line_start)
9028 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9029 (get_next_display_element, set_iterator_to_next)
9030 (get_visually_first_element, compute_stop_pos_backwards)
9031 (handle_stop_backwards, next_element_from_buffer)
9032 (move_it_in_display_line_to, move_it_in_display_line)
9033 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9034 (add_to_log, message_dolog, message_log_check_duplicate)
9035 (message2, message2_nolog, message3, message3_nolog
9036 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9037 (current_message_1, truncate_echo_area, truncate_message_1)
9038 (set_message, set_message_1, store_mode_line_noprop)
9039 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9040 (text_outside_line_unchanged_p, check_point_in_composition)
9041 (reconsider_clip_changes)
9042 (redisplay_internal, set_cursor_from_row, try_scrolling)
9043 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9044 (redisplay_window, find_last_unchanged_at_beg_row)
9045 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9046 (trailing_whitespace_p, find_row_edges, display_line)
9047 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9048 (display_mode_element, store_mode_line_string)
9049 (pint2str, pint2hrstr, decode_mode_spec)
9050 (display_count_lines, display_string, draw_glyphs)
9051 (x_produce_glyphs, x_insert_glyphs)
9052 (rows_from_pos_range, mouse_face_from_buffer_pos)
9053 (fast_find_string_pos, mouse_face_from_string_pos)
9054 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9055 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9056 (safe_call, init_from_display_pos, handle_fontified_prop)
9057 (handle_single_display_spec, load_overlay_strings)
9058 (with_echo_area_buffer, setup_echo_area_for_printing)
9059 (display_echo_area, echo_area_display)
9060 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9061 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9062 (redisplay_window, dump_glyph_row, display_mode_line)
9063 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9064 (handle_display_spec, display_prop_string_p):
9065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9066 (handle_single_display_spec, build_desired_tool_bar_string)
9067 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9068 (get_specified_cursor_type):
9069 Check that fixnums are in proper range for system types.
9070 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9071 (Flookup_image_map):
9072 Don't assume fixnums fit in int.
9073 (compare_overlay_entries):
9074 Avoid mishandling comparisons due to subtraction overflow.
9075 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9076 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9077 (handle_tool_bar_click):
9078 Use int, not unsigned, since we prefer signed and the signedness
9079 doesn't matter here.
9080 (get_next_display_element, next_element_from_display_vector):
9081 Use int, not EMACS_INT, when int is wide enough.
9082 (start_hourglass): Use duration_to_sec_usec to do proper
9083 overflow checking on durations.
9084 * xfaces.c (Fbitmap_spec_p):
9085 Check that fixnums are in proper range for system types.
9086 (compare_fonts_by_sort_order):
9087 Avoid mishandling comparisons due to subtraction overflow.
9088 (Fx_family_fonts, realize_basic_faces):
9089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9090 (Fx_family_fonts):
9091 Don't assume fixnum fits in int.
9092 Use SAFE_ALLOCA_LISP, not alloca.
9093 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9094 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9095 (face_at_buffer_position, face_for_overlay_string)
9096 (face_at_string_position):
9097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9098 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9099 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9100 (Fx_show_tip):
9101 Check that fixnums are in proper range for system types.
9102 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9103 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9105 (Fx_change_window_property): Don't assume fixnums fit in int.
9106 * xfont.c (xfont_chars_supported):
9107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9108 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9109 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9111 * xml.c (parse_region):
9112 * xrdb.c (magic_file_p):
9113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9114 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9115 (x_get_local_selection, x_reply_selection_request)
9116 (x_handle_selection_request, wait_for_property_change):
9117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9118 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9119 short is wide enough.
9120 (x_send_client_event): Don't assume fixnum fits in int.
9121 * xterm.c (x_x_to_emacs_modifiers):
9122 Don't assume EMACS_INT overflows nicely into int.
9123 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9124 may come from Lisp.
9125 (handle_one_xevent): NATNUMP can eval its arg twice.
9126 (x_connection_closed):
9127 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9128 * xterm.h: Adjust decls to match defn changes elsewhere.
9129 (struct scroll_bar): Use struct vectorlike_header
9130 rather than rolling our own approximation.
9131 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9132
9133 2012-05-25 Glenn Morris <rgm@gnu.org>
9134
9135 * lisp.mk (lisp): Update for more files being compiled now.
9136
9137 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9138
9139 * lread.c: Remove `read_pure' which makes no difference.
9140 (read_pure): Remove var.
9141 (unreadpure): Remove function.
9142 (readevalloop): Don't call read_list with -1 flag.
9143 (read1, read_vector): Don't test read_pure any more.
9144 (read_list): Simplify.
9145
9146 * fileio.c, character.h: Minor style tweaks.
9147
9148 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9149
9150 * window.h (clip_changed): Remove useless declaration.
9151
9152 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9153
9154 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9155 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9156
9157 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 Remove src/m/*.
9160 This directory predates autoconf and is no longer needed nowadays.
9161 Move its few remaining bits of functionality to where they're needed.
9162 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9163 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9164 * m/template.h: Remove.
9165 * Makefile.in (M_FILE): Remove. All uses removed.
9166 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9167 * lisp.h (USE_LSB_TAG):
9168 * mem-limits.h (EXCEEDS_LISP_PTR):
9169 Use VAL_MAX, not VALBITS, in #if.
9170 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9171 (EMACS_UINT): Define unconditionally now.
9172 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9173 (BITS_PER_EMACS_INT): New constants, replacing
9174 what used to be in config.h, but not useful in #if.
9175 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9176 define them any more.
9177 (VAL_MAX): New macro.
9178 (VALMASK): Use it.
9179 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9180 BITS_PER_EMACS_INT, in #if.
9181 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9182 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9183 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9184 * s/ms-w32.h (DATA_START):
9185 Move here from removed file m/intel386.h.
9186 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9187 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9188
9189 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9190
9191 Assume C89 or later.
9192 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9193 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9194 (xrealloc):
9195 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9196 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9197 * textprop.c, tparam.c (NULL): Remove.
9198 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9199 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9200 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9201 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9202 * xterm.c (input_signal_count): Assume volatile works.
9203
9204 2012-05-21 Ken Brown <kbrown@cornell.edu>
9205
9206 * xgselect.c (xg_select): Fix first argument in call to 'select'
9207 (bug#11508).
9208
9209 2012-05-20 Ken Brown <kbrown@cornell.edu>
9210
9211 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9212 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9213
9214 2012-05-19 Ken Brown <kbrown@cornell.edu>
9215
9216 * xfns.c (x_in_use): Remove `static' qualifier.
9217 * xterm.h (x_in_use): Declare.
9218 * xgselect.c: Include xterm.h.
9219 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9220 and `display_arg' (bug#9754).
9221
9222 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9223
9224 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9225
9226 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9227 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9228
9229 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9230
9231 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9232
9233 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9234 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9235
9236 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9237 reference to image_cache->refcount.
9238 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9239
9240 2012-05-17 Juri Linkov <juri@jurta.org>
9241
9242 * search.c (Fword_search_regexp, Fword_search_backward)
9243 (Fword_search_forward, Fword_search_backward_lax)
9244 (Fword_search_forward_lax): Move functions to isearch.el
9245 (bug#10145, bug#11381).
9246
9247 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9248
9249 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9250
9251 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9252
9253 * lread.c (init_obarray): Declare Qt and Qnil as special.
9254
9255 2012-05-14 Glenn Morris <rgm@gnu.org>
9256
9257 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9258 Put "libexec" before "bin", for the sake of init_callproc_1.
9259
9260 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9263
9264 * unexaix.c: Port to more-recent AIX compilers.
9265 (report_error, report_error_1, make_hdr, copy_sym)
9266 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9267 Make arguments const char *, not char *, to avoid violations of C
9268 standard and to fix some AIX warnings reported by Gilles Pion.
9269
9270 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9271
9272 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9273 already have overlays loaded.
9274 (handle_single_display_spec): Before returning without displaying
9275 fringe bitmap, synchronize the bidi iterator with the main display
9276 iterator, by calling iterate_out_of_display_property.
9277 (iterate_out_of_display_property): Detect buffer iteration by
9278 testing that it->string is a Lisp string.
9279 (get_next_display_element): When the current object is exhausted,
9280 and there's something on it->stack, call set_iterator_to_next to
9281 proceed with what's on the stack, instead of returning zero.
9282 (set_iterator_to_next): If called at the end of a Lisp string,
9283 proceed to consider_string_end without incrementing string
9284 position. Don't increment display vector index past the end of
9285 the display vector. (Bug#11417)
9286 (pos_visible_p): Don't report a position visible when move_it_to
9287 stopped at the last line of window, which happens to be scanned
9288 backwards by the bidi iteration. (Bug#11464)
9289
9290 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9291
9292 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9293 and right-margin display specs even if the spec is invalid or we
9294 are on a TTY, and thus unable to display on the fringes.
9295 That's because the text with the property will not be displayed anyway,
9296 so we need to signal to the caller that this is a "replacing"
9297 display spec. This fixes display when the spec is invalid or we
9298 are on a TTY.
9299
9300 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9301
9302 * unexaix.c (make_hdr): Fix typo in prototype.
9303 This bug broke the build on AIX. Problem reported by Gilles Pion.
9304
9305 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9306
9307 * keyboard.c (kbd_buffer_get_event): Read special events also in
9308 batch mode. (Bug#11415)
9309
9310 2012-05-12 Glenn Morris <rgm@gnu.org>
9311
9312 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9313
9314 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9315
9316 * lisp.mk (lisp): Add newcomment.elc.
9317
9318 2012-05-12 Glenn Morris <rgm@gnu.org>
9319
9320 * Makefile.in (MKDIR_P): New, set by configure.
9321 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9322
9323 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9324
9325 Remove unused function hourglass_started.
9326 * dispextern.h (hourglass_started):
9327 * w32fns.c (hourglass_started):
9328 * xdisp.c (hourglass_started): Remove.
9329
9330 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9331
9332 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9333 Update dependencies.
9334
9335 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9336
9337 * xgselect.c (xg_select): Put maxfds+1 into a var.
9338 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9339
9340 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9341
9342 2012-05-10 Dave Abrahams <dave@boostpro.com>
9343
9344 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9345 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9346
9347 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9348
9349 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9350 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9351 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9352 Initialize xd_registered_buses.
9353
9354 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 Untag more efficiently if USE_LSB_TAG.
9357 This is based on a proposal by YAMAMOTO Mitsuharu in
9358 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9359 For an admittedly artificial (nth 8000 longlist) benchmark on
9360 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9361 Emacs's overall text size by 1%.
9362 * lisp.h (XUNTAG): New macro.
9363 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9364 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9365 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9366 * eval.c (Fautoload):
9367 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9368 * frame.h (XFRAME): Use XUNTAG.
9369
9370 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9371 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9372 Remove unportable assumptions about print widths of types like
9373 dbus_uint32_t.
9374 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9375 intptr_t when converting between pointer and integer, to avoid GCC
9376 warnings about wrong width.
9377
9378 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9379
9380 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9381 stack for each reader_thread, instead of defaulting to 8MB
9382 determined by the linker. This avoids failures in creating
9383 subprocesses on Windows 7, see the discussion in this thread:
9384 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9385
9386 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9387
9388 Fix up display of the *Minibuf-0* buffer in the mini window.
9389 * keyboard.c (read_char): Don't clear the echo area if there's no
9390 message to clear.
9391 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9392 contents of *Minibuf-0*) if there's no message displayed in its stead.
9393
9394 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9395
9396 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9397 batch mode.
9398
9399 2012-05-06 Chong Yidong <cyd@gnu.org>
9400
9401 * lisp.mk (lisp): Update.
9402
9403 2012-05-05 Jim Meyering <meyering@redhat.com>
9404
9405 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9406
9407 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9408
9409 * data.c (PUT_ERROR): New macro.
9410 (syms_of_data): Use it. Add new error type `user-error'.
9411 * undo.c (user_error): New function.
9412 (Fprimitive_undo): Use it.
9413 * print.c (print_error_message): Adjust print style for `user-error'.
9414 * keyboard.c (user_error): New function.
9415 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9416
9417 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9418
9419 Do not limit current-time-string to years 1000..9999.
9420 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9421 (Fcurrent_time_string): Support any year that is supported by the
9422 underlying localtime representation. Don't use asctime, as it
9423 has undefined behavior for years outside the range -999..9999.
9424
9425 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9426
9427 Fix race conditions involving setenv, gmtime, localtime, asctime.
9428 Without this fix, interrupts could mess up code that uses these
9429 nonreentrant functions, since setting TZ invalidates existing
9430 tm_zone or tzname values, and since most of these functions return
9431 pointers to static storage.
9432 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9433 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9434 Grow the critical sections to include not just invoking
9435 localtime/gmtime, but also accessing these functions' results
9436 including their tm_zone values if any, and any related TZ setting.
9437 (format_time_string): Last arg is now struct tm *, not struct tm **,
9438 so that the struct tm is saved in the critical section.
9439 All callers changed. Simplify allocation of initial buffer, partly
9440 motivated by the fact that memory allocation needs to be outside
9441 the critical section.
9442
9443 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9444
9445 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9446 with RESET_INTERVAL.
9447
9448 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9449 Remove duplicated buffer name initialization.
9450
9451 2012-05-02 Jim Meyering <jim@meyering.net>
9452
9453 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9454
9455 * xfns.c (x_window): Use xstrdup (Bug#11375).
9456
9457 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9458
9459 * xdisp.c (pos_visible_p): If already at a newline from the
9460 display string before the 'while' loop, don't walk back the glyphs
9461 from it3.glyph_row. Solves assertion violation when the display
9462 string begins with a newline (egg.el). (Bug#11367)
9463
9464 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9465
9466 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9467 Move to simple.el.
9468
9469 2012-05-01 Glenn Morris <rgm@gnu.org>
9470
9471 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9472 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9473 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9474 All were removed before 23.1.
9475
9476 * dispnew.c: Remove HAVE_LIBNCURSES test;
9477 it is always true on relevant platforms.
9478
9479 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9480 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9481
9482 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9483
9484 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9485
9486 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9487 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9488 Remove.
9489
9490 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9491
9492 Do not avoid creating empty evaporating overlays (Bug#9642).
9493 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9494 That is, do not delete an evaporating overlay if it becomes
9495 empty after its bounds are adjusted to fit within its buffer.
9496 This fix caused other problems, and I'm reverting it until we get
9497 to the bottom of them.
9498
9499 2012-04-27 Chong Yidong <cyd@gnu.org>
9500
9501 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9502
9503 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9504
9505 * xdisp.c (pos_visible_p): If the window start position is beyond
9506 ZV, start the display from buffer beginning. Prevents assertion
9507 violation in init_iterator when the minibuffer window is scrolled
9508 via the scroll bar.
9509
9510 * window.c (window_scroll_pixel_based): Likewise.
9511
9512 2012-04-27 Chong Yidong <cyd@gnu.org>
9513
9514 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9515
9516 2012-04-27 Glenn Morris <rgm@gnu.org>
9517
9518 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9519 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9520
9521 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9522
9523 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9524 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9525
9526 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9527
9528 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9529 display element, check also the underlying string or buffer
9530 character. (Bug#11341)
9531
9532 * w32menu.c: Include w32heap.h.
9533 (add_menu_item): If the call to AppendMenuW (via
9534 unicode_append_menu) fails, disable Unicode menus only if we are
9535 running on Windows 9X/Me.
9536
9537 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9538
9539 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9540 (xgetint): Add missing shift for LSB tags.
9541
9542 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9543
9544 * keyboard.c (read_char): Don't wipe echo area for select window
9545 events: These might get delayed via `mouse-autoselect-window'
9546 (Bug#11304).
9547
9548 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9549
9550 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9551 manipulation of :loaded-from data.
9552
9553 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9554
9555 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9556 now a cons (bug#11311).
9557
9558 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9559
9560 Do not create empty overlays with the evaporate property (Bug#9642).
9561 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9562 if it becomes empty after its bounds are adjusted to fit within
9563 its buffer. Without this fix, in a nonempty buffer (let ((o
9564 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9565 yields an empty overlay that has the evaporate property, which is
9566 not supposed to happen.
9567
9568 Fix minor GTK3 problems found by static checking.
9569 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9570 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9571 (struct _EmacsFixedClass, emacs_fixed_get_type):
9572 Move decls here from emacsgtkfixed.h, since they needn't be public.
9573 (emacs_fixed_get_type): Now static.
9574 (emacs_fixed_class_init): Omit unused local.
9575 (emacs_fixed_child_type): Remove; unused.
9576 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9577 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9578 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9579 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9580 (EMACS_FIXED_GET_CLASS): Remove; unused.
9581 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9582
9583 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9584 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9585
9586 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9587
9588 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9589 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9590 (__malloc_size_t, __malloc_ptrdiff_t):
9591 Remove. All uses removed, replaced by the definiens if needed,
9592 since we can assume C89 or better now.
9593 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9594 (protect_malloc_state, align, get_contiguous_space)
9595 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9596 (malloc_atfork_handler_child, malloc_enable_thread)
9597 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9598 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9599 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9600 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9601 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9602 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9603 Define using prototypes, not old style.
9604 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9605 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9606 (align): Don't assume that signed integer overflow wraps around.
9607 Omit unused local var.
9608 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9609 (_free_internal_nolock, memalign, mallochook, reallochook):
9610 Omit no-longer-needed casts.
9611 (valloc): Use getpagesize, not __getpagesize.
9612 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9613 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9614
9615 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9616
9617 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9618
9619 Move functions from C to Lisp. Make non-blocking method calls
9620 the default. Implement further D-Bus standard interfaces.
9621
9622 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9623 (QCdbus_request_name_allow_replacement)
9624 (QCdbus_request_name_replace_existing)
9625 (QCdbus_request_name_do_not_queue)
9626 (QCdbus_request_name_reply_primary_owner)
9627 (QCdbus_request_name_reply_in_queue)
9628 (QCdbus_request_name_reply_exists)
9629 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9630 (QCdbus_registered_serial, QCdbus_registered_method)
9631 (QCdbus_registered_signal): New Lisp objects.
9632 (XD_DEBUG_MESSAGE): Use sizeof.
9633 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9634 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9635 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9636 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9637 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9638 (xd_signature, xd_append_arg): Allow float for integer types.
9639 (xd_get_connection_references): New function.
9640 (xd_get_connection_address): Rename from xd_initialize.
9641 Return cached address.
9642 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9643 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9644 level.
9645 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9646 Return number of refcounts.
9647 (Fdbus_get_unique_name): Make stronger parameter check.
9648 (Fdbus_message_internal): New defun.
9649 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9650 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9651 (Fdbus_send_signal, Fdbus_register_service)
9652 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9653 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9654 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9655 (Vdbus_compiled_version, Vdbus_runtime_version)
9656 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9657 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9658 (Vdbus_message_type_signal): New defvars.
9659 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9660 Adapt docstring.
9661
9662 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9665 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9666 Do not assume ptrdiff_t is the same width as 'int'.
9667
9668 * alloc.c: Handle unusual debugging option combinations.
9669 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9670 since the two debugging options are incompatible.
9671 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9672 is defined.
9673 (mem_init, mem_insert, mem_insert_fixup):
9674 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9675 (NEED_MEM_INSERT): Remove; no longer needed.
9676
9677 2012-04-22 Leo Liu <sdl.web@gmail.com>
9678
9679 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9680
9681 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * sysdep.c [__FreeBSD__]: Minor cleanups.
9684 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9685 Use Emacs indenting style more consistently. Avoid some casts.
9686 Use 'double' consistently rather than mixing 'float' and 'double'.
9687
9688 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9689
9690 * sysdep.c (list_system_processes, system_process_attributes):
9691 Add implementation for FreeBSD (Bug#5243).
9692
9693 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9694
9695 * lisp.mk (lisp): Update.
9696
9697 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9698
9699 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9700 It is never used otherwise.
9701
9702 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9703
9704 * print.c (print_preprocess): Only check print_depth if print-circle
9705 is nil.
9706 (print_object): Check for cycles even when print-circle is nil and
9707 print-gensym is t, but only check print_depth if print-circle is nil.
9708
9709 2012-04-20 Chong Yidong <cyd@gnu.org>
9710
9711 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9712 set the status to "failed" and ensure that sentinel is run.
9713
9714 2012-04-20 Glenn Morris <rgm@gnu.org>
9715
9716 * process.c (Fset_process_inherit_coding_system_flag)
9717 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9718 (Fmake_network_process, Fmake_serial_process): Doc fix.
9719
9720 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9721
9722 * xdisp.c (string_buffer_position_lim): Limit starting position to
9723 BEGV.
9724 (set_cursor_from_row): If called for a mode-line or header-line
9725 row, return zero immediately.
9726 (try_cursor_movement): If inside continuation line, don't back up
9727 farther than the first row after the header line, if any.
9728 Don't consider the header-line row as "partially visible", even if
9729 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9730
9731 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9732
9733 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9734 (bug#11238).
9735
9736 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9737 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9738
9739 configure: new option --enable-gcc-warnings (Bug#11207)
9740 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9741 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9742 (ALL_CFLAGS): Use new macros rather than old.
9743 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9744 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9745 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9746 -Wunused-result, -Wunused-variable. This should go away once
9747 the Emacs and Gnulib regex code is merged.
9748 (xmalloc, xrealloc): Now static.
9749
9750 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 * dired.c (Fsystem_groups): Remove unused local.
9753
9754 2012-04-17 Glenn Morris <rgm@gnu.org>
9755
9756 * dired.c (Fsystem_users): Doc fix.
9757
9758 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9759
9760 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9761 (syms_of_dired): Add them.
9762
9763 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9764
9765 Fix minor alloc.c problems found by static checking.
9766 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9767 New extern decls, to avoid calling undeclared functions.
9768 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9769 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9770 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9771 (NEED_MEM_INSERT): New macro.
9772 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9773 Remove one incorrect comment and fix another.
9774
9775 Fix minor ralloc.c problems found by static checking.
9776 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9777 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9778 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9779 (r_alloc_sbrk): Now static.
9780
9781 Improve ralloc.c interface checking.
9782 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9783 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9784 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9785 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9786 [REL_ALLOC]: ... to here, to check interface.
9787 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9788 Remove decls. This fixes an "It stinks!".
9789
9790 * alloc.c (which_symbols): Fix alignment issue / type clash.
9791
9792 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9793
9794 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9795 (struct Lisp_Misc_Any): Likewise.
9796 (struct Lisp_Free): Likewise.
9797 * alloc.c (union aligned_Lisp_Symbol): Define.
9798 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9799 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9800 (union aligned_Lisp_Misc): Define.
9801 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9802 aligned_Lisp_Misc instead of union Lisp_Misc.
9803 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9804
9805 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9806
9807 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9808 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9809 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9810 * s/netbsd.h, s/sol2-6.h:
9811 Remove definition of GC_MARK_STACK, since the default now works.
9812 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9813 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9814 no longer the default.
9815 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9816
9817 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9818
9819 * lread.c (lisp_file_lexically_bound_p):
9820 Fix hang at ";-*-\n" (bug#11238).
9821
9822 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9823
9824 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9825 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9826
9827 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9828
9829 * nsterm.m (constrainFrameRect): Always constrain when there is only
9830 one screen (Bug#10962).
9831
9832 2012-04-13 Ken Brown <kbrown@cornell.edu>
9833
9834 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9835
9836 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9837
9838 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9839
9840 2012-04-11 Daniel Colascione <dancol@dancol.org>
9841
9842 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9843 against is gone. It's better to use vfork now so that when Cygwin
9844 gains a new, working vfork, we use it automatically (bug#10398).
9845
9846 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9847
9848 * window.c (save_window_save): Obey window-point-insertion-type.
9849
9850 2012-04-11 Glenn Morris <rgm@gnu.org>
9851
9852 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9853
9854 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9855
9856 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9857
9858 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9859
9860 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9861 (force_quit_count): New var.
9862 (handle_interrupt): Use it.
9863
9864 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9865
9866 * w32.c (w32_delayed_load): Record the full path of the library
9867 being loaded (bug#10424).
9868
9869 2012-04-09 Glenn Morris <rgm@gnu.org>
9870
9871 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9872 not just in the obarray, before snarfing them. (Bug#11036)
9873
9874 * Makefile.in ($(leimdir)/leim-list.el):
9875 Pass EMACS rather than BUILT_EMACS.
9876
9877 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9878
9879 * process.c (make_process):
9880 * process.h: Add integer `gnutls_handshakes_tried' member to
9881 process struct.
9882
9883 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9884 Add convenience `GNUTLS_LOG2i' macro.
9885
9886 * gnutls.c (gnutls_log_function2i): Convenience log function.
9887 (emacs_gnutls_read): Use new log functions,
9888 `gnutls_handshakes_tried' process member, and
9889 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9890 attempts per process (connection).
9891
9892 2012-04-09 Chong Yidong <cyd@gnu.org>
9893
9894 * eval.c (Fuser_variable_p, user_variable_p_eh)
9895 (lisp_indirect_variable): Functions deleted.
9896 (Fdefvar): Caller changed.
9897
9898 * callint.c (Finteractive, Fcall_interactively):
9899 * minibuf.c (Fread_variable): Callers changed.
9900
9901 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9902
9903 * xdisp.c (set_cursor_from_row): If the display string appears in
9904 the buffer at position that is closer to point than the position
9905 after the display string, display the cursor on the first glyph of
9906 the display string. Fixes cursor display when a 'display' text
9907 property immediately follows invisible text. (Bug#11094)
9908
9909 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 composite.c: use 'double' consistently
9912 * composite.c (get_composition_id): Use 'double' consistently
9913 instead of converting 'float' to 'double' and vice versa; this is
9914 easier to understand and avoids a GCC warning.
9915
9916 2012-04-09 Glenn Morris <rgm@gnu.org>
9917
9918 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9919 preparation for dumping it with emacs. (Bug#4789)
9920 (leimdir): New variable.
9921 ($(leimdir)/leim-list.el): New rule.
9922 (emacs$(EXEEXT)): Depend on leim-list.el.
9923
9924 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9925 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9926 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9927
9928 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9929
9930 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9931 proper alignment.
9932
9933 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9934
9935 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9936 Remove unused local variable.
9937
9938 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9939
9940 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9941 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9942 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9943 objects, as mark_maybe_pointer will catch them otherwise.
9944 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9945 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9946
9947 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9948
9949 Fix typo that broke non-Windows builds.
9950 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9951
9952 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9953
9954 Support building on MS-Windows with libxml2.
9955
9956 * makefile.w32-in (OBJ2): Add xml.$(O).
9957 (GLOBAL_SOURCES): Add xml.c.
9958 ($(BLD)/xml.$(O)): New dependency list.
9959
9960 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9961 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9962 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9963 [!WINDOWSNT]: New macros.
9964 (init_libxml2_functions, libxml2_loaded_p): New functions.
9965 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9966 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9967 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9968 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9969 linked in).
9970 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9971 Call init_libxml2_functions before calling libxml2 functions.
9972 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9973
9974 * emacs.c: Don't include libxml/parser.h.
9975 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9976 xmlCleanupParser directly.
9977
9978 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9979
9980 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9981
9982 * indent.c (Fvertical_motion): If there is a display string at
9983 point, use it.vpos to compute how many lines to backtrack after
9984 move_it_to point. (Bug#11133)
9985
9986 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9987
9988 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9989 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9990 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9991 macros related to unification of CJK characters. For the details,
9992 see the discussion following the message here:
9993 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9994
9995 2012-04-04 Chong Yidong <cyd@gnu.org>
9996
9997 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9998
9999 2012-04-01 Eli Zaretskii <eliz@gnu.org>
10000
10001 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10002 instead of alloca. (Bug#11138)
10003
10004 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10005
10006 * w32menu.c (is_simple_dialog): Properly check lisp types.
10007 (Bug#11141)
10008
10009 2012-03-31 Eli Zaretskii <eliz@gnu.org>
10010
10011 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10012 position we get to after a call to move_it_to fails the
10013 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10014 only if we wind up in a string from display property. (Bug#11063)
10015
10016 * window.c (Fdelete_other_windows_internal): Invalidate the row
10017 and column information about mouse highlight, so that redisplay
10018 restores it after reallocating the glyph matrices. (Bug#7464)
10019
10020 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10021 string comes from a `display' text property, use the buffer
10022 position of that property as if we actually saw that position in
10023 the row's glyphs.
10024 (move_it_by_lines): Remove the assertion that
10025 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10026 violated when there's a before-string at the beginning of a line.
10027 (Bug#11063)
10028
10029 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10030
10031 * xdisp.c (append_space_for_newline): If the default face was
10032 remapped, use the remapped face for the appended newline.
10033 (extend_face_to_end_of_line): Use the remapped default face for
10034 extending the face to the end of the line.
10035 (display_line): Call extend_face_to_end_of_line when the default
10036 face was remapped. (Bug#11068)
10037
10038 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10039
10040 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10041
10042 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10043
10044 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10045
10046 2012-03-27 Glenn Morris <rgm@gnu.org>
10047
10048 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10049 Doc fixes.
10050
10051 2012-03-26 Kenichi Handa <handa@m17n.org>
10052
10053 * dispextern.h (struct glyph): Fix previous change. Change the
10054 bit length of glyphless.ch to 25 (Bug#11082).
10055
10056 2012-03-26 Chong Yidong <cyd@gnu.org>
10057
10058 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10059 (command_loop_1): Use it; inhibit selection update for
10060 handle-select-window too (Bug#8996).
10061
10062 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10063
10064 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10065
10066 2012-03-25 Kenichi Handa <handa@m17n.org>
10067
10068 * dispextern.h (struct glyph): Change the bit length of
10069 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10070
10071 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10072
10073 * s/ms-w32.h (tzname): Include time.h before redirecting to
10074 _tzname. Fixes the MSVC build. (Bug#9960)
10075
10076 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10077
10078 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10079 characters.
10080
10081 * xterm.c (XTread_socket): Only modify handling_signal if
10082 !SYNC_INPUT. (Bug#11080)
10083
10084 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10085
10086 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10087 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10088 when fetching a multibyte character consumes more bytes than
10089 CHAR_BYTES returns, due to unification of CJK characters in
10090 string_char. (Bug#11073)
10091
10092 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10093
10094 * process.c (wait_reading_process_output): Handle pty disconnect
10095 by refraining from sending oneself a SIGCHLD (bug#10933).
10096
10097 2012-03-22 Chong Yidong <cyd@gnu.org>
10098
10099 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10100
10101 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10102 Mark string as coming from a prefix property.
10103 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10104 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10105
10106 2012-03-21 Chong Yidong <cyd@gnu.org>
10107
10108 * xfaces.c (Vface_remapping_alist): Doc fix.
10109
10110 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10111
10112 * w32proc.c (Fw32_set_console_codepage)
10113 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10114 Doc fixes.
10115
10116 2012-03-20 Chong Yidong <cyd@gnu.org>
10117
10118 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10119 to reflect default non-nil value of redisplay-dont-pause.
10120
10121 2012-03-19 Kenichi Handa <handa@m17n.org>
10122
10123 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10124 it fit in a valid range (Bug#11003).
10125
10126 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10127
10128 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10129 that is not from display property, accept the row as a "cursor
10130 row" if one of the string's character has a non-nil `cursor'
10131 property. Fixes cursor positioning when there are newlines in
10132 overlay strings, e.g. in icomplete.el. (Bug#11035)
10133
10134 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10135
10136 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10137
10138 2012-03-12 Chong Yidong <cyd@gnu.org>
10139
10140 * eval.c (inhibit_lisp_code): Rename from
10141 inhibit_window_configuration_change_hook; move from window.c.
10142
10143 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10144 * window.c (run_window_configuration_change_hook)
10145 (syms_of_window): Callers changed.
10146
10147 2012-03-11 Chong Yidong <cyd@gnu.org>
10148
10149 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10150
10151 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10152
10153 2012-03-10 Chong Yidong <cyd@gnu.org>
10154
10155 * frame.c (other_visible_frames): Don't assume the selected frame
10156 is visible (Bug#10955).
10157
10158 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10159
10160 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10161
10162 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10163
10164 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10165 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10166 zero (Bug#10954).
10167
10168 2012-03-03 Glenn Morris <rgm@gnu.org>
10169
10170 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10171
10172 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10173
10174 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10175 position past the first glyph_row that ends at ZV. (Bug#10902)
10176 (redisplay_window, next_element_from_string): Fix typos in
10177 comments.
10178 (redisplay_window): Pass to move_it_vertically the margin in
10179 pixels, not in screen lines.
10180
10181 2012-03-02 Glenn Morris <rgm@gnu.org>
10182
10183 * buffer.c (buffer-list-update-hook): Doc fix.
10184
10185 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10186
10187 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10188 push_it before setting up the iterator for the first overlay
10189 string, even if we have an empty string loaded.
10190 (next_overlay_string): If there's an empty string on the iterator
10191 stack, pop the stack. (Bug#10903)
10192
10193 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10194
10195 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10196 Suggested by Stefan Monnier in
10197 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10198 * alloc.c (widen_to_Lisp_Object): New static function.
10199 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10200 and widening them to Lisp_Objects. This would work even if
10201 USE_LSB_TAG is defined and wide integers are used, which might
10202 happen in a future version of Emacs.
10203
10204 2012-02-25 Chong Yidong <cyd@gnu.org>
10205
10206 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10207 Doc fix.
10208
10209 * xselect.c (Fx_selection_exists_p): Doc fix.
10210 (x_clipboard_manager_save_all): Print an informative message
10211 before saving to clipboard manager.
10212
10213 2012-02-24 Chong Yidong <cyd@gnu.org>
10214
10215 * keyboard.c (process_special_events): Handle all X selection
10216 requests in kbd_buffer, not just the next one (Bug#8869).
10217
10218 2012-02-23 Chong Yidong <cyd@gnu.org>
10219
10220 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10221 call when setting menu-bar-lines and tool-bar-lines parameters.
10222 (unwind_create_frame_1): New helper function.
10223
10224 * window.c (inhibit_window_configuration_change_hook): New var.
10225 (run_window_configuration_change_hook): Obey it.
10226 (syms_of_window): Initialize it.
10227
10228 2012-02-22 Chong Yidong <cyd@gnu.org>
10229
10230 * xterm.c (x_draw_image_relief): Add missing type check for
10231 Vtool_bar_button_margin (Bug#10743).
10232
10233 2012-02-21 Chong Yidong <cyd@gnu.org>
10234
10235 * fileio.c (Vfile_name_handler_alist): Doc fix.
10236
10237 * buffer.c (Fget_file_buffer): Protect against invalid file
10238 handler return value.
10239
10240 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10241
10242 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10243 when computing $valmask.
10244
10245 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10246 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10247 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10248 It's useless in that case, and it can cause problems on hosts
10249 that allocate halves of EMACS_INT values separately.
10250 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10251 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10252 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10253 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10254 it avoids undefined behavior on hosts where shifting right by more
10255 than the word width has undefined behavior.
10256
10257 2012-02-19 Chong Yidong <cyd@gnu.org>
10258
10259 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10260 (Funhandled_file_name_directory, Ffile_name_as_directory)
10261 (Fdirectory_file_name, Fexpand_file_name)
10262 (Fsubstitute_in_file_name): Protect against invalid file handler
10263 return values (Bug#10845).
10264
10265 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10266
10267 * .gdbinit (pitx): Fix incorrect references to fields of the
10268 iterator stack.
10269
10270 2012-02-17 Chong Yidong <cyd@gnu.org>
10271
10272 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10273
10274 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10275
10276 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10277 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10278
10279 2012-02-15 Chong Yidong <cyd@gnu.org>
10280
10281 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10282 marked as special. Also, starting docstrings with * is obsolete.
10283
10284 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10285
10286 * gnutls.c (emacs_gnutls_write): Fix last change.
10287
10288 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10289
10290 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10291 send_process.
10292
10293 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10294
10295 * keymap.c (Fsingle_key_description): Handle char ranges.
10296
10297 2012-02-12 Chong Yidong <cyd@gnu.org>
10298
10299 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10300 as that creates a dangerous corner case.
10301
10302 * window.c (Fdelete_window_internal): Invalidate the mouse
10303 highlight (Bug#9904).
10304
10305 2012-02-12 Glenn Morris <rgm@gnu.org>
10306
10307 * xselect.c (Fx_own_selection_internal)
10308 (Fx_get_selection_internal, Fx_disown_selection_internal)
10309 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10310 * nsselect.m (Fx_own_selection_internal)
10311 (Fx_disown_selection_internal, Fx_selection_exists_p)
10312 (Fx_selection_owner_p, Fx_get_selection_internal):
10313 Sync docs and argument specs with the xselect.c versions.
10314
10315 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10316
10317 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10318
10319 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10320
10321 * w32select.c (Fx_selection_exists_p): Sync doc string and
10322 argument list with xselect.c. (Bug#10783)
10323
10324 * w16select.c (Fx_selection_exists_p): Sync doc string and
10325 argument list with xselect.c. (Bug#10783)
10326
10327 2012-02-10 Glenn Morris <rgm@gnu.org>
10328
10329 * fns.c (Fsecure_hash): Doc fix.
10330
10331 2012-02-09 Kenichi Handa <handa@m17n.org>
10332
10333 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10334
10335 2012-02-07 Chong Yidong <cyd@gnu.org>
10336
10337 * buffer.c (Fbuffer_local_variables)
10338 (buffer_lisp_local_variables): Handle unbound vars correctly;
10339 don't let Qunbound leak into Lisp.
10340
10341 2012-02-07 Glenn Morris <rgm@gnu.org>
10342
10343 * image.c (Fimagemagick_types): Doc fix.
10344
10345 * image.c (imagemagick-render-type): Change it from a lisp object
10346 to an integer. Move the doc here from the lisp manual.
10347 Treat all values not equal to 0 the same.
10348
10349 2012-02-06 Chong Yidong <cyd@gnu.org>
10350
10351 * doc.c (store_function_docstring): Avoid applying docstring of
10352 alias to base function (Bug#2603).
10353
10354 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10355
10356 * .gdbinit (pp1, pv1): Remove redundant defines.
10357 (pr): Use pp.
10358
10359 2012-02-04 Chong Yidong <cyd@gnu.org>
10360
10361 * nsterm.m: Declare a global (Bug#10694).
10362
10363 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10364
10365 * w32.c (get_emacs_configuration_options):
10366 Include --enable-checking, if specified, in the return value.
10367
10368 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10369
10370 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10371 after rounding frame sizes. (Bug#9723)
10372
10373 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10374
10375 * keyboard.c (adjust_point_for_property): Don't position point
10376 before BEGV. (Bug#10696)
10377
10378 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10379
10380 Handle overflow when computing char display width (Bug#9496).
10381 * character.c (char_width): Return EMACS_INT, not int.
10382 (char_width, c_string_width): Check for overflow when
10383 computing the width; this is possible now that individual
10384 characters can have unbounded width. Problem introduced
10385 by merge from Emacs 23 on 2012-01-19.
10386
10387 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10388
10389 * dbusbind.c (Fdbus_register_method): Mention the return value
10390 :ignore in the docstring.
10391
10392 2012-02-02 Glenn Morris <rgm@gnu.org>
10393
10394 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10395
10396 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10397 Unconditionally set to t. (Bug#10673)
10398 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10399 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10400 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10401
10402 2012-02-02 Kenichi Handa <handa@m17n.org>
10403
10404 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10405 0, do not call append_composite_glyph.
10406
10407 2012-02-02 Kenichi Handa <handa@m17n.org>
10408
10409 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10410 NULL (Bug#6988).
10411 (x_produce_glyphs): If the component of a composition is a null
10412 string, set it->pixel_width to 1 to avoid zero-width glyph.
10413
10414 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10415
10416 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10417 first 2 arguments are identical. This makes inserting large
10418 output from a subprocess an order of magnitude faster on
10419 MS-Windows, where all sbrk'ed memory is always contiguous.
10420
10421 2012-01-31 Glenn Morris <rgm@gnu.org>
10422
10423 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10424 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10425 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10426
10427 2012-01-29 Glenn Morris <rgm@gnu.org>
10428
10429 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10430
10431 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10432
10433 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10434
10435 2012-01-28 Chong Yidong <cyd@gnu.org>
10436
10437 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10438
10439 2012-01-26 Chong Yidong <cyd@gnu.org>
10440
10441 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10442
10443 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10444 repeat counts (Bug#10507).
10445
10446 2012-01-26 Glenn Morris <rgm@gnu.org>
10447
10448 * lread.c (syms_of_lread): Doc fix.
10449
10450 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10451
10452 * coding.c (encode_designation_at_bol): Change return value to
10453 EMACS_INT.
10454
10455 2012-01-25 Chong Yidong <cyd@gnu.org>
10456
10457 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10458
10459 2012-01-21 Chong Yidong <cyd@gnu.org>
10460
10461 * floatfns.c (Fcopysign): Make the second argument non-optional,
10462 since nil is not allowed anyway.
10463
10464 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10465
10466 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10467 (send_process): Likewise.
10468
10469 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10470
10471 * window.c (save_window_save, Fcurrent_window_configuration)
10472 (Vwindow_persistent_parameters): Do not use Qstate.
10473 Rewrite doc-strings.
10474
10475 2012-01-19 Kenichi Handa <handa@m17n.org>
10476
10477 * character.c (char_width): New function.
10478 (Fchar_width, c_string_width, lisp_string_width):
10479 Use char_width (Bug#9496).
10480
10481 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10482
10483 * window.c (Vwindow_persistent_parameters): New variable.
10484 (Fset_window_configuration, save_window_save): Handle persistent
10485 window parameters.
10486
10487 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10488
10489 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10490 thrashing the stack of the thread. (Bug#9087)
10491
10492 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10493
10494 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10495
10496 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10497
10498 * xdisp.c (rows_from_pos_range): Handle the case where the
10499 highlight ends on a newline. (Bug#10464)
10500 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10501 he end column for display of highlight that ends on a newline
10502 before a R2L line.
10503
10504 2012-01-11 Glenn Morris <rgm@gnu.org>
10505
10506 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10507 from load-path also when installation-directory is nil. (Bug#10208)
10508
10509 2012-01-10 Glenn Morris <rgm@gnu.org>
10510
10511 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10512
10513 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10514 Update template values to be closer to their typical values these days.
10515
10516 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10517
10518 * xdisp.c (rows_from_pos_range): Accept additional argument
10519 DISP_STRING, and accept any glyph in a row whose object is that
10520 string as eligible for mouse highlight. Fixes mouse highlight of
10521 display strings from overlays. (Bug#10464)
10522
10523 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10524
10525 emacs: fix an auto-save permissions race condition (Bug#10400)
10526 * fileio.c (auto_saving_dir_umask): New static var.
10527 (Fmake_directory_internal): Use it.
10528 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10529 creating the directory. The old code temporarily assigns
10530 too-generous permissions to the directory.
10531 (do_auto_save_eh): Clear it.
10532 (Fdo_auto_save): Catch all errors, not just file errors, so
10533 that the var is always cleared.
10534
10535 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10536
10537 * search.c (scan_buffer): Pass character positions to
10538 know_region_cache, not byte positions. (Bug#6540)
10539
10540 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10541
10542 * w32.c (sys_rename): Report EXDEV when rename of a directory
10543 fails because the target is on another logical disk. (Bug#10284)
10544
10545 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10546
10547 * xterm.c (x_embed_request_focus): New function.
10548
10549 * xterm.h: Add prototype.
10550
10551 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10552
10553 2012-01-05 Glenn Morris <rgm@gnu.org>
10554
10555 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10556
10557 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10558
10559 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10560 Load gnutls_transport_set_lowat only if GnuTLS version is below
10561 2.11.1.
10562 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10563 GnuTLS versions below 2.11.1.
10564
10565 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10566
10567 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10568 to the doc string advising against its use for altering the way
10569 windows are scrolled.
10570
10571 2011-12-28 Kenichi Handa <handa@m17n.org>
10572
10573 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10574 coding-system ASCII compatible only when it does not produce BOM
10575 on encoding (Bug#10383).
10576
10577 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10578
10579 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10580 can scroll.
10581 (create_and_show_popup_menu): Always use menu_position_func for
10582 Gtk3 (Bug#10361).
10583
10584 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10585
10586 * callint.c (Fcall_interactively): Don't truncate prompt string.
10587
10588 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10589
10590 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10591 property that ends at ZV, so that the bidi iteration could be
10592 resumed from there (after widening). (Bug#10360)
10593
10594 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10595
10596 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10597
10598 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10599
10600 * nsterm.m (x_free_frame_resources):
10601 Release f->output_data.ns->miniimage.
10602 (ns_index_color): Fix indentation. Do not retain
10603 color_table->colors[i].
10604
10605 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10606 before returning.
10607
10608 * nsfns.m (x_set_background_color): Assign return value from
10609 ns_index_color to face-background instead of NSColor*.
10610 (ns_implicitly_set_icon_type): Fix indentation.
10611 Change assignment in for loop to comparison.
10612
10613 * emacs.c (ns_pool): New variable.
10614 (main): Assign ns_pool.
10615 (Fkill_emacs): Call ns_release_autorelease_pool.
10616
10617 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10618 autorelease fdesc, release fdAttrs and tdict.
10619 (ns_get_covering_families): Release charset.
10620 (ns_findfonts): Release NSFontDescriptor created with new.
10621 (ns_uni_to_glyphs): Fix indentation.
10622 (setString): Release attrStr before assigning new value.
10623
10624 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10625
10626 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10627 and NS_IMPL_COCOA.
10628 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10629 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10630
10631 2011-12-18 David Reitter <reitter@cmu.edu>
10632
10633 * nsterm.m (ns_term_init): Subscribe for notifications
10634 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10635 to method trackingNotification in EmacsMenu.
10636
10637 * nsmenu.m (trackingMenu): New variable.
10638 (trackingNotification): New method (from Aquamacs).
10639 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10640 from Aquamacs (Bug#7030).
10641
10642 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10643
10644 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10645 (symbol_to_nsstring): Fix indentation.
10646 (ns_symbol_to_pb): New function.
10647 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10648 (Fns_rotate_cut_buffers_internal): Remove.
10649 (Fns_store_selection_internal): Rename from
10650 Fns_store_cut_buffer_internal.
10651 (ns_get_foreign_selection, Fx_own_selection_internal)
10652 (Fx_disown_selection_internal, Fx_selection_exists_p)
10653 (Fns_get_selection_internal, Fns_store_selection_internal):
10654 Use ns_symbol_to_pb and check if return value is nil.
10655 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10656 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10657 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10658 renamed to Sns_store_selection_internal.
10659 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10660 and remove this function.
10661 (ns_handle_selection_clear): Remove, never used.
10662 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10663 here.
10664
10665 2011-12-17 Ken Brown <kbrown@cornell.edu>
10666
10667 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10668 GID is unknown (Bug#10257).
10669
10670 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10671
10672 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10673 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10674 which caused a build failure on GNU/Linux IA-64. This problem was
10675 introduced by my 2011-10-07 patch.
10676
10677 2011-12-15 Juri Linkov <juri@jurta.org>
10678
10679 * image.c (imagemagick_error): New function. (Bug#10112)
10680 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10681 Use `imagemagick_error' where ImageMagick functions return
10682 `MagickFalse'.
10683 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10684 proper order.
10685
10686 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10687
10688 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10689 fill background (Bug#8992).
10690
10691 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10692
10693 * window.c (Vwindow_combination_resize)
10694 (Vwindow_combination_limit): Use t instead of non-nil in
10695 doc-strings.
10696 (Vrecenter_redisplay): Add first sentence of doc-string on
10697 separate line.
10698 (Frecenter): Fix doc-string typo.
10699
10700 2011-12-11 Kenichi Handa <handa@m17n.org>
10701
10702 * coding.c (Funencodable_char_position): Pay attention to the
10703 buffer text relocation (Bug#9389).
10704
10705 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10706
10707 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10708 gtk_init (Bug#10100).
10709
10710 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10711
10712 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10713 IT->string is nil. (Bug#10263)
10714
10715 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10716
10717 * nsterm.h (x_free_frame_resources): Declare.
10718
10719 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10720 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10721
10722 * nsterm.h (ns_get_defaults_value): Declare.
10723
10724 * nsterm.m (ns_default): Call ns_get_defaults_value.
10725
10726 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10727
10728 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10729 (Bug#10170)
10730
10731 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10732
10733 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10734 that where the value of an _OBJC_* symbol points to is in the .bss
10735 section (Bug#10240).
10736
10737 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10738
10739 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10740 after the loop to call ccl_driver at least once (Bug#8619).
10741
10742 2011-12-08 Kenichi Handa <handa@m17n.org>
10743
10744 * ftfont.c (get_adstyle_property): Fix previous change
10745 (Bug#10233).
10746
10747 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10748
10749 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10750 dirs from the default value of EMACSLOADPATH (bug#10208).
10751
10752 2011-12-07 Glenn Morris <rgm@gnu.org>
10753
10754 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10755 installation and source directories as well. (Bug#10208)
10756
10757 2011-12-06 Chong Yidong <cyd@gnu.org>
10758
10759 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10760
10761 2011-12-06 Glenn Morris <rgm@gnu.org>
10762
10763 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10764 as an error, not just -1. (Bug#10217)
10765
10766 2011-12-05 Chong Yidong <cyd@gnu.org>
10767
10768 * keyboard.c (process_special_events): New function.
10769 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10770
10771 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10772
10773 * coding.c (encode_designation_at_bol): Don't use uninitialized
10774 local variable (Bug#9318).
10775
10776 2011-12-05 Kenichi Handa <handa@m17n.org>
10777
10778 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10779 return Qnil (Bug#8046, Bug#10193).
10780
10781 2011-12-05 Kenichi Handa <handa@m17n.org>
10782
10783 * coding.c (encode_designation_at_bol): New args charbuf_end and
10784 dst. Return the number of produced bytes. Callers changed.
10785 (coding_set_source): Return how many bytes coding->source was
10786 relocated.
10787 (coding_set_destination): Return how many bytes
10788 coding->destination was relocated.
10789 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10790 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10791
10792 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10793
10794 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10795 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10796 macro (Bug#9318).
10797
10798 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10799
10800 The following changes are to fix Bug#9318.
10801
10802 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10803 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10804 (encode_coding_iso_2022, encode_coding_sjis)
10805 (encode_coding_big5, encode_coding_charset): Use the above macros.
10806
10807 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10808
10809 * lisp.h (process_quit_flag): Fix external declaration.
10810
10811 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10812
10813 Don't macro-inline non-performance-critical code.
10814 * eval.c (process_quit_flag): New function.
10815 * lisp.h (QUIT): Use it.
10816
10817 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10818
10819 * nsfns.m (get_geometry_from_preferences): New function.
10820 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10821
10822 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10823
10824 * emacs.c (Qkill_emacs): Define.
10825 (syms_of_emacs): Initialize it.
10826 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10827 Qquit_flag to `kill-emacs' instead.
10828 (quit_throw_to_read_char): Add parameter `from_signal'.
10829 All callers changed. Call Fkill_emacs if requested and safe.
10830 * lisp.h (QUIT): Call Fkill_emacs if requested.
10831
10832 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10833
10834 * widget.c (update_wm_hints): Return if wmshell is null.
10835 (widget_update_wm_size_hints): New function.
10836
10837 * widget.h (widget_update_wm_size_hints): Declare.
10838
10839 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10840 widget_update_wm_size_hints (Bug#10104).
10841
10842 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10843
10844 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10845 before a newline, prepare the bidi iterator for consuming the
10846 newline, and keep the current paragraph direction. (Bug#10183)
10847 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10848
10849 2011-12-02 Juri Linkov <juri@jurta.org>
10850
10851 * search.c (Fword_search_regexp): New Lisp function created from
10852 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10853 (Fword_search_backward, Fword_search_forward)
10854 (Fword_search_backward_lax, Fword_search_forward_lax):
10855 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10856 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10857
10858 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10859
10860 * fileio.c (Finsert_file_contents): Move after-change-function call
10861 to before the "handled:" label, since all "goto handled" appear in
10862 cases where the *-change-functions have already been properly called
10863 (bug#10117).
10864
10865 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10866
10867 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10868 waiting for input. (Bug#10169)
10869
10870 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10871
10872 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10873 verifies glyph row's hash code--we have just reallocated the
10874 glyphs, so their contents can be complete garbage. (Bug#10164)
10875
10876 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10877
10878 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10879
10880 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10881
10882 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10883 attributes are tested _before_ calling verify_row_hash, to protect
10884 against GCC re-ordering of the tests. (Bug#10164)
10885
10886 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10887
10888 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10889
10890 * xterm.c (handle_one_xevent): Only set async_visible and friends
10891 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10892 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10893 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10894
10895 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10896
10897 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10898 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10899 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10900 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10901 All uses changed to use GCPRO1 etc.
10902 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10903 Revert to old implementation (i.e., before 2011-03-11).
10904
10905 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10906
10907 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10908 of scroll runs so as to avoid assigning disabled bogus rows and
10909 unnecessary graphics copy operations.
10910
10911 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10912
10913 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10914 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10915 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10916 (malloc, free, realloc, calloc): Redirect to e_* only when
10917 compiling Emacs.
10918
10919 * lisp.h (GCTYPEBITS): Move before first use.
10920 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10921 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10922 this macro definition.
10923
10924 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10925 _MSC_VER.
10926
10927 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10928
10929 * gtkutil.c (xg_create_frame_widgets):
10930 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10931 present with Gtk+ 2.0.
10932
10933 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10934
10935 * fileio.c (Finsert_file_contents): Undo previous change; see
10936 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10937
10938 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10939
10940 Rename locals to avoid shadowing.
10941 * fileio.c (Finsert_file_contents):
10942 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10943 * process.c (wait_reading_process_output):
10944 Rename inner 'proc' to 'p' to avoid shadowing.
10945 Indent for consistency with usual Emacs style.
10946
10947 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10948
10949 * xdisp.c (redisplay_window): If cursor row is not fully visible
10950 after recentering, and scroll-conservatively is set to a large
10951 number, scroll window by a few more lines to make the cursor fully
10952 visible and out of scroll-margin. (Bug#10105)
10953 (start_display): Don't move to the next line if the display should
10954 start at a newline that is part of a display vector or an overlay
10955 string. (Bug#10119)
10956
10957 2011-11-24 Juri Linkov <juri@jurta.org>
10958
10959 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10960 after the `MagickPingImage' call. (Bug#10112)
10961
10962 2011-11-23 Chong Yidong <cyd@gnu.org>
10963
10964 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10965
10966 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10967
10968 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10969 making another buffer current. (Bug#10114)
10970
10971 2011-11-23 Glenn Morris <rgm@gnu.org>
10972
10973 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10974
10975 2011-11-23 Chong Yidong <cyd@gnu.org>
10976
10977 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10978 using it (Bug#5984).
10979
10980 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10981
10982 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10983 and header-lines, as they don't have one computed for them.
10984 (Bug#10098)
10985
10986 * .gdbinit (prow): Make displayed values more self-explaining.
10987 Add row's hash code.
10988
10989 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10990
10991 * process.c (wait_reading_process_output): Fix asynchrounous
10992 GnuTLS socket handling on some versions of the GnuTLS library.
10993 (wait_reading_process_output): Add comment and URL.
10994
10995 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10996
10997 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10998
10999 2011-11-21 Chong Yidong <cyd@gnu.org>
11000
11001 * window.c (Fnext_window, Fprevious_window): Doc fix.
11002
11003 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11004
11005 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11006
11007 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11008
11009 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11010
11011 2011-11-20 Martin Rudalics <rudalics@gmx.at>
11012
11013 * window.c (Fset_window_combination_limit): Rename argument
11014 STATUS to LIMIT.
11015 (Vwindow_combination_limit): Remove "status" from doc-string.
11016
11017 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11018
11019 * m/ibms390.h: Remove.
11020 * m/ibms390x.h: Don't include "ibms390.h".
11021
11022 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11023
11024 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11025 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11026
11027 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11028
11029 * casetab.c (Fset_case_table):
11030 * charset.c (Fcharset_after): Fix typos.
11031
11032 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11033
11034 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11035 Otherwise, valgrind does not work on some platforms.
11036 Problem reported by Andreas Schwab in
11037 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11038 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11039 is set, removing the need for VIRT_ADDRESS_VARIES.
11040 (PURE_P): Use a more-efficient implementation that needs just one
11041 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11042 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11043 to 4 (xorl, subq, cmpq, setbe).
11044 * alloc.c (pure): Always extern now, since that's the
11045 VIRT_ADDR_VARIES behavior.
11046 (PURE_POINTER_P): Use a single comparison, not two, for
11047 consistency with the new puresize.h.
11048 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11049 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11050 Remove VIRT_ADDR_VARIES no longer needed.
11051
11052 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11053
11054 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11055 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11056 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11057 behave as if the cursor position were at the window margin.
11058
11059 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11060 and the cursor position is out of bounds, behave as if the cursor
11061 position were at the window margin. (Bug#10075)
11062
11063 2011-11-18 Chong Yidong <cyd@gnu.org>
11064
11065 * window.c (Fwindow_combination_limit): Make first argument
11066 non-optional, since it is meaningless for live windows like the
11067 selected window.
11068
11069 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11070
11071 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11072
11073 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11074
11075 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11076 (graft_intervals_into_buffer): Simplify.
11077
11078 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11079
11080 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11081 hash values of the two rows.
11082 (copy_row_except_pointers): Preserve the used[] arrays and the
11083 hash values of the two rows. (Bug#10035)
11084 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11085
11086 * xdisp.c (row_hash): New function, body extracted from
11087 compute_line_metrics.
11088 (compute_line_metrics): Call row_hash, instead of computing the
11089 hash code inline.
11090
11091 * dispnew.c (verify_row_hash): Call row_hash for computing the
11092 hash code of a row, instead of duplicating code from xdisp.c.
11093
11094 * dispextern.h (row_hash): Add prototype.
11095
11096 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11097
11098 * frame.c (delete_frame): Don't delete the terminal when the last
11099 X frame is closed if emacs is built with GTK toolkit.
11100
11101 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11102
11103 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11104
11105 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11106
11107 * window.c (Vwindow_splits): Rename to
11108 Vwindow_combination_resize. Suggested by Juri Linkov.
11109 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11110 of Vwindow_splits.
11111
11112 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11113
11114 * nsfns.m (Fns_font_name):
11115 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11116
11117 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11118
11119 * window.h (window): Rename slot "nest" to "combination_limit".
11120 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11121 (Fset_window_nest): Rename to Fset_window_combination_limit.
11122 (Vwindow_nest): Rename to Vwindow_combination_limit.
11123 (recombine_windows, make_parent_window, make_window)
11124 (Fsplit_window_internal, saved_window)
11125 (Fset_window_configuration, save_window_save): Rename all
11126 occurrences of window_nest to window_combination_limit.
11127
11128 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11129
11130 * image.c (imagemagick_load_image): Fix typo.
11131
11132 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11133
11134 * xdisp.c (display_line): Move the call to
11135 highlight_trailing_whitespace before the call to
11136 compute_line_metrics, since the latter needs to see the final
11137 faces of all the glyphs to compute ROW's hash value.
11138 Fixes assertion violations in row_equal_p. (Bug#10035)
11139
11140 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11141
11142 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11143 just return (bug#10044).
11144
11145 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11146
11147 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11148 with user-defined heap size. Bump the default size of the temacs
11149 heap to 27MB, to avoid memory warning when running temacs.
11150 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11151
11152 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11153 current_matrix and desired_matrix. (Bug#9990)
11154 (verify_row_hash) [XASSERTS]: New function.
11155 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11156 that the hash value of glyph rows is correct.
11157
11158 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11159
11160 * window.h (window): Remove splits slot.
11161 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11162 (Fdelete_other_windows_internal, make_parent_window)
11163 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11164 (Fset_window_configuration, save_window_save): Don't deal with
11165 split status of windows.
11166 (saved_window): Remove splits slot.
11167 (Vwindow_splits): Rewrite doc-string.
11168
11169 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11170
11171 * xfns.c (unwind_create_frame):
11172 * nsfns.m (unwind_create_frame):
11173 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11174 Vframe_list (Bug#9999).
11175
11176 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11177
11178 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11179
11180 2011-11-11 Kenichi Handa <handa@m17n.org>
11181
11182 * callproc.c (Fcall_process): Set the member dst_multibyte of
11183 process_coding.
11184
11185 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11186
11187 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11188 avoid a crash (bug#9496).
11189
11190 2011-11-09 Chong Yidong <cyd@gnu.org>
11191
11192 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11193 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11194
11195 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11196
11197 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11198
11199 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11200
11201 Avoid some portability problems by eschewing 'extern inline' functions.
11202 The trivial performance wins aren't worth the portability hassles; see
11203 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11204 et seq.
11205 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11206 (window_box_width, window_box_left, window_box_left_offset)
11207 (window_box_right, window_box_right_offset): Undo previous change,
11208 by removing the "extern"s.
11209 * intervals.c (adjust_intervals_for_insertion)
11210 (adjust_intervals_for_deletion): Undo previous change,
11211 making these static again.
11212 (offset_intervals, temp_set_point_both, temp_set_point)
11213 (copy_intervals_to_string): No longer inline.
11214 * xdisp.c (window_text_bottom_y, window_box_width)
11215 (window_box_height, window_box_left_offset)
11216 (window_box_right_offset, window_box_left, window_box_right)
11217 (window_box): No longer inline.
11218
11219 2011-11-08 Chong Yidong <cyd@gnu.org>
11220
11221 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11222 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11223 Signal an error if not a live window.
11224 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11225 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11226
11227 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11228
11229 * lisp.h (syms_of_abbrev): Remove declaration.
11230 Reported by CHENG Gao <chenggao@royau.me>.
11231
11232 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11233
11234 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11235 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11236 of temacs in GUI mode.
11237
11238 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11239
11240 * window.h: Declare delete_all_child_windows instead of
11241 delete_all_subwindows.
11242 * window.c (Fwindow_nest, Fset_window_nest)
11243 (Fset_window_new_total, Fset_window_new_normal)
11244 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11245 (delete_all_subwindows): Rename to delete_all_child_windows.
11246 (Fdelete_other_windows_internal, Fset_window_configuration):
11247 Call delete_all_child_windows instead of delete_all_subwindows.
11248 * frame.c (delete_frame): Call delete_all_child_windows instead
11249 of delete_all_subwindows.
11250
11251 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11252
11253 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11254 This is also needed for porting to any host where GC_MARK_STACK is
11255 not GC_MAKE_GCPROS_NOOPS.
11256 (which_symbols): Use it.
11257
11258 2011-11-07 Kenichi Handa <handa@m17n.org>
11259
11260 * coding.c (coding_set_destination): Check coding->src_pos only
11261 when coding->src_object is a buffer (bug#9910).
11262
11263 * process.c (send_process): Set the member src_multibyte of coding
11264 to 0 (bug#9911) when sending a unibyte text.
11265
11266 * callproc.c (Fcall_process): Set the member src_multibyte of
11267 process_coding to 0 (bug#9912).
11268
11269 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11270
11271 * xmenu.c (cleanup_widget_value_tree): New function.
11272 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11273 calling free_menubar_widget_value_tree directly (Bug#9830).
11274
11275 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11276
11277 Fix some portability problems with 'inline'.
11278 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11279 (window_box_width, window_box_left, window_box_left_offset)
11280 (window_box_right, window_box_right_offset): Declare extern.
11281 Otherwise, these inline functions do not conform to C99 and
11282 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11283 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11284 * intervals.c (adjust_intervals_for_insertion)
11285 (adjust_intervals_for_deletion): Now extern, because otherwise the
11286 extern inline functions 'offset_intervals' couldn't refer to it.
11287 (static_offset_intervals): Remove.
11288 (offset_intervals): Rewrite using the old contents of
11289 static_offset_intervals. The old version didn't conform to C99
11290 because an extern inline function contained a reference to an
11291 identifier with static linkage.
11292
11293 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11294
11295 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11296 GC.
11297
11298 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11299
11300 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11301 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11302 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11303 return Qleft_to_right.
11304
11305 2011-11-06 Chong Yidong <cyd@gnu.org>
11306
11307 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11308 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11309 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11310 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11311 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11312 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11313 (Fwindow_vscroll): Doc fix.
11314 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11315 argument, since it makes no sense to pass a live window and for
11316 consistency with window-child.
11317
11318 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11319
11320 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11321 support MSVC.
11322
11323 2011-11-05 Jason Rumney <jasonr@gnu.org>
11324
11325 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11326 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11327 fonts (Bug#6029).
11328 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11329 bitwise arithmetic preventing use of unicode-sip and non-truetype
11330 opentype fonts.
11331
11332 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11333
11334 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11335 "emacs"-only part.
11336
11337 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11338 initialization code to keep similarity to xfns.c after changes
11339 from 2011-11-05.
11340
11341 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11342
11343 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11344 (unwind_create_frame): New function (Bug#9943).
11345 (Fx_create_frame): Restructure code to be more similar to the one in
11346 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11347 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11348 Move terminal->reference_count++ just before making the frame official
11349 (Bug#9943).
11350
11351 * nsterm.m (x_free_frame_resources): New function.
11352 (x_destroy_window): Move code to x_free_frame_resources.
11353
11354 * xfns.c (unwind_create_frame): Fix comment.
11355 (Fx_create_frame, x_create_tip_frame):
11356 Move terminal->reference_count++ just before making the frame
11357 official. Move initialization of image_cache_refcount and
11358 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11359
11360 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11361
11362 Support MSVC build with newer versions of Visual Studio.
11363 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11364 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11365 nt/gmake.defs.
11366
11367 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11368 which are not supported by MSVC.
11369 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11370 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11371 bitfields.
11372 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11373 types in bitfields.
11374 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11375
11376 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11377
11378 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11379
11380 Support MSVC build with newer versions of Visual Studio.
11381 * w32.c: Don't include w32api.h for MSVC.
11382 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11383
11384 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11385 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11386 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11387 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11388 e_* cousins.
11389 (alloca) [_MSC_VER]: Define to _alloca.
11390
11391 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11392
11393 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11394
11395 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11396
11397 * xdisp.c (note_mouse_highlight): If either of
11398 previous/next-single-property-change returns nil, treat that as
11399 the beginning or the end of the buffer. (Bug#9955)
11400
11401 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11402
11403 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11404 label is not null (Bug#9951).
11405 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11406 may be NULL.
11407
11408 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11409
11410 * window.c (Fwindow_body_size): Mention in the doc string that the
11411 return value is in frame's canonical units. (Bug#9949)
11412
11413 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11414
11415 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11416
11417 * w32fns.c (unwind_create_frame): If needed, free the glyph
11418 matrices of the partially constructed frame. (Bug#9943)
11419 * xfns.c (unwind_create_frame): Likewise.
11420
11421 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11422
11423 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11424 Don't stop backward scan on the continuation glyph, even though
11425 its CHARPOS is positive.
11426 (mouse_face_from_buffer_pos, note_mouse_highlight):
11427 Rename cover_string to disp_string.
11428
11429 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11430
11431 * window.c (temp_output_buffer_show): Don't use
11432 Vtemp_buffer_show_specifiers.
11433 (Vtemp_buffer_show_specifiers): Remove unused variable.
11434
11435 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11436
11437 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11438 past the beginning of the current glyph matrix.
11439
11440 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11441
11442 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11443 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11444 HAVE_GTK3 (Bug#9869).
11445
11446 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11447 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11448
11449 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11450
11451 * xterm.c: Declare x_handle_net_wm_state to return int.
11452 (handle_one_xevent): Check if we are iconified but don't have
11453 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11454 (get_current_wm_state): Return non-zero if not hidden,
11455 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11456 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11457 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11458 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11459
11460 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11461
11462 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11463 so that this new function doesn't get optimized away by a
11464 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11465
11466 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11467
11468 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11469
11470 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11471
11472 Fix the `xbytecode' command.
11473 * .gdbinit (xprintbytestr): New command.
11474 (xwhichsymbols): Rename from `which'; all callers changed.
11475 (xbytecode): Print the byte-code string as well.
11476
11477 2011-10-29 Kim Storm <storm@cua.dk>
11478
11479 * alloc.c (which_symbols): New function.
11480
11481 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11482
11483 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11484 line. (Bug#9903)
11485
11486 2011-10-29 Glenn Morris <rgm@gnu.org>
11487
11488 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11489 Not clear what it was for, and it causes various bugs. (Bug#9839)
11490
11491 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11492
11493 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11494 possible random value that matches one of those tested as
11495 condition to clear the mouse face.
11496
11497 2011-10-28 Chong Yidong <cyd@gnu.org>
11498
11499 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11500
11501 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11502
11503 * window.c (make_window): Initialize phys_cursor_on_p.
11504
11505 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11506
11507 * lisp.h (struct Lisp_Symbol): Update comments.
11508
11509 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11510
11511 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11512
11513 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11514
11515 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11516 <oslsachem@gmail.com> for helping to debug this.
11517
11518 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11519 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11520 (g_b_init_get_glyph_outline_w): New static variables.
11521 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11522 (GetGlyphOutlineW_Proc): New typedefs.
11523 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11524 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11525 New functions.
11526 (w32font_open_internal, compute_metrics):
11527 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11528 instead of calling the "wide" APIs directly.
11529
11530 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11531
11532 * w32.h (syms_of_w32font): Add prototype.
11533
11534 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11535
11536 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11537 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11538 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11539 (Fmove_to_window_line): Doc fix.
11540
11541 2011-10-27 Chong Yidong <cyd@gnu.org>
11542
11543 * process.c (make_process): Set gnutls_state to NULL.
11544
11545 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11546 non-NULL, regardless of GNUTLS_INITSTAGE.
11547 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11548 an error. Set process slots as soon as we allocate them.
11549
11550 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11551
11552 2011-10-27 Chong Yidong <cyd@gnu.org>
11553
11554 * gnutls.c (emacs_gnutls_deinit): New function.
11555 Deallocate credentials structures as well as calling gnutls_deinit.
11556 (Fgnutls_deinit, Fgnutls_boot): Use it.
11557
11558 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11559 (deactivate_process): Call emacs_gnutls_deinit.
11560
11561 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11562
11563 * image.c (x_create_x_image_and_pixmap):
11564 * w32.c (sys_rename, w32_delayed_load):
11565 * w32font.c (fill_in_logfont):
11566 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11567
11568 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11569
11570 * w32fns.c (w32_default_color_map): New function,
11571 extracted from Fw32_default_color_map.
11572 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11573
11574 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11575
11576 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11577
11578 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11579
11580 * keyboard.c (test_undefined): New function (bug#9751).
11581 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11582
11583 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11584
11585 * sysdep.c (init_sys_modes): Fix the check for the controlling
11586 terminal (Bug#6649).
11587
11588 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11589
11590 * dispextern.h (struct bidi_it): New member next_en_type.
11591
11592 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11593 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11594 current character, check also for next_en_type being WEAK_EN.
11595 (bidi_resolve_weak): Don't enter the expensive loop if the current
11596 position is before next_en_pos. Record the bidi type of the first
11597 non-ET, non-BN character we find, in addition to its position.
11598 (bidi_level_of_next_char): Invalidate next_en_type when
11599 next_en_pos is over-stepped.
11600
11601 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11602
11603 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11604 * editfns.c: Rewrite current-time-zone so that it invokes
11605 the equivalent of (format-time-string "%Z") to get the time zone name.
11606 This fixes a bug when the time zone name contains characters that
11607 need converting from the system time locale to Emacs internal format.
11608 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11609 that patch fixed format-time-string to do the conversion, but
11610 I forgot to fix current-time-zone.
11611 (format_time_string): New function, containing most of
11612 what Fformat_time_string used to contain.
11613 (Fformat_time_string): Rewrite in terms of format_time_string.
11614 This doesn't change this function's behavior.
11615 (current-time-zone): Rewrite to use format_time_string.
11616 This fixes the bug reported by Michael Schierl in
11617 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11618 Jason Rumney's 2007-06-07 change worked around this bug, but
11619 didn't fix it.
11620 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11621
11622 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11623
11624 * xdisp.c (start_display): If the character at POS is displayed
11625 via a display vector, reset IT->current.dpvec_index to zero.
11626 (try_window_reusing_current_matrix): If a line ends in a display
11627 vector or the next line starts in a display vector, continue
11628 redrawing the window even though the character position of
11629 start_row was reached.
11630 (Bug#9771, part 2)
11631
11632 2011-10-18 Chong Yidong <cyd@gnu.org>
11633
11634 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11635 with nobreak-char-display too.
11636
11637 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11638
11639 Fix part 3 of bug#9771.
11640 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11641 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11642 non-neutral characters if the current character is a paragraph
11643 separator (a.k.a. Newline). This avoids running the same
11644 expensive loop twice, once when we consume the preceding newline
11645 and the other time when the line actually needs to be displayed.
11646 Avoid the loop when we see neutrals on the base embedding level
11647 following a character whose directionality is the same as the
11648 paragraph's. This avoids running the expensive loop when a line
11649 ends in a long sequence of neutrals, like control characters.
11650 Add assertion against STRONG_AL type. Slightly rearrange code
11651 that determines the type of a neutral given the first non-neutral
11652 that follows it.
11653 (bidi_level_of_next_char): Set next_en_pos to zero when
11654 invalidating its info.
11655
11656 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11657
11658 * xdisp.c (push_display_prop): Determine whether to record string
11659 or buffer position by IT->string, not by IT->method. Allow
11660 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11661 (move_it_vertically_backward): Don't look for character position
11662 immediately after the newline when in a continuation line.
11663 (Bug#9771, part 1)
11664
11665 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11666
11667 * window.c (coordinates_in_window): Rewrite and delabelize
11668 vertical border check. (Bug#5357) (Bug#9618)
11669
11670 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11671
11672 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11673 errors in XSetWindowBorder (bug#9310).
11674
11675 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11676
11677 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11678 avoid crash when xmalloc overrun checking is enabled.
11679
11680 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11681
11682 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11683 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11684 cursor motion with <left> and <right> arrow keys.
11685
11686 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11687 some callers set that themselves.
11688
11689 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11690
11691 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11692 display string and the previous row comes from the same string and
11693 is empty. (Bug#9739) (Bug#9738)
11694
11695 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11696
11697 * doc.c (get_doc_string): Encode file name (bug#9735).
11698
11699 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11700
11701 * bidi.c (bidi_level_of_next_char):
11702 * xdisp.c (get_visually_first_element): Remove old incorrect
11703 comments regarding the Unicode Line Separator character.
11704
11705 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11706
11707 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11708
11709 * alloc.c (Fgc_status): Do not access beyond zombies array
11710 boundary if nzombies > MAX_ZOMBIES.
11711 * alloc.c (dump_zombies): Add missing format specifier.
11712
11713 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11716 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11717
11718 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11719 Some packages use them to denote characters with modifiers.
11720
11721 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11722
11723 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11724 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11725 matching a pp-number. Rename parameter var to var1.
11726
11727 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11728
11729 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11730
11731 2011-10-08 Glenn Morris <rgm@gnu.org>
11732
11733 * callint.c (Fcall_interactively): Give a more explicit error for the
11734 'c' case with a non-character input. (Bug#8479)
11735
11736 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11737
11738 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11739 lines.
11740 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11741 lines that are hscrolled on the left.
11742
11743 * dispnew.c (buffer_posn_from_coords): Account for a possible
11744 presence of header-line. (Bug#4426)
11745
11746 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11747
11748 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11749 Don't advertise functionality which we discourage or doesn't work.
11750
11751 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11752
11753 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11754 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11755 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11756 this makes Emacs dump core during garbage collection on rare
11757 occasions. sizeof is obviously inferior to offsetof here, so
11758 stick with offsetof.
11759 (GC_POINTER_ALIGNMENT): New macro.
11760 (mark_memory): Omit 3rd (offset) arg; caller changed.
11761 Don't assume EMACS_INT alignment is the same as pointer alignment.
11762
11763 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11764
11765 * keyboard.c (read_key_sequence_remapped): New var.
11766 (read_key_sequence): Compute remapping in the right buffer.
11767 (command_loop_1): Use read_key_sequence's remapping directly.
11768
11769 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11770
11771 * dired.c (file_name_completion): Don't expand file name.
11772 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11773 before checking file name handler.
11774
11775 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11776 they've been requested explicitly (bug#9591).
11777
11778 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11779
11780 * keymap.c (Fsingle_key_description): Use make_specified_string
11781 instead of build_string to build string from push_key_description.
11782 (Bug#5193)
11783
11784 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11785
11786 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11787 This fixes a Y2038 bug on 64-bit hosts.
11788 * buffer.c (reset_buffer):
11789 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11790 (Fclear_buffer_auto_save_failure):
11791 Use 0, not -1, to represent an unset failure time, since time_t
11792 might not be signed.
11793
11794 Remove dependency on glibc malloc internals.
11795 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11796 Move back here from lisp.h, but with their new implementations.
11797 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11798 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11799 * charset.c (charset_table_init): New static var.
11800 (syms_of_charset): Use it instead of xmalloc. This removes a
11801 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11802 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11803 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11804 Move back to alloc.c.
11805 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11806 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11807
11808 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11809
11810 * nsterm.m (windowDidResize): Call x_set_window_size only when
11811 ns_in_resize is true. Otherwise set pixelwidth/height and
11812 call change_frame_size (Bug#9628).
11813
11814 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 Port --enable-checking=all to Fedora 14 x86-64.
11817 * charset.c (syms_of_charset): Also account for glibc malloc's
11818 internal overhead when calculating the initial malloc maximum.
11819
11820 Port --enable-checking=all to Fedora 14 x86.
11821 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11822 Move to lisp.h.
11823 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11824 (overrun_check_realloc, overrun_check_free):
11825 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11826 That way, xmalloc returns a properly-aligned pointer even if
11827 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11828 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11829 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11830 into account when calculating the initial malloc maximum.
11831 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11832 Move here from alloc.c, so that charset.c can use it too.
11833 Properly align; the old code wasn't right for common 32-bit hosts
11834 when configured with --enable-checking=all.
11835 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11836 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11837
11838 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11839
11840 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11841 use EDOM.
11842
11843 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11844
11845 * xdisp.c (compute_display_string_end): If there's no display
11846 string at CHARPOS, return -1.
11847
11848 * bidi.c (bidi_fetch_char): When compute_display_string_end
11849 returns a negative value, treat the character as a normal
11850 character not covered by a display string. (Bug#9624)
11851
11852 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11853
11854 * lread.c (Fread_from_string): Fix typo in docstring.
11855
11856 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11857
11858 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11859 newline, reseat the iterator instead of bidi-iterating there one
11860 character at a time. (Bug#9610)
11861 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11862 TO_CHARPOS if the bidi iterator is at base embedding level.
11863
11864 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11865
11866 * lread.c (readevalloop): Use correct code for NBSP.
11867 (read1): Likewise. (Bug#9608)
11868
11869 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11870
11871 * dbusbind.c (Fdbus_register_signal): When service is not
11872 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11873
11874 2011-09-25 Glenn Morris <rgm@gnu.org>
11875
11876 * buffer.c (truncate-lines): Doc fix.
11877
11878 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11879
11880 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11881 (Fset_window_next_buffers): Doc fix.
11882
11883 2011-09-24 Glenn Morris <rgm@gnu.org>
11884
11885 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11886
11887 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11888
11889 Fix minor problems found by static checking.
11890 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11891 * indent.c (Fvertical_motion): Fix == vs = typo.
11892
11893 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11894
11895 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11896 Default value is now t. Doc fix.
11897
11898 * indent.c (Fvertical_motion): Compute and apply the overshoot
11899 logic when moving up, not only when moving down. Fix the
11900 confusing name and values of the it_overshoot_expected variable;
11901 logic changes accordingly. (Bug#9254) (Bug#9549)
11902
11903 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11904 CHARPOS is covered by a display string which includes newlines.
11905 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11906 is covered by a display string with embedded newlines.
11907
11908 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11909
11910 * dbusbind.c (Fdbus_register_signal): Add match rule to
11911 Vdbus_registered_objects_table. (Bug#9581)
11912 (Fdbus_register_method, Vdbus_registered_objects_table):
11913 Fix docstring.
11914
11915 2011-09-24 Jim Meyering <meyering@redhat.com>
11916
11917 do not ignore write error for any output size
11918 The previous change was incomplete.
11919 While it makes emacs --batch detect the vast majority of stdout
11920 write failures, errors were still ignored whenever the output size is
11921 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11922 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11923 && echo FAIL: ignored write error
11924 FAIL: ignored write error
11925 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11926 && echo FAIL: ignored write error
11927 FAIL: ignored write error
11928 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11929
11930 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11931
11932 * emacs.c (Fkill_emacs): In noninteractive mode exit
11933 non-successfully if a write error occurred on stdout. (Bug#9574)
11934
11935 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11936
11937 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11938 the xassert test.
11939
11940 * dispextern.h (struct it): Update the comment documenting what
11941 can it->OBJECT be.
11942
11943 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11944
11945 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11946 a display string, extend search for cursor position to end of row.
11947 (find_row_edges): If the row ends in a newline from a display
11948 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11949 Handle the case of a display string with multiple newlines.
11950 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11951 non-empty line. Fixes confusing cursor motion with arrow keys at
11952 the beginning of a line that starts with whitespace.
11953
11954 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11955
11956 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11957 (bug#9493).
11958
11959 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11960
11961 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11962 boolean (Bug#9154).
11963
11964 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11965
11966 * xdisp.c (display_line): Record maximum and minimum buffer
11967 positions even if no glyphs were produced (e.g., by a zero-width
11968 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11969 buffer positions that will be removed from the glyph row because
11970 they don't fit.
11971 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11972 column is beyond frame width: don't subtract 1 "pixel" when
11973 computing width of the stretch.
11974 (reseat_at_next_visible_line_start): Undo the change made on
11975 2011-09-17 that saved paragraph information and restored it after
11976 the call to `reseat'. (Bug#9545)
11977
11978 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11979
11980 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11981 and turn window cursor on if cleared (Bug#9415).
11982
11983 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11984
11985 * search.c (boyer_moore): Take unibyte characters from pattern
11986 literally. (Bug#9458)
11987
11988 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11989
11990 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11991
11992 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11993
11994 Fix minor problem found by static checking.
11995 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11996 initialized, to pacify gcc -Wuninitialized.
11997
11998 * fileio.c: Report proper errno when syscall falls.
11999 (Finsert_file_contents): Save and restore errno,
12000 so that report_file_error outputs the correct diagnostic.
12001 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12002
12003 2011-09-18 Eli Zaretskii <eliz@gnu.org>
12004
12005 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12006
12007 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12008
12009 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12010 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12011
12012 2011-09-17 Eli Zaretskii <eliz@gnu.org>
12013
12014 * xdisp.c (reseat_at_next_visible_line_start): Keep information
12015 about the current paragraph and restore it after the call to reseat.
12016
12017 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12018 (bidi_find_paragraph_start): Search back for paragraph beginning
12019 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12020 (bidi_move_to_visually_next): Only trigger paragraph-related
12021 computations when the last character is a newline or at EOB, not
12022 just any NEUTRAL_B. (Bug#9470)
12023
12024 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12025 truncated lines if point is covered by a display string. (Bug#9524)
12026
12027 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12028
12029 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12030 (cons_to_x_long): New function.
12031 (lisp_data_to_selection_data): Use it. Correct the test for
12032 short-versus-long data; it was negated. Break out of vector
12033 loop, for efficiency, when a long datum is discovered.
12034
12035 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12036
12037 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12038
12039 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12040
12041 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12042 GCC PR/17406) by declaring this function with external scope.
12043
12044 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12045
12046 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12047 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12048
12049 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12050
12051 * editfns.c (Fformat): Correctly handle text properties on "%%".
12052
12053 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12054
12055 * xterm.c (x_draw_composite_glyph_string_foreground):
12056 * w32term.c (x_draw_composite_glyph_string_foreground):
12057 * term.c (encode_terminal_code):
12058 * composite.c (composition_update_it, get_composition_id):
12059 * xdisp.c (get_next_display_element)
12060 (fill_composite_glyph_string): Add comments about special meaning
12061 of TAB characters in a composition.
12062
12063 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12064
12065 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12066 This occurs when processing a multibyte format.
12067 Problem reported by Wolfgang Jenker.
12068
12069 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12070
12071 * xdisp.c (try_cursor_movement): Only check for exact match if
12072 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12073
12074 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 Remove unused external symbols.
12077 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12078 * xdisp.c (calc_pixel_width_or_height): Now static.
12079 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12080 * indent.c (check_display_width):
12081 * w32term.c: Fix comment to match code.
12082 * xterm.c, xterm.h (x_catching_errors): Remove.
12083
12084 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12085
12086 * xselect.c: Use signed conversions more consistently (Bug#9498).
12087 (selection_data_to_lisp_data): Assume incoming selection data are
12088 signed integers, not unsigned. This is to be consistent with
12089 outgoing selection data, which was modified to use signed integers
12090 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12091 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12092 expects long, not unsigned long.
12093
12094 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12095
12096 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12097 computation of loop end. Reported by Johan Bockgård
12098 <bojohan@gnu.org>.
12099
12100 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12101
12102 * frame.c (Fother_visible_frames_p): Function deleted.
12103
12104 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12105
12106 * indent.c (compute_motion): Process display vector front to back
12107 rather than the other way around. (Bug#2496)
12108
12109 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12110
12111 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12112
12113 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12114
12115 * minibuf.c (Fread_from_minibuffer): Doc fix.
12116
12117 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12118
12119 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12120 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12121
12122 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12123
12124 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12125 value for non-existent files.
12126
12127 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12128
12129 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12130 set its "size" to -1. This will set the modtime_size field of
12131 the corresponding buffer to -1, which is what
12132 verify-visited-file-modtime expects for files that do not exist.
12133 (Bug#9139)
12134
12135 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12136
12137 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12138 here ...
12139 * lisp.h: ... from here. push_key_description is no longer
12140 defined in keyboard.c, so its declaration should not be in
12141 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12142 logically belongs with push_key_description.
12143
12144 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 * buffer.h: Include <sys/types.h> instead of <time.h>.
12147 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12148 Problem reported by Herbert J. Skuhra.
12149
12150 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12151
12152 * xml.c (parse_region): Make the parsing work for
12153 non-comment-starting XML files again (bug#9144).
12154
12155 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12156
12157 * image.c (gif_load): Fix calculation of bottom and right corner.
12158 (Bug#9468)
12159
12160 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12161
12162 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12163 redisplay in small windows.
12164
12165 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12166
12167 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12168
12169 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12170
12171 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12172 Operate on live windows only.
12173
12174 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12175
12176 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12177
12178 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12179
12180 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12181 only under bidi iteration.
12182
12183 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12184
12185 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12186
12187 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12188
12189 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12190 Without this fix, the command to link temacs failed due to an
12191 undefined symbol __builtin_isnan. This is because
12192 /usr/include/iso/math_c99.h #defines isnan(x) to
12193 __builtin_isnan(x), but the bundled gcc, which identifies itself
12194 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12195 a __builtin_isnan.
12196 * floatfns.c (isnan): #undef, and then #define to a clone of
12197 what's in data.c.
12198 (Fisnan): Always define, since it's always available now.
12199 (syms_of_floatfns): Always define isnan at the Lisp level.
12200
12201 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12204
12205 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12206
12207 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12208 The previous code assumed that file offsets (off_t values) fit in
12209 EMACS_INT variables, which is not true on typical 32-bit hosts.
12210 The code messed up by falsely reporting buffer overflow in cases
12211 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12212 when "big" contains more than 2**29 bytes, even though this
12213 inserts just one byte and does not overflow the buffer.
12214 (Finsert_file_contents): Store file offsets as off_t
12215 values, not as EMACS_INT values. Check for overflow when
12216 converting between EMACS_INT and off_t. When checking for
12217 buffer overflow or for overlap, take the offsets into account.
12218 Don't use EMACS_INT for small values where int suffices.
12219 When checking for overlap, fix a typo: ZV was used where
12220 ZV_BYTE was intended.
12221 (Fwrite_region): Don't assume off_t fits into 'long'.
12222 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12223
12224 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12225
12226 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12227
12228 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12229
12230 sprintf-related integer and memory overflow issues (Bug#9412).
12231
12232 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12233 (esprintf, exprintf, evxprintf): New functions.
12234 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12235 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12236 (modify_event_symbol): Do not assume that the length of
12237 name_alist_or_stem is safe to alloca and fits in int.
12238 (Fexecute_extended_command): Likewise for function name and binding.
12239 (Frecursion_depth): Wrap around reliably on integer overflow.
12240 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12241 since some callers pass EMACS_INT values.
12242 (Fsingle_key_description): Don't crash if symbol name contains more
12243 than MAX_ALLOCA bytes.
12244 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12245 (get_minibuffer): Arg is now EMACS_INT, not int.
12246 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12247 (esprintf, exprintf, evxprintf): New decls.
12248 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12249
12250 * dbusbind.c (signature_cat): New function.
12251 (xd_signature, Fdbus_register_signal):
12252 Do not overrun buffer; instead, report string overflow.
12253
12254 * dispnew.c (add_window_display_history): Don't overrun buffer.
12255 Truncate instead; this is OK since it's just a log.
12256
12257 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12258 even if the time zone offset is outlandishly large.
12259 Don't mishandle offset == INT_MIN.
12260
12261 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12262 when creating daemon; the previous buffer-overflow check was incorrect.
12263
12264 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12265 which has the guts of the old verror function.
12266
12267 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12268 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12269
12270 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12271 (font_unparse_xlfd): Don't blindly alloca long strings.
12272 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12273 fits in int, when using sprintf. Use single snprintf to count
12274 length of string rather than counting it via multiple sprintfs;
12275 that's simpler and more reliable.
12276 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12277 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12278 sprintf, in case result does not fit in int.
12279
12280 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12281 (fontset_from_font): Print it.
12282
12283 * frame.c (tty_frame_count): Now printmax_t, not int.
12284 (make_terminal_frame, set_term_frame_name): Print it.
12285 (x_report_frame_params): In X, window IDs are unsigned long,
12286 not signed long, so print them as unsigned.
12287 (validate_x_resource_name): Check for implausibly long names,
12288 and don't assume name length fits in 'int'.
12289 (x_get_resource_string): Don't blindly alloca invocation name;
12290 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12291 not fit in int.
12292
12293 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12294 (xg_check_special_colors, xg_set_geometry):
12295 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12296
12297 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12298 Use esprintf, not sprintf, in case result does not fit in int.
12299
12300 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12301 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12302 it as a large positive number.
12303 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12304 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12305
12306 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12307 in case result does not fit in int.
12308
12309 * print.c (float_to_string): Detect width overflow more reliably.
12310 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12311 buffer overrun. Don't assume list length fits in 'int'. Treat
12312 print length of 0 as 0, not as infinity; to be consistent with other
12313 uses of print length in this function. Don't overflow print length
12314 index. Don't assume hash table size fits in 'long', or that
12315 vectorlike size fits in 'unsigned long'.
12316
12317 * process.c (make_process): Use printmax_t, not int, to format
12318 process-name gensyms.
12319
12320 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12321
12322 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12323 to avoid potential buffer overrun.
12324
12325 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12326 if X resource line is longer than 512 bytes.
12327
12328 * xfns.c (x_window): Make sprintf buffer a bit bigger
12329 to avoid potential buffer overrun.
12330
12331 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12332
12333 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12334
12335 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12336
12337 Integer overflow fixes for scrolling, etc.
12338 Without these, Emacs silently mishandles large integers sometimes.
12339 For example, "C-u 4294967297 M-x recenter" was treated as if
12340 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12341
12342 * xdisp.c (try_window_id): Check Emacs fixnum range before
12343 converting to 'int'.
12344
12345 * window.c (window_scroll_line_based, Frecenter):
12346 Check that an Emacs fixnum is in range before assigning it to 'int'.
12347 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12348 values converted from Emacs fixnums.
12349 (Frecenter): Don't wrap around a line count if it is out of 'int'
12350 range; instead, treat it as an extreme value.
12351 (Fset_window_configuration, compare_window_configurations):
12352 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12353
12354 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12355 that can exceed INT_MAX. Check that EMACS_INT value is in range
12356 before assigning it to the (possibly-narrower) index.
12357 (match_limit): Don't assume that a fixnum can fit in 'int'.
12358
12359 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12360 exceed INT_MAX.
12361
12362 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12363 (Fvertical_motion): Don't wrap around LINES values that don't fit
12364 in 'int'. Instead, treat them as extreme values. This is good
12365 enough for windows, which can't have more than INT_MAX lines anyway.
12366
12367 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12368
12369 * Require libxml/parser.h to avoid compilation warning.
12370
12371 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12372
12373 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12374 since this reportedly can destroy thread storage.
12375
12376 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12377
12378 * syntax.c (find_defun_start): Update all cache variables if
12379 exiting early (Bug#9401).
12380
12381 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12382
12383 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12384
12385 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12386 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12387 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12388
12389 * term.c (tty_append_glyph): New function.
12390 (produce_stretch_glyph): Static function and its prototype deleted.
12391
12392 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12393 Add prototypes.
12394
12395 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12396
12397 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12398 when checking :margin (Bug#9390).
12399 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12400 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12401 so that the name doesn't mislead. All uses changed.
12402
12403 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12404
12405 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12406 set_tty_hooks.
12407
12408 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12409
12410 * xdisp.c (move_it_to): Don't bail out early when reaching
12411 position beyond to_charpos, if we are scanning backwards.
12412 (move_it_vertically_backward): When DY == 0, make sure we get to
12413 the first character in the line after the newline.
12414
12415 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12416
12417 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12418 (ccl_driver): Do not generate an out-of-range pointer.
12419 (Fccl_execute_on_string): Remove unnecessary check for
12420 integer overflow, noted by Stefan Monnier in
12421 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12422 Remove a FIXME that didn't need fixing.
12423 Simplify the newly-introduced buffer reallocation code.
12424
12425 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12426
12427 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12428
12429 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12430
12431 Integer and memory overflow issues (Bug#9196).
12432
12433 * doc.c (get_doc_string): Rework so that
12434 get_doc_string_buffer_size is the actual buffer size, rather than
12435 being 1 less than the actual buffer size; this makes xpalloc more
12436 convenient.
12437
12438 * image.c (x_allocate_bitmap_record, cache_image):
12439 * xselect.c (Fx_register_dnd_atom):
12440 Simplify previous changes by using xpalloc.
12441
12442 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12443 since either will do and ptrdiff_t is convenient with xpalloc.
12444
12445 * charset.c (charset_table_size)
12446 (struct charset_sort_data.priority): Now ptrdiff_t.
12447 (charset_compare): Don't overflow if priorities differ greatly.
12448 (Fsort_charsets): Don't assume list length fits in int.
12449 Check for size-calculation overflow when allocating sort data.
12450 (syms_of_charset): Allocate an initial charset table that is
12451 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12452
12453 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12454
12455 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12456 The actual value is always <= INT_MAX, and leaving it unsigned made
12457 overflow checking harder.
12458
12459 * dispextern.h (struct glyph_matrix.rows_allocated)
12460 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12461 with xpalloc. The values are still always <= INT_MAX.
12462
12463 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12464
12465 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12466 (SAFE_NALLOCA): New macro.
12467
12468 * region-cache.c (struct boundary.pos, find_cache_boundary)
12469 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12470 (set_cache_region, invalidate_region_cache)
12471 (revalidate_region_cache, know_region_cache, region_cache_forward)
12472 (region_cache_backward, pp_cache):
12473 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12474 so that ptrdiff_t * can be passed to xpalloc.
12475 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12476 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12477 (pp_cache): Don't assume cache_len fits in int.
12478 * region-cache.h: Adjust extern decls to match.
12479
12480 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12481 EMACS_INT, since either will do, for xpalloc.
12482
12483 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12484 (xnmalloc, xnrealloc, xpalloc): New functions.
12485
12486 * bidi.c (bidi_shelve_header_size): New constant.
12487 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12488 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12489
12490 * bidi.c (bidi_cache_shrink):
12491 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12492 (overlay_strings):
12493 Don't update size of array until after memory allocation succeeds,
12494 because xmalloc/xrealloc may not return.
12495 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12496 now that we have proper integer overflow checking.
12497 (record_overlay_string, overlay_strings): Catch overflows when
12498 calculating size of overlay_str_buf.
12499
12500 * callproc.c (Fcall_process): Check for size overflow when
12501 calculating size of args2.
12502 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12503 Normally we prefer signed values, but sticking with ptrdiff_t would
12504 require adding more-complicated checks.
12505
12506 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12507 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12508 Redo buffer-overflow calculations to avoid integer overflow.
12509 Add a FIXME comment where memory seems to be over-allocated.
12510
12511 * character.c (Fstring): Check for size-calculation overflow.
12512
12513 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12514 unnecessary integer overflow. Check for size overflow.
12515 (encode_coding_object): Don't update size until xmalloc succeeds.
12516
12517 * composite.c (get_composition_id): Check for overflow in glyph
12518 length calculations.
12519
12520 Integer and memory overflow fixes for display code.
12521 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12522 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12523 (scrolling_window): Check for overflow in size calculations.
12524 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12525 Don't assume glyph table len fits in int.
12526 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12527 (row_table_size): Now ptrdiff_t, not int.
12528 (scrolling_window): Avoid overflow in size calculations.
12529 Don't update size until allocation succeeds.
12530 * fns.c (concat): Check for overflow in size calculations.
12531 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12532 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12533 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12534
12535 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12536 (get_doc_string): Check for size calculation overflow.
12537 Don't update size until allocation succeeds.
12538 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12539 EMACS_INT, where ptrdiff_t will do.
12540 (Fsubstitute_command_keys): Check for string overflow.
12541
12542 * editfns.c (set_time_zone_rule): Don't assume environment length
12543 fits in int.
12544 (message_length): Now ptrdiff_t, not int.
12545 (Fmessage_box): Don't update size until allocation succeeds.
12546 Don't assume message length fits in int.
12547 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12548
12549 * emacs.c (main): Do not reallocate argv, since there is a null at
12550 the end that can be overwritten, and this way there's no need to
12551 worry about size-calculation overflow.
12552 (sort_args): Check for size-calculation overflow.
12553
12554 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12555 alloc succeeds.
12556 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12557
12558 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12559 (x_set_scroll_bar_width, x_figure_window_size):
12560 Check for integer overflow.
12561 (x_set_alpha): Do not assume XINT fits in int.
12562
12563 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12564 This is for the members text_lines, text_cols, total_lines, total_cols,
12565 where the system imposes an 'int' limit.
12566
12567 * fringe.c (Fdefine_fringe_bitmap):
12568 Don't update size until alloc works.
12569
12570 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12571 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12572
12573 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12574 Check for size-calculation overflow.
12575 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12576 do, as we prefer signed integers.
12577 (id_to_widget.max_size, id_to_widget.used)
12578 (xg_store_widget_in_map, xg_remove_widget_from_map)
12579 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12580 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12581 Use and return ptrdiff_t, not int.
12582 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12583 * gtkutil.h: Change prototypes to match the above.
12584
12585 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12586 are duplicate now that they've been promoted to lisp.h.
12587 (x_allocate_bitmap_record, x_alloc_image_color)
12588 (make_image_cache, cache_image, xpm_load):
12589 Don't update size until alloc is done.
12590 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12591 (x_detect_edges):
12592 Check for size calculation overflow.
12593 (ct_colors_allocated_max): New constant.
12594 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12595 overflow.
12596
12597 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12598 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12599 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12600 Use ptrdiff_t, not int, to count maps.
12601 (read_char_minibuf_menu_prompt): Check for overflow in size
12602 calculations. Don't update size until allocation succeeds.
12603 Redo calculations to avoid overflow.
12604 * keyboard.h: Change prototypes to match the above.
12605
12606 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12607 to count maps.
12608 (current_minor_maps): Check for size calculation overflow.
12609 * keymap.h: Change prototypes to match the above.
12610
12611 * lread.c (read1, init_obarray): Don't update size until alloc done.
12612
12613 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12614 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12615
12616 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12617 Now ptrdiff_t, not int.
12618 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12619 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12620
12621 * process.c (Fnetwork_interface_list): Check for overflow
12622 in size calculation.
12623
12624 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12625
12626 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12627 overflow. Don't bother calling xmalloc when xrealloc will do.
12628
12629 * search.c (Freplace_match): Check for size calculation overflow.
12630 (Fset_match_data): Don't assume list lengths fit in 'int'.
12631
12632 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12633 for command line length. Do not attempt to address one before the
12634 beginning of an array, as that's not portable.
12635
12636 * term.c (max_frame_lines): Remove; unused.
12637 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12638 not int.
12639 (encode_terminal_code, calculate_costs): Check for size
12640 calculation overflow.
12641 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12642 table lengths and related sizes. Don't update size until alloc
12643 done. Redo calculations to avoid overflow.
12644 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12645
12646 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12647 subtracting pointers.
12648 (gobble_line): Check for overflow more carefully. Don't update size
12649 until alloc done.
12650
12651 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12652 Don't update size until alloc done.
12653 Redo size calculations to avoid overflow.
12654 Check for size calculation overflow.
12655 (main) [DEBUG]: Fix typo in invoking tparam1.
12656
12657 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12658 Use ptrdiff_t, not int, for sizes.
12659 (store_mode_line_noprop_char): Don't update size until alloc done.
12660
12661 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12662 Use ptrdiff_t, not int, for sizes.
12663 (Finternal_make_lisp_face, cache_face):
12664 Check for size calculation overflow.
12665 (cache_face): Treat size calculation overflows as if they were
12666 memory exhaustion (the usual treatment), rather than aborting.
12667
12668 * xfns.c (x_encode_text, x_set_name_internal)
12669 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12670 sizes, since they can exceed INT_MAX in size. Check for size
12671 calculation overflow.
12672
12673 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12674 (xg_select): Check for size calculation overflow.
12675 Don't update size until alloc done.
12676
12677 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12678 as sprintf is limited to int lengths.
12679
12680 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12681 (X_LONG_MIN): New macros.
12682 Use them to make the following changes clearer.
12683 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12684 This change doesn't affect the value now, but it may help remind
12685 future maintainers not to raise the value too much later.
12686 (SELECTION_QUANTUM): Remove, replacing with ...
12687 (selection_quantum): ... new function, which avoids overflow.
12688 All uses changed.
12689 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12690 assumption that selection length fits in 'int'.
12691 (x_reply_selection_request, x_handle_selection_request)
12692 (x_get_window_property, receive_incremental_selection)
12693 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12694 (lisp_data_to_selection_data, clean_local_selection_data):
12695 Use ptrdiff_t, not int, to record length of selection.
12696 (x_reply_selection_request, x_get_window_property)
12697 (receive_incremental_selection, x_property_data_to_lisp):
12698 Redo calculations to avoid overflow.
12699 (x_reply_selection_request): When sending hint, ceiling it at
12700 X_LONG_MAX rather than relying on wraparound overflow to send
12701 something.
12702 (x_get_window_property, receive_incremental_selection)
12703 (lisp_data_to_selection_data, x_property_data_to_lisp):
12704 Check for size-calculation overflow.
12705 (x_get_window_property, receive_incremental_selection)
12706 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12707 Don't store size until memory allocation succeeds.
12708 (x_get_window_property): Plug memory leak on memory exhaustion.
12709 Don't double-block input; malloc is safe here. Don't assume 2**34
12710 - 4 fits in unsigned long. Add an xassert to check
12711 XGetWindowProperty overflow. Be more careful about overflow
12712 calculations, and distinguish size from memory overflow better.
12713 (receive_incremental_selection): When tracing, don't assume
12714 unsigned int is less than INT_MAX.
12715 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12716 harmful) conversions of unsigned short to int.
12717 (lisp_data_to_selection_data): Don't assume that integers
12718 in the range -65535 through -1 fit in an X unsigned short.
12719 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12720 result parameters unless successful. Rely on cons_to_unsigned
12721 to report problems with elements; the old code wasn't right anyway.
12722 (x_check_property_data): Check for int overflow; we cannot use
12723 a wider type due to X limits.
12724 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12725
12726 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12727
12728 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12729 (x_term_init): Check for size calculation overflow.
12730 (x_color_cells): Don't store size until memory allocation succeeds.
12731 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12732 Don't assume alloca size is less than MAX_ALLOCA.
12733 (x_term_init): Don't assume length fits in int (sprintf is limited
12734 to int size).
12735
12736 Use ptrdiff_t for composition IDs.
12737 * character.c (lisp_string_width):
12738 * composite.c (composition_table_size, n_compositions)
12739 (get_composition_id, composition_gstring_from_id):
12740 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12741 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12742 * window.c (Frecenter):
12743 Use ptrdiff_t, not int, for composition IDs.
12744 * composite.c (get_composition_id): Check for integer overflow.
12745 * composite.h: Adjust prototypes to match the above changes.
12746
12747 Use ptrdiff_t for hash table indexes.
12748 * category.c (hash_get_category_set):
12749 * ccl.c (ccl_driver):
12750 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12751 * coding.c (coding_system_charset_list, detect_coding_system):
12752 * coding.h (struct coding_system.id):
12753 * composite.c (get_composition_id, gstring_lookup_cache):
12754 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12755 * image.c (xpm_get_color_table_h):
12756 * lisp.h (hash_lookup, hash_put):
12757 * minibuf.c (Ftest_completion):
12758 Use ptrdiff_t for hash table indexes, not int (which is too
12759 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12760 32-bit --with-wide-int hosts).
12761
12762 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12763 Add a FIXME comment about memory leaks.
12764 (syms_of_charset): Don't assume xmalloc returns.
12765
12766 Don't assume that stated character widths fit in int.
12767 * character.c (Fchar_width, c_string_width, lisp_string_width):
12768 * character.h (CHAR_WIDTH):
12769 * indent.c (MULTIBYTE_BYTES_WIDTH):
12770 Use sanitize_char_width to avoid undefined and/or bad behavior
12771 with outlandish widths.
12772 * character.h (sanitize_tab_width): Rename from sanitize_width,
12773 now that we have two such functions. All uses changed.
12774 (sanitize_char_width): New inline function.
12775
12776 Don't assume that tab-width fits in int.
12777 * character.h (sanitize_width): New inline function.
12778 (SANE_TAB_WIDTH): New macro.
12779 (ASCII_CHAR_WIDTH): Use it.
12780 * indent.c (sane_tab_width): Remove. All uses replaced by
12781 SANE_TAB_WIDTH (current_buffer).
12782 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12783
12784 * fileio.c: Integer overflow issues with file modes.
12785 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12786
12787 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12788 Remove unreachable code.
12789 (read_hex, load_charset_map_from_file): Check for integer overflow.
12790
12791 * xterm.c: Don't go over XClientMessageEvent limit.
12792 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12793 (x_send_scroll_bar_event): Likewise. Check that the size does not
12794 exceed limits imposed by XClientMessageEvent, as well as the usual
12795 ptrdiff_t and size_t limits.
12796
12797 * keyboard.c: Overflow, signedness and related fixes.
12798 (make_lispy_movement): Use same integer type in forward decl
12799 that is used in the definition.
12800 (read_key_sequence, keyremap_step):
12801 Change bufsize argument back to int, undoing my 2011-03-30 change.
12802 We prefer signed types, and int is wide enough here.
12803 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12804 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12805 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12806 length, not size_t. Use ptrdiff_t for index, not int.
12807 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12808 possibility of integer overflow.
12809
12810 Overflow, signedness and related fixes for images.
12811
12812 * dispextern.h (struct it.stack[0].u.image.image_id)
12813 (struct_it.image_id, struct image.id, struct image_cache.size)
12814 (struct image_cache.used, struct image_cache.ref_count):
12815 * gtkutil.c (update_frame_tool_bar):
12816 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12817 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12818 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12819 * nsmenu.m (update_frame_tool_bar):
12820 * xdisp.c (calc_pixel_width_or_height):
12821 * xfns.c (image_cache_refcount):
12822 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12823 on typical 64-bit hosts.
12824
12825 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12826 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12827 Omit unnecessary casts to int.
12828 (parse_image_spec): Check that integers fall into 'int' range
12829 when the callers expect that.
12830 (image_ascent): Redo ascent calculation to avoid int overflow.
12831 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12832 (lookup_image): Remove unnecessary tests.
12833 (xbm_image_p): Locals are now of int, not EMACS_INT,
12834 since parse_image_check makes sure they fit into int.
12835 (png_load, gif_load, svg_load_image):
12836 Prefer int to unsigned where either will do.
12837 (tiff_handler): New function, combining the cores of the
12838 old tiff_error_handler and tiff_warning_handler.
12839 This function is rewritten to use vsnprintf and thereby avoid
12840 stack buffer overflows. It uses only the features of vsnprintf
12841 that are common to both POSIX and native Microsoft.
12842 (tiff_error_handler, tiff_warning_handler): Use it.
12843 (tiff_load, gif_load, imagemagick_load_image):
12844 Don't assume :index value fits in 'int'.
12845 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12846 (imagemagick_load_image): Check that crop parameters fit into
12847 the integer types that MagickCropImage accepts. Don't assume
12848 Vimagemagick_render_type has a nonnegative value. Don't assume
12849 size_t fits in 'long'.
12850 (gs_load): Use printmax_t to print the widest integers possible.
12851 Check for integer overflow when computing image height and width.
12852
12853 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12854
12855 * xdisp.c (redisplay_window): Don't force window start if point
12856 will be invisible in the resulting window. (Bug#9324)
12857
12858 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12859
12860 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12861 the display spec is of the form `(space ...)'.
12862 (handle_display_spec): Return the value returned by
12863 handle_single_display_spec, not just 1 or zero.
12864 (handle_single_display_spec): If the display spec is of the form
12865 `(space ...)', and specifies display in the text area, return 2
12866 rather than 1.
12867 (try_cursor_movement): Check for the need to scroll more
12868 accurately, and prefer exact match for point under bidi.
12869 Don't advance `row' beyond the last row of the window.
12870
12871 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12872 into disp_prop; all users changed.
12873
12874 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12875 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12876 for the text covered by the display property.
12877
12878 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12879
12880 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12881 Change return value to nil.
12882 (Frecord_buffer): Delete unused function.
12883
12884 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12885
12886 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12887 buffers, return left-to-right.
12888 (set_cursor_from_row): Consider candidate row a win if its glyph
12889 represents a newline and point is on that newline. Fixes cursor
12890 positioning on the newline at EOL of R2L text within L2R
12891 paragraph, and vice versa.
12892 (try_cursor_movement): Check continued rows, in addition to
12893 continuation rows. Fixes unwarranted scroll when point enters a
12894 continued line of R2L text within an L2R paragraph, or vice versa.
12895 (cursor_row_p): Consider the case of point being equal to
12896 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12897 from the end of a short line to the beginning of a continued line
12898 of R2L text within L2R paragraph.
12899 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12900 composed characters.
12901
12902 * bidi.c (bidi_check_type): Use xassert.
12903 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12904 members.
12905
12906 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12907
12908 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12909 a character.
12910
12911 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12912
12913 * nsfont.m (ns_otf_to_script): Fix typo.
12914
12915 2011-08-22 Kenichi Handa <handa@m17n.org>
12916
12917 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12918 extra slot even if the purpose is char-code-property-table.
12919
12920 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12921
12922 * xdisp.c (redisplay_window): When computing centering_position,
12923 account for the height of the header line. (Bug#8874)
12924
12925 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12926 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12927 candidate is selected by the mouse, and that candidate has a
12928 composed character under the mouse.
12929
12930 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12931 coordinates reported by pos-visible-in-window-p for a composed
12932 character in column zero.
12933
12934 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12935
12936 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12937
12938 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12939
12940 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12941 consider it a hit if to_charpos is anywhere in the range of the
12942 composed buffer positions.
12943
12944 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12945
12946 * image.c (gif_load): Don't assume that each subimage has the same
12947 dimensions as the base image. Handle disposal method that is
12948 "undefined" by the gif spec (Bug#9335).
12949
12950 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12951
12952 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12953 (Fcondition_case): Document `debug' symbol in error handler.
12954
12955 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12956
12957 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12958 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12959 from an Org mode buffer to a Speedbar frame.
12960
12961 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12962 a composition, take its buffer position from IT->cmp_it.charpos.
12963 Fixes cursor positioning at the beginning of a line that begins
12964 with a composed character.
12965
12966 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12967
12968 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12969 character bidirectional type, use STRONG_L instead. Fixes crashes
12970 in a buffer produced by `describe-categories'.
12971
12972 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12973 members before the level stack, so they would be saved and
12974 restored when copying iterator state. Fixes incorrect reordering
12975 around TABs covered by display properties.
12976
12977 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12978
12979 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12980
12981 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12982
12983 * eval.c (internal_condition_case, internal_condition_case_1)
12984 (internal_condition_case_2, internal_condition_case_n):
12985 Remove unnecessary aborts (Bug#9081).
12986
12987 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12988
12989 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12990 has no `load' handler, try opening the file locally. (Bug#9311)
12991
12992 2011-08-16 Ken Brown <kbrown@cornell.edu>
12993
12994 * gmalloc.c: Expand comment.
12995
12996 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12997
12998 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12999 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13000
13001 2011-08-16 Ken Brown <kbrown@cornell.edu>
13002
13003 Fix memory allocation problems in Cygwin build (Bug#9273).
13004
13005 * unexcw.c ( __malloc_initialized): Declare external variable.
13006 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13007
13008 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13009 New variables.
13010 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13011 dumped emacs.
13012 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13013 in the static heap.
13014 [CYGWIN] (special_realloc): New function.
13015 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13016 requests to realloc storage in the static heap.
13017
13018 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13019
13020 * bidi.c (bidi_initialize): Remove unused local.
13021
13022 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13023
13024 * bidimirror.h:
13025 * biditype.h: Remove file.
13026 * makefile.w32-in ($(BLD)/bidi.$(O)):
13027 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13028
13029 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13030
13031 * chartab.c: Improve commentary for the uniprop_table API.
13032
13033 * bidi.c (bidi_paragraph_init): Support zero value of
13034 bidi_ignore_explicit_marks_for_paragraph_level.
13035 (bidi_initialize): Use uniprop_table instead of including
13036 biditype.h and bidimirror.h.
13037
13038 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13039 coordinates of the iterator when restoring from ppos_it.
13040 (Bug#9296)
13041
13042 2011-08-14 Kenichi Handa <handa@m17n.org>
13043
13044 * process.c (create_process): Call setup_process_coding_systems
13045 after the pid of the process is set to -1 (Bug#8162).
13046
13047 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13048
13049 * xdisp.c (move_it_in_display_line_to): Don't invoke
13050 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13051 ppos_it. Fixes vertical cursor motion when line beginning is
13052 covered by an image. (Bug#9296)
13053
13054 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13055
13056 * nsterm.h (ns_run_ascript): Declare.
13057 (NSAPP_DATA2_RUNASSCRIPT): Define.
13058
13059 * nsfns.m (as_script, as_result, as_status): New static variables.
13060 (ns_run_ascript): New function.
13061 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13062 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13063 the event loop. Get status from as_status (Bug#7276).
13064
13065 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13066 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13067 the event loop (Bug#7276).
13068
13069 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13070
13071 * gnutls.c (QCgnutls_bootprop_priority)
13072 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13073 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13074 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13075 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13076 (QCgnutls_bootprop_verify_hostname_error)
13077 (QCgnutls_bootprop_callbacks_verify): Rename from
13078 Qgnutls_bootprop_..., all uses changed.
13079
13080 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13081 uses changed.
13082
13083 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13084
13085 * xfaces.c (Qframe_set_background_mode): Now static.
13086 * dispextern.h (Qframe_set_background_mode): Remove decl.
13087
13088 * process.c (Fnetwork_interface_info): Declare local only if needed.
13089
13090 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13091
13092 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13093 (Fnetwork_interface_list): Allocate in increments of bytes instead
13094 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13095 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13096 sockaddr.
13097 (struct ifflag_def): notrailers is smart on OSX.
13098 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13099 Get hardware address with getifaddrs if available.
13100
13101 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13102
13103 * xdisp.c (iterate_out_of_display_property): xassert that
13104 IT->position is set to within IT->object's boundaries. Break from
13105 the loop as soon as EOB is reached; avoids infloops in redisplay
13106 when IT->position is set up wrongly due to some bug.
13107 Set IT->current to match the bidi iterator unconditionally.
13108 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13109 entry. Force push_it to save on the stack the current
13110 buffer/string position, to be restored by pop_it. Fix flags in
13111 the iterator structure wrt the object coming from a display
13112 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13113 properties. (Bug#9284)
13114
13115 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13116
13117 * fontset.c (fontset_get_font_group): Add proper type checks.
13118 (Bug#9172)
13119
13120 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13121
13122 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13123 and LC_VERSION_MIN_MACOSX.
13124 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13125 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13126
13127 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13128
13129 * xdisp.c (forward_to_next_line_start): Allow to use the
13130 no-display-properties-and-no-overlays under bidi display.
13131 Set disp_pos in the bidi iterator to avoid searches for display
13132 properties and overlays.
13133
13134 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13135
13136 * editfns.c (Fset_time_zone_rule): Document relationship with the
13137 setenv function.
13138
13139 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13140 the font entity extracted from the cache (Bug#8109).
13141
13142 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13143
13144 * composite.c (autocmp_chars): Don't reset point. That is done by
13145 restore_point_unwind (Bug#5984).
13146
13147 2011-08-07 Juri Linkov <juri@jurta.org>
13148
13149 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13150 to show the arg `TIME' instead of `TIMEVAL'.
13151
13152 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13153
13154 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13155 display property strides EOL and includes a newline, as in
13156 longlines-mode. (Bug#9254)
13157 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13158 word-wrap under bidirectional display. (Bug#9224)
13159
13160 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13161 is non-zero, even if the data buffer is NULL. Fixes a crash in
13162 vertical-motion with longlines-mode. (Bug#9254)
13163
13164 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13165
13166 * bidi.c <bidi_cache_total_alloc>: Now static.
13167 (bidi_initialize): Initialize bidi_cache_total_alloc.
13168
13169 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13170 cache. (Bug#9221)
13171
13172 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13173 amount allocated this far in `bidi_cache_total_alloc'.
13174 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13175 non-zero, only free the data buffer without restoring the cache
13176 contents. All callers changed.
13177
13178 * dispextern.h (bidi_unshelve_cache): Update prototype.
13179
13180 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13181 (move_it_in_display_line, move_it_to)
13182 (move_it_vertically_backward, move_it_by_lines): Replace the call
13183 to xfree to an equivalent call to bidi_unshelve_cache.
13184 (move_it_in_display_line_to): Fix logic of returning
13185 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13186
13187 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13188
13189 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13190 came from a string character with a `cursor' property. (Bug#9229)
13191
13192 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13193
13194 * Makefile.in (LIB_PTHREAD): New variable.
13195 (LIBES): Add LIB_PTHREAD (Bug#9216).
13196
13197 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13198 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13199
13200 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13201
13202 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13203
13204 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13205
13206 * xterm.c (x_find_topmost_parent): New function.
13207 (x_set_frame_alpha): Find topmost parent window with
13208 x_find_topmost_parent and set the property there also (bug#9181).
13209 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13210
13211 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13212
13213 * callproc.c (Fcall_process): Avoid vfork clobbering
13214 the local vars buffer, coding_systems, current_dir.
13215
13216 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13217
13218 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13219
13220 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13221
13222 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13223 so that it is not optimized away.
13224
13225 * xdisp.c (compute_display_string_pos): Remove unused local.
13226
13227 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13228
13229 Fix slow cursor motion and scrolling in large buffers with
13230 selective display, like Org Mode buffers. (Bug#9218)
13231
13232 * dispextern.h (struct bidi_it): New member disp_prop_p.
13233
13234 * xdisp.c: Remove one-slot cache of display string positions.
13235 (compute_display_string_pos): Accept an additional argument
13236 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13237 for a display string or property. If found, set DISP_PROP_P
13238 non-zero.
13239
13240 * bidi.c (bidi_fetch_char): Accept an additional argument
13241 DISP_PROP_P, and pass it to compute_display_string_pos.
13242 Only handle text covered by a display string if DISP_PROP_P is returned
13243 non-zero. All callers of bidi_fetch_char changed.
13244
13245 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13246
13247 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13248
13249 2010-12-03 Don March <don@ohspite.net>
13250
13251 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13252 last character M-[char] is translated to ESC [char] (bug#7541).
13253
13254 2011-08-02 Kenichi Handa <handa@m17n.org>
13255
13256 * lisp.h (uniprop_table): Extern it.
13257
13258 * chartab.c (uniprop_table): Make it non-static.
13259
13260 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13261
13262 * xdisp.c (forward_to_next_line_start): Accept additional argument
13263 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13264 on the newline.
13265 (reseat_at_next_visible_line_start): Use the bidi iterator state
13266 returned by forward_to_next_line_start to restore the state of
13267 it->bidi_it after backing up to previous newline. (Bug#9212)
13268
13269 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13270
13271 * regex.c (re_comp): Protoize.
13272 (re_exec): Fix return type.
13273 (regexec): Fix type of `ret'. (Bug#9203)
13274
13275 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13276
13277 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13278 This is needed if max-image-size is a floating-point number.
13279
13280 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13281
13282 * print.c (print_object): Print empty symbol as ##.
13283
13284 * lread.c (read1): Read ## as empty symbol.
13285
13286 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13287
13288 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13289 setting frame foreground color (Bug#9175).
13290 (x_set_background_color): Likewise.
13291
13292 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13293 contents (Bug#9176).
13294 (EmacsTooltip -init): Remove bezels and add shadows to
13295 tooltip windows.
13296
13297 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13298 or scroll bar (Bug#8470).
13299
13300 * nsfont.m (nsfont_open): Remove assignment to voffset and
13301 unnecessary vars hshink, expand, hd, full_height, min_height.
13302 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13303
13304 * nsterm.h (nsfont_info): Remove voffset field.
13305
13306 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13307
13308 Implement strike-through and overline on NextStep (Bug#8863).
13309
13310 * nsfont.m (nsfont_open): Use underline position provided by font,
13311 instead of hard-coded value of 2.
13312 (nsfont_draw): Call ns_draw_text_decoration instead.
13313
13314 * nsterm.h: Add declaration for ns_draw_text_decoration.
13315
13316 * nsterm.m (ns_draw_text_decoration): New function for drawing
13317 underline, overline, and strike-through.
13318 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13319 ns_draw_text_decoration. Change treatment of cursor drawing to
13320 accommodate underlining, etc.
13321
13322 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13323
13324 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13325 default.
13326
13327 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13328
13329 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13330 Without this fix, if a signal arrives just after memory fills up,
13331 'malloc' might be invoked reentrantly.
13332
13333 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13334 In other words, assume that every image size is allowed, on non-X
13335 hosts. This assumption is probably wrong, but it lets Emacs compile.
13336
13337 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13338
13339 * regex.c (re_iswctype): Convert return values to boolean.
13340
13341 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13342
13343 * xdisp.c (compute_display_string_pos): Don't use cached display
13344 string position if the buffer had its restriction changed.
13345 (Bug#9184)
13346
13347 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13348
13349 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13350
13351 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 Integer signedness and overflow and related fixes. (Bug#9079)
13354
13355 * bidi.c: Integer size and overflow fixes.
13356 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13357 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13358 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13359 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13360 (bidi_find_other_level_edge):
13361 Use ptrdiff_t instead of EMACS_INT where either will do.
13362 This works better on 32-bit hosts configured --with-wide-int.
13363 (bidi_cache_ensure_space): Check for size-calculation overflow.
13364 Use % rather than repeated addition, for better worst-case speed.
13365 Don't set bidi_cache_size until after xrealloc returns, because it
13366 might not return.
13367 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13368 (bidi_cache_ensure_space): Also check that the bidi cache size
13369 does not exceed that of the largest Lisp string or buffer. See Eli
13370 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13371
13372 * alloc.c (__malloc_size_t): Remove.
13373 All uses replaced by size_t. See Andreas Schwab's note
13374 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13375
13376 * image.c: Improve checking for integer overflow.
13377 (check_image_size): Assume that f is nonnull, since
13378 it is always nonnull in practice. This is one less thing to
13379 worry about when checking for integer overflow later.
13380 (x_check_image_size): New function, which checks for integer
13381 overflow issues inside X.
13382 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13383 This removes the need for a memory_full check.
13384 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13385 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13386 (xbm_read_bitmap_data): Change locals back to 'int', since
13387 their values must fit in 'int'.
13388 (xpm_load_image, png_load, tiff_load):
13389 Invoke x_create_x_image_and_pixmap earlier,
13390 to avoid much needless work if the image is too large.
13391 (tiff_load): Treat overly large images as if
13392 x_create_x_image_and_pixmap failed, not as malloc failures.
13393 (gs_load): Use x_check_image_size.
13394
13395 * gtkutil.c: Omit integer casts.
13396 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13397 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13398
13399 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13400
13401 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13402 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13403 would wrongly return t on a 64-bit host.
13404
13405 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13406 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13407 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13408 and therefore cause GCC to emit a bogus diagnostic in some cases.
13409
13410 * image.c: Integer signedness and overflow and related fixes.
13411 This is not an exhaustive set of fixes, but it's time to
13412 record what I've got.
13413 (lookup_pixel_color, check_image_size): Remove redundant decls.
13414 (check_image_size): Don't assume that arbitrary EMACS_INT values
13415 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13416 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13417 (tiff_load, imagemagick_load_image):
13418 Check for overflow in size calculations.
13419 (x_create_x_image_and_pixmap): Remove unnecessary test for
13420 xmalloc returning NULL; that can't happen.
13421 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13422 (xpm_color_bucket): Use better integer hashing function.
13423 (xpm_cache_color): Don't possibly over-allocate memory.
13424 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13425 (gif_memory_source):
13426 Use ptrdiff_t, not int or size_t, to record sizes.
13427 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13428 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13429 either works, as we prefer signed integers.
13430 (tiff_read_from_memory, tiff_write_from_memory):
13431 Return tsize_t, not size_t, since that's what the TIFF API wants.
13432 (tiff_read_from_memory): Don't fail simply because the read would
13433 go past EOF; instead, return a short read.
13434 (tiff_load): Omit no-longer-needed casts.
13435 (Fimagemagick_types): Don't assume size fits into 'int'.
13436
13437 Improve hashing quality when configured --with-wide-int.
13438 * fns.c (hash_string): New function, taken from sxhash_string.
13439 Do not discard information about ASCII character case; this
13440 discarding is no longer needed.
13441 (sxhash-string): Use it. Change sig to match it. Caller changed.
13442 * lisp.h: Declare it.
13443 * lread.c (hash_string): Remove, since we now use fns.c's version.
13444 The fns.c version returns a wider integer if --with-wide-int is
13445 specified, so this should help the quality of the hashing a bit.
13446
13447 * emacs.c: Integer overflow minor fix.
13448 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13449 Define only if GNU_LINUX.
13450 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13451
13452 * dispnew.c: Integer signedness and overflow fixes.
13453 Remove unnecessary forward decls, that were a maintenance hassle.
13454 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13455 All uses changed.
13456 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13457 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13458 (prepare_desired_row, line_draw_cost):
13459 Use int, not unsigned, where either works.
13460 (save_current_matrix, restore_current_matrix):
13461 Use ptrdiff_t, not size_t, where either works.
13462 (init_display): Check for overflow more accurately, and without
13463 relying on undefined behavior.
13464
13465 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13466 Remove, replacing with the new symbols in lisp.h. All uses changed.
13467 * fileio.c (make_temp_name):
13468 * filelock.c (lock_file_1, lock_file):
13469 * xdisp.c (message_dolog):
13470 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13471 Use pMd etc. instead.
13472 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13473 replacing the pWIDE etc. symbols removed from editfns.c.
13474
13475 * keyboard.h (num_input_events): Now uintmax_t.
13476 This is (very slightly) less likely to mess up due to wraparound.
13477 All uses changed.
13478
13479 * buffer.c: Integer signedness fixes.
13480 (alloc_buffer_text, enlarge_buffer_text):
13481 Use ptrdiff_t rather than size_t when either will do, as we prefer
13482 signed integers.
13483
13484 * alloc.c: Integer signedness and overflow fixes.
13485 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13486 (__malloc_size_t): Default to size_t, not to int.
13487 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13488 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13489 Prefer ptrdiff_t to size_t when either would do, as we prefer
13490 signed integers.
13491 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13492 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13493 Now const. Initialize with values that are in range even if char
13494 is signed.
13495 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13496 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13497 These functions do the right thing with sizes > 2**32.
13498 (check_depth): Now ptrdiff_t, not int.
13499 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13500 Adjust to new way of storing sizes. Check for size overflow bugs
13501 in rest of code.
13502 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13503 slightly wrong anyway, as it missed one instance of
13504 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13505 (refill_memory_reserve): Omit needless cast to size_t.
13506 (mark_object_loop_halt): Mark as externally visible.
13507
13508 * xselect.c: Integer signedness and overflow fixes.
13509 (Fx_register_dnd_atom, x_handle_dnd_message):
13510 Use ptrdiff_t, not size_t, since we prefer signed.
13511 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13512 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13513 x_dnd_atoms_size and x_dnd_atoms_length.
13514
13515 * doprnt.c: Prefer signed to unsigned when either works.
13516 * eval.c (verror):
13517 * doprnt.c (doprnt):
13518 * lisp.h (doprnt):
13519 * xdisp.c (vmessage):
13520 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13521 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13522 prefer signed arithmetic to avoid comparison confusion.
13523 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13524 but is a bit tricky.
13525
13526 Assume freestanding C89 headers, string.h, stdlib.h.
13527 * data.c, doprnt.c, floatfns.c, print.c:
13528 Include float.h unconditionally.
13529 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13530 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13531 * regex.c: Likewise for stddef.h, string.h.
13532 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13533 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13534 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13535 (STDC_HEADERS): Remove obsolete defines.
13536 * sysdep.c: Include limits.h unconditionally.
13537
13538 Assume support for memcmp, memcpy, memmove, memset.
13539 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13540 * regex.c (memcmp, memcpy):
13541 Remove; we assume C89 now.
13542
13543 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13544 (__malloc_safe_bcopy): Remove; no longer needed.
13545
13546 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13547 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13548 well either way, and we prefer signed to unsigned.
13549
13550 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13551
13552 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13553 closes the connection while we're reading (bug#9182).
13554
13555 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13556
13557 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13558 are specified (Bug#9168).
13559
13560 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13561
13562 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13563 Found by GCC static checking and --with-wide-int on a 32-bit host.
13564
13565 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13566
13567 * xdisp.c (compute_display_string_pos): Fix logic of caching
13568 previous display string position. Initialize cached_prev_pos to
13569 -1. Fixes slow-down at the beginning of a buffer.
13570
13571 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13572
13573 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13574 for attrs[LFACE_FONTSET_INDEX].
13575
13576 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13577
13578 * xml.c (parse_region): Remove unused local
13579 that was recently introduced.
13580
13581 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13582
13583 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13584 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13585
13586 * xdisp.c (move_it_in_display_line_to): Record the best matching
13587 position for TO_CHARPOS while scanning the line, and restore it on
13588 exit if none of the characters scanned was an exact match.
13589 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13590 when exact match is impossible due to invisible text, and the
13591 lines are truncated.
13592
13593 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13594
13595 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13596 for OSX >= 10.7.
13597
13598 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13599
13600 Fix a significant slow-down of cursor motion with C-n, C-p,
13601 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13602 auto-repeat under bidi redisplay in fontified buffers.
13603 * xdisp.c (compute_stop_pos_backwards): New function.
13604 (next_element_from_buffer): Call compute_stop_pos_backwards to
13605 find a suitable prev_stop when we find ourselves before
13606 base_level_stop.
13607 (reseat): Don't look for prev_stop, as that could mean a very long
13608 run.
13609 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13610 <cached_disp_overlay_modiff>: Cache for last found display string
13611 position.
13612 (compute_display_string_pos): Return the cached position if asked
13613 about the same buffer in the same area of character positions, and
13614 the buffer wasn't changed since the time the display string
13615 position was cached.
13616
13617 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13618
13619 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13620 is an integer, which is important for empty lines. (Bug#9149)
13621
13622 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13623
13624 * frame.c (Fmodify_frame_parameters): In tty case, update the
13625 default face if necessary (Bug#4238).
13626
13627 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13628
13629 * editfns.c (Fstring_to_char): No need to explain what a character
13630 is in the docstring (Bug#6576).
13631
13632 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13633
13634 * xml.c (parse_region): Make sure we always return a tree.
13635
13636 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13637
13638 * xml.c (parse_region): If a document contains only comments,
13639 return that, too.
13640
13641 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13642
13643 * xml.c (make_dom): Return comments, too.
13644
13645 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13646
13647 Port to OpenBSD.
13648 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13649 and the surrounding thread.
13650 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13651 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13652 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13653 timer goes off.
13654 * s/openbsd.h (BROKEN_SIGIO): Define.
13655 * unexelf.c (unexec) [__OpenBSD__]:
13656 Don't update the .mdebug section of the Alpha COFF symbol table.
13657
13658 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13659
13660 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13661 (bug#8460).
13662
13663 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13664
13665 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13666 This fixes some race conditions on the permissions of any newly
13667 created file.
13668
13669 * alloc.c (valid_pointer_p): Use pipe, not open.
13670 This fixes some permissions issues when debugging.
13671
13672 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13673 If fchown fails to set both uid and gid, try to set just gid,
13674 as that is sometimes allowed. Adjust the file's mode to eliminate
13675 setuid or setgid bits that are inappropriate if fchown fails.
13676
13677 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13678
13679 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13680 to compare Lisp_Objects.
13681 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13682 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13683 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13684
13685 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13686
13687 * lread.c (read_integer): Unread even EOF character.
13688 (read1): Likewise. Properly record start position of symbol.
13689
13690 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13691 symbol character follows.
13692
13693 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13694
13695 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13696 This works around a problem with the previous change to Fcopy_file.
13697 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13698 and without this change, GCC might complain about discarding
13699 fchown's return value.
13700
13701 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13702
13703 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13704
13705 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13706
13707 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13708
13709 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13710
13711 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13712 it's used from the C level.
13713
13714 * process.c: Use the same condition for POLL_FOR_INPUT in both
13715 keyboard.c and process.c (bug#1858).
13716
13717 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13718
13719 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13720 (Fgnutls_boot): Use it.
13721
13722 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13723
13724 * doc.c (Fsubstitute_command_keys): Revert last change.
13725
13726 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13727
13728 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13729 quotes the next character, and doesn't affect other longer
13730 sequences (bug#8935).
13731
13732 * lread.c (syms_of_lread): Clarify that is isn't only
13733 `eval-buffer' and `eval-defun' that's affected by
13734 `lexical-binding' (bug#8460).
13735
13736 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13737
13738 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13739 bidi redisplay when a line includes both an image and is truncated.
13740
13741 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13742
13743 Fix minor problems found by static checking.
13744 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13745 (elsz): Now a signed constant, not a size_t var. We prefer signed
13746 types to unsigned, to avoid integer comparison confusion. Without
13747 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13748 "cannot optimize loop, the loop counter may overflow", a symptom
13749 of the confusion.
13750 * indent.c (Fvertical_motion): Mark locals as initialized.
13751 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13752
13753 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13754
13755 * search.c (Fre_search_backward): Mention `case-fold-search' in
13756 all the re_search_* functions (bug#8138).
13757
13758 * keyboard.c (Fopen_dribble_file): Document when the file is
13759 closed (bug#8056).
13760
13761 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13762
13763 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13764 bidi_cache_idx.
13765
13766 Support bidi reordering of display and overlay strings.
13767 * xdisp.c (compute_display_string_pos)
13768 (compute_display_string_end): Accept additional argument STRING.
13769 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13770 (reseat_to_string): Initialize bidi_it->string.s and
13771 bidi_it->string.schars.
13772 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13773 NULL (avoids a crash in bidi_paragraph_init).
13774 Initialize itb.string.lstring.
13775 (init_iterator): Call bidi_init_it only of a valid
13776 buffer position was specified. Initialize paragraph_embedding to
13777 L2R.
13778 (reseat_to_string): Initialize the bidi iterator.
13779 (display_string): If we need to ignore text properties of
13780 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13781 original value of -1 will not work with bidi.)
13782 (compute_display_string_pos): First arg is now struct
13783 `text_pos *'; all callers changed. Support display properties on
13784 Lisp strings.
13785 (compute_display_string_end): Support display properties on Lisp
13786 strings.
13787 (init_iterator, reseat_1, reseat_to_string): Initialize the
13788 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13789 when iterating on a string not from display properties).
13790 (compute_display_string_pos, compute_display_string_end):
13791 Fix calculation of the object to scan. Fixes an error when using
13792 arrow keys.
13793 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13794 base_level_stop; instead, set base_level_stop to BEGV.
13795 Fixes crashes in vertical-motion.
13796 (next_element_from_buffer): Improve commentary for when
13797 the iterator is before prev_stop.
13798 (init_iterator): Initialize bidi_p from the default value of
13799 bidi-display-reordering, not from buffer-local value. Use the
13800 buffer-local value only if initializing for buffer iteration.
13801 (handle_invisible_prop): Support invisible properties on strings
13802 that are being bidi-reordered.
13803 (set_iterator_to_next): Support bidi reordering of C strings and
13804 Lisp strings.
13805 (next_element_from_string): Support bidi reordering of Lisp
13806 strings.
13807 (handle_stop_backwards): Support Lisp strings as well.
13808 (display_string): Support display of R2L glyph rows.
13809 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13810 (init_iterator): Don't initialize it->bidi_p for strings
13811 here.
13812 (reseat_to_string): Initialize it->bidi_p for strings here.
13813 (next_element_from_string, next_element_from_c_string)
13814 (next_element_from_buffer): Add xassert's for correspondence
13815 between IT's object being iterated and it->bidi_it.string
13816 structure.
13817 (face_before_or_after_it_pos): Support bidi iteration.
13818 (next_element_from_c_string): Handle the case of the first string
13819 character that is not the first one in the visual order.
13820 (get_visually_first_element): New function, refactored from common
13821 parts of next_element_from_buffer, next_element_from_string, and
13822 next_element_from_c_string.
13823 (tool_bar_lines_needed, redisplay_tool_bar)
13824 (display_menu_bar): Force left-to-right direction. Add a FIXME
13825 comment for making that be controlled by a user option.
13826 (push_it, pop_it): Save and restore the state of the
13827 bidi iterator. Save and restore the bidi_p flag.
13828 (pop_it): Iterate out of display property for string iteration as
13829 well.
13830 (iterate_out_of_display_property): Support iteration over strings.
13831 (handle_single_display_spec): Set up it->bidi_it for iteration
13832 over a display string, and call bidi_init_it.
13833 (handle_single_display_spec, next_overlay_string)
13834 (get_overlay_strings_1, push_display_prop): Set up the bidi
13835 iterator for displaying display or overlay strings.
13836 (forward_to_next_line_start): Don't use the shortcut if
13837 bidi-iterating.
13838 (back_to_previous_visible_line_start): If handle_display_prop
13839 pushed the iterator stack, restore the internal state of the bidi
13840 iterator by calling bidi_pop_it same number of times.
13841 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13842 and we are bidi-iterating, don't decrement the iterator position;
13843 instead, set the first_elt flag in the bidi iterator, to produce
13844 the same effect.
13845 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13846 (push_display_prop): xassert that we are iterating a buffer.
13847 (push_it, pop_it): Save and restore paragraph_embedding member.
13848 (handle_single_display_spec, next_overlay_string)
13849 (get_overlay_strings_1, reseat_1, reseat_to_string)
13850 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13851 correctly. Don't assume unibyte strings are not bidi-reordered.
13852 (compute_display_string_pos)
13853 (compute_display_string_end): Fix handling the case of C string.
13854 (push_it, pop_it): Save and restore from_disp_prop_p.
13855 (handle_single_display_spec, push_display_prop): Set the
13856 from_disp_prop_p flag.
13857 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13858 (pop_it): Call iterate_out_of_display_property only if we are
13859 popping after iteration over a string that came from a display
13860 property. Fix a typo in popping stretch info. Add an assertion
13861 for verifying that the iterator position is in sync with the bidi
13862 iterator.
13863 (handle_single_display_spec, get_overlay_strings_1)
13864 (push_display_prop): Fix initialization of paragraph direction for
13865 string when that of the parent object is not yet determined.
13866 (reseat_1): Call bidi_init_it to resync the bidi
13867 iterator with IT's position. (Bug#7616)
13868 (find_row_edges): If ROW->start.pos gives position
13869 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13870 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13871 Reset the from_disp_prop_p flag.
13872 (SAVE_IT, RESTORE_IT): New macros.
13873 (pos_visible_p, face_before_or_after_it_pos)
13874 (back_to_previous_visible_line_start)
13875 (move_it_in_display_line_to, move_it_in_display_line)
13876 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13877 (try_scrolling, redisplay_window, display_line): Use them when
13878 saving a temporary copy of the iterator and restoring it back.
13879 (back_to_previous_visible_line_start, reseat_1)
13880 (init_iterator): Empty the bidi cache "stack".
13881 (move_it_in_display_line_to): If iterator ended up at
13882 EOL, but we never saw any buffer positions smaller than
13883 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13884 motion in bidi-reordered lines.
13885 (move_it_in_display_line_to): Record prev_method and prev_pos
13886 immediately before the call to set_iterator_to_next. Fixes cursor
13887 motion in bidi-reordered lines with stretch glyphs and strings
13888 displayed in margins. (Bug#8133) (Bug#8867)
13889 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13890 TO_CHARPOS.
13891 (pos_visible_p): Support positions in bidi-reordered lines.
13892 Save and restore bidi cache.
13893
13894 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13895 (bidi_paragraph_info): Delete unused struct.
13896 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13897 (bidi_cache_start): New variable.
13898 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13899 to zero.
13900 (bidi_cache_fetch_state, bidi_cache_search)
13901 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13902 (bidi_cache_find, bidi_peek_at_next_level)
13903 (bidi_level_of_next_char, bidi_find_other_level_edge)
13904 (bidi_move_to_visually_next): Compare cache index with
13905 bidi_cache_start rather than with zero.
13906 (bidi_fetch_char): Accept new argument STRING; all callers
13907 changed. Support iteration over a string. Support strings with
13908 display properties. Support unibyte strings. Fix the type of
13909 `len' according to what STRING_CHAR_AND_LENGTH expects.
13910 (bidi_paragraph_init, bidi_resolve_explicit_1)
13911 (bidi_resolve_explicit, bidi_resolve_weak)
13912 (bidi_level_of_next_char, bidi_move_to_visually_next):
13913 Support iteration over a string.
13914 (bidi_set_sor_type, bidi_resolve_explicit_1)
13915 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13916 can now be zero (for strings); special values 0 and -1 were
13917 changed to -1 and -2, respectively.
13918 (bidi_char_at_pos): New function.
13919 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13920 Call it instead of FETCH_MULTIBYTE_CHAR.
13921 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13922 initialized to valid values.
13923 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13924 values.
13925 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13926 the test for valid cached positions. Fix the logic for looking up
13927 the sentinel state in the cache. GCPRO the Lisp string we are
13928 iterating.
13929 (bidi_push_it, bidi_pop_it): New functions.
13930 (bidi_initialize): Initialize the bidi cache start stack pointer.
13931 (bidi_cache_ensure_space): New function, refactored from part of
13932 bidi_cache_iterator_state. Don't assume the required size is just
13933 one BIDI_CACHE_CHUNK away.
13934 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13935 (bidi_count_bytes, bidi_char_at_pos): New functions.
13936 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13937 always valid if bidi_cache_idx is valid.
13938 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13939 is valid if it's going to be used.
13940 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13941 (bidi_cache_fetch_state, bidi_cache_search)
13942 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13943 (bidi_cache_iterator_state, bidi_cache_find)
13944 (bidi_find_other_level_edge, bidi_cache_start_stack):
13945 All variables related to cache indices are now EMACS_INT.
13946
13947 * dispextern.h (struct bidi_string_data): New structure.
13948 (struct bidi_it): New member `string'. Make flag members be 1-bit
13949 fields, and put them last in the struct.
13950 (compute_display_string_pos, compute_display_string_end):
13951 Update prototypes.
13952 (bidi_push_it, bidi_pop_it): Add prototypes.
13953 (struct iterator_stack_entry): New members bidi_p,
13954 paragraph_embedding, and from_disp_prop_p.
13955 (struct it): Member bidi_p is now a bit field 1 bit wide.
13956 (bidi_shelve_cache, bidi_unshelve_cache):
13957 Declare prototypes.
13958
13959 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13960 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13961 and vector-like objects.
13962
13963 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13964 cache around display iteration.
13965
13966 * window.c (Fwindow_end, window_scroll_pixel_based)
13967 (displayed_window_lines, Frecenter): Save and restore the bidi
13968 cache around display iteration.
13969
13970 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13971
13972 * editfns.c (Fdelete_region): Clarify the use of the named
13973 parameters (bug#6788).
13974
13975 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13976
13977 * indent.c (Fvertical_motion): Set and restore w->pointm when
13978 saving and restoring the window's buffer (Bug#9006).
13979
13980 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13981
13982 * editfns.c (Fstring_to_char): Clarify just what is returned
13983 (bug#6576). Text by Eli Zaretskii.
13984
13985 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13986
13987 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13988
13989 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13990
13991 * buffer.c (mmap_find): Fix a typo.
13992
13993 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13994
13995 Fix execution of x selection hooks.
13996 * xselect.c (Qx_lost_selection_functions)
13997 (Qx_sent_selection_functions): New vars.
13998 (syms_of_xselect): DEFSYM them.
13999 (x_handle_selection_request): Pass Qx_sent_selection_functions
14000 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14001 (x_handle_selection_clear,x_clear_frame_selections):
14002 Pass Qx_lost_selection_functions rather than
14003 Vx_lost_selection_functions to Frun_hook_with_args.
14004
14005 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14006
14007 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
14008 The old code sometimes used this field without initializing it.
14009
14010 * alloc.c (gc_sweep): Don't read past end of array.
14011 In theory, the old code could also have corrupted Emacs internals,
14012 though it'd be very unlikely.
14013
14014 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14015
14016 * character.c (Fcharacterp): Don't advertise optional ignored
14017 argument. (Bug#4026)
14018
14019 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14020
14021 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14022 key" (bug#4257).
14023
14024 * window.c (Fset_window_start): Doc fix (bug#4199).
14025 (Fset_window_hscroll): Ditto.
14026
14027 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14028
14029 Fix minor new problems caught by GCC 4.6.1.
14030 * term.c (init_tty): Remove unused local.
14031 * xsettings.c (store_monospaced_changed): Define this function only
14032 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14033 not used otherwise.
14034
14035 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14036
14037 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14038
14039 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14040
14041 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14042 are the mini-buffer and the echo area (bug#3320).
14043
14044 * term.c (init_tty): Remove support for supdup, c10 and perq
14045 terminals, which are no longer supported (bug#1482).
14046
14047 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14048
14049 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14050
14051 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14052
14053 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14054 for non-popups (Bug#3642).
14055
14056 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14057
14058 * alloc.c (reset_malloc_hooks): Protoize.
14059 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14060 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14061 * cm.c (losecursor): Likewise.
14062 * data.c (fmod): Likewise.
14063 * dispnew.c (swap_glyphs_in_rows): Likewise.
14064 * emacs.c (memory_warning_signal): Likewise.
14065 * floatfns.c (float_error): Likewise.
14066 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14067 (otf_open, font_otf_capability, generate_otf_features)
14068 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14069 Likewise.
14070 * image.c (pbm_read_file): Likewise.
14071 * indent.c (string_display_width): Likewise.
14072 * intervals.c (check_for_interval, search_for_interval)
14073 (inc_interval_count, count_intervals, root_interval)
14074 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14075 * lread.c (defalias): Likewise.
14076 * ralloc.c (r_alloc_check): Likewise.
14077 * regex.c (set_image_of_range_1, set_image_of_range)
14078 (regex_grow_registers): Likewise.
14079 * sysdep.c (strerror): Likewise.
14080 * termcap.c (valid_filename_p, tprint, main): Likewise.
14081 * tparam.c (main): Likewise.
14082 * unexhp9k800.c (run_time_remap, save_data_space)
14083 (update_file_ptrs, read_header, write_header, calculate_checksum)
14084 (copy_file, copy_rest, display_header): Likewise.
14085 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14086 Likewise.
14087 * xdisp.c (check_it): Likewise.
14088 * xfaces.c (register_color, unregister_color, unregister_colors):
14089 Likewise.
14090 * xfns.c (print_fontset_result): Likewise.
14091 * xrdb.c (member, fatal, main): Likewise.
14092
14093 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14094
14095 Fix minor problems found by static checking (Bug#9031).
14096 * chartab.c (char_table_set_range, map_sub_char_table):
14097 Remove unused locals.
14098 (uniprop_table): Now static.
14099 * composite.c (_work_char): Remove unused static var.
14100
14101 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14102
14103 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14104
14105 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14106
14107 * gtkutil.c (qttip_cb): Remove code without function.
14108
14109 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14110
14111 * w32.c (pthread_sigmask): New stub.
14112
14113 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14114
14115 Use pthread_sigmask, not sigprocmask (Bug#9010).
14116 sigprocmask is portable only for single-threaded applications, and
14117 Emacs can be multi-threaded when it uses GTK.
14118 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14119 (LIBES): Use it.
14120 * callproc.c (Fcall_process):
14121 * process.c (create_process):
14122 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14123 Use pthread_sigmask, not sigprocmask.
14124
14125 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14126
14127 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14128 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14129 wrong (Bug#8591).
14130
14131 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14132
14133 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14134 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14135 (xg_hide_tooltip): Fix comment.
14136
14137 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14138 in registerServicesMenuSendTypes.
14139 (validRequestorForSendType): Don't check ns_return_types.
14140
14141 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14142 ns_return_type.
14143
14144 2011-07-08 Jason Rumney <jasonr@gnu.org>
14145
14146 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14147 SH_SHOW for hidden windows (Bug#5482).
14148
14149 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14150 frame struct members of non-existent frames (Bug#6284).
14151
14152 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14153
14154 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14155 variable firstTime not needed on OSX >= 10.6.
14156 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14157 >= 10.5. Use setKnobProportion, setDoubleValue.
14158
14159 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14160 (MAC_OS_X_VERSION_10_5): Define if not defined.
14161 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14162 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14163 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14164
14165 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14166 cString and lossyCString on OSX >= 10.4.
14167
14168 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14169 sizeToFit on OSX >= 10.2.
14170
14171 * nsimage.m (allocInitFromFile): Don't use deprecated method
14172 bestRepresentationForDevice on OSX >= 10.6.
14173
14174 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14175 to avoid warning.
14176
14177 * emacs.c: Declare unexec_init_emacs_zone.
14178
14179 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14180
14181 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14182
14183 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14184 on svcsMenu (Bug#8842).
14185
14186 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14187 ns_return_types.
14188 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14189
14190 * nsterm.m (QUTF8_STRING): Declare.
14191 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14192 (validRequestorForSendType): Return type is (id).
14193 Change indexOfObjectIdenticalTo to indexOfObject.
14194 Check if we have local selection before returning self (Bug#8842).
14195 (writeSelectionToPasteboard): Put local selection into paste board
14196 if we have a local selection (Bug#8842).
14197 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14198
14199 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14200 (ns_get_local_selection): Declare.
14201
14202 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14203
14204 * keymap.c (describe_map_tree): Don't insert a double newline at
14205 the end of the buffer (bug#1169) and return whether we inserted
14206 something.
14207
14208 * callint.c (Fcall_interactively): Change "reading args" to
14209 "providing args" to try to clarify what it does (bug#1010).
14210
14211 2011-07-07 Kenichi Handa <handa@m17n.org>
14212
14213 * composite.c (composition_compute_stop_pos): Ignore a static
14214 composition starting before CHARPOS (Bug#8915).
14215
14216 * xdisp.c (handle_composition_prop): Likewise.
14217
14218 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14219
14220 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14221 (Bug#9015)
14222
14223 2011-07-07 Kenichi Handa <handa@m17n.org>
14224
14225 * character.h (unicode_category_t): New enum type.
14226
14227 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14228 (Qchar_code_property_table): New variable.
14229 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14230 (UNIPROP_COMPRESSED_FORM_P): New macros.
14231 (char_table_ascii): Uncompress the compressed values.
14232 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14233 Uncompress the compressed values.
14234 (sub_char_table_ref_and_range): Likewise.
14235 (char_table_ref_and_range): Uncompress the compressed values.
14236 (sub_char_table_set): New arg is_uniprop. Callers changed.
14237 Uncompress the compressed values.
14238 (sub_char_table_set_range): Args changed. Callers changed.
14239 (char_table_set_range): Adjuted for the above change.
14240 (map_sub_char_table): Delete args default_val and parent. Add arg
14241 top. Give decoded values to a Lisp function.
14242 (map_char_table): Adjust for the above change. Give decoded
14243 values to a Lisp function. Gcpro more variables.
14244 (uniprop_table_uncompress)
14245 (uniprop_decode_value_run_length): New functions.
14246 (uniprop_decoder, uniprop_decoder_count): New variables.
14247 (uniprop_get_decoder, uniprop_encode_value_character)
14248 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14249 New functions.
14250 (uniprop_encoder, uniprop_encoder_count): New variables.
14251 (uniprop_get_encoder, uniprop_table)
14252 (Funicode_property_table_internal, Fget_unicode_property_internal)
14253 (Fput_unicode_property_internal): New functions.
14254 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14255 Sunicode_property_table_internal, Sget_unicode_property_internal,
14256 and Sput_unicode_property_internal. Defvar_lisp
14257 char-code-property-alist.
14258
14259 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14260 Vunicode_category_table.
14261
14262 * font.c (font_range): Adjust for the change of
14263 Vunicode_category_table.
14264
14265 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14266
14267 * m/iris4d.h: Remove file, move contents ...
14268 * s/irix6-5.h: ... here.
14269
14270 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14271
14272 Remove unportable assumption about struct layout (Bug#8884).
14273 * alloc.c (mark_buffer):
14274 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14275 (clone_per_buffer_values): Don't assume that
14276 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14277 This isn't true in general, and it's particularly not true
14278 if Emacs is configured with --with-wide-int.
14279 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14280 New macros, used in the buffer.c change.
14281
14282 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14283
14284 * xsettings.c: Use both GConf and GSettings if both are available.
14285 (store_config_changed_event): Add comment.
14286 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14287 (store_tool_bar_style_changed): New functions.
14288 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14289 (struct xsettings): Move font inside HAVE_XFT.
14290 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14291 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14292 Move inside HAVE_XFT.
14293 (something_changed_gsettingsCB): Rename from something_changedCB.
14294 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14295 also.
14296 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14297 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14298 (something_changed_gconfCB): Rename from something_changedCB.
14299 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14300 (parse_settings): Move check for font inside HAVE_XFT.
14301 (read_settings, apply_xft_settings): Add comment.
14302 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14303 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14304 call store_font_name_changed.
14305 (xft_settings_event): Add comment.
14306 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14307 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14308 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14309 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14310 (xsettings_initialize): Call init_gsettings last.
14311 (xsettings_get_system_font, xsettings_get_system_normal_font):
14312 Add comment.
14313
14314 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14315
14316 Random fixes. E.g., (random) never returned negative values.
14317 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14318 subseconds part to the entropy, as that's a bit more random.
14319 Prefer signed to unsigned, since the signedness doesn't matter and
14320 in general we prefer signed. When given a limit, use a
14321 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14322 latter isn't right if USE_2_TAGS_FOR_INTS.
14323 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14324 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14325
14326 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14327
14328 * textprop.c (text_property_stickiness):
14329 Obey Vtext_property_default_nonsticky.
14330 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14331 * w32fns.c (syms_of_w32fns):
14332 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14333
14334 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14335
14336 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14337 This is more efficient than Ffile_directory_p and avoids a minor race.
14338
14339 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14340
14341 * buffer.c (Foverlay_put): Say what the return value is
14342 (bug#7835).
14343
14344 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14345 is a directory before asking whether to use the file name
14346 (bug#7564).
14347 (barf_or_query_if_file_exists): Make the "File is a directory"
14348 error be more correct.
14349
14350 * fns.c (Frequire): Remove the mention of the .gz files, since
14351 that's installation-specific, but keep the mention of
14352 `get-load-suffixes'.
14353
14354 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14355
14356 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14357 Report string overflow if the output is too long.
14358
14359 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14360
14361 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14362 (syms_of_gnutls): Remove duplicate DEFSYM for
14363 Qgnutls_bootprop_verify_hostname_error, an error for
14364 Qgnutls_bootprop_verify_error (which is no longer used).
14365
14366 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14367 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14368 Also (re)move comments that are misplaced or no longer relevant.
14369
14370 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14371
14372 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14373
14374 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14375
14376 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14377 and background color parameters if they have been changed.
14378
14379 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14380
14381 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14382
14383 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14384
14385 * xsettings.c (SYSTEM_FONT): Define only when used.
14386 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14387
14388 * keymap.c (access_keymap_1): Now static.
14389
14390 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14391
14392 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14393 leave any prefix arg for the up event (Bug#1586).
14394
14395 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14396
14397 * lread.c (syms_of_lread): Mention single symbols defined by
14398 `defvar' or `defconst' (bug#7154).
14399
14400 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14401 (Frequire): Mention get-load-suffixes.
14402
14403 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14404
14405 * window.h (window): Remove clone_number slot.
14406 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14407 Remove.
14408 (make_parent_window, make_window, saved_window)
14409 (Fset_window_configuration, save_window_save): Don't deal with
14410 clone numbers.
14411 * buffer.c (Qclone_number): Remove declaration.
14412 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14413
14414 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14415
14416 Add multiple inheritance to keymaps.
14417 * keymap.c (Fmake_composed_keymap): New function.
14418 (Fset_keymap_parent): Simplify.
14419 (fix_submap_inheritance): Remove.
14420 (access_keymap_1): New function extracted from access_keymap to handle
14421 embedded parents and handle lists of maps.
14422 (access_keymap): Use it.
14423 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14424 (Fcopy_keymap): Handle embedded parents.
14425 (Fcommand_remapping, define_as_prefix): Simplify.
14426 (Fkey_binding): Simplify.
14427 (syms_of_keymap): Move minibuffer-local-completion-map,
14428 minibuffer-local-filename-completion-map,
14429 minibuffer-local-must-match-map, and
14430 minibuffer-local-filename-must-match-map to Elisp.
14431 (syms_of_keymap): Defsubr make-composed-keymap.
14432 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14433 (parse_menu_item): Trivial simplification.
14434
14435 2011-07-01 Glenn Morris <rgm@gnu.org>
14436
14437 * Makefile.in (SETTINGS_LIBS): Fix typo.
14438
14439 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14440
14441 * coding.c (Fencode_coding_string): Record the last coding system
14442 used, as the function doc string says (bug#8738).
14443
14444 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14445
14446 * xsettings.c (store_monospaced_changed): Take new font as arg and
14447 check for change against current_mono_font.
14448 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14449 (emacs_settings_constructor, emacs_settings_get_property)
14450 (emacs_settings_set_property, emacs_settings_class_init)
14451 (emacs_settings_init, gsettings_obj): Remove.
14452 (something_changedCB): New function for HAVE_GSETTINGS.
14453 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14454 with value as argument.
14455 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14456 g_settings_new (Bug#8967). Do not create gsettings_obj.
14457 Remove calls to g_settings_bind. Connect something_changedCB to
14458 "changed".
14459
14460 * xgselect.c: Add defined (HAVE_GSETTINGS).
14461 (xgselect_initialize): Ditto.
14462
14463 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14464 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14465 xg_select.
14466
14467 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14468
14469 * eval.c (struct backtrace): Simplify and port the data structure.
14470 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14471 signed bit field, as this assumption is not portable and it makes
14472 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14473 "char debug_on_exit : 1" as this is not portable either; instead,
14474 use the portable "unsigned int debug_on_exit : 1". Remove unused
14475 member evalargs. Remove obsolete comments about cc bombing out.
14476
14477 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14478
14479 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14480 Let HAVE_GSETTINGS override HAVE_GCONF.
14481 (store_monospaced_changed): New function.
14482 (EMACS_SETTINGS): A new type derived from GObject to handle
14483 GSettings notifications.
14484 (emacs_settings_constructor, emacs_settings_get_property)
14485 (emacs_settings_set_property, emacs_settings_class_init):
14486 New functions.
14487 (gsettings_client, gsettings_obj): New variables.
14488 (GSETTINGS_SCHEMA): New define.
14489 (something_changedCB): Call store_monospaced_changed.
14490 (init_gsettings): New function.
14491 (xsettings_initialize): Call init_gsettings.
14492 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14493 to NULL.
14494
14495 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14496 GCONF_CFLAGS/LIBS.
14497
14498 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14499
14500 * window.c (resize_root_window, grow_mini_window)
14501 (shrink_mini_window): Rename Qresize_root_window to
14502 Qwindow_resize_root_window and Qresize_root_window_vertically to
14503 Qwindow_resize_root_window_vertically.
14504
14505 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14506
14507 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14508
14509 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14510
14511 * makefile.w32-in: Redesign dependencies so they reflect more
14512 clearly which files are directly included by each source file,
14513 and not through other includes.
14514
14515 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14516
14517 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14518 (sort_overlays, overlay_strings): When an overlay's clone number
14519 matches the window's clone number process the overlay even if
14520 the overlay's window property doesn't match the current window.
14521
14522 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14523 (Fwindow_hchild): Rename to Fwindow_left_child.
14524 (Fwindow_next): Rename to Fwindow_next_sibling.
14525 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14526 (resize_window_check): Rename to window_resize_check.
14527 (resize_window_apply): Rename to window_resize_apply.
14528 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14529 (Fdelete_other_windows_internal, resize_frame_windows)
14530 (Fsplit_window_internal, Fdelete_window_internal)
14531 (grow_mini_window, shrink_mini_window)
14532 (Fresize_mini_window_internal): Fix callers accordingly.
14533
14534 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14535
14536 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14537 (emacs_fixed_set_min_size): Remove.
14538 (emacs_fixed_new): Take frame as argument.
14539
14540 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14541 (_EmacsFixedPrivate): Remove minwidth/height.
14542 Add struct frame *f.
14543 (emacs_fixed_init): Initialize priv->f.
14544 (get_parent_class, emacs_fixed_set_min_size): Remove.
14545 (emacs_fixed_new): Set priv->f to argument.
14546 (emacs_fixed_get_preferred_width)
14547 (emacs_fixed_get_preferred_height): Use min_width/height from
14548 frames size_hint to set minimum and natural (Bug#8919).
14549 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14550 and use min_width/height from frames size_hint to set
14551 min_width/height (Bug#8919).
14552
14553 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14554 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14555 Fix indentation.
14556
14557 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14558
14559 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14560 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14561 called at ZV.
14562
14563 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14564
14565 * process.c (wait_reading_process_output): Bypass select if
14566 waiting for a cell while ignoring keyboard input, and input is
14567 pending. Suggested by Jan Djärv (Bug#8869).
14568
14569 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14570
14571 Use gnulib's dup2 module instead of rolling our own.
14572 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14573
14574 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14575
14576 * dispnew.c (scrolling_window): Before scrolling, turn off a
14577 mouse-highlight in the window being scrolled.
14578
14579 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14580
14581 Move DEFSYM to lisp.h and use everywhere.
14582
14583 * character.h (DEFSYM): Move declaration...
14584 * lisp.h (DEFSYM): ...here.
14585
14586 * gnutls.c:
14587 * minibuf.c:
14588 * w32menu.c:
14589 * w32proc.c:
14590 * w32select.c: Don't include character.h.
14591
14592 * alloc.c (syms_of_alloc):
14593 * buffer.c (syms_of_buffer):
14594 * bytecode.c (syms_of_bytecode):
14595 * callint.c (syms_of_callint):
14596 * casefiddle.c (syms_of_casefiddle):
14597 * casetab.c (init_casetab_once):
14598 * category.c (init_category_once, syms_of_category):
14599 * ccl.c (syms_of_ccl):
14600 * cmds.c (syms_of_cmds):
14601 * composite.c (syms_of_composite):
14602 * dbusbind.c (syms_of_dbusbind):
14603 * dired.c (syms_of_dired):
14604 * dispnew.c (syms_of_display):
14605 * doc.c (syms_of_doc):
14606 * editfns.c (syms_of_editfns):
14607 * emacs.c (syms_of_emacs):
14608 * eval.c (syms_of_eval):
14609 * fileio.c (syms_of_fileio):
14610 * fns.c (syms_of_fns):
14611 * frame.c (syms_of_frame):
14612 * fringe.c (syms_of_fringe):
14613 * insdel.c (syms_of_insdel):
14614 * keymap.c (syms_of_keymap):
14615 * lread.c (init_obarray, syms_of_lread):
14616 * macros.c (syms_of_macros):
14617 * msdos.c (syms_of_msdos):
14618 * print.c (syms_of_print):
14619 * process.c (syms_of_process):
14620 * search.c (syms_of_search):
14621 * sound.c (syms_of_sound):
14622 * syntax.c (init_syntax_once, syms_of_syntax):
14623 * terminal.c (syms_of_terminal):
14624 * textprop.c (syms_of_textprop):
14625 * undo.c (syms_of_undo):
14626 * w32.c (globals_of_w32):
14627 * window.c (syms_of_window):
14628 * xdisp.c (syms_of_xdisp):
14629 * xfaces.c (syms_of_xfaces):
14630 * xfns.c (syms_of_xfns):
14631 * xmenu.c (syms_of_xmenu):
14632 * xsettings.c (syms_of_xsettings):
14633 * xterm.c (syms_of_xterm): Use DEFSYM.
14634
14635 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14636
14637 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14638
14639 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14640
14641 Integer and buffer overflow fixes (Bug#8873).
14642
14643 * print.c (printchar, strout): Check for string overflow.
14644 (PRINTPREPARE, printchar, strout):
14645 Don't set size unless allocation succeeds.
14646
14647 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14648 for sizes. Check for string overflow more accurately.
14649 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14650
14651 * macros.c: Integer and buffer overflow fixes.
14652 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14653 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14654 Use ptrdiff_t, not int, for sizes.
14655 Don't increment bufsize until after realloc succeeds.
14656 Check for size-calculation overflow.
14657 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14658
14659 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14660
14661 * lread.c: Integer overflow fixes.
14662 (read_integer): Radix is now EMACS_INT, not int,
14663 to improve quality of diagnostics for out-of-range radices.
14664 Calculate buffer size correctly for out-of-range radices.
14665 (read1): Check for integer overflow in radices, and in
14666 read-circle numbers.
14667 (read_escape): Avoid int overflow.
14668 (Fload, openp, read_buffer_size, read1)
14669 (substitute_object_recurse, read_vector, read_list, map_obarray):
14670 Use ptrdiff_t, not int, for sizes.
14671 (read1): Use EMACS_INT, not int, for sizes.
14672 Check for size overflow.
14673
14674 * image.c (cache_image): Check for size arithmetic overflow.
14675
14676 * lread.c: Integer overflow issues.
14677 (saved_doc_string_size, saved_doc_string_length)
14678 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14679 Now ptrdiff_t, not int.
14680 (read1): Don't assume doc string length fits in int. Check for
14681 out-of-range doc string lengths.
14682 (read_list): Don't assume file position fits in int.
14683 (read_escape): Check for hex character overflow.
14684
14685 2011-06-22 Leo Liu <sdl.web@gmail.com>
14686
14687 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14688 Move to minibuffer.el.
14689
14690 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14691
14692 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14693 The following patches are for when GLYPH_DEBUG && !XASSERT.
14694 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14695 * dispnew.c (flush_stdout):
14696 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14697 Mark as externally visible.
14698 * dispnew.c (check_window_matrix_pointers): Now static.
14699 * dispnew.c (window_to_frame_vpos):
14700 * xfns.c (unwind_create_frame):
14701 * xterm.c (x_check_font): Remove unused local.
14702 * scroll.c (CHECK_BOUNDS):
14703 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14704 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14705 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14706 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14707 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14708 Now static.
14709 (debug_method_add): Use va_list and vsprintf rather than relying
14710 on undefined behavior with wrong number of arguments.
14711 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14712 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14713 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14714 since we're not interested in debugging glyphs with old libraries.
14715 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14716 GCC 4.6.0's static checking.
14717
14718 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14719
14720 Integer overflow and signedness fixes (Bug#8873).
14721 A few related buffer overrun fixes, too.
14722
14723 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14724
14725 * dispextern.h (struct face.stipple):
14726 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14727 (x_bitmap_mask, x_allocate_bitmap_record)
14728 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14729 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14730 (x_create_bitmap_from_xpm_data):
14731 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14732 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14733 (.bitmaps_last):
14734 * xfaces.c (load_pixmap):
14735 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14736 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14737 (.bitmaps_last, struct x_output.icon_bitmap):
14738 Use ptrdiff_t, not int, for bitmap indexes.
14739 (x_allocate_bitmap_record): Check for size overflow.
14740 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14741
14742 Use ptrdiff_t, not int, for overlay counts.
14743 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14744 * editfns.c (overlays_around, get_pos_property):
14745 * textprop.c (get_char_property_and_overlay):
14746 * xdisp.c (next_overlay_change, note_mouse_highlight):
14747 * xfaces.c (face_at_buffer_position):
14748 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14749 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14750 (Fnext_overlay_change, Fprevious_overlay_change)
14751 (mouse_face_overlay_overlaps, Foverlays_in):
14752 Use ptrdiff_t, not int, for sizes.
14753 (overlays_at, overlays_in): Check for size-calculation overflow.
14754
14755 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14756
14757 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14758 (x_session_initialize): Do not assume string length fits in int.
14759
14760 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14761 This is unlikely, but can occur if DPI is outlandish.
14762
14763 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14764 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14765
14766 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14767 * xrdb.c (magic_file_p, search_magic_path):
14768 Omit last arg SUFFIX; it was always 0. All callers changed.
14769 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14770
14771 * xfont.c (xfont_match): Avoid need for strlen.
14772
14773 * xfns.c: Don't assume strlen fits in int.
14774 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14775
14776 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14777 not unsigned long, as we prefer signed integers. All callers changed.
14778 Detect integer overflow in repeat count.
14779 (message_dolog): Don't assume print length fits in 39 bytes.
14780 (display_mode_element): Don't assume strlen fits in int.
14781
14782 * termcap.c: Don't assume sizes fit in int and never overflow.
14783 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14784 (gobble_line): Check for size-calculation overflow.
14785
14786 * minibuf.c (Fread_buffer):
14787 * lread.c (intern, intern_c_string):
14788 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14789 Don't assume string length fits in int.
14790
14791 * keyboard.c (parse_tool_bar_item):
14792 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14793
14794 * font.c: Don't assume string length fits in int.
14795 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14796 Use ptrdiff_t, not int.
14797 (font_intern_prop): Don't assume string length fits in int.
14798 Don't assume integer property fits in fixnum.
14799 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14800
14801 * filelock.c: Fix some buffer overrun and integer overflow issues.
14802 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14803 Reformulate so as not to need the command string.
14804 Invoke gzip -cd rather than gunzip, as it's more portable.
14805 (lock_info_type, lock_file_1, lock_file):
14806 Don't assume pid_t and time_t fit in unsigned long.
14807 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14808 (current_lock_owner): Prefer signed type for sizes.
14809 Use memcpy, not strncpy, where memcpy is what is really wanted.
14810 Don't assume (via atoi) that time_t and pid_t fit in int.
14811 Check for time_t and/or pid_t out of range, e.g., via a network share.
14812 Don't alloca where an auto var works fine.
14813
14814 * fileio.c: Fix some integer overflow issues.
14815 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14816 Don't assume string length fits in int.
14817 (directory_file_name): Don't assume string length fits in long.
14818 (make_temp_name): Don't assume pid fits in int, or that its print
14819 length is less than 20.
14820
14821 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14822
14823 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14824
14825 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14826
14827 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14828 We prefer signed integers, even for size calculations.
14829
14830 * emacs.c: Don't assume string length fits in 'int'.
14831 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14832 (main): Don't invoke strlen when not needed.
14833
14834 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14835 (XD_DEBUG_MESSAGE): Don't waste a byte.
14836
14837 * callproc.c (getenv_internal_1, getenv_internal)
14838 (Fgetenv_internal):
14839 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14840
14841 * lread.c (invalid_syntax): Omit length argument.
14842 All uses changed. This doesn't fix a bug, but it simplifies the
14843 code away from its former Hollerith-constant appearance, and it's
14844 one less 'int' to worry about when looking at integer-overflow issues.
14845 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14846
14847 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14848 This didn't break anything, but it didn't help either.
14849 It's confusing to put a bogus integer in a place where the actual
14850 value does not matter.
14851 (LIST_END_P): Remove unused macro and its bogus comment.
14852 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14853
14854 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14855 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14856 implementation.
14857 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14858 We prefer signed types, and the value cannot exceed the EMACS_INT
14859 range anyway (because otherwise the length would not be representable).
14860 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14861 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14862 This avoids a GCC warning when WIDE_EMACS_INT.
14863
14864 * indent.c (sane_tab_width): New function.
14865 (current_column, scan_for_column, Findent_to, position_indentation)
14866 (compute_motion): Use it. This is just for clarity.
14867 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14868
14869 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14870
14871 * lisp.h (lint_assume): New macro.
14872 * composite.c (composition_gstring_put_cache):
14873 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14874
14875 * editfns.c, insdel.c:
14876 Omit unnecessary forward decls, to simplify future changes.
14877
14878 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14879
14880 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14881
14882 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14883 Use much-faster test for byte-length change.
14884 Don't assume string byte-length fits in 'int'.
14885 Check that character arg fits in 'int'.
14886 (mapcar1): Declare byte as byte, for clarity.
14887
14888 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14889
14890 * fns.c (concat): Catch string overflow earlier.
14891 Do not rely on integer wraparound.
14892
14893 * dispextern.h (struct it.overlay_strings_charpos)
14894 (struct it.selective): Now EMACS_INT, not int.
14895 * xdisp.c (forward_to_next_line_start)
14896 (back_to_previous_visible_line_start)
14897 (reseat_at_next_visible_line_start, next_element_from_buffer):
14898 Don't arbitrarily truncate the value of 'selective' to int.
14899
14900 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14901
14902 * composite.c: Don't truncate sizes to 'int'.
14903 (composition_gstring_p, composition_reseat_it)
14904 (composition_adjust_point): Use EMACS_INT, not int.
14905 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14906 not EMACS_UINT, for indexes.
14907
14908 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14909
14910 * buffer.c: Include <verify.h>.
14911 (struct sortvec.priority, struct sortstr.priority):
14912 Now EMACS_INT, not int.
14913 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14914 (struct sortstr.size, record_overlay_string)
14915 (struct sortstrlist.size, struct sortlist.used):
14916 Don't truncate size to int.
14917 (record_overlay_string): Check for size-calculation overflow.
14918 (init_buffer_once): Check at compile-time, not run-time.
14919
14920 2011-06-22 Jim Meyering <meyering@redhat.com>
14921
14922 Don't leak an XBM-image-sized buffer
14923 * image.c (xbm_load): Free the image buffer after using it.
14924
14925 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14926
14927 Port to Sun C.
14928 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14929 that Sun C diagnosed.
14930 * fns.c (secure_hash): Fix pointer signedness issue.
14931 * intervals.c (static_offset_intervals): New function.
14932 (offset_intervals): Use it.
14933
14934 2011-06-21 Leo Liu <sdl.web@gmail.com>
14935
14936 * deps.mk (fns.o):
14937 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14938 sha512.h.
14939
14940 * fns.c (secure_hash): Rename from crypto_hash_function and change
14941 the first arg to accept symbols.
14942 (Fsecure_hash): New primitive.
14943 (syms_of_fns): New symbols.
14944
14945 2011-06-20 Deniz Dogan <deniz@dogan.se>
14946
14947 * process.c (Fset_process_buffer): Clarify return value in
14948 docstring.
14949
14950 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14951
14952 * dispnew.c (add_window_display_history): Use BVAR.
14953
14954 * xdisp.c (debug_method_add): Use BVAR.
14955 (check_window_end, dump_glyph_matrix, dump_glyph)
14956 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14957
14958 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14959 Likewise.
14960
14961 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14962 check till after the cache is created in init_frame_faces.
14963
14964 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14965
14966 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14967
14968 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14969
14970 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14971 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14972 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14973
14974 Improve buffer-overflow checking (Bug#8873).
14975 * fileio.c (Finsert_file_contents):
14976 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14977 Remove the old (too-loose) buffer overflow checks.
14978 They weren't needed, since make_gap checks for buffer overflow.
14979 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14980 The old code merely checked for Emacs fixnum overflow, and relied
14981 on undefined (wraparound) behavior. The new code avoids undefined
14982 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14983
14984 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14985 Tune. Don't use wider integers than needed. Don't use alloca.
14986 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14987
14988 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14989
14990 * insdel.c, lisp.h (buffer_overflow): New function.
14991 (insert_from_buffer_1, replace_range, replace_range_2):
14992 * insdel.c (make_gap_larger):
14993 * editfns.c (Finsert_char):
14994 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14995
14996 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14997
14998 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14999
15000 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
15001
15002 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15003 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15004
15005 * fileio.c: Don't assume EMACS_INT fits in off_t.
15006 (emacs_lseek): New static function.
15007 (Finsert_file_contents, Fwrite_region): Use it.
15008 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15009
15010 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15011
15012 * fns.c: Don't overflow int when computing a list length.
15013 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15014 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15015 truncation on 64-bit hosts. Check for QUIT every
15016 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15017 faster and is responsive enough.
15018 (Flength): Report an error instead of overflowing an integer.
15019 (Fsafe_length): Return a float if the value is not representable
15020 as a fixnum. This shouldn't happen except in contrived situations.
15021 (Fnthcdr, Fsort): Don't assume list length fits in int.
15022 (Fcopy_sequence): Don't assume vector length fits in int.
15023
15024 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15025 (header_size, word_size): New constants.
15026 (allocate_vectorlike): Don't check size overflow here.
15027 (allocate_vector): Check it here instead, since this is the only
15028 caller of allocate_vectorlike that could cause overflow.
15029 Check that the new vector's length is representable as a fixnum.
15030
15031 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15032 The previous code was bogus. For example, next_almost_prime (32)
15033 returned 39, which is undesirable as it is a multiple of 3; and
15034 next_almost_prime (24) returned 25, which is a multiple of 5 so
15035 why was the code bothering to check for multiples of 7?
15036
15037 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15038
15039 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15040
15041 Variadic C functions now count arguments with ptrdiff_t.
15042 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15043 Back then I didn't know that the Emacs coding style prefers signed int.
15044 Also, in the meantime I found a few more instances where arguments
15045 were being counted with int, which may truncate counts on 64-bit
15046 machines, or EMACS_INT, which may be unnecessarily wide.
15047 * lisp.h (struct Lisp_Subr.function.aMANY)
15048 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15049 Arg counts are now ptrdiff_t, not size_t.
15050 All variadic functions and their callers changed accordingly.
15051 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15052 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15053 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15054 * callint.c (Fcall_interactively): Check arg count for overflow,
15055 to avoid potential buffer overrun. Use signed char, not 'int',
15056 for 'varies' array, so that we needn't bother to check its size
15057 calculation for overflow.
15058 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15059 * eval.c (apply_lambda):
15060 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15061 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15062 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15063
15064 * callint.c (Fcall_interactively): Don't use index var as event count.
15065
15066 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15067 * mem-limits.h (SIZE): Remove; no longer used.
15068
15069 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15070
15071 Remove unnecessary casts.
15072 * xterm.c (x_term_init):
15073 * xfns.c (x_set_border_pixel):
15074 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15075 These aren't needed now that we assume ANSI C.
15076
15077 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15078 It's more likely to cause problems (due to unsigned overflow)
15079 than to cure them.
15080
15081 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15082
15083 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15084
15085 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15086
15087 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15088
15089 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15090
15091 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15092
15093 GLYPH_CODE_FACE returns EMACS_INT, not int.
15094 * dispextern.h (merge_faces):
15095 * xfaces.c (merge_faces):
15096 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15097 Don't assume EMACS_INT fits in int.
15098
15099 * character.h (CHAR_VALID_P): Remove unused parameter.
15100 * fontset.c, lisp.h, xdisp.c: All uses changed.
15101
15102 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15103
15104 * fns.c (concat): Minor tuning based on overflow analysis.
15105 This doesn't fix any bugs. Use int to hold character, instead
15106 of constantly refetching from Emacs object. Use XFASTINT, not
15107 XINT, for value known to be a character. Don't bother comparing
15108 a single byte to 0400, as it's always less.
15109
15110 * floatfns.c (Fexpt):
15111 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15112
15113 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15114 for characters.
15115
15116 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15117
15118 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15119 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15120 incorrectly succeed when S was a string, because 4294967386 was
15121 truncated before it was used.
15122
15123 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15124 Otherwise, an out-of-range integer could cause undefined behavior
15125 on a 64-bit host.
15126
15127 * composite.c: Use int, not EMACS_INT, for characters.
15128 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15129 EMACS_INT, for values that are known to be in character range.
15130 This doesn't fix any bugs but is the usual style inside Emacs and
15131 may generate better code on 32-bit machines.
15132
15133 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15134 This is for reasons similar to the recent CHAR_STRING fix.
15135 * charset.c (Fencode_char): Check that character arg is actually
15136 a character. Pass an int to ENCODE_CHAR.
15137 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15138 wider than 'int', as a compile-time check to prevent future regressions
15139 in this area.
15140
15141 * character.c (char_string): Remove unnecessary casts.
15142
15143 Make sure a 64-bit char is never passed to CHAR_STRING.
15144 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15145 by silently ignoring the top 32 bits, allowing some values
15146 that were far too large to be valid characters.
15147 * character.h: Include <verify.h>.
15148 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15149 arguments are no wider than unsigned, as a compile-time check
15150 to prevent future regressions in this area.
15151 * data.c (Faset):
15152 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15153 (Fsubst_char_in_region):
15154 * fns.c (concat):
15155 * xdisp.c (decode_mode_spec_coding):
15156 Adjust to CHAR_STRING's new requirement.
15157 * editfns.c (Finsert_char, Fsubst_char_in_region):
15158 * fns.c (concat): Check that character args are actually
15159 characters. Without this test, these functions did the wrong
15160 thing with wildly out-of-range values on 64-bit hosts.
15161
15162 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15163 These casts should not be needed on 32-bit hosts, either.
15164 * keyboard.c (read_char):
15165 * lread.c (Fload): Remove casts to unsigned.
15166
15167 * lisp.h (UNSIGNED_CMP): New macro.
15168 This fixes comparison bugs on 64-bit hosts.
15169 (ASCII_CHAR_P): Use it.
15170 * casefiddle.c (casify_object):
15171 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15172 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15173 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15174 * dispextern.h (FACE_FROM_ID):
15175 * keyboard.c (read_char): Use UNSIGNED_CMP.
15176
15177 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15178 not to EMACS_INT, to avoid GCC warning.
15179
15180 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15181
15182 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15183 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15184 isn't needed on 32-bit machines.
15185
15186 * buffer.c (Fgenerate_new_buffer_name):
15187 Use EMACS_INT for count, not int.
15188 (advance_to_char_boundary): Return EMACS_INT, not int.
15189
15190 * data.c (Qcompiled_function): Now static.
15191
15192 * window.c (window_body_lines): Now static.
15193
15194 * image.c (gif_load): Rename local to avoid shadowing.
15195
15196 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15197 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15198 * alloc.c (make_save_value): Integer argument is now of type
15199 ptrdiff_t, not int.
15200 (mark_object): Use ptrdiff_t, not int.
15201 * lisp.h (pD): New macro.
15202 * print.c (print_object): Use it.
15203
15204 * alloc.c: Use EMACS_INT, not int, to count objects.
15205 (total_conses, total_markers, total_symbols, total_vector_size)
15206 (total_free_conses, total_free_markers, total_free_symbols)
15207 (total_free_floats, total_floats, total_free_intervals)
15208 (total_intervals, total_strings, total_free_strings):
15209 Now EMACS_INT, not int. All uses changed.
15210 (Fgarbage_collect): Compute overall total using a double, so that
15211 integer overflow is less likely to be a problem. Check for overflow
15212 when converting back to an integer.
15213 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15214 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15215 These were 'int' variables that could overflow on 64-bit hosts;
15216 they were never used, so remove them instead of repairing them.
15217 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15218 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15219 Previously, this ceilinged at INT_MAX, but that doesn't work on
15220 64-bit machines.
15221 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15222
15223 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15224 (allocate_vectorlike): Check for ptrdiff_t overflow.
15225 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15226 when a (possibly-narrower) signed value would do just as well.
15227 We prefer using signed arithmetic, to avoid comparison confusion.
15228
15229 * alloc.c: Catch some string size overflows that we were missing.
15230 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15231 for convenience in STRING_BYTES_MAX.
15232 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15233 The definition here is exact; the one in lisp.h was approximate.
15234 (allocate_string_data): Check for string overflow. This catches
15235 some instances we weren't catching before. Also, it catches
15236 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15237 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15238 and ptrdiff_t and EMACS_INT are both 64 bits.
15239
15240 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15241 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15242 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15243
15244 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15245
15246 * alloc.c (Fmake_string): Check for out-of-range init.
15247
15248 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15249
15250 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15251
15252 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15253
15254 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15255 xg_get_default_scrollbar_width.
15256
15257 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15258 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15259 (style_changed_cb): Call update_theme_scrollbar_width and call
15260 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15261 all frames (Bug#8505).
15262 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15263 Call gtk_window_set_resizable if HAVE_GTK3.
15264 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15265 and height if HAVE_GTK3 (Bug#8505).
15266 (scroll_bar_width_for_theme): New variable.
15267 (update_theme_scrollbar_width): New function.
15268 (xg_get_default_scrollbar_width): Move code to
15269 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15270 (xg_initialize): Call update_theme_scrollbar_width.
15271
15272 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15273
15274 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15275
15276 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15277
15278 * frame.c (make_frame): Call other_buffer_safely instead of
15279 other_buffer.
15280
15281 * window.c (temp_output_buffer_show): Call display_buffer with
15282 second argument Vtemp_buffer_show_specifiers and reset latter
15283 immediately after the call.
15284 (Vtemp_buffer_show_specifiers): New variable.
15285 (auto_window_vscroll_p, next_screen_context_lines)
15286 (Vscroll_preserve_screen_position): Remove leading asterisks from
15287 doc-strings.
15288
15289 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15290
15291 Fix minor problems found by GCC 4.6.0 static checking.
15292 * buffer.c (Qclone_number): Remove for now, as it's unused.
15293 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15294 (record_buffer): Remove unused local.
15295 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15296 (set_frame_buffer_list): Remove; unused.
15297 * frame.h (other_visible_frames): Remove decl.
15298 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15299 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15300 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15301 if HAVE_GPM.
15302 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15303 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15304 Define only if HAVE_GPM.
15305 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15306 (update_hints_inhibit): Remove; never set. All uses removed.
15307 * widgetprv.h (emacsFrameClassRec): Remove decl.
15308 * window.c (delete_deletable_window): Now returns void, since it
15309 wasn't returning anything.
15310 (compare_window_configurations): Remove unused locals.
15311 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15312 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15313 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15314 the same widths as pointers. This follows up on the 2011-05-06 patch.
15315 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15316 * xterm.h: Likewise.
15317 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15318
15319 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15320
15321 * makefile.w32-in: Update dependencies.
15322 (LISP_H): Add lib/intprops.h.
15323
15324 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15325
15326 * image.c (gif_load): Add animation frame delay to the metadata.
15327 (syms_of_image): Use DEFSYM. New symbol `delay'.
15328
15329 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15330
15331 * window.c (delete_deletable_window): Re-add.
15332 (Fset_window_configuration): Rewrite to handle dead buffers and
15333 consequently deletable windows.
15334 (window_tree, Fwindow_tree): Remove. Supply functionality in
15335 window.el.
15336 (compare_window_configurations): Simplify code.
15337
15338 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15339
15340 * image.c (imagemagick_load_image): Fix type mismatch.
15341 (Fimagemagick_types): Likewise.
15342
15343 * window.h (replace_buffer_in_windows): Declare.
15344
15345 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15346
15347 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15348 Qclone_number. Remove external declaration of Qdelete_window.
15349 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15350 code.
15351 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15352 Run Qbuffer_list_update_hook if allowed.
15353 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15354 buffer list implementation.
15355 (other_buffer_safely): New function.
15356 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15357 calls to replace_buffer_in_windows and
15358 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15359 if allowed.
15360 (record_buffer): Inhibit quitting and rewrite using quittable
15361 functions. Run Qbuffer_list_update_hook if allowed.
15362 (Frecord_buffer, Funrecord_buffer): New functions.
15363 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15364 Move switch-to-buffer to window.el.
15365 (bury-buffer): Move to window.el.
15366 (Vbuffer_list_update_hook): New variable.
15367
15368 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15369 section.
15370
15371 * window.h (resize_frame_windows): Move up in code.
15372 (Fwindow_frame): Remove EXFUN.
15373 (replace_buffer_in_all_windows): Remove prototype.
15374 (replace_buffer_in_windows_safely): Add prototype.
15375
15376 * window.c: Declare Qdelete_window static again. Move down
15377 declaration of select_count.
15378 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15379 (Fother_window): Move to window.el.
15380 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15381 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15382 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15383 window.el.
15384 (replace_buffer_in_windows): Implement by calling
15385 Qreplace_buffer_in_windows.
15386 (replace_buffer_in_all_windows): Remove with some functionality
15387 moved into replace_buffer_in_windows_safely.
15388 (replace_buffer_in_windows_safely): New function.
15389 (select_window_norecord, select_frame_norecord): Move in front
15390 of run_window_configuration_change_hook. Remove now obsolete
15391 declarations.
15392 (Fset_window_buffer): Rewrite doc-string.
15393 Call Qrecord_window_buffer.
15394 (keys_of_window): Move binding for other-window to window.el.
15395
15396 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15397
15398 * dispextern.h (struct image): Replace data member, whose int_val
15399 and ptr_val fields were not used by anything, with a single
15400 lisp_val object.
15401
15402 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15403 (gif_clear_image, gif_load, imagemagick_load_image)
15404 (gs_clear_image, gs_load): Callers changed.
15405
15406 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15407
15408 * buffer.h: Include <time.h>, for time_t.
15409 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15410
15411 Fix minor problems found by static checking.
15412
15413 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15414
15415 Make identifiers static if they are not used in other modules.
15416 * data.c (Qcompiled_function, Qframe, Qvector):
15417 * image.c (QimageMagick, Qsvg):
15418 * minibuf.c (Qmetadata):
15419 * window.c (resize_window_check, resize_root_window): Now static.
15420 * window.h (resize_window_check, resize_root_window): Remove decls.
15421
15422 * window.c (window_deletion_count, delete_deletable_window):
15423 Remove; unused.
15424 (window_body_lines): Now static.
15425 (Fdelete_other_windows_internal): Mark vars as initialized.
15426 Make sure 'resize_failed' is initialized.
15427 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15428 (resize_window_apply): Remove unused local.
15429 * window.h (delete_deletable_window): Remove decl.
15430
15431 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15432 (imagemagick_load_image): Fix pointer signedness problem by changing
15433 last arg from unsigned char * to char *. All uses changed.
15434 Also, fix a local for similar reasons.
15435 Remove unused locals. Remove locals to avoid shadowing.
15436 (fn_rsvg_handle_free): Remove; unused.
15437 (svg_load, svg_load_image): Fix pointer signedness problem.
15438 (imagemagick_load_image): Don't use garbage pointer image_wand.
15439
15440 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15441
15442 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15443
15444 * image.c (gif_load): Fix omitted cast error introduced by
15445 2011-06-06 change.
15446
15447 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15448
15449 * window.h (resize_proportionally, orig_total_lines)
15450 (orig_top_line): Remove from window structure.
15451 (set_window_height, set_window_width, change_window_heights)
15452 (Fdelete_window): Remove prototypes.
15453 (resize_frame_windows): Remove duplicate declaration.
15454
15455 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15456
15457 * window.h (resize_frame_windows, resize_window_check)
15458 (delete_deletable_window, resize_root_window)
15459 (resize_frame_windows): Declare prototypes.
15460
15461 * window.c (resize_window_apply): Make definition be "static" to
15462 match the prototype.
15463
15464 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15465
15466 * window.c: Remove declarations of Qwindow_size_fixed,
15467 window_min_size_1, window_min_size_2, window_min_size,
15468 size_window, window_fixed_size_p, enlarge_window, delete_window.
15469 Remove static from declaration of Qdelete_window, it's
15470 temporarily needed by Fbury_buffer.
15471 (replace_window): Don't assign orig_top_line and
15472 orig_total_lines.
15473 (Fdelete_window, delete_window): Remove. Window deletion is
15474 handled by window.el.
15475 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15476 Replace Fdelete_window calls with calls to Qdelete_window.
15477 (Fdelete_other_windows): Remove. Deleting other windows is
15478 handled by window.el.
15479 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15480 handled in window.el.
15481 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15482 Window minimum sizes are handled in window.el.
15483 (shrink_windows, size_window, set_window_height)
15484 (set_window_width, change_window_heights, window_height)
15485 (window_width, CURBEG, CURSIZE, enlarge_window)
15486 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15487 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15488 handled in window.el.
15489 (make_dummy_parent): Rename to make_parent_window and give it a
15490 second argument horflag.
15491 (make_window): Don't set resize_proportionally any more.
15492 (Fsplit_window): Remove. Windows are split in window.el.
15493 (save_restore_action, save_restore_orig_size)
15494 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15495 Resize mini windows in window.el.
15496 (grow_mini_window, shrink_mini_window): Implement by calling
15497 Qresize_root_window_vertically, resize_window_check and
15498 resize_window_apply.
15499 (saved_window, Fset_window_configuration, save_window_save):
15500 Do not handle orig_top_line, orig_total_lines, and
15501 resize_proportionally.
15502 (window_min_height, window_min_width): Move to window.el.
15503 (keys_of_window): Move bindings for delete-other-windows,
15504 split-window, delete-window and enlarge-window to window.el.
15505
15506 * buffer.c: Temporarily extern Qdelete_window.
15507 (Fbury_buffer): Temporarily call Qdelete_window instead of
15508 Fdelete_window (Fbury_buffer will move to window.el soon).
15509
15510 * frame.c (set_menu_bar_lines_1): Remove code handling
15511 orig_top_line and orig_total_lines.
15512
15513 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15514 set_window_height but set heights directly.
15515 (change_frame_size_1): Use resize_frame_windows.
15516
15517 * xdisp.c (init_xdisp): Don't use set_window_height but set
15518 heights directly.
15519
15520 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15521 Use resize_frame_windows instead of change_window_heights and run
15522 run_window_configuration_change_hook.
15523
15524 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15525 instead of change_window_heights and run
15526 run_window_configuration_change_hook.
15527
15528 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15529
15530 * window.c (replace_window): Rename second argument REPLACEMENT to
15531 NEW. New third argument SETFLAG. Rewrite.
15532 (delete_window, make_dummy_parent): Call replace_window with
15533 third argument 1.
15534 (window_list_1): Move down in code.
15535 (run_window_configuration_change_hook): Move set_buffer part
15536 before select_frame_norecord part in order to unwind correctly.
15537 Rename count1 to count.
15538 (recombine_windows, delete_deletable_window, resize_root_window)
15539 (Fdelete_other_windows_internal)
15540 (Frun_window_configuration_change_hook, make_parent_window)
15541 (resize_window_check, resize_window_apply, Fresize_window_apply)
15542 (resize_frame_windows, Fsplit_window_internal)
15543 (Fdelete_window_internal, Fresize_mini_window_internal):
15544 New functions.
15545 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15546
15547 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15548
15549 * window.h (window): Add some new members to window structure -
15550 normal_lines, normal_cols, new_total, new_normal, clone_number,
15551 splits, nest, prev_buffers, next_buffers.
15552 (WINDOW_TOTAL_SIZE): Move here from window.c.
15553 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15554
15555 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15556 Remove.
15557 (make_dummy_parent): Set new members of windows structure.
15558 (make_window): Move down in code. Handle new members of window
15559 structure.
15560 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15561 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15562 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15563 (Fset_window_prev_buffers, Fwindow_next_buffers)
15564 (Fset_window_next_buffers, Fset_window_clone_number):
15565 New functions.
15566 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15567 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15568 Doc-string fixes.
15569 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15570 Argument WINDOW can be now internal window too.
15571 (Fwindow_use_time): Move up in code.
15572 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15573 Rewrite doc-string.
15574 (Fset_window_configuration, saved_window)
15575 (Fcurrent_window_configuration, save_window_save): Handle new
15576 members of window structure.
15577 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15578 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15579 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15580 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15581 Qget_mru_window, Qresize_root_window,
15582 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15583 Qauto_buffer_name; staticpro them.
15584
15585 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15586
15587 * window.c (Fwindow_total_size, Fwindow_left_column)
15588 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15589 (Fwindow_list_1): New functions.
15590 (window_box_text_cols): Replace with window_body_cols.
15591 (Fwindow_width, Fscroll_left, Fscroll_right):
15592 Use window_body_cols instead of window_box_text_cols.
15593 (delete_window, Fset_window_configuration):
15594 Call delete_all_subwindows with window as argument.
15595 (delete_all_subwindows): Take a window as argument and not a
15596 structure. Rewrite.
15597 (window_loop): Remove handling of GET_LRU_WINDOW and
15598 GET_LARGEST_WINDOW.
15599 (Fget_lru_window, Fget_largest_window): Move to window.el.
15600
15601 * window.h: Extern window_body_cols instead of
15602 window_box_text_cols. delete_all_subwindows now takes a
15603 Lisp_Object as argument.
15604
15605 * indent.c (compute_motion, Fcompute_motion):
15606 Use window_body_cols instead of window_box_text_cols.
15607
15608 * frame.c (delete_frame): Call delete_all_subwindows with root
15609 window as argument.
15610
15611 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15612
15613 * fns.c (Fputhash): Document return value.
15614
15615 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15616
15617 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15618
15619 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15620
15621 Cons<->int and similar integer overflow fixes (Bug#8794).
15622
15623 Check for overflow when converting integer to cons and back.
15624 * charset.c (Fdefine_charset_internal, Fdecode_char):
15625 Use cons_to_unsigned to catch overflow.
15626 (Fencode_char): Use INTEGER_TO_CONS.
15627 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15628 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15629 * data.c (long_to_cons, cons_to_long): Remove.
15630 (cons_to_unsigned, cons_to_signed): New functions.
15631 These signal an error for invalid or out-of-range values.
15632 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15633 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15634 * font.c (Ffont_variation_glyphs):
15635 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15636 * lisp.h: Include <intprops.h>.
15637 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15638 (cons_to_signed, cons_to_unsigned): New decls.
15639 (long_to_cons, cons_to_long): Remove decls.
15640 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15641 (Fprimitive_undo): Use CONS_TO_INTEGER.
15642 * xfns.c (Fx_window_property): Likewise.
15643 * xselect.c: Include <limits.h>.
15644 (x_own_selection, selection_data_to_lisp_data):
15645 Use INTEGER_TO_CONS.
15646 (x_handle_selection_request, x_handle_selection_clear)
15647 (x_get_foreign_selection, Fx_disown_selection_internal)
15648 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15649 (lisp_data_to_selection_data): Use cons_to_unsigned.
15650 (x_fill_property_data): Use cons_to_signed.
15651 Report values out of range.
15652
15653 Check for buffer and string overflow more precisely.
15654 * buffer.h (BUF_BYTES_MAX): New macro.
15655 * lisp.h (STRING_BYTES_MAX): New macro.
15656 * alloc.c (Fmake_string):
15657 * character.c (string_escape_byte8):
15658 * coding.c (coding_alloc_by_realloc):
15659 * doprnt.c (doprnt):
15660 * editfns.c (Fformat):
15661 * eval.c (verror):
15662 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15663 since they may not be the same number.
15664 * editfns.c (Finsert_char):
15665 * fileio.c (Finsert_file_contents):
15666 Likewise for BUF_BYTES_MAX.
15667
15668 * image.c: Use ptrdiff_t, not int, for sizes.
15669 (slurp_file): Switch from int to ptrdiff_t.
15670 All uses changed.
15671 (slurp_file): Check that file size fits in both size_t (for
15672 malloc) and ptrdiff_t (for sanity and safety).
15673
15674 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15675 if b->modtime has its maximal value.
15676
15677 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15678
15679 Don't assume time_t can fit into int.
15680 * buffer.h (struct buffer.modtime): Now time_t, not int.
15681 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15682 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15683
15684 Minor fixes for signed vs unsigned integers.
15685 * character.h (MAYBE_UNIFY_CHAR):
15686 * charset.c (maybe_unify_char):
15687 * keyboard.c (read_char, reorder_modifiers):
15688 XINT -> XFASTINT, since the integer must be nonnegative.
15689 * ftfont.c (ftfont_spec_pattern):
15690 * keymap.c (access_keymap, silly_event_symbol_error):
15691 XUINT -> XFASTINT, since the integer must be nonnegative.
15692 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15693 since it makes no difference and we prefer signed.
15694 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15695 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15696 nonnegative.
15697
15698 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15699
15700 * window.h (Fwindow_frame): Declare.
15701
15702 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15703
15704 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15705 (SPARE_MEMORY): Always define.
15706 (LARGE_REQUEST): Remove.
15707 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15708
15709 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15710
15711 * lisp.h: Move EXFUNS for Fframe_root_window,
15712 Fframe_first_window and Fset_frame_selected_window to window.h.
15713
15714 * window.h: Move EXFUNS for Fframe_root_window,
15715 Fframe_first_window and Fset_frame_selected_window here from
15716 lisp.h.
15717
15718 * frame.c (Fwindow_frame, Fframe_first_window)
15719 (Fframe_root_window, Fframe_selected_window)
15720 (Fset_frame_selected_window): Move to window.c.
15721 (Factive_minibuffer_window): Move to minibuf.c.
15722 (Fother_visible_frames_p): New function.
15723
15724 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15725
15726 * window.c (decode_window, decode_any_window): Move up in code.
15727 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15728 (inhibit_frame_unsplittable): Remove unused variable.
15729 (Fwindow_buffer): Move up and rewrite doc-string.
15730 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15731 (Fwindow_prev): New functions.
15732 (Fwindow_frame): Move here from frame.c. Accept any window as
15733 argument.
15734 (Fframe_root_window, Fframe_first_window)
15735 (Fframe_selected_window): Move here from frame.c. Accept frame
15736 or arbitrary window as argument. Update doc-strings.
15737 (Fminibuffer_window): Move up in code.
15738 (Fwindow_minibuffer_p): Move up in code and simplify.
15739 (Fset_frame_selected_window): Move here from frame.c.
15740 Marginal rewrite.
15741 (Fselected_window, select_window, Fselect_window): Move up in
15742 code. Minor doc-string fixes.
15743
15744 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15745
15746 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15747 Do not assume that spare memory exists; that assumption is valid
15748 only if SYSTEM_MALLOC.
15749 (LARGE_REQUEST): New macro, so that the issue of large requests
15750 is separated from the issue of spare memory.
15751
15752 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15753
15754 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15755 format. (Bug#8806)
15756
15757 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15758
15759 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15760 before statements.
15761
15762 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15763
15764 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15765
15766 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15767
15768 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15769 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15770
15771 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15772
15773 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15774
15775 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15776
15777 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15778 (x_clipboard_manager_save): Add return value.
15779 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15780 New error handlers.
15781 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15782 Obey Vx_select_enable_clipboard_manager. Catch errors in
15783 x_clipboard_manager_save (Bug#8779).
15784 (Vx_select_enable_clipboard_manager): New variable.
15785 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15786
15787 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15788
15789 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15790
15791 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15792
15793 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15794 in the current matrix if keep_current_p is non-zero.
15795
15796 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15797
15798 * bidi.c (bidi_level_of_next_char): Fix last change.
15799
15800 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15801
15802 Support bidi reordering of text covered by display properties.
15803
15804 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15805 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15806 (bidi_cache_search, bidi_cache_iterator_state)
15807 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15808 (bidi_level_of_next_char, bidi_move_to_visually_next):
15809 Support character positions inside a run of characters covered by a
15810 display string.
15811 (bidi_paragraph_init, bidi_resolve_explicit_1)
15812 (bidi_level_of_next_char): Call bidi_fetch_char and
15813 bidi_fetch_char_advance instead of FETCH_CHAR and
15814 FETCH_CHAR_ADVANCE.
15815 (bidi_init_it): Initialize new members.
15816 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15817 definitions.
15818 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15819 instead of using explicit *_CHAR codes.
15820 (bidi_resolve_explicit, bidi_resolve_weak):
15821 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15822 bidirectional text is supported only in multibyte buffers.
15823 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15824 it to initialize the frame_window_p member of struct bidi_it.
15825 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15826 (bidi_resolve_explicit, bidi_resolve_weak)
15827 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15828 bidi_it->nchars is non-positive.
15829 (bidi_level_of_next_char): Don't try to lookup the cache for the
15830 next/previous character if nothing is cached there yet, or if we
15831 were just reseat()'ed to a new position.
15832
15833 * xdisp.c (set_cursor_from_row): Set start and stop points
15834 according to the row's direction when priming the loop that looks
15835 for the glyph on which to display cursor.
15836 (single_display_spec_intangible_p): Function deleted.
15837 (display_prop_intangible_p): Reimplement to call
15838 handle_display_spec instead of single_display_spec_intangible_p.
15839 Accept 3 additional arguments needed by handle_display_spec.
15840 This fixes incorrect cursor motion across display property with complex
15841 values: lists, `(when COND...)' forms, etc.
15842 (single_display_spec_string_p): Support property values that are
15843 lists with the argument STRING its top-level element.
15844 (display_prop_string_p): Fix the condition for processing a
15845 property that is a list to be consistent with handle_display_spec.
15846 (handle_display_spec): New function, refactored from the
15847 last portion of handle_display_prop.
15848 (compute_display_string_pos): Accept additional argument
15849 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15850 value of a `display' property is a "replacing spec".
15851 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15852 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15853 the display property, but just return a value indicating whether
15854 the display property will replace the characters it covers.
15855 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15856 frame_window_p members of struct bidi_it.
15857 (compute_display_string_pos, compute_display_string_end):
15858 New functions.
15859 (push_it): Accept second argument POSITION, where pop_it should
15860 jump to continue iteration.
15861 (reseat_1): Initialize bidi_it.disp_pos.
15862
15863 * keyboard.c (adjust_point_for_property): Adjust the call to
15864 display_prop_intangible_p to its new signature.
15865
15866 * dispextern.h (struct bidi_it): New member frame_window_p.
15867 (bidi_init_it): Update prototypes.
15868 (display_prop_intangible_p): Update prototype.
15869 (compute_display_string_pos, compute_display_string_end):
15870 Declare prototypes.
15871 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15872 EMACS_INT.
15873
15874 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15875
15876 Malloc failure behavior now depends on size of allocation.
15877 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15878 * lisp.h: Change signatures accordingly.
15879 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15880 All callers changed. (Bug#8762)
15881
15882 * gnutls.c: Use Emacs's memory allocators.
15883 Without this change, the gnutls library would invoke malloc etc.
15884 directly, which causes problems on non-SYNC_INPUT hosts, and which
15885 runs afoul of improving memory_full behavior. (Bug#8761)
15886 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15887 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15888 xfree instead of the default malloc, realloc, free.
15889 (Fgnutls_boot): No need to check for memory allocation failure,
15890 since xmalloc does that for us.
15891
15892 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15893 * category.c (hash_get_category_set):
15894 * ccl.c (ccl_driver):
15895 * charset.c (Fdefine_charset_internal):
15896 * charset.h (struct charset.hash_index):
15897 * composite.c (get_composition_id, gstring_lookup_cache)
15898 (composition_gstring_put_cache):
15899 * composite.h (struct composition.hash_index):
15900 * dispextern.h (struct image.hash):
15901 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15902 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15903 (hashfn_equal, hashfn_user_defined, make_hash_table)
15904 (maybe_resize_hash_table, hash_lookup, hash_put)
15905 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15906 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15907 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15908 * image.c (make_image, search_image_cache, lookup_image)
15909 (xpm_put_color_table_h):
15910 * lisp.h (struct Lisp_Hash_Table):
15911 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15912 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15913 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15914 * alloc.c (allocate_vectorlike):
15915 Check for overflow in vector size calculations.
15916 * ccl.c (ccl_driver):
15917 Check for overflow when converting EMACS_INT to int.
15918 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15919 need to be updated by these changes.
15920 * fns.c (make_hash_table, maybe_resize_hash_table):
15921 Check for integer overflow with large hash tables.
15922 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15923 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15924 (SXHASH_REDUCE): New macro.
15925 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15926 Use it instead of discarding useful hash info with large hash values.
15927 (sxhash_float): New function.
15928 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15929 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15930 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15931 Rewrite to use FIXNUM_BITS, as this simplifies things.
15932 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15933 Adjust signatures to match updated version of code.
15934 (consing_since_gc): Now EMACS_INT, since a single hash table can
15935 use more than INT_MAX bytes.
15936
15937 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15938
15939 Make it possible to build with GCC-4.6+ -O2 -flto.
15940
15941 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15942
15943 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15944
15945 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15946 Call minibuffer-inactive-mode.
15947
15948 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15949
15950 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15951 Update dependencies.
15952
15953 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15954
15955 * data.c (init_data): Remove code for UTS, this system is not
15956 supported anymore.
15957
15958 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15959
15960 Don't force ./temacs to start in terminal mode.
15961
15962 * frame.c (make_initial_frame): Initialize faces in all cases, not
15963 only when CANNOT_DUMP is defined.
15964 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15965
15966 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15967
15968 * dispnew.c (add_window_display_history): Use const for the string
15969 pointer. Remove declaration, not needed.
15970
15971 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15972
15973 Use 'inline', not 'INLINE'.
15974 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15975 * alloc.c, fontset.c (INLINE): Remove.
15976 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15977 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15978 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15979 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15980 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15981
15982 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15983
15984 Make it possible to run ./temacs.
15985
15986 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15987 syms_of_callproc does the same thing. Remove test for
15988 "initialized", do it in the caller.
15989 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15990
15991 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15992
15993 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15994 (read_minibuf): Use get_minibuffer.
15995 (syms_of_minibuf): Use DEFSYM.
15996 (Qmetadata): New var.
15997 * data.c (Qbuffer): Don't make it static.
15998 (syms_of_data): Use DEFSYM.
15999
16000 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16001
16002 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16003 (CCL_CODE_MIN): New macro.
16004
16005 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16006
16007 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16008
16009 * eval.c (Qdebug): Now static.
16010 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16011 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16012 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16013
16014 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16015
16016 * image.c: Various fixes to ImageMagick code comments.
16017 (Fimagemagick_types): Doc fix.
16018
16019 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16020
16021 Minor fixes prompted by GCC 4.6.0 warnings.
16022
16023 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16024
16025 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16026 (x_clipboard_manager_save_all): Move extern decl to ...
16027 * xterm.h: ... here, so that it can be checked for consistency.
16028
16029 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16030
16031 * xselect.c (x_clipboard_manager_save_frame)
16032 (x_clipboard_manager_save_all): New functions.
16033 (Fx_clipboard_manager_save): Lisp function deleted.
16034
16035 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16036 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16037
16038 * xterm.h: Update prototype.
16039
16040 2011-05-28 William Xu <william.xwl@gmail.com>
16041
16042 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16043 exiting (Bug#8239).
16044
16045 2011-05-28 Jim Meyering <meyering@redhat.com>
16046
16047 Avoid a sign-extension bug in crypto_hash_function.
16048 * fns.c (to_uchar): Define.
16049 (crypto_hash_function): Use it to convert some newly-signed
16050 variables to unsigned, to avoid sign-extension bugs. For example,
16051 without this change, (md5 "truc") would evaluate to
16052 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16053 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16054 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16055
16056 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16057
16058 Integer overflow fixes.
16059
16060 * dbusbind.c: Serial number integer overflow fixes.
16061 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16062 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16063 to hold a serial number that is too large for a fixnum.
16064 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16065 Check for serial numbers out of range. Decode any serial number
16066 that was so large that it became a float. (Bug#8722)
16067
16068 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16069 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16070 Use XFASTINT rather than XUINT when numbers are nonnegative.
16071 (xd_append_arg, Fdbus_method_return_internal):
16072 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16073 arguments, check that Lisp number is nonnegative, rather than
16074 silently wrapping negative numbers around. (Bug#8722)
16075 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16076 (Bug#8722)
16077
16078 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16079
16080 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16081
16082 ccl: Add integer overflow checks.
16083 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16084 (IN_INT_RANGE): New macros.
16085 (ccl_driver): Use them to check for integer overflow when
16086 decoding a CCL program. Many of the new checks are whether XINT (x)
16087 fits in int; it doesn't always, on 64-bit hosts. The new version
16088 doesn't catch all possible integer overflows, but it's an
16089 improvement. (Bug#8719)
16090
16091 * alloc.c (make_event_array): Use XINT, not XUINT.
16092 There's no need for unsigned here.
16093
16094 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16095 This follows up to the 2011-05-06 change that substituted uintptr_t
16096 for EMACS_INT. This case wasn't caught back then.
16097
16098 Rework Fformat to avoid integer overflow issues.
16099 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16100 now (part of C89). Include <verify.h>.
16101 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16102 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16103 (Fformat): Avoid the prepass trying to compute sizes; it was only
16104 approximate and thus did not catch overflow reliably. Instead, walk
16105 through the format just once, formatting and computing sizes as we go,
16106 checking for integer overflow at every step, and allocating a larger
16107 buffer as needed. Keep track separately whether the format is
16108 multibyte. Keep only the most-recently calculated precision, rather
16109 than them all. Record whether each argument has been converted to
16110 string. Use EMACS_INT, not int, for byte and char and arg counts.
16111 Support field widths and precisions larger than INT_MAX. Avoid
16112 sprintf's undefined behavior with conversion specifications such as %#d
16113 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16114 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16115 formatting out-of-range floating point numbers with int
16116 formats. (Bug#8668)
16117
16118 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16119
16120 * data.c: Avoid integer truncation in expressions involving floats.
16121 * data.c: Include <intprops.h>.
16122 (arith_driver): When there's an integer overflow in an expression
16123 involving floating point, convert the integers to floating point
16124 so that the resulting value does not suffer from catastrophic
16125 integer truncation. For example, on a 64-bit host (* 4
16126 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16127 Do not rely on undefined behavior after integer overflow.
16128
16129 merge count_size_as_multibyte, parse_str_to_multibyte
16130 * character.c, character.h (count_size_as_multibyte):
16131 Rename from parse_str_to_multibyte; all uses changed.
16132 Check for integer overflow.
16133 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16134 since it's now a duplicate of the other. This is more of
16135 a character than a buffer op, so better that it's in character.c.
16136 * fns.c, print.c: Adjust to above changes.
16137
16138 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16139
16140 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16141
16142 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16143
16144 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16145 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16146 (x_clipboard_manager_save): Now static.
16147 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16148
16149 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16150 (crypto_hash_function): Now static.
16151 Fix pointer signedness problems. Avoid unnecessary initializations.
16152
16153 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16154
16155 * termhooks.h (Vselection_alist): Make it terminal-local.
16156
16157 * terminal.c (create_terminal): Initialize it.
16158
16159 * xselect.c: Support for clipboard managers.
16160 (Vselection_alist): Move to termhooks.h as terminal-local var.
16161 (LOCAL_SELECTION): New macro.
16162 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16163 (symbol_to_x_atom): Remove gratuitous arg.
16164 (x_handle_selection_request, lisp_data_to_selection_data)
16165 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16166 (x_own_selection, x_get_local_selection, x_convert_selection):
16167 New arg, specifying work frame. Use terminal-local Vselection_alist.
16168 (some_frame_on_display): Delete unused function.
16169 (Fx_own_selection_internal, Fx_get_selection_internal)
16170 (Fx_disown_selection_internal, Fx_selection_owner_p)
16171 (Fx_selection_exists_p): New optional frame arg.
16172 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16173 (x_handle_selection_clear): Don't treat other terminals with the
16174 same keyboard specially. Use the terminal-local Vselection_alist.
16175 (x_clear_frame_selections): Use Frun_hook_with_args.
16176
16177 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16178
16179 * xterm.h: Add support for those atoms.
16180
16181 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16182
16183 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16184 (converted_selections, conversion_fail_tag): New global variables.
16185 (x_selection_request_lisp_error): Free the above.
16186 (x_get_local_selection): Remove unnecessary code.
16187 (x_reply_selection_request): Args changed; handle arbitrary array
16188 of converted selections stored in converted_selections.
16189 Separate the XChangeProperty and SelectionNotify steps.
16190 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16191 (x_convert_selection): New function.
16192 (x_handle_selection_event): Simplify.
16193 (x_get_foreign_selection): Don't ignore incoming requests while
16194 waiting for an answer; this will fail when we implement
16195 SAVE_TARGETS, and seems unnecessary anyway.
16196 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16197 (Vx_sent_selection_functions): Doc fix.
16198
16199 2011-05-26 Leo Liu <sdl.web@gmail.com>
16200
16201 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16202
16203 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16204
16205 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16206
16207 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16208 for fringe update if it has periodic bitmap.
16209 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16210 and fringe_bitmap_periodic_p.
16211
16212 * fringe.c (get_fringe_bitmap_data): New function.
16213 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16214 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16215 row. Mark glyph row for fringe update if periodicity changed.
16216
16217 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16218 for fringe update unless it has periodic bitmap.
16219
16220 2011-05-25 Kenichi Handa <handa@m17n.org>
16221
16222 * xdisp.c (get_next_display_element): Set correct it->face_id for
16223 a static composition.
16224
16225 2011-05-24 Leo Liu <sdl.web@gmail.com>
16226
16227 * deps.mk (fns.o):
16228 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16229
16230 * fns.c (crypto_hash_function, Fsha1): New function.
16231 (Fmd5): Use crypto_hash_function.
16232 (syms_of_fns): Add Ssha1.
16233
16234 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16235
16236 * gnutls.c: Remove unused macros.
16237 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16238 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16239 Remove macros that are defined and never used.
16240 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16241
16242 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16243
16244 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16245 (Fx_get_selection_internal): Minor cleanup.
16246 (Fx_own_selection_internal): Rename arguments for consistency with
16247 select.el.
16248
16249 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16250
16251 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16252
16253 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16254
16255 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16256
16257 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16258
16259 * dispnew.c (scrolling_window): Don't exclude the case that the
16260 last enabled row in the desired matrix touches the bottom boundary.
16261
16262 2011-05-21 Glenn Morris <rgm@gnu.org>
16263
16264 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16265 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16266 and add some more files.
16267
16268 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16269
16270 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16271 report_file_error introduced by the change from 2011-05-07.
16272
16273 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16274
16275 * systime.h (Time): Define only if emacs is defined.
16276 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16277 where the include path doesn't have X11/X.h by default. See
16278 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16279
16280 2011-05-20 Kenichi Handa <handa@m17n.org>
16281
16282 * composite.c (find_automatic_composition): Fix previous change.
16283
16284 2011-05-20 Glenn Morris <rgm@gnu.org>
16285
16286 * lisp.mk: New file, split from Makefile.in.
16287 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16288 (shortlisp): Remove.
16289 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16290
16291 2011-05-19 Glenn Morris <rgm@gnu.org>
16292
16293 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16294 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16295 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16296 (lisp): Set the order to that of loadup.el.
16297 (shortlisp): Make it a copy of $lisp.
16298 (SOME_MACHINE_LISP): Remove.
16299 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16300 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16301
16302 2011-05-18 Kenichi Handa <handa@m17n.org>
16303
16304 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16305 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16306 (find_automatic_composition): Mostly rewrite for efficiency.
16307
16308 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16309
16310 * makefile.w32-in: Update dependencies.
16311
16312 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16313
16314 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16315 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16316
16317 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16318
16319 Fix some integer overflow issues, such as string length overflow.
16320
16321 * insdel.c (count_size_as_multibyte): Check for string overflow.
16322
16323 * character.c (lisp_string_width): Check for string overflow.
16324 Use EMACS_INT, not int, for string indexes and lengths; in
16325 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16326 the resulting string length overflows an EMACS_INT; instead,
16327 report a string overflow if no precision given. When checking for
16328 precision exhaustion, use a check that cannot possibly have
16329 integer overflow. (Bug#8675)
16330 * character.h (lisp_string_width): Adjust to new signature.
16331
16332 * alloc.c (string_overflow): New function.
16333 (Fmake_string): Use it. This doesn't change behavior, but saves
16334 a few bytes and will simplify future changes.
16335 * character.c (string_escape_byte8): Likewise.
16336 * lisp.h (string_overflow): New decl.
16337
16338 Fixups, following up to the user-interface timestamp change.
16339 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16340 for UI timestamps, instead of unsigned long.
16341 * msdos.c (mouse_get_pos): Likewise.
16342 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16343 * w32gui.h (Time): Define by including "systime.h" rather than by
16344 declaring it ourselves. (Bug#8664)
16345
16346 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16347 * image.c (clear_image_cache): Likewise.
16348
16349 * term.c (term_mouse_position): Don't assume time_t wraparound.
16350
16351 Be more systematic about user-interface timestamps.
16352 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16353 and sometimes 'EMACS_UINT', to represent these timestamps.
16354 This change causes it to use 'Time' uniformly, as that's what X uses.
16355 This makes the code easier to follow, and makes it easier to catch
16356 integer overflow bugs such as Bug#8664.
16357 * frame.c (Fmouse_position, Fmouse_pixel_position):
16358 Use Time, not unsigned long, for user-interface timestamps.
16359 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16360 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16361 * keyboard.h (last_event_timestamp): Likewise.
16362 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16363 * menu.h (xmenu_show): Likewise.
16364 * term.c (term_mouse_position): Likewise.
16365 * termhooks.h (struct input_event.timestamp): Likewise.
16366 (struct terminal.mouse_position_hook): Likewise.
16367 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16368 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16369 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16370 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16371 what it was before.
16372 * menu.h, termhooks.h: Include "systime.h", for Time.
16373
16374 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16375 Don't assume that the difference between two unsigned long values
16376 can fit into an integer. At this point, we know button_down_time
16377 <= event->timestamp, so the difference must be nonnegative, so
16378 there's no need to cast the result if double-click-time is
16379 nonnegative, as it should be; check that it's nonnegative, just in
16380 case. This bug is triggered when events are more than 2**31 ms
16381 apart (about 25 days). (Bug#8664)
16382
16383 * xselect.c (last_event_timestamp): Remove duplicate decl.
16384 (x_own_selection): Remove needless cast to unsigned long.
16385
16386 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16387 that always fit in int. Use a sentinel instead of a counter, to
16388 avoid a temp and to allay GCC's concerns about possible int overflow.
16389 * frame.h (struct frame): Use int for menu_bar_items_used
16390 instead of EMACS_INT, since it always fits in int.
16391
16392 * menu.c (grow_menu_items): Check for int overflow.
16393
16394 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16395
16396 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16397 Before, the code was not consistent. These values cannot exceed
16398 2**31 - 1 so there's no need to make them unsigned.
16399 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16400 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16401 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16402 as modifiers.
16403 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16404
16405 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16406 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16407 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16408 presumably because the widths might not match.
16409
16410 * window.c (size_window): Avoid needless test at loop start.
16411
16412 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16413
16414 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16415
16416 2011-05-12 Drew Adams <drew.adams@oracle.com>
16417
16418 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16419
16420 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16421
16422 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16423 `width' to `bar_area_x' and `bar_area_width', respectively.
16424 (x_scroll_run): Take account of fringe background extension.
16425
16426 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16427 Rename local vars `left' and `width' to `bar_area_x' and
16428 `bar_area_width', respectively.
16429 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16430 background extension.
16431
16432 2011-05-10 Jim Meyering <meyering@redhat.com>
16433
16434 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16435
16436 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16437
16438 * image.c (Finit_image_library): Return t for built-in image types,
16439 like pbm and xbm. (Bug#8640)
16440
16441 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16442
16443 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16444
16445 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16446
16447 * w32console.c (Fset_screen_color): Doc fix.
16448 (Fget_screen_color): New function.
16449 (syms_of_ntterm): Defsubr it.
16450
16451 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16452 unlink the temporary file if Fcall_process didn't create it in the
16453 first place.
16454 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16455 child process will be redirected to a file specified with `:file'.
16456 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16457 cue to call_process_cleanup not to close that handle.
16458
16459 2011-05-07 Ben Key <bkey76@gmail.com>
16460
16461 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16462 one of two shell specific rules, either bootstrap-temacs-CMD or
16463 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16464 to the previous implementation of the bootstrap-temacs rule.
16465 The bootstrap-temacs-CMD rule is similar to the previous
16466 implementation of the bootstrap-temacs rule except that it
16467 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16468 variable.
16469
16470 These changes, along with some changes to nt/configure.bat,
16471 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16472 earlier fix to add support for --cflags and --ldflags options
16473 that include quotes so that it works whether make uses cmd or
16474 sh as the shell.
16475
16476 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16477
16478 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16479 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16480 is a constant.
16481 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16482 a string. Handle both cases.
16483 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16484 (Fdbus_register_method): Use Qinvalid_function.
16485
16486 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16487
16488 * makefile.w32-in: Update dependencies.
16489 (LISP_H): Add inttypes.h and stdin.h.
16490 (PROCESS_H): Add unistd.h.
16491
16492 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16493
16494 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16495 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16496
16497 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16498
16499 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16500
16501 * term.c (vfatal): Remove stray call to va_end.
16502 It's not needed and the C Standard doesn't allow it here anyway.
16503
16504 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16505 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16506
16507 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16508 bytes.
16509
16510 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16511
16512 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16513
16514 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16515
16516 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16517
16518 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16519
16520 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16521 * charset.c (Fdefine_charset_internal): Don't initialize
16522 charset.code_space[15]. The value was garbage, on hosts with
16523 32-bit int (Bug#8600).
16524
16525 * lread.c (read_integer): Be more consistent with string-to-number.
16526 Use string_to_number to do the actual conversion; this avoids
16527 rounding errors and fixes some other screwups. Without this fix,
16528 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16529 (digit_to_number): Move earlier, for benefit of read_integer.
16530 Return -1 if the digit is out of range for the base, -2 if it is
16531 not a digit in any supported base. (Bug#8602)
16532
16533 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16534
16535 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16536 to match comment at start of function. This also removes a
16537 GCC warning about overflow in a 32+64-bit port.
16538
16539 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16540
16541 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16542 Reported by Stefan Monnier in
16543 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16544 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16545 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16546
16547 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16548 (EMACS_UINTPTR): Likewise, with uintptr_t.
16549
16550 * lisp.h: Prefer 64-bit EMACS_INT if available.
16551 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16552 on 32-bit hosts that have 64-bit int, so that they can access
16553 large files.
16554 However, temporarily disable this change unless the temporary
16555 symbol WIDE_EMACS_INT is defined.
16556
16557 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16558
16559 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16560 This removes an assumption that EMACS_INT and long are the same
16561 width as pointers. The assumption is true for Emacs porting targets
16562 now, but we want to make other targets possible.
16563 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16564 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16565 In the rest of the code, change types of integers that hold casted
16566 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16567 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16568 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16569 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16570 No need to cast type when ORing.
16571 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16572 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16573 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16574 assume EMACS_INT is the same width as char *.
16575 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16576 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16577 Remove no-longer-needed casts.
16578 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16579 (xg_tool_bar_help_callback, xg_make_tool_item):
16580 Use EMACS_INTPTR to hold an integer
16581 that will be cast to void *; this can avoid a GCC warning
16582 if EMACS_INT is not the same width as void *.
16583 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16584 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16585 (current_message_1, set_message_1):
16586 Use a local to convert to proper width without a cast.
16587 * xmenu.c (dialog_selection_callback): Likewise.
16588
16589 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16590 Also, don't assume VALBITS / RAND_BITS is less than 5,
16591 and don't rely on undefined behavior when shifting a 1 left into
16592 the sign bit.
16593 * lisp.h (get_random): Change signature to match.
16594
16595 * lread.c (hash_string): Use size_t, not int, for hash computation.
16596 Normally we prefer signed values; but hashing is special, because
16597 it's better to use unsigned division on hash table sizes so that
16598 the remainder is nonnegative. Also, size_t is the natural width
16599 for hashing into memory. The previous code used 'int', which doesn't
16600 retain enough info to hash well into very large tables.
16601 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16602
16603 * dbusbind.c: Don't possibly lose pointer info when converting.
16604 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16605 Use XPNTR rather than XHASH, so that the high-order bits of
16606 the pointer aren't lost when converting through void *.
16607
16608 * eval.c (Fautoload): Don't double-shift a pointer.
16609
16610 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16611
16612 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16613
16614 * gnutls.c (DEF_GNUTLS_FN):
16615 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16616
16617 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16618
16619 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16620 marker. (Bug#8610)
16621
16622 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16623
16624 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16625 New version that can reserve upto 2GB of heap space.
16626
16627 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16628
16629 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16630
16631 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16632
16633 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16634 `gnutls_certificate_set_x509_key_file'.
16635
16636 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16637
16638 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16639 Update dependencies.
16640
16641 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16642
16643 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16644 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16645 Remove unused parameter `fildes'.
16646 * process.c (read_process_output, send_process): Don't pass it.
16647
16648 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16649
16650 Fix previous change: the library cache is defined in w32.c.
16651 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16652 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16653
16654 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16655
16656 Implement dynamic loading of GnuTLS on Windows.
16657
16658 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16659 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16660 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16661 Declare.
16662
16663 * gnutls.c (Qgnutls_dll): Define.
16664 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16665 (gnutls_*): Declare function pointers.
16666 (init_gnutls_functions): New function to initialize function pointers.
16667 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16668 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16669 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16670 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16671 (emacs_gnutls_write, emacs_gnutls_read)
16672 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16673 (Fgnutls_available_p): New function.
16674 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16675 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16676 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16677
16678 * image.c: Include w32.h.
16679 (Vimage_type_cache): Delete.
16680 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16681 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16682 (w32_delayed_load): Move to w32.c.
16683
16684 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16685
16686 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16687 (w32_delayed_load): Move from image.c. When loading a library, record
16688 its filename in the :loaded-from property of the library id.
16689 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16690 Initialize and staticpro them.
16691 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16692
16693 * process.c: Include lisp.h before w32.h, not after.
16694 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16695 instead of gnutls_record_check_pending.
16696
16697 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16698
16699 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16700
16701 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16702 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16703 as passed in.
16704
16705 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16706
16707 * xterm.c (x_set_frame_alpha): Do not set property on anything
16708 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16709
16710 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16711
16712 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16713
16714 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16715
16716 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16717 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16718 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16719 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16720 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16721 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16722 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16723 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16724 (Qgnutls_bootprop_callbacks_verify): Make static.
16725
16726 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16727
16728 * callproc.c: Indentation fixup.
16729
16730 * sysdep.c (wait_for_termination_1): Make static.
16731 (wait_for_termination, interruptible_wait_for_termination):
16732 Move after wait_for_termination_1.
16733
16734 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16735
16736 * sysdep.c (interruptible_wait_for_termination): New function
16737 which is like wait_for_termination, but allows keyboard
16738 interruptions.
16739
16740 * callproc.c (Fcall_process): Add (:file "file") as an option for
16741 the STDOUT buffer.
16742 (Fcall_process_region): Ditto.
16743
16744 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16745
16746 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16747 rather than `XVECTOR (FOO)->size'.
16748
16749 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16750 inttypes.h, as a gnulib replacement is used if it not available in
16751 system headers.
16752
16753 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16754
16755 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16756 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16757 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16758
16759 * coding.c (coding_alloc_by_realloc): Error out if destination
16760 will grow beyond MOST_POSITIVE_FIXNUM.
16761 (decode_coding_emacs_mule): Abort if there isn't enough place in
16762 charbuf for the composition carryover bytes. Reserve an extra
16763 space for up to 2 characters produced in a loop.
16764 (decode_coding_iso_2022): Abort if there isn't enough place in
16765 charbuf for the composition carryover bytes.
16766
16767 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16768
16769 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16770 aborting when %lld or %lll format is passed.
16771 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16772 %llo or %llx format is passed. (Bug#8545)
16773
16774 * window.c (window_scroll_line_based): Use a marker instead of
16775 simple variables to record original value of point. (Bug#7952)
16776
16777 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16778 produced by %s or %c overflows available buffer space. (Bug#8545)
16779
16780 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16781
16782 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16783 (SIZE_MAX): Move defn after all includes, as they might #define it.
16784
16785 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16786
16787 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16788
16789 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16790
16791 * keyboard.c (Qdelayed_warnings_hook): Define.
16792 (command_loop_1): Run `delayed-warnings-hook'
16793 if Vdelayed_warnings_list is non-nil.
16794 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16795 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16796
16797 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16798
16799 * doprnt.c (doprnt): Don't return value smaller than the buffer
16800 size if the message was truncated. (Bug#8545).
16801
16802 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16803
16804 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16805 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16806
16807 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16808
16809 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16810
16811 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16812
16813 * makefile.w32-in: Update dependencies.
16814
16815 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16816
16817 Improve `doprnt' and its usage. (Bug#8545)
16818 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16819 `format_end'. Remove support for %l as a conversion specifier.
16820 Don't use xrealloc. Improve diagnostics when the %l size modifier
16821 is used. Update the commentary.
16822
16823 * eval.c (verror): Simplify calculation of size_t.
16824
16825 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16826 messages.
16827
16828 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16829
16830 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16831 change.
16832
16833 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16834
16835 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16836 This makes this file independent of the recent pseudovector change.
16837
16838 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16839
16840 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16841
16842 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16843 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16844 Remove unused local.
16845 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16846
16847 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16848 GCC 4.6.0 optimizes based on type-based alias analysis.
16849 For example, if b is of type struct buffer * and v of type struct
16850 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16851 != &v->size, and therefore "v->size = 1; b->size = 2; return
16852 v->size;" must therefore return 1. This assumption is incorrect
16853 for Emacs, since it type-puns struct Lisp_Vector * with many other
16854 types. To fix this problem, this patch adds a new type struct
16855 vectorlike_header that documents the constraints on layout of vectors
16856 and pseudovectors, and helps optimizing compilers not get fooled
16857 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16858 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16859 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16860 the size member.
16861 (XSETPVECTYPE): Rewrite in terms of new macro.
16862 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16863 This is a bit clearer, and further avoids the possibility of
16864 undesirable aliasing.
16865 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16866 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16867 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16868 since Lisp_Subr is a special case (no "next" field).
16869 (ASIZE): Now uses header.size rather than size.
16870 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16871 to avoid the hassle of writing XVECTOR (foo)->header.size.
16872 (struct vectorlike_header): New type.
16873 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16874 object, to help avoid aliasing.
16875 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16876 (SUBRP): Likewise, since Lisp_Subr is a special case.
16877 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16878 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16879 (struct Lisp_Hash_Table): Combine first two members into a single
16880 struct vectorlike_header member. All uses of "size" and "next" members
16881 changed to be "header.size" and "header.next".
16882 * buffer.h (struct buffer): Likewise.
16883 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16884 * frame.h (struct frame): Likewise.
16885 * process.h (struct Lisp_Process): Likewise.
16886 * termhooks.h (struct terminal): Likewise.
16887 * window.c (struct save_window_data, struct saved_window): Likewise.
16888 * window.h (struct window): Likewise.
16889 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16890 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16891 * buffer.c (init_buffer_once): Likewise.
16892 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16893 special case.
16894 * process.c (Fformat_network_address): Use local var for size,
16895 for brevity.
16896
16897 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16898
16899 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16900 * data.c (atof): Remove decl; no longer used or needed.
16901 (digit_to_number): Move to lread.c.
16902 (Fstring_to_number): Use new string_to_number function, to be
16903 consistent with how the Lisp reader treats infinities and NaNs.
16904 Do not assume that floating-point numbers represent EMACS_INT
16905 without losing information; this is not true on most 64-bit hosts.
16906 Avoid double-rounding errors, by insisting on integers when
16907 parsing non-base-10 numbers, as the documentation specifies.
16908 * lisp.h (string_to_number): New decl, replacing ...
16909 (isfloat_string): Remove.
16910 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16911 (read1): Do not accept +. and -. as integers; this
16912 appears to have been a coding error. Similarly, do not accept
16913 strings like +-1e0 as floating point numbers. Do not report
16914 overflow for integer overflows unless the base is not 10 which
16915 means we have no simple and reliable way to continue.
16916 Break out the floating-point parsing into a new
16917 function string_to_number, so that Fstring_to_number parses
16918 floating point numbers consistently with the Lisp reader.
16919 (digit_to_number): Move here from data.c. Make it static inline.
16920 (E_CHAR, EXP_INT): Remove, replacing with ...
16921 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16922 (string_to_number): New function, replacing isfloat_string.
16923 This function checks for valid syntax and produces the resulting
16924 Lisp float number too. Rework it so that string-to-number
16925 no longer mishandles examples like "1.0e+". Use strtoumax,
16926 so that overflow for non-base-10 numbers is reported only when
16927 there's no portable and simple way to convert to floating point.
16928
16929 * textprop.c (set_text_properties_1): Rewrite for clarity,
16930 and to avoid GCC warning about integer overflow.
16931
16932 * intervals.h (struct interval): Use EMACS_INT for members
16933 where EMACS_UINT might cause problems. See
16934 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16935 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16936 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16937 All uses changed.
16938 (offset_intervals): Tell GCC not to worry about length overflow
16939 when negating a negative length.
16940
16941 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16942 (overrun_check_free): Likewise.
16943
16944 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16945 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16946 word size.
16947
16948 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16949 (gnutls_make_error): Rename local to avoid shadowing.
16950 (gnutls_emacs_global_deinit): ifdef out; not used.
16951 (Fgnutls_boot): Use const for pointer to readonly storage.
16952 Comment out unused local. Fix pointer signedness problems.
16953
16954 * lread.c (openp): Don't stuff size_t into an 'int'.
16955 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16956 about possible signed overflow.
16957
16958 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16959 (GDK_KEY_g): Don't define if already defined.
16960 (xg_prepare_tooltip): Avoid pointer signedness problem.
16961 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16962
16963 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16964 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16965
16966 * xfns.c (Fx_window_property): Simplify a bit,
16967 to make a bit faster and to avoid GCC 4.6.0 warning.
16968 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16969
16970 * fns.c (internal_equal): Don't assume size_t fits in int.
16971
16972 * alloc.c (compact_small_strings): Tighten assertion a little.
16973
16974 Replace pEd with more-general pI, and fix some printf arg casts.
16975 * lisp.h (pI): New macro, generalizing old pEd macro to other
16976 conversion specifiers. For example, use "...%"pI"d..." rather
16977 than "...%"pEd"...".
16978 (pEd): Remove. All uses replaced with similar uses of pI.
16979 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16980 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16981 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16982 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16983 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16984 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16985 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16986 64-bit hosts.
16987 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16988 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16989 * print.c (safe_debug_print, print_object): Likewise.
16990 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16991 to int.
16992 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16993 avoiding the 0 flag, which is not portable.
16994 * process.c (Fmake_network_process): Use pI to avoid cast.
16995 * region-cache.c (pp_cache): Likewise.
16996 * xdisp.c (decode_mode_spec): Likewise.
16997 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16998 behavior on 64-bit hosts with printf arg.
16999 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
17000 (x_stop_queuing_selection_requests): Likewise.
17001 (x_get_window_property): Don't truncate byte count to an 'int'
17002 when tracing.
17003
17004 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17005 here, since it parses constructs like leading '-' and spaces,
17006 which are not wanted; and it overflows with large numbers.
17007 Instead, simply match F[0-9]+, which is what is wanted anyway.
17008
17009 * alloc.c: Remove unportable assumptions about struct layout.
17010 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17011 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17012 (allocate_vectorlike, make_pure_vector): Use the new macros,
17013 plus offsetof, to remove unportable assumptions about struct layout.
17014 These assumptions hold on all porting targets that I know of, but
17015 they are not guaranteed, they're easy to remove, and removing them
17016 makes further changes easier.
17017
17018 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17019 This doesn't fix a bug but makes the code clearer.
17020 (string_overrun_cookie): Now const. Use initializers that
17021 don't formally overflow signed char, to avoid warnings.
17022 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17023 can cause Emacs to crash when string overrun checking is enabled.
17024 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17025 multiple of sizeof (EMACS_INT); it need not be, if
17026 alignof(EMACS_INT) < sizeof (EMACS_INT).
17027 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17028
17029 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17030
17031 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17032
17033 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17034
17035 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17036 supposed to be handshaking. (Bug#8556)
17037 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17038
17039 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17040
17041 * lisp.h (Qdebug): List symbol.
17042 * eval.c (Qdebug): Restore global linkage.
17043 * keyboard.c (debug-on-event): New variable.
17044 (handle_user_signal): Break into debugger when debug-on-event
17045 matches the current signal symbol.
17046
17047 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17048
17049 * alloc.c (check_sblock, check_string_bytes)
17050 (check_string_free_list): Convert to standard C.
17051
17052 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17053
17054 * w32.c (emacs_gnutls_push): Fix typo.
17055
17056 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17057
17058 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17059 "cast to pointer from integer of different size".
17060
17061 Improve doprnt and its use in verror. (Bug#8545)
17062 * doprnt.c (doprnt): Document the set of format control sequences
17063 supported by the function. Use SAFE_ALLOCA instead of always
17064 using `alloca'.
17065
17066 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17067 is one byte too soon. Don't use xrealloc; instead xfree and
17068 xmalloc anew.
17069
17070 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17071
17072 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17073 callbacks stage.
17074
17075 * gnutls.c: Renamed global_initialized to
17076 gnutls_global_initialized. Added internals for the
17077 :verify-hostname-error, :verify-error, and :verify-flags
17078 parameters of `gnutls-boot' and documented those parameters in the
17079 docstring. Start callback support.
17080 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17081 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17082 on error. Return error code.
17083 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17084 (emacs_gnutls_read): Likewise.
17085 (Fgnutls_boot): Return handshake error code.
17086 (emacs_gnutls_handle_error): New function.
17087 (wsaerror_to_errno): Likewise.
17088
17089 * w32.h (emacs_gnutls_pull): Add prototype.
17090 (emacs_gnutls_push): Likewise.
17091
17092 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17093 (emacs_gnutls_push): Likewise.
17094
17095 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17096
17097 * process.c (wait_reading_process_output): Check if GnuTLS
17098 buffered some data internally if no FDs are set for TLS
17099 connections.
17100
17101 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17102 (LIBS): Link to USER_LIBS.
17103 ($(BLD)/gnutls.$(0)): New target.
17104
17105 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17106
17107 * xdisp.c (handle_single_display_spec): Rename the
17108 display_replaced_before_p argument into display_replaced_p, to
17109 make it consistent with the commentary. Fix typos in the
17110 commentary.
17111
17112 * textprop.c (syms_of_textprop): Remove dead code.
17113 (copy_text_properties): Delete obsolete commentary about an
17114 interface that was deleted long ago. Fix typos in the description
17115 of arguments.
17116
17117 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17118 to changes in oldXMenu/XMenu.h from 2011-04-16.
17119 <menu_help_message, prev_menu_help_message>: Constify.
17120 (IT_menu_make_room): menu->help_text is now `const char **';
17121 adjust.
17122
17123 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17124 to changes in oldXMenu/XMenu.h from 2011-04-16.
17125 (struct XMenu): Declare `help_text' `const char **'.
17126
17127 * xfaces.c <Qunspecified>: Make extern again.
17128
17129 * syntax.c: Include sys/types.h before including regex.h, as
17130 required by POSIX.
17131
17132 * doc.c (get_doc_string): Improve the format passed to `error'.
17133
17134 * doprnt.c (doprnt): Improve commentary.
17135
17136 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17137
17138 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17139 them with etags.
17140
17141 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17142 changes in globals.h immediately force recompilation.
17143 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17144 $(CURDIR)/s/ms-w32.h.
17145 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17146
17147 * character.c (Fchar_direction): Function deleted.
17148 (syms_of_character): Don't defsubr it.
17149 <char-direction-table>: Deleted.
17150
17151 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17152
17153 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17154 * doprnt.c: Include limits.h.
17155 (SIZE_MAX): New macro.
17156 (doprnt): Return a size_t value. 2nd arg is now size_t.
17157 Many local variables are now size_t instead of int or unsigned.
17158 Improve overflow protection. Support `l' modifier for integer
17159 conversions. Support %l conversion. Don't assume an EMACS_INT
17160 argument for integer conversions and for %c.
17161
17162 * lisp.h (doprnt): Restore prototype.
17163
17164 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17165 $(SRC)/character.h.
17166
17167 * Makefile.in (base_obj): Add back doprnt.o.
17168
17169 * deps.mk (doprnt.o): Add back prerequisites.
17170 (callint.o): Depend on character.h.
17171
17172 * eval.c (internal_lisp_condition_case): Include the handler
17173 representation in the error message.
17174 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17175 when breaking from the loop.
17176
17177 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17178
17179 * callint.c (Fcall_interactively): When displaying error message
17180 about invalid control letter, pass the character's codepoint, not
17181 a pointer to its multibyte form. Improve display of the character
17182 in octal and display also its hex code.
17183
17184 * character.c (char_string): Use %x to display the (unsigned)
17185 codepoint of an invalid character, to avoid displaying a bogus
17186 negative value.
17187
17188 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17189 `error', not SYMBOL_NAME itself.
17190
17191 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17192 character arguments to `error'.
17193
17194 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17195 to `error' in error message about FINAL_CHAR argument. Make sure
17196 FINAL_CHAR is a character, and use %c when it is passed as
17197 argument to `error'.
17198
17199 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17200
17201 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17202
17203 * w32.c: Include <time.h>.
17204 (sys_localtime): New function.
17205
17206 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17207
17208 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17209
17210 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17211
17212 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17213
17214 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17215 zombies (Bug#8467).
17216
17217 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17218
17219 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17220 gl_state.e_property when gl_state.object is Qt.
17221
17222 * insdel.c (make_gap_larger): Remove limitation of buffer size
17223 to <= INT_MAX.
17224
17225 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17226
17227 * xdisp.c (lookup_glyphless_char_display)
17228 (produce_glyphless_glyph): Handle cons cell entry in
17229 glyphless-char-display.
17230 (Vglyphless_char_display): Document it.
17231
17232 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17233 glyphless-char-display.
17234
17235 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17236
17237 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17238
17239 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17240
17241 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17242 definition for no-X builds.
17243
17244 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17245
17246 Static checks with GCC 4.6.0 and non-default toolkits.
17247
17248 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17249
17250 * process.c (keyboard_bit_set): Define only if SIGIO.
17251 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17252 (send_process): Repair possible setjmp clobbering.
17253
17254 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17255
17256 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17257
17258 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17259
17260 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17261 Define only if needed.
17262
17263 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17264 by pacifying GCC about it. Maybe it's time to retire it?
17265 * xfaces.c (USG, __TIMEVAL__): Likewise.
17266
17267 * dispextern.h (struct redisplay_interface): Rename param
17268 to avoid shadowing.
17269 * termhooks.h (struct terminal): Likewise.
17270 * xterm.c (xembed_send_message): Likewise.
17271
17272 * insdel.c (make_gap_smaller): Define only if
17273 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17274
17275 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17276 it.
17277
17278 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17279 so that we aren't warned about unused symbols.
17280
17281 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17282
17283 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17284
17285 * xfns.c (x_real_positions): Mark locals as initialized.
17286
17287 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17288
17289 * xterm.c: Fix problems found by static analysis with other toolkits.
17290 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17291 (x_dispatch_event): Declare static if USE_GTK, and
17292 define if USE_GTK || USE_X_TOOLKIT.
17293 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17294 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17295 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17296 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17297
17298 * xmenu.c (menu_help_callback): Pointer type fixes.
17299 Use const pointers when pointing at readonly data. Avoid pointer
17300 signedness clashes.
17301 (FALSE): Remove unused macro.
17302 (update_frame_menubar): Remove unused decl.
17303
17304 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17305
17306 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17307 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17308 (single_menu_item): Rename local to avoid shadowing.
17309
17310 * keyboard.c (make_lispy_event): Remove unused local var.
17311
17312 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17313 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17314
17315 * bitmaps: Change bitmaps from unsigned char back to the X11
17316 compatible char. Avoid the old compiler warnings about
17317 out-of-range initializers by using, for example, '\xab' rather
17318 than 0xab.
17319
17320 * xgselect.c (xgselect_initialize): Check vs interface
17321 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17322
17323 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17324
17325 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17326 to read-only memory.
17327
17328 * fns.c (vector): Remove; this old hack is no longer needed.
17329
17330 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17331 Remove unused var.
17332 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17333
17334 * xrdb.c (x_load_resources): Omit unused local.
17335
17336 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17337 (x_window): Rename locals to avoid shadowing.
17338 (USG): Use the kludged USG macro, to pacify gcc.
17339
17340 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17341 (x_term_init): Remove local to avoid shadowing.
17342
17343 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17344
17345 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17346 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17347
17348 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17349
17350 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17351
17352 Fix regex.c, syntax.c and friends for buffers > 2GB.
17353 * syntax.h (struct gl_state_s): Declare character position members
17354 EMACS_INT.
17355
17356 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17357
17358 * textprop.c (verify_interval_modification, interval_of):
17359 Declare arguments EMACS_INT.
17360
17361 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17362 EMACS_INT.
17363
17364 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17365
17366 * indent.c (Fvertical_motion): Local variable it_start is now
17367 EMACS_INT.
17368
17369 * regex.c (re_match, re_match_2, re_match_2_internal)
17370 (bcmp_translate, regcomp, regexec, print_double_string)
17371 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17372 (re_compile_pattern, re_exec): Declare arguments and local
17373 variables `size_t' and `ssize_t' and return values `regoff_t', as
17374 appropriate.
17375 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17376 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17377 <compile_stack_type>: `size' and `avail' are now `size_t'.
17378
17379 * regex.h <regoff_t>: Use ssize_t, not int.
17380 (re_search, re_search_2, re_match, re_match_2): Arguments that
17381 specify buffer/string position and length are now ssize_t and
17382 size_t. Return type is regoff_t.
17383
17384 2011-04-16 Ben Key <bkey76@gmail.com>
17385
17386 * nsfont.m: Fixed bugs in ns_get_family and
17387 ns_descriptor_to_entity that were caused by using free to
17388 deallocate memory blocks that were allocated by xmalloc (via
17389 xstrdup). This caused Emacs to crash when compiled with
17390 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17391 --enable-checking=xmallocoverrun). xfree is now used to
17392 deallocate these memory blocks.
17393
17394 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17395
17396 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17397
17398 emacs_write: Accept and return EMACS_INT for sizes.
17399 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17400 et seq.
17401 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17402 Accept and return EMACS_INT.
17403 (emacs_gnutls_write): Return the number of bytes written on
17404 partial writes.
17405 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17406 (emacs_read, emacs_write): Remove check for negative size, as the
17407 Emacs source code has been audited now.
17408 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17409 (emacs_read, emacs_write): Use it.
17410 * process.c (send_process): Adjust to the new signatures of
17411 emacs_write and emacs_gnutls_write. Do not attempt to store
17412 a byte offset into an 'int'; it might overflow.
17413 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17414
17415 * sound.c: Don't assume sizes fit in 'int'.
17416 (struct sound_device.period_size, alsa_period_size):
17417 Return EMACS_INT, not int.
17418 (struct sound_device.write, vox_write, alsa_write):
17419 Accept EMACS_INT, not int.
17420 (wav_play, au_play): Use EMACS_INT to store sizes and to
17421 record read return values.
17422
17423 2011-04-15 Ben Key <bkey76@gmail.com>
17424
17425 * keyboard.c (Qundefined): Don't declare static since it is used
17426 in nsfns.m.
17427 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17428 static since they are used in nsfont.m.
17429
17430 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17431
17432 * process.c (Qprocessp): Don't declare static.
17433 * lisp.h (Qprocessp): Declare again.
17434
17435 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17436
17437 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17438
17439 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17440
17441 Improve C-level modularity by making more things 'static'.
17442
17443 Don't publish debugger-only interfaces to other modules.
17444 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17445 (verify_bytepos, count_markers): Move decls to the only modules
17446 that need them.
17447 * region-cache.h (pp_cache): Likewise.
17448 * window.h (check_all_windows): Likewise.
17449 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17450
17451 * sysdep.c (croak): Now static, if
17452 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17453 * syssignal.h (croak): Declare only if not static.
17454
17455 * alloc.c (refill_memory_reserve): Now static if
17456 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17457 * lisp.h (refill_memory_reserve): Declare only if not static.
17458
17459 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17460 Define only if USE_LUCID.
17461
17462 * xrdb.c (x_customization_string, x_rm_string): Now static.
17463
17464 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17465 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17466
17467 * xdisp.c (draw_row_with_mouse_face): Now static.
17468 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17469
17470 * window.h (check_all_windows): Mark externally visible.
17471
17472 * window.c (window_deletion_count): Now static.
17473
17474 * undo.c: Make symbols static if they're not exported.
17475 (last_undo_buffer, last_boundary_position, pending_boundary):
17476 Now static.
17477
17478 * textprop.c (interval_insert_behind_hooks): Now static.
17479 (interval_insert_in_front_hooks): Likewise.
17480
17481 * term.c: Make symbols static if they're not exported.
17482 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17483 (max_frame_lines, tty_set_terminal_modes):
17484 (tty_reset_terminal_modes, tty_turn_off_highlight):
17485 (get_tty_terminal): Now static.
17486 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17487 * termhooks.h (term_mouse_moveto): Do not declare if
17488 HAVE_WINDOW_SYSTEM.
17489 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17490 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17491
17492 * sysdep.c: Make symbols static if they're not exported.
17493 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17494 Now static.
17495 (sigprocmask_set, full_mask): Remove; unused.
17496 (wait_debugging): Mark as visible.
17497 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17498 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17499
17500 * syntax.c (syntax_temp): Define only if !__GNUC__.
17501
17502 * sound.c (current_sound_device, current_sound): Now static.
17503
17504 * search.c (searchbufs, searchbuf_head): Now static.
17505
17506 * scroll.c (scroll_cost): Remove; unused.
17507 * dispextern.h (scroll_cost): Remove decl.
17508
17509 * region-cache.h (pp_cache): Mark as externally visible.
17510
17511 * process.c: Make symbols static if they're not exported.
17512 (process_tick, update_tick, create_process, chan_process):
17513 (Vprocess_alist, proc_buffered_char, datagram_access):
17514 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17515 (deactivate_process): Mark defn as static, as well as decl.
17516 * lisp.h (create_process): Remove decl.
17517 * process.h (chan_process, Vprocess_alist): Remove decls.
17518
17519 * print.c: Make symbols static if they're not exported.
17520 (print_depth, new_backquote_output, being_printed, print_buffer):
17521 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17522 (print_interval, print_number_index, initial_stderr_stream):
17523 Now static.
17524 * lisp.h (Fprinc): Remove decl.
17525 (debug_output_compilation_hack): Mark as externally visible.
17526
17527 * sysdep.c (croak): Move decl from here to syssignal.h.
17528 * syssignal.h (croak): Put it here, so the API can be checked when
17529 'croak' is called from dissociate_if_controlling_tty.
17530
17531 * minibuf.c: Make symbols static if they're not exported.
17532 (minibuf_save_list, choose_minibuf_frame): Now static.
17533 * lisp.h (choose_minibuf_frame): Remove decl.
17534
17535 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17536
17537 * lread.c: Make symbols static if they're not exported.
17538 (read_objects, initial_obarray, oblookup_last_bucket_number):
17539 Now static.
17540 (make_symbol): Remove; unused.
17541 * lisp.h (initial_obarray, make_symbol): Remove decls.
17542
17543 * keyboard.c: Make symbols static if they're not exported.
17544 (single_kboard, recent_keys_index, total_keys, recent_keys):
17545 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17546 (this_single_command_key_start, echoing, last_auto_save):
17547 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17548 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17549 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17550 (Vlispy_mouse_stem, double_click_count):
17551 Now static.
17552 (force_auto_save_soon): Define only if SIGDANGER.
17553 (ignore_mouse_drag_p): Now static if
17554 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17555 (print_help): Remove; unused.
17556 (stop_character, last_timer_event): Mark as externally visible.
17557 * keyboard.h (ignore_mouse_drag_p): Declare only if
17558 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17559 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17560 * lisp.h (echoing): Remove decl.
17561 (force_auto_save_soon): Declare only if SIGDANGER.
17562 * xdisp.c (redisplay_window): Simplify code, to make it more
17563 obvious that ignore_mouse_drag_p is not accessed if !defined
17564 USE_GTK && !defined HAVE_NS.
17565
17566 * intervals.c: Make symbols static if they're not exported.
17567 (merge_properties_sticky, merge_interval_right, delete_interval):
17568 Now static.
17569 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17570
17571 * insdel.c: Make symbols static if they're not exported.
17572 However, leave prepare_to_modify_buffer alone. It's never
17573 called from outside this function, but that appears to be a bug.
17574 (combine_after_change_list, combine_after_change_buffer):
17575 (adjust_after_replace, signal_before_change): Now static.
17576 (adjust_after_replace_noundo): Remove; unused.
17577 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17578 (signal_before_change): Remove decls.
17579
17580 * indent.c (val_compute_motion, val_vmotion): Now static.
17581
17582 * image.c: Make symbols static if they're not exported.
17583 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17584 if USE_GTK.
17585 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17586 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17587
17588 * fringe.c (standard_bitmaps): Now static.
17589 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17590
17591 * frame.c: Make symbols static if they're not exported.
17592 (x_report_frame_params, make_terminal_frame): Now static.
17593 (get_frame_param): Now static, unless HAVE_NS.
17594 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17595 (x_get_resource_string): Remove; not used.
17596 * frame.h (make_terminal_frame, x_report_frame_params):
17597 (x_get_resource_string); Remove decls.
17598 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17599 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17600
17601 * font.c, fontset.c: Make symbols static if they're not exported.
17602 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17603 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17604 * font.c (font_close_object): Now static.
17605 * font.h (font_close_object): Remove.
17606 * fontset.c (FONTSET_OBJLIST): Remove.
17607 (free_realized_fontset) #if-0 the body, which does nothing.
17608 (face_suitable_for_char_p): #if-0, as it's never called.
17609 * fontset.h (face_suitable_for_char_p): Remove decl.
17610 * xfaces.c (face_at_string_position):
17611 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17612 since 0 is always ASCII.
17613
17614 * fns.c (weak_hash_tables): Now static.
17615
17616 * fileio.c: Make symbols static if they're not exported.
17617 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17618 (Vwrite_region_annotation_buffers): Now static.
17619
17620 * eval.c: Make symbols static if they're not exported.
17621 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17622 * lisp.h (backtrace_list): Remove decl.
17623
17624 * emacs.c: Make symbols static if they're not exported.
17625 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17626 (fatal_error_code, fatal_error_signal_hook, standard_args):
17627 Now static.
17628 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17629 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17630 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17631 * lisp.h (fatal_error_signal_hook): Remove decl.
17632 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17633
17634 * editfns.c: Move a (normally-unused) function to its only use.
17635 * editfns.c, lisp.h (get_operating_system_release): Remove.
17636 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17637 worth the hassle of breaking this out.
17638
17639 * xterm.c: Make symbols static if they're not exported.
17640 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17641 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17642 (x_destroy_window, x_delete_display):
17643 Now static.
17644 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17645 (x_mouse_leave): Remove; unused.
17646 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17647 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17648 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17649 Remove decls.
17650 (x_mouse_leave): Declare only if WINDOWSNT.
17651 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17652 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17653 USE_X_TOOLKIT.
17654
17655 * ftxfont.c: Make symbols static if they're not exported.
17656 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17657 HAVE_FREETYPE.
17658 * font.h (ftxfont_driver): Likewise.
17659
17660 * xfns.c: Make symbols static if they're not exported.
17661 (x_last_font_name, x_display_info_for_name):
17662 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17663 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17664 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17665 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17666 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17667 (last_show_tip_args): Now static.
17668 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17669 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17670 (x_screen_planes): Remove; unused.
17671 * dispextern.h (x_screen_planes): Remove decl.
17672
17673 * dispnew.c: Make symbols static if they're not exported.
17674 * dispextern.h (redraw_garbaged_frames, scrolling):
17675 (increment_row_positions): Remove.
17676 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17677 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17678 Now static.
17679 (redraw_garbaged_frames): Remove; unused.
17680
17681 * xfaces.c: Make symbols static if they're not exported.
17682 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17683 Remove decls.
17684 * xterm.h (defined_color): Remove decls.
17685 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17686 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17687 (menu_face_changed_default, defined_color, free_realized_face):
17688 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17689 (ascii_face_of_lisp_face): Remove; unused.
17690
17691 * xdisp.c: Make symbols static if they're not exported.
17692 * dispextern.h (scratch_glyph_row, window_box_edges):
17693 (glyph_to_pixel_coords, set_cursor_from_row):
17694 (get_next_display_element, set_iterator_to_next):
17695 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17696 (show_mouse_face): Remove decls
17697 * frame.h (message_buf_print): Likewise.
17698 * lisp.h (pop_message, set_message, check_point_in_composition):
17699 Likewise.
17700 * xterm.h (set_vertical_scroll_bar): Likewise.
17701 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17702 (message_buf_print, scratch_glyph_row, displayed_buffer):
17703 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17704 (get_next_display_element, show_mouse_face, window_box_edges):
17705 (frame_to_window_pixel_xy, check_point_in_composition):
17706 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17707 (glyph_to_pixel_coords): Remove; unused.
17708
17709 * dired.c (file_name_completion): Now static.
17710
17711 * dbusbind.c (xd_in_read_queued_messages): Now static.
17712
17713 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17714 * data.c (circular_list_error): Remove.
17715
17716 * commands.h (last_point_position, last_point_position_buffer):
17717 (last_point_position_window): Remove decls.
17718 * keyboard.c: Make these variables static.
17719
17720 * coding.h (coding, code_convert_region, encode_coding_gap):
17721 Remove decls.
17722 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17723 (iso_code_class, detect_coding, code_convert_region): Now static.
17724 (encode_coding_gap): Remove; unused.
17725
17726 * chartab.c (chartab_chars, chartab_bits): Now static.
17727
17728 * charset.h (charset_iso_8859_1): Remove decl.
17729 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17730 Now static.
17731
17732 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17733 * ccl.c (Vccl_program_table): Now static.
17734 (check_ccl_update): Remove; unused.
17735
17736 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17737 * category.h: ... from here.
17738 * category.c (check_category_table, set_category_set): Now static.
17739
17740 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17741 * lisp.h: Remove these decls.
17742
17743 * buffer.c (buffer_count): Remove unused var.
17744
17745 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17746 so that it's not optimized away.
17747 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17748 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17749 exported only to the debugger.
17750
17751 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17752 * atimer.h (run_all_atimers): Remove; not exported.
17753
17754 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17755 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17756 was inaccessible from Lisp.
17757 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17758 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17759
17760 alloc.c: Import and export fewer symbols, and remove unused items.
17761 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17762 is defined.
17763 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17764 it's not optimized away by whole-program optimization.
17765 (message_enable_multibyte, free_misc): Remove.
17766 (catchlist, handlerlist, mark_backtrace):
17767 Declare only if BYTE_MARK_STACK.
17768 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17769 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17770 (message_enable_multibyte): Remove decl.
17771 (free_misc, interval_free_list, float_block, float_block_index):
17772 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17773 (cons_free_list, last_marked_index):
17774 Now static.
17775 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17776 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17777 (mark_backtrace): Define only if BYTE_MARK_STACK.
17778 * xdisp.c (message_enable_multibyte): Now static.
17779
17780 Declare Lisp_Object Q* variables to be 'static' if not exported.
17781 This makes it easier for human readers (and static analyzers)
17782 to see whether these variables are used from other modules.
17783 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17784 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17785 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17786 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17787 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17788 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17789 * xmenu.c, xselect.c:
17790 Declare Q* vars static if they are not used in other modules.
17791 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17792 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17793 Remove decls of unexported vars.
17794 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17795
17796 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17797
17798 Make Emacs functions such as Fatom 'static' by default.
17799 This makes it easier for human readers (and static analyzers)
17800 to see whether these functions can be called from other modules.
17801 DEFUN now defines a static function. To make the function external
17802 so that it can be used in other C modules, use the new macro DEFUE.
17803 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17804 (Finit_image_library):
17805 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17806 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17807 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17808 Remove decls, since these functions are now static.
17809 (Funintern, Fget_internal_run_time): New decls, since these functions
17810 were already external.
17811
17812 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17813 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17814 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17815 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17816 * keyboard.c, keymap.c, lread.c:
17817 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17818 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17819 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17820 Mark functions with DEFUE instead of DEFUN,
17821 if they are used in other modules.
17822 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17823 decls for now-static functions.
17824 * buffer.h (Fdelete_overlay): Remove decl.
17825 * callproc.c (Fgetenv_internal): Mark as internal.
17826 * composite.c (Fremove_list_of_text_properties): Remove decl.
17827 (Fcomposition_get_gstring): New forward static decl.
17828 * composite.h (Fcomposite_get_gstring): Remove decl.
17829 * dired.c (Ffile_attributes): New forward static decl.
17830 * doc.c (Fdocumntation_property): New forward static decl.
17831 * eval.c (Ffetch_bytecode): New forward static decl.
17832 (Funintern): Remove extern decl; now in .h file where it belongs.
17833 * fileio.c (Fmake_symbolic_link): New forward static decl.
17834 * image.c (Finit_image_library): New forward static decl.
17835 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17836 * intervals.h (Fprevious_property_change):
17837 (Fremove_list_of_text_properties): Remove decls.
17838 * keyboard.c (Fthis_command_keys): Remove decl.
17839 (Fcommand_execute): New forward static decl.
17840 * keymap.c (Flookup_key): New forward static decl.
17841 (Fcopy_keymap): Now static.
17842 * keymap.h (Flookup_key): Remove decl.
17843 * process.c (Fget_process): New forward static decl.
17844 (Fprocess_datagram_address): Mark as internal.
17845 * syntax.c (Fsyntax_table_p): New forward static decl.
17846 (skip_chars): Remove duplicate decl.
17847 * textprop.c (Fprevious_property_change): New forward static decl.
17848 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17849 Now internal.
17850 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17851 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17852
17853 * editfns.c (Fformat): Remove unreachable code.
17854
17855 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17856
17857 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17858 change. (Bug#8496)
17859
17860 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17861
17862 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17863 when at ZV. (Bug#8487)
17864
17865 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17866
17867 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17868 (Bug#8437)
17869 * keyboard.c (parse_tool_bar_item): Likewise.
17870 * sound.c (sound_cleanup, alsa_close): Likewise.
17871 * termcap.c (tgetent): Likewise.
17872 * xfns.c (x_default_font_parameter): Likewise.
17873 * xsettings.c (read_and_apply_settings): Likewise.
17874
17875 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17876 (overrun_check_free): Protoize.
17877
17878 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17879
17880 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17881 since callers should never pass a negative size.
17882 Change the signature to match that of plain 'read' and 'write'; see
17883 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17884 * lisp.h: Update prototypes of emacs_write and emacs_read.
17885
17886 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17887
17888 * xdisp.c (redisplay_window): Don't try to determine the character
17889 position of the scroll margin if the window start point w->startp
17890 is outside the buffer's accessible region. (Bug#8468)
17891
17892 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17893
17894 Fix write-region and its subroutines for buffers > 2GB.
17895 * fileio.c (a_write, e_write): Modify declaration of arguments and
17896 local variables to support buffers larger than 2GB.
17897 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17898
17899 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17900 argument, local variables, and return value.
17901
17902 * lisp.h: Update prototypes of emacs_write and emacs_read.
17903
17904 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17905
17906 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17907
17908 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17909
17910 Fix more problems found by GCC 4.6.0's static checks.
17911
17912 * xdisp.c (vmessage): Use a better test for character truncation.
17913
17914 * charset.c (load_charset_map): <, not <=, for optimization,
17915 and to avoid potential problems with integer overflow.
17916 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17917 * casetab.c (set_identity, shuffle): Likewise.
17918 * editfns.c (Fformat): Likewise.
17919 * syntax.c (skip_chars): Likewise.
17920
17921 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17922 This also lets GCC 4.6.0 generate slightly better loop code.
17923
17924 * callint.c (Fcall_interactively): <, not <=, for optimization.
17925 (Fcall_interactively): Count the number of arguments produced,
17926 not the number of arguments given. This is simpler and lets GCC
17927 4.6.0 generate slightly better code.
17928
17929 * ftfont.c: Distingish more carefully between FcChar8 and char.
17930 The previous code passed unsigned char * to a functions like
17931 strlen and xstrcasecmp that expect char *, which does not
17932 conform to the C standard.
17933 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17934 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17935 char * when the C standard requires it.
17936
17937 * keyboard.c (read_char): Remove unused var.
17938
17939 * eval.c: Port to Windows vsnprintf (Bug#8435).
17940 Include <limits.h>.
17941 (SIZE_MAX): Define if the headers do not.
17942 (verror): Do not give up if vsnprintf returns a negative count.
17943 Instead, grow the buffer. This ports to Windows vsnprintf, which
17944 does not conform to C99. Problem reported by Eli Zaretskii.
17945 Also, simplify the allocation scheme, by avoiding the need for
17946 calling realloc, and removing the ALLOCATED variable.
17947
17948 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17949
17950 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17951 But keep the doprint source code for now, as we might revamp it
17952 and use it again (Bug#8435).
17953 * lisp.h (doprnt): Remove.
17954 * Makefile.in (base_obj): Remove doprnt.o.
17955 * deps.mk (doprnt.o): Remove.
17956
17957 error: Print 32- and 64-bit integers portably (Bug#8435).
17958 Without this change, on typical 64-bit hosts error ("...%d...", N)
17959 was used to print both 32- and 64-bit integers N, which relied on
17960 undefined behavior.
17961 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17962 * lisp.h (error, verror): Mark as printf-like functions.
17963 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17964 Report overflow in size calculations when allocating printf buffer.
17965 Do not truncate output string at its first null byte.
17966 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17967 Truncate the output at a character boundary, since vsnprintf does not
17968 do that.
17969 * charset.c (check_iso_charset_parameter): Convert internal
17970 character to string before calling 'error', since %c now has the
17971 printf meaning.
17972 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17973 overflow when computing char to be passed to 'error'. Do not
17974 pass Lisp_Object to 'error'; pass the integer instead.
17975 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17976 formatted with plain %d.
17977
17978 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17979
17980 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17981
17982 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17983
17984 * xterm.c (x_catch_errors): Remove duplicate declaration.
17985
17986 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17987
17988 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17989
17990 2011-04-10 Jim Meyering <meyering@redhat.com>
17991
17992 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17993 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17994 return ssize_t not "int", and use size_t as the buffer length.
17995 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17996 * gnutls.h: Update declarations.
17997 * process.c (read_process_output): Use ssize_t, to match.
17998 (send_process): Likewise.
17999
18000 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18001
18002 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18003
18004 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
18005
18006 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18007 Use unsigned char, to match FcChar8 type definition.
18008
18009 * xterm.c (handle_one_xevent):
18010 * xmenu.c (create_and_show_popup_menu):
18011 * xselect.c (x_decline_selection_request)
18012 (x_reply_selection_request): Avoid type-punned deref of X events.
18013
18014 2011-04-09 Eli Zaretskii <eliz@gnu.org>
18015
18016 Fix some uses of `int' instead of EMACS_INT.
18017 * search.c (string_match_1, fast_string_match)
18018 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18019 (scan_buffer, find_next_newline_no_quit)
18020 (find_before_next_newline, search_command, Freplace_match)
18021 (Fmatch_data): Make some `int' variables be EMACS_INT.
18022
18023 * xdisp.c (display_count_lines): 3rd argument and return value now
18024 EMACS_INT. All callers changed.
18025 (pint2hrstr): Last argument is now EMACS_INT.
18026
18027 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18028 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18029 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18030 (decode_coding_utf_16, decode_coding_emacs_mule)
18031 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18032 (decode_coding_ccl, decode_coding_charset)
18033 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18034 (decode_coding_iso_2022, decode_coding_emacs_mule)
18035 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18036 <char_offset, last_offset>: Declare EMACS_INT.
18037 (encode_coding_utf_8, encode_coding_utf_16)
18038 (encode_coding_emacs_mule, encode_invocation_designation)
18039 (encode_designation_at_bol, encode_coding_iso_2022)
18040 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18041 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18042 Declare EMACS_INT.
18043 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18044 (encode_invocation_designation): Last argument P_NCHARS is now
18045 EMACS_INT.
18046 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18047 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18048
18049 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18050 All users changed.
18051
18052 * ccl.c (Fccl_execute_on_string): Declare some variables
18053 EMACS_INT.
18054
18055 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18056
18057 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18058
18059 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18060
18061 * process.c (Fformat_network_address): Doc fix.
18062
18063 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18064
18065 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18066
18067 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18068
18069 * keyboard.c (read_char): Call Lisp function help-form-show,
18070 instead of using internal_with_output_to_temp_buffer.
18071 (Qhelp_form_show): New var.
18072 (syms_of_keyboard): Use DEFSYM macro.
18073
18074 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18075
18076 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18077
18078 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18079
18080 * process.c (Flist_processes): Remove to Lisp.
18081 (list_processes_1): Delete.
18082
18083 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18084
18085 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18086
18087 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18088
18089 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18090
18091 Fix more problems found by GCC 4.6.0's static checks.
18092
18093 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18094
18095 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18096
18097 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18098
18099 * xdisp.c (vmessage): Mark as a printf-like function.
18100
18101 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18102
18103 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18104
18105 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18106 printf-like functions.
18107 (tiff_load): Add casts to remove these marks before passing them
18108 to system-supplied API.
18109
18110 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18111
18112 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18113 This avoids several warnings with gcc -Wstrict-overflow.
18114 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18115 directly, rather than having caller test rule sign. This avoids
18116 some unnecessary tests.
18117 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18118 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18119 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18120
18121 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18122 (xfont_open): Avoid unnecessary tests.
18123
18124 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18125
18126 * composite.h, composite.c (composition_gstring_put_cache):
18127 Use EMACS_INT, not int, for length.
18128
18129 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18130 breaking out part of COMPOSITION_DECODE_RULE.
18131 (COMPOSITION_DECODE_RULE): Use it.
18132 * composite.c (get_composition_id): Remove unused local vars,
18133 by using the new macro.
18134
18135 * textprop.c (set_text_properties_1): Change while to do-while,
18136 since the condition is always true at first.
18137
18138 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18139 (interval_deletion_adjustment): Return unsigned value.
18140 All uses changed.
18141
18142 * process.c (list_processes_1, create_pty, read_process_output):
18143 (exec_sentinel): Remove vars that were set but not used.
18144 (create_pty): Remove unnecessary "volatile"s.
18145 (Fnetwork_interface_info): Avoid possibility of int overflow.
18146 (read_process_output): Do adaptive read buffering even if carryover.
18147 (read_process_output): Simplify nbytes computation if buffered.
18148
18149 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18150
18151 * syntax.c (scan_words): Remove var that was set but not used.
18152 (update_syntax_table): Use unsigned instead of int.
18153
18154 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18155 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18156 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18157
18158 * print.c (print_error_message): Avoid int overflow.
18159
18160 * font.c (font_list_entities): Redo for clarity,
18161 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18162
18163 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18164 (font_score): Avoid potential overflow in diff calculation.
18165
18166 * fns.c (substring_both): Remove var that is set but not used.
18167 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18168
18169 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18170
18171 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18172 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18173 can always succeed if overflow has undefined behavior.
18174
18175 * search.c (boyer_moore, wordify): Remove vars set but not used.
18176 (wordify): Omit three unnecessary tests.
18177
18178 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18179 All callers changed. This avoids the need for an unused var.
18180
18181 * casefiddle.c (casify_region): Remove var that is set but not used.
18182
18183 * dired.c (file_name_completion): Remove var that is set but not used.
18184
18185 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18186
18187 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18188 (Finsert_file_contents): Remove unnecessary code checking fd.
18189
18190 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18191 Check for integer overflow on size calculations.
18192
18193 * buffer.c (Fprevious_overlay_change): Remove var that is set
18194 but not used.
18195
18196 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18197 Remove vars that are set but not used.
18198 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18199 (timer_check_2): Mark vars as initialized.
18200
18201 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18202
18203 * image.c (lookup_image): Remove var that is set but not used.
18204 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18205
18206 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18207 that are set but not used.
18208
18209 * xfns.c (make_invisible_cursor): Don't return garbage
18210 if XCreateBitmapFromData fails (Bug#8410).
18211
18212 * xselect.c (x_get_local_selection, x_handle_property_notify):
18213 Remove vars that are set but not used.
18214
18215 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18216 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18217
18218 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18219 Remove var that is set but not used.
18220 (scroll_bar_windows_size): Now size_t, not int.
18221 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18222 Check for overflow.
18223
18224 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18225 (map_tty_color) [!defined MSDOS]: Likewise.
18226
18227 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18228
18229 * coding.c: Remove vars that are set but not used.
18230 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18231 All callers changed.
18232 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18233 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18234 (decode_coding_charset): Remove vars that are set but not used.
18235
18236 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18237 that is set but not used.
18238
18239 * print.c (print_object): Remove var that is set but not used.
18240
18241 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18242 The gnulib version avoids calling malloc in the usual case,
18243 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18244 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18245 * filelock.c (current_lock_owner): Likewise.
18246 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18247 * sysdep.c: Include allocator.h, careadlinkat.h.
18248 (emacs_no_realloc_allocator): New static constant.
18249 (emacs_readlink): New function.
18250 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18251 ../lib/careadlinkat.h.
18252
18253 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18254
18255 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18256 first non-nil return value).
18257
18258 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18259
18260 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18261 if not defined (Bug#8403).
18262
18263 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18264
18265 * xdisp.c (display_count_lines): Remove parameter `start',
18266 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18267 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18268 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18269 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18270 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18271 and thereabouts. All callers changed.
18272 (get_per_char_metric): Remove parameter `f', unused since
18273 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18274
18275 2011-04-02 Jim Meyering <meyering@redhat.com>
18276
18277 do not dereference NULL upon failed strdup
18278 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18279 (ns_get_family): Likewise.
18280
18281 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18282
18283 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18284
18285 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18286
18287 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18288 later (Bug#8403).
18289
18290 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18291
18292 Add lexical binding.
18293
18294 * window.c (Ftemp_output_buffer_show): New fun.
18295 (Fsave_window_excursion):
18296 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18297
18298 * lread.c (lisp_file_lexically_bound_p): New function.
18299 (Fload): Bind Qlexical_binding.
18300 (readevalloop): Remove `evalfun' arg.
18301 Bind Qinternal_interpreter_environment.
18302 (Feval_buffer): Bind Qlexical_binding.
18303 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18304 Mark as dynamic.
18305 (syms_of_lread): Declare `lexical-binding'.
18306
18307 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18308
18309 * keyboard.c (eval_dyn): New fun.
18310 (menu_item_eval_property): Use it.
18311
18312 * image.c (parse_image_spec): Use Ffunctionp.
18313
18314 * fns.c (concat, mapcar1): Accept byte-code-functions.
18315
18316 * eval.c (Fsetq): Handle lexical vars.
18317 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18318 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18319 (FletX, Flet): Obey lexical binding.
18320 (Fcommandp): Handle closures.
18321 (Feval): New `lexical' arg.
18322 (eval_sub): New function extracted from Feval. Use it almost
18323 everywhere where Feval was used. Look up vars in lexical env.
18324 Handle closures.
18325 (Ffunctionp): Move from subr.el.
18326 (Ffuncall): Handle closures.
18327 (apply_lambda): Remove `eval_flags'.
18328 (funcall_lambda): Handle closures and new byte-code-functions.
18329 (Fspecial_variable_p): New function.
18330 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18331 but without exporting it to Lisp.
18332
18333 * doc.c (Fdocumentation, store_function_docstring):
18334 * data.c (Finteractive_form): Handle closures.
18335
18336 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18337 interactive spec.
18338
18339 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18340 New byte-codes.
18341 (exec_byte_code): New function extracted from Fbyte_code to handle new
18342 calling convention for byte-code-functions. Add new byte-codes.
18343
18344 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18345
18346 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18347
18348 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18349
18350 * xdisp.c (redisplay_internal): Fix prototype.
18351
18352 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18353
18354 * xdisp.c (SCROLL_LIMIT): New macro.
18355 (try_scrolling): Use it when setting scroll_limit.
18356 Limit scrolling to 100 screen lines.
18357 (redisplay_window): Even when falling back on "recentering",
18358 position point in the window according to scroll-conservatively,
18359 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18360
18361 (try_scrolling): When point is above the window, allow searching
18362 as far as scroll_max, or one screenful, to compute vertical
18363 distance from PT to the scroll margin position. This prevents
18364 try_scrolling from unnecessarily failing when
18365 scroll-conservatively is set to a value slightly larger than the
18366 window height. Clean up the case of PT below the margin at bottom
18367 of window: scroll_max can no longer be INT_MAX. When aggressive
18368 scrolling is in use, don't let point enter the opposite scroll
18369 margin as result of the scroll.
18370 (syms_of_xdisp) <scroll-conservatively>: Document the
18371 threshold of 100 lines for never-recentering scrolling.
18372
18373 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18374
18375 * dispextern.h (move_it_by_lines):
18376 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18377 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18378 (message_log_check_duplicate): Remove parameters `prev_bol' and
18379 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18380 (redisplay_internal): Remove parameter `preserve_echo_area',
18381 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18382
18383 * indent.c (Fvertical_motion):
18384 * window.c (window_scroll_pixel_based, Frecenter):
18385 Don't pass `need_y_p' to `move_it_by_lines'.
18386
18387 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18388
18389 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18390 steal a few bits to be more compact.
18391 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18392 Remove unneeded casts.
18393
18394 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18395
18396 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18397
18398 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18399 binding" message (bug#7967).
18400
18401 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18402
18403 Fix more problems found by GCC 4.6.0's static checks.
18404
18405 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18406 Remove unused local var.
18407
18408 * editfns.c (Fmessage_box): Remove unused local var.
18409
18410 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18411 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18412 Omit unused local vars.
18413 * window.c (shrink_windows): Omit unused local var.
18414 * menu.c (digest_single_submenu): Omit unused local var.
18415 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18416 Omit unused local var.
18417
18418 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18419 Don't assume string length fits in int.
18420 (keyremap_step, read_key_sequence): Use size_t for sizes.
18421 (read_key_sequence): Don't check last_real_key_start redundantly.
18422
18423 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18424 instead of alloca (Bug#8344).
18425
18426 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18427 (Fbacktrace_frame): Don't assume nframes fits in int.
18428
18429 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18430
18431 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18432 concerns.
18433
18434 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18435
18436 * cm.c (calccost): Turn while-do into do-while, for clarity.
18437
18438 * keyboard.c (syms_of_keyboard): Use the same style as later
18439 in this function when indexing through an array. This also
18440 works around GCC bug 48267.
18441
18442 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18443
18444 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18445
18446 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18447 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18448
18449 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18450 This avoids undefined behavior on integer overflow, and is a bit
18451 more convenient anyway since it is compared to a size_t variable.
18452
18453 Variadic C functions now count arguments with size_t, not int.
18454 This avoids an unnecessary limitation on 64-bit machines, which
18455 caused (substring ...) to crash on large vectors (Bug#8344).
18456 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18457 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18458 All variadic functions and their callers changed accordingly.
18459 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18460 * data.c (arith_driver, float_arith_driver): Likewise.
18461 * editfns.c (general_insert_function): Likewise.
18462 * eval.c (struct backtrace.nargs, interactive_p)
18463 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18464 (funcall_lambda, mark_backtrace): Likewise.
18465 * fns.c (concat): Likewise.
18466 * frame.c (x_set_frame_parameters): Likewise.
18467 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18468 0 if not found, not -1. All callers changed.
18469
18470 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18471 (stack_copy_size): Now size_t, not int.
18472 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18473
18474 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18475
18476 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18477 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18478 All callers changed.
18479
18480 * lisp.h (multibyte_char_to_unibyte):
18481 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18482 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18483 * character.h (CHAR_TO_BYTE8):
18484 * cmds.c (internal_self_insert):
18485 * editfns.c (general_insert_function):
18486 * keymap.c (push_key_description):
18487 * search.c (Freplace_match):
18488 * xdisp.c (message_dolog, set_message_1): All callers changed.
18489
18490 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18491
18492 * keyboard.c (safe_run_hook_funcall): New function.
18493 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18494 don't set the hook to nil, but remove the offending function instead.
18495 (Qcommand_hook_internal): Remove, unused.
18496 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18497 Vcommand_hook_internal.
18498
18499 * eval.c (enum run_hooks_condition): Remove.
18500 (funcall_nil, funcall_not): New functions.
18501 (run_hook_with_args): Call each function through a `funcall' argument.
18502 Remove `cond' argument, now redundant.
18503 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18504 (Frun_hook_with_args_until_failure): Adjust accordingly.
18505 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18506
18507 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18508
18509 * dispextern.h (string_buffer_position): Remove declaration.
18510
18511 * print.c (strout): Remove parameter `multibyte', unused since
18512 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18513
18514 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18515 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18516 All callers changed.
18517
18518 * w32.c (_wsa_errlist): Use braces for struct initializers.
18519
18520 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18521 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18522 All callers changed.
18523 (string_buffer_position): Likewise. Also, make static (it's never
18524 used outside xdisp.c).
18525 (cursor_row_p): Remove parameter `w', unused since
18526 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18527 (decode_mode_spec): Remove parameter `precision', introduced during
18528 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18529 All callers changed.
18530
18531 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18532
18533 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18534
18535 2011-03-27 Anders Lindgren <andlind@gmail.com>
18536
18537 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18538 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18539 (ns_update_auto_hide_menu_bar): New functions.
18540 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18541 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18542 ns_constrain_all_frames.
18543 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18544 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18545
18546 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18547
18548 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18549
18550 2011-03-27 Glenn Morris <rgm@gnu.org>
18551
18552 * syssignal.h: Replace RETSIGTYPE with void.
18553 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18554 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18555 Replace SIGTYPE with void everywhere.
18556 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18557 * s/template.h (SIGTYPE): Remove commented out definition.
18558
18559 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18560
18561 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18562 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18563
18564 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18565
18566 * w32.c (read_unc_volume): Use parameter `henum', instead of
18567 global variable `wget_enum_handle'.
18568
18569 * keymap.c (describe_vector): Remove parameters `indices' and
18570 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18571 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18572
18573 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18574
18575 * keyboard.c (timer_check): Remove parameter `do_it_now',
18576 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18577 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18578 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18579
18580 * keyboard.c (read_char):
18581 * w32menu.c (w32_menu_display_help):
18582 * xmenu.c (show_help_event, menu_help_callback):
18583 Adjust calls to `show_help_echo'.
18584
18585 * gtkutil.c (xg_maybe_add_timer):
18586 * keyboard.c (readable_events):
18587 * process.c (wait_reading_process_output):
18588 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18589
18590 * insdel.c (adjust_markers_gap_motion):
18591 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18592 (gap_left, gap_right): Don't call it.
18593
18594 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18595
18596 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18597 incurred during fontification.
18598
18599 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18600
18601 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18602 (DEFVAR_PER_BUFFER): Don't pass it.
18603
18604 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18605 (scrolling_window): Don't pass it.
18606
18607 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18608
18609 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18610
18611 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18612 and `suffix'.
18613 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18614 of variables specific to SELinux and computation of `encoded_absname'.
18615
18616 * image.c (XPutPixel): Remove unused variable `height'.
18617
18618 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18619
18620 * unexw32.c (get_section_info): Remove unused variable `section'.
18621
18622 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18623 (system_process_attributes): Remove unused variable `sess'.
18624 (sys_read): Remove unused variable `err'.
18625
18626 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18627 (w32_wnd_proc): Remove unused variable `isdead'.
18628 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18629 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18630 (x_create_tip_frame): Remove unused variable `tem'.
18631
18632 * w32inevt.c (w32_console_read_socket):
18633 Remove unused variable `no_events'.
18634
18635 * w32term.c (x_draw_composite_glyph_string_foreground):
18636 Remove unused variable `width'.
18637
18638 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18639
18640 * w32term.c (x_set_glyph_string_clipping):
18641 Don't pass uninitialized region to CombineRgn.
18642
18643 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18644
18645 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18646 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18647 (Fx_close_connection): Remove unused variable `i'.
18648
18649 * w32font.c (w32font_draw): Return number of glyphs.
18650 (w32font_open_internal): Remove unused variable `i'.
18651 (w32font_driver): Add missing initializer.
18652
18653 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18654 (fill_in_menu): Remove unused variable `items_added'.
18655
18656 * w32term.c (last_mouse_press_frame): Remove static global variable.
18657 (w32_clip_to_row): Remove unused variable `f'.
18658 (x_delete_terminal): Remove unused variable `i'.
18659
18660 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18661 (NOTHING): Remove unused static global variable.
18662 (uniscribe_check_otf): Remove unused variable `table'.
18663 (uniscribe_font_driver): Add missing initializers.
18664
18665 2011-03-23 Julien Danjou <julien@danjou.info>
18666
18667 * term.c (Fsuspend_tty, Fresume_tty):
18668 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18669 * window.c (temp_output_buffer_show):
18670 * insdel.c (signal_before_change):
18671 * frame.c (Fhandle_switch_frame):
18672 * fileio.c (Fdo_auto_save):
18673 * emacs.c (Fkill_emacs):
18674 * editfns.c (save_excursion_restore):
18675 * cmds.c (internal_self_insert):
18676 * callint.c (Fcall_interactively):
18677 * buffer.c (Fkill_all_local_variables):
18678 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18679 Use Frun_hooks.
18680 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18681 unconditionally since it does the check itself.
18682
18683 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18684
18685 Fix more problems found by GCC 4.5.2's static checks.
18686
18687 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18688 the first time through the loop, since we know p0 < p1 then.
18689 This also avoids a gcc -Wstrict-overflow warning.
18690
18691 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18692 leading to a memory leak, possible in functions like
18693 load_charset_map_from_file that can allocate an unbounded number
18694 of objects (Bug#8318).
18695
18696 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18697 that could (at least in theory) be that large.
18698
18699 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18700 This is less likely to overflow, and avoids undefined behavior if
18701 overflow does occur. All callers changed. Use strtoul to scan
18702 for the unsigned long integer.
18703 (pint2hrstr): Simplify and tune code slightly.
18704 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18705
18706 * scroll.c (do_scrolling): Work around GCC bug 48228.
18707 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18708
18709 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18710 This also avoids a warning with gcc -Wstrict-overflow.
18711 (validate_x_resource_name): Simplify count usage.
18712 This also avoids a warning with gcc -Wstrict-overflow.
18713
18714 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18715 fail (Bug#8306).
18716
18717 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18718
18719 * process.c (Fmake_network_process): Use socklen_t, not int,
18720 where POSIX says socklen_t is required in portable programs.
18721 This fixes a porting bug on hosts like 64-bit HP-UX, where
18722 socklen_t is wider than int (Bug#8277).
18723 (Fmake_network_process, server_accept_connection):
18724 (wait_reading_process_output, read_process_output):
18725 Likewise.
18726
18727 * process.c: Rename or move locals to avoid shadowing.
18728 (list_processes_1, Fmake_network_process):
18729 (read_process_output_error_handler, exec_sentinel_error_handler):
18730 Rename or move locals.
18731 (Fmake_network_process): Define label "retry_connect" only if needed.
18732 (Fnetwork_interface_info): Fix pointer signedness.
18733 (process_send_signal): Add cast to avoid pointer signedness problem.
18734 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18735 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18736
18737 Make tparam.h and terminfo.c consistent.
18738 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18739 Include tparam.h instead, since it declares them.
18740 * cm.h (PC): Remove extern decl; tparam.h now does this.
18741 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18742 * terminfo.c: Include tparam.h, to check interfaces.
18743 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18744 (tparam): Adjust signature to match interface in tparam.h;
18745 this removes some undefined behavior. Check that outstring and len
18746 are zero, which they always are with Emacs.
18747 * tparam.h (PC, BC, UP): New extern decls.
18748
18749 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18750 (xftfont_open): Rename locals to avoid shadowing.
18751
18752 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18753 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18754 (OTF_TAG_SYM): Omit macro if not needed.
18755 (ftfont_list): Remove unused local.
18756 (get_adstyle_property, ftfont_pattern_entity):
18757 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18758 Rename locals to avoid shadowing.
18759
18760 * xfont.c (xfont_list_family): Mark var as initialized.
18761
18762 * xml.c (make_dom): Now static.
18763
18764 * composite.c (composition_compute_stop_pos): Rename local to
18765 avoid shadowing.
18766 (composition_reseat_it): Remove unused locals.
18767 (find_automatic_composition, composition_adjust_point): Likewise.
18768 (composition_update_it): Mark var as initialized.
18769 (find_automatic_composition): Mark vars as initialized,
18770 with a FIXME (Bug#8290).
18771
18772 character.h: Rename locals to avoid shadowing.
18773 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18774 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18775 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18776 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18777 to avoid shadowing.
18778
18779 * textprop.c (property_change_between_p): Remove; unused.
18780
18781 * intervals.c (interval_start_pos): Now static.
18782
18783 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18784
18785 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18786 Rename locals to avoid shadowing.
18787
18788 * sound.c (wav_play, au_play, Fplay_sound_internal):
18789 Fix pointer signedness.
18790 (alsa_choose_format): Remove unused local var.
18791 (wav_play): Initialize a variable to 0, to prevent undefined
18792 behavior (Bug#8278).
18793
18794 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18795
18796 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18797
18798 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18799 clobbering (Bug#8298).
18800 * sysdep.c (sys_subshell): Likewise.
18801 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18802
18803 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18804 This should get cleaned up, so that child_setup has the
18805 same signature on all platforms.
18806
18807 * callproc.c (call_process_cleanup): Now static.
18808 (relocate_fd): Rename locals to avoid shadowing.
18809
18810 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18811
18812 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18813 not to be necessary, and produces flickering.
18814
18815 2011-03-20 Glenn Morris <rgm@gnu.org>
18816
18817 * config.in: Remove file.
18818
18819 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18820
18821 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18822 are now in src/globals.h.
18823 (syms_of_minibuf): Remove spurious & from previous change.
18824
18825 2011-03-20 Leo Liu <sdl.web@gmail.com>
18826
18827 * minibuf.c (completing-read-function): New variable.
18828 (completing-read-default): Rename from completing-read.
18829 (completing-read): Call completing-read-function.
18830
18831 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18832
18833 * xfaces.c (Fx_load_color_file):
18834 Read color file from absolute filename (bug#8250).
18835
18836 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18837
18838 * makefile.w32-in: Update dependencies.
18839
18840 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18841
18842 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18843
18844 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18845
18846 Fix more problems found by GCC 4.5.2's static checks.
18847
18848 * process.c (make_serial_process_unwind, send_process_trap):
18849 (sigchld_handler): Now static.
18850
18851 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18852 That way, the code declares only the vars that it needs.
18853 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18854 * s/cygwin.h (PTY_ITERATION): Likewise.
18855 * s/darwin.h (PTY_ITERATION): Likewise.
18856 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18857
18858 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18859 * process.c (allocate_pty): Don't declare stb unless it's needed.
18860
18861 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18862 (CONSTANTLIM): Remove; unused.
18863 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18864 Define only if needed.
18865
18866 * unexelf.c (unexec): Name an expression,
18867 to avoid gcc -Wbad-function-cast warning.
18868 Use a different way to cause a compilation error if anyone uses
18869 n rather than nn, a way that does not involve shadowing.
18870 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18871
18872 * deps.mk (unexalpha.o): Remove; unused.
18873
18874 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18875 * unexec.h: New file.
18876 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18877 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18878 Depend on unexec.h.
18879 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18880 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18881 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18882 Change as necessary to match prototype in unexec.h.
18883
18884 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18885 shadowing.
18886 (back_comment, skip_chars): Mark vars as initialized.
18887
18888 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18889 Rename locals to avoid shadowing.
18890
18891 * lread.c (read1): Rewrite so as not to use empty "else".
18892 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18893
18894 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18895
18896 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18897 warning when compiling print.c.
18898
18899 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18900 instead of using an uninitialized var.
18901 (font_sort_entities): Mark var as initialized.
18902
18903 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18904
18905 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18906 pointers to constants.
18907 (font_parse_fcname): Remove unused vars.
18908 (font_delete_unmatched): Now static.
18909 (font_get_spec): Remove; unused.
18910 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18911 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18912 Rename or move locals to avoid shadowing.
18913
18914 * fns.c (require_nesting_list, require_unwind): Now static.
18915 (Ffillarray): Rename locals to avoid shadowing.
18916
18917 * floatfns.c (domain_error2): Define only if needed.
18918 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18919
18920 * alloc.c (mark_backtrace): Move decl from here ...
18921 * lisp.h: ... to here, so that it can be checked.
18922
18923 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18924 (Fdefvar): Rewrite so as not to use empty "else".
18925 (lisp_indirect_variable): Name an expression,
18926 to avoid gcc -Wbad-function-cast warning.
18927 (Fdefvar): Rename locals to avoid shadowing.
18928
18929 * callint.c (quotify_arg, quotify_args): Now static.
18930 (Fcall_interactively): Rename locals to avoid shadowing.
18931 Use const pointer when appropriate.
18932
18933 * lisp.h (get_system_name, get_operating_system_release):
18934 Move decls here, to check interfaces.
18935 * process.c (get_operating_system_release): Move decl to lisp.h.
18936 * xrdb.c (get_system_name): Likewise.
18937 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18938 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18939 some of which prompt warnings from gcc -Wbad-function-cast.
18940 (Fformat_time_string, Fencode_time, Finsert_char):
18941 (Ftranslate_region_internal, Fformat):
18942 Rename or remove local vars to avoid shadowing.
18943 (Ftranslate_region_internal): Mark var as initialized.
18944
18945 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18946 avoid shadowing.
18947
18948 * lisp.h (eassert): Check that the argument compiles, even if
18949 ENABLE_CHECKING is not defined.
18950
18951 * data.c (Findirect_variable): Name an expression, to avoid
18952 gcc -Wbad-function-cast warning.
18953 (default_value, arithcompare, arith_driver, arith_error): Now static.
18954 (store_symval_forwarding): Rename local to avoid shadowing.
18955 (Fmake_variable_buffer_local, Fmake_local_variable):
18956 Mark variables as initialized.
18957 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18958
18959 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18960 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18961 Rename locals to avoid shadowing.
18962 (mark_stack): Move local variables into the #ifdef region where
18963 they're used.
18964 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18965 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18966 needed otherwise.
18967 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18968 (GC_STRING_CHARS): Remove; not used.
18969 (Fmemory_limit): Cast sbrk's returned value to char *.
18970
18971 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18972 avoids undefined behavior in theory.
18973
18974 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18975
18976 Use functions, not macros, for up- and down-casing (Bug#8254).
18977 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18978 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18979 to use the following functions instead of these macros.
18980 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18981 EMACS_INT, since callers assume the returned value fits in int.
18982 (upcase1): Likewise, for UPCASE_TABLE.
18983 (uppercasep, lowercasep, upcase): New static inline functions.
18984 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18985 the race-condition problem in the old DOWNCASE.
18986
18987 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18988 Rename locals to avoid shadowing.
18989 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18990 (regex_compile, re_search_2, re_match_2_internal):
18991 Remove unused local vars.
18992 (FREE_VAR): Rewrite so as not to use empty "else",
18993 which gcc can warn about.
18994 (regex_compile, re_match_2_internal): Mark locals as initialized.
18995 (RETALLOC_IF): Define only if needed.
18996 (WORDCHAR_P): Likewise. This one is never needed, but is used
18997 only in a comment talking about a compiler bug, so put inside
18998 the #if 0 of that comment.
18999 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19000 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19001 Remove; unused.
19002
19003 * search.c (boyer_moore): Rename locals to avoid shadowing.
19004 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19005 (PREV_CHAR_BOUNDARY): Likewise.
19006
19007 * search.c (simple_search): Remove unused var.
19008
19009 * dired.c (compile_pattern): Move decl from here ...
19010 * lisp.h: ... to here, so that it can be checked.
19011 (struct re_registers): New forward decl.
19012
19013 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19014
19015 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19016 All uses changed.
19017 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19018 Rename locals to avoid shadowing.
19019 (Fvertical_motion): Mark locals as initialized.
19020
19021 * casefiddle.c (casify_object, casify_region): Now static.
19022 (casify_region): Mark local as initialized.
19023
19024 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19025
19026 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19027 New macros, so that the caller can use some names other than
19028 gcpro1, gcpro2, etc.
19029 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19030 of the new macros.
19031 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19032 argument, for consistency with GCPRO2_VAR, etc: it is now the
19033 prefix of the variable, not the variable itself. All uses
19034 changed.
19035 * dired.c (directory_files_internal, file_name_completion):
19036 Rename locals to avoid shadowing.
19037
19038 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19039 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19040 dired.c's scmp function, had undefined behavior.
19041 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19042 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19043 * buffer.h: ... to here, because these macros use current_buffer,
19044 and the new implementation with inline functions needs to have
19045 current_buffer in scope now, rather than later when the macros
19046 are used.
19047 (downcase, upcase1): New static inline functions.
19048 (DOWNCASE, UPCASE1): Reimplement using these functions.
19049 This avoids undefined behavior in expressions like
19050 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19051 from race conditions in accessing the global variables
19052 case_temp1 and case_temp2.
19053 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19054 * lisp.h (case_temp1, case_temp2): Remove their decls.
19055 * character.h (ASCII_CHAR_P): Move from here ...
19056 * lisp.h: ... to here, so that the inline functions mentioned
19057 above can use them.
19058
19059 * dired.c (directory_files_internal_unwind): Now static.
19060
19061 * fileio.c (file_name_as_directory, directory_file_name):
19062 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19063 Now static.
19064 (file_name_as_directory): Use const pointers when appropriate.
19065 (Fexpand_file_name): Likewise. In particular, newdir might
19066 point at constant storage, so make it a const pointer.
19067 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19068 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19069 signedness issues.
19070 (Fset_file_times, Finsert_file_contents, auto_save_error):
19071 Rename locals to avoid shadowing.
19072
19073 * minibuf.c (choose_minibuf_frame_1): Now static.
19074 (Ftry_completion, Fall_completions): Rename or remove locals
19075 to avoid shadowing.
19076
19077 * marker.c (bytepos_to_charpos): Remove; unused.
19078
19079 * lisp.h (verify_bytepos, count_markers): New decls,
19080 so that gcc does not warn that these functions aren't declared.
19081
19082 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19083 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19084 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19085 (copy_text): Remove unused local var.
19086
19087 * filelock.c (within_one_second): Now static.
19088 (lock_file_1): Rename local to avoid shadowing.
19089
19090 * buffer.c (fix_overlays_before): Mark locals as initialized.
19091 (fix_start_end_in_overlays): Likewise. This function should be
19092 simplified by using pointers-to-pointers, but that's a different
19093 matter.
19094 (switch_to_buffer_1): Now static.
19095 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19096 (report_overlay_modification): Rename locals to avoid shadowing.
19097
19098 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19099 Fix pointer signedness issue.
19100 (sys_subshell): Mark local as volatile if checking for lint,
19101 to suppress a gcc -Wclobbered warning that does not seem to be right.
19102 (MAXPATHLEN): Define only if needed.
19103
19104 * process.c (serial_open, serial_configure): Move decls from here ...
19105 * systty.h: ... to here, so that they can be checked.
19106
19107 * fns.c (get_random, seed_random): Move extern decls from here ...
19108 * lisp.h: ... to here, so that they can be checked.
19109
19110 * sysdep.c (reset_io): Now static.
19111 (wait_for_termination_signal): Remove; unused.
19112
19113 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19114 (copy_keymap_item, append_key, push_text_char_description):
19115 Now static.
19116 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19117 (DENSE_TABLE_SIZE): Remove; unused.
19118 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19119 (describe_map_tree):
19120 Rename locals to avoid shadowing.
19121
19122 * keyboard.c: Declare functions static if they are not used elsewhere.
19123 (echo_char, echo_dash, cmd_error, top_level_2):
19124 (poll_for_input, handle_async_input): Now static.
19125 (read_char, kbd_buffer_get_event, make_lispy_position):
19126 (make_lispy_event, make_lispy_movement, apply_modifiers):
19127 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19128 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19129 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19130 (read_key_sequence, read_char): Mark locals as initialized.
19131 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19132
19133 * keyboard.h (make_ctrl_char): New decl.
19134 (mark_kboards): Move decl here ...
19135 * alloc.c (mark_kboards): ... from here.
19136
19137 * lisp.h (force_auto_save_soon): New decl.
19138
19139 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19140 (DEFINE_DUMMY_FUNCTION): New macro.
19141 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19142 Use it.
19143 (main): Add casts to avoid warnings
19144 if GCC considers string literals to be constants.
19145
19146 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19147
19148 * dbusbind.c: Pointer signedness fixes.
19149 (xd_signature, xd_append_arg, xd_initialize):
19150 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19151 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19152 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19153 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19154
19155 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19156 if GCC considers string literals to be constants.
19157 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19158
19159 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19160
19161 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19162 (print_preprocess, print_object): New macro to fix last change.
19163
19164 * print.c (print_preprocess): Don't forget font objects.
19165
19166 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19167
19168 * emacs.c (USAGE3): Doc fixes.
19169
19170 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19171
19172 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19173 structure.
19174
19175 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19176
19177 * lisp.h (VWindow_system, Qfile_name_history):
19178 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19179 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19180 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19181
19182 * w32select.c: Don't #include "keyboard.h".
19183 (run_protected): Add extern declaration for waiting_for_input.
19184
19185 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19186 * w32console.c (detect_input_pending, read_input_pending)
19187 (encode_terminal_code):
19188 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19189 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19190 (w32_system_caret_y, Qfile_name_history):
19191 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19192 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19193 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19194 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19195 * w32proc.c (Qlocal, report_file_error):
19196 * w32term.c (Vwindow_system, updating_frame):
19197 * w32uniscribe.c (initialized, uniscribe_font_driver):
19198 Remove unneeded extern declarations.
19199
19200 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19201
19202 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19203
19204 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19205
19206 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19207 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19208 These macros can no longer be used for assignment.
19209
19210 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19211 Assign struct members directly, instead of using BUF_BEGV etc.
19212 (record_buffer_markers, fetch_buffer_markers): New functions for
19213 recording and fetching special buffer markers.
19214 (set_buffer_internal_1, set_buffer_temp): Use them.
19215
19216 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19217
19218 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19219
19220 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19221 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19222
19223 * xdisp.c (hscroll_window_tree):
19224 (reconsider_clip_changes): Use PT instead of BUF_PT.
19225
19226 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19227
19228 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19229 $(EMACS_ROOT)/lib/intprops.h.
19230
19231 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19232
19233 Fix more problems found by GCC 4.5.2's static checks.
19234
19235 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19236 to unsigned char * to avoid compiler diagnostic.
19237 (xg_free_frame_widgets): Make it clear that a local variable is
19238 needed only if USE_GTK_TOOLTIP.
19239 (gdk_window_get_screen): Make it clear that this macro is needed
19240 only if USE_GTK_TOOLTIP.
19241 (int_gtk_range_get_value): New function, which avoids a diagnostic
19242 from gcc -Wbad-function-cast.
19243 (xg_set_toolkit_scroll_bar_thumb): Use it.
19244 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19245 diagnostic from gcc -Wbad-function-cast.
19246 (get_utf8_string, xg_get_file_with_chooser):
19247 Rename locals to avoid shadowing.
19248 (create_dialog): Move locals to avoid shadowing.
19249
19250 * xgselect.c (xg_select): Remove unused var.
19251
19252 * image.c (four_corners_best): Mark locals as initialized.
19253 (gif_load): Initialize transparent_p to zero (Bug#8238).
19254 Mark another local as initialized.
19255 (my_png_error, my_error_exit): Mark with NO_RETURN.
19256
19257 * image.c (clear_image_cache): Now static.
19258 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19259 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19260 (x_edge_detection): Remove unnecessary cast that
19261 gcc -Wbad-function-cast diagnoses.
19262 (gif_load): Fix pointer signedness.
19263 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19264 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19265
19266 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19267
19268 Improve quality of tests for time stamp overflow.
19269 For example, without this patch (encode-time 0 0 0 1 1
19270 1152921504606846976) returns the obviously-bogus value (-948597
19271 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19272 reports time overflow. See
19273 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19274 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19275 * editfns.c: Include limits.h and intprops.h.
19276 (TIME_T_MIN, TIME_T_MAX): New macros.
19277 (time_overflow): Move earlier, to before first use.
19278 (hi_time, lo_time): New functions, for an accurate test for
19279 out-of-range times.
19280 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19281 (Fget_internal_run_time): Don't assume time_t fits in int.
19282 (make_time): Use list2 instead of Fcons twice.
19283 (Fdecode_time): More accurate test for out-of-range times.
19284 (check_tm_member): New function.
19285 (Fencode_time): Use it, to test for out-of-range times.
19286 (lisp_time_argument): Don't rely on undefined left-shift and
19287 right-shift behavior when checking for time stamp overflow.
19288
19289 * editfns.c (time_overflow): New function, refactoring common code.
19290 (Fformat_time_string, Fdecode_time, Fencode_time):
19291 (Fcurrent_time_string): Use it.
19292
19293 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19294 * dired.c (make_time): Move to ...
19295 * editfns.c (make_time): ... here.
19296 * systime.h: Note the move.
19297
19298 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19299
19300 * fringe.c (update_window_fringes): Remove unused variables.
19301
19302 * unexmacosx.c (copy_data_segment): Also copy __got section.
19303 (Bug#8223)
19304
19305 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19306
19307 * termcap.c [MSDOS]: Include "msdos.h".
19308 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19309 Constify `char *' arguments and their references according to
19310 prototypes in tparam.h.
19311
19312 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19313
19314 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19315 Adapt all references accordingly.
19316
19317 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19318
19319 2011-03-11 Tom Tromey <tromey@redhat.com>
19320
19321 * buffer.c (syms_of_buffer): Remove obsolete comment.
19322
19323 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19324
19325 * termhooks.h (encode_terminal_code): Declare prototype.
19326
19327 * msdos.c (encode_terminal_code): Don't declare prototype.
19328
19329 * term.c (encode_terminal_code): Now external again, used by
19330 w32console.c and msdos.c.
19331
19332 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19333 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19334
19335 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19336
19337 Fix some minor problems found by GCC 4.5.2's static checks.
19338
19339 * fringe.c (update_window_fringes): Mark locals as initialized
19340 (Bug#8227).
19341 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19342
19343 * alloc.c (mark_fringe_data): Move decl from here ...
19344 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19345 to check its interface.
19346 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19347
19348 * fontset.c (free_realized_fontset): Now static.
19349 (Fset_fontset_font): Rename local to avoid shadowing.
19350 (fontset_font): Mark local as initialized.
19351 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19352
19353 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19354
19355 * xselect.c (x_disown_buffer_selections): Remove; not used.
19356 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19357 (x_own_selection, Fx_disown_selection_internal): Rename locals
19358 to avoid shadowing.
19359 (x_handle_dnd_message): Remove local to avoid shadowing.
19360
19361 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19362 so that the caller can use some name other than gcpro1.
19363 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19364 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19365 (Fx_backspace_delete_keys_p):
19366 Use them to avoid shadowing, and rename vars to avoid shadowing.
19367 (x_decode_color, x_set_name, x_window): Now static.
19368 (Fx_create_frame): Add braces to silence GCC warning.
19369 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19370 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19371 Remove unused locals.
19372 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19373 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19374 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19375 macros.
19376
19377 * xterm.h (x_mouse_leave): New decl.
19378
19379 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19380 Remove unused functions.
19381 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19382 (x_calc_absolute_position): Now static.
19383 (XTread_socket): Don't define label "out" unless it's used.
19384 Don't declare local "event" unless it's used.
19385 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19386 unless they are used.
19387 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19388 (x_fatal_error_signal): Remove; not used.
19389 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19390 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19391 (x_error_catcher, x_connection_closed, x_error_handler):
19392 (x_error_quitter, xembed_send_message, x_iconify_frame):
19393 (my_log_handler): Rename locals to avoid shadowing.
19394 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19395 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19396
19397 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19398 Rename or move locals to avoid shadowing.
19399 (tty_defined_color, merge_face_heights): Now static.
19400 (free_realized_faces_for_fontset): Remove; not used.
19401 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19402 does not deduce is never used uninitialized.
19403 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19404 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19405
19406 * terminal.c (store_terminal_param): Now static.
19407
19408 * xmenu.c (menu_highlight_callback): Now static.
19409 (set_frame_menubar): Remove unused local.
19410 (xmenu_show): Rename parameter to avoid shadowing.
19411 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19412 since they might point to immutable storage.
19413 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19414 since it's unused otherwise.
19415
19416 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19417 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19418 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19419 avoids a gcc -Wuninitialized diagnostic.
19420 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19421 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19422 does not deduce are never used uninitialized.
19423
19424 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19425
19426 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19427 * window.c (window_loop, size_window):
19428 (run_window_configuration_change_hook, enlarge_window): Likewise.
19429
19430 * window.c (display_buffer): Now static.
19431 (size_window): Mark variables that gcc -Wuninitialized
19432 does not deduce are never used uninitialized.
19433 * window.h (check_all_windows): New decl, to forestall
19434 gcc -Wmissing-prototypes diagnostic.
19435 * dispextern.h (bidi_dump_cached_states): Likewise.
19436
19437 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19438 shadowing.
19439 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19440 Include <limits.h>.
19441 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19442 and to avoid gcc -Wuninitialized warning.
19443 (load_charset_map): Mark variables that gcc -Wuninitialized
19444 does not deduce are never used uninitialized.
19445 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19446
19447 * coding.c (coding_set_source, coding_set_destination):
19448 Use "else { /* comment */ }" rather than "else /* comment */;"
19449 for clarity, and to avoid gcc -Wempty-body warning.
19450 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19451 a block, when the outer 'i' will do.
19452 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19453 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19454 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19455 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19456 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19457 Rename locals to avoid shadowing.
19458 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19459 * coding.c (emacs_mule_char, encode_invocation_designation):
19460 Now static, since they're not used elsewhere.
19461 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19462 (decode_coding_object, encode_coding_object, detect_coding_system):
19463 (decode_coding_emacs_mule): Mark variables that gcc
19464 -Wuninitialized does not deduce are never used uninitialized.
19465 (detect_coding_iso_2022): Initialize a local variable that might
19466 be used uninitialized. Leave a FIXME because it's not clear that
19467 this initialization is needed. (Bug#8211)
19468 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19469 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19470 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19471 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19472 Remove unused macros.
19473
19474 * category.c (hash_get_category_set): Remove unused local var.
19475 (copy_category_table): Now static, since it's not used elsewhere.
19476 * character.c (string_count_byte8): Likewise.
19477
19478 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19479 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19480
19481 * chartab.c (copy_sub_char_table): Now static, since it's not used
19482 elsewhere.
19483 (sub_char_table_ref_and_range, char_table_ref_and_range):
19484 Rename locals to avoid shadowing.
19485 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19486
19487 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19488 (BIDI_BOB): Remove unused macro.
19489
19490 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19491 deduce are never used uninitialized.
19492 * term.c (encode_terminal_code): Likewise.
19493
19494 * term.c (encode_terminal_code): Now static. Remove unused local.
19495
19496 * tparam.h: New file.
19497 * term.c, tparam.h: Include it.
19498 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19499 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19500 Move these decls to tparam.h, and make them agree with what
19501 is actually in tparam.c. The previous trick of using incompatible
19502 decls in different modules does not conform to the C standard.
19503 All callers of tparam changed to use tparam's actual API.
19504 * tparam.c (tparam1, tparam, tgoto):
19505 Use const pointers where appropriate.
19506
19507 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19508 * cm.h (struct cm): Likewise.
19509 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19510 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19511 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19512 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19513 (turn_on_face, init_tty): Likewise.
19514 * termchar.h (struct tty_display_info): Likewise.
19515
19516 * term.c (term_mouse_position): Rename local to avoid shadowing.
19517
19518 * alloc.c (mark_ttys): Move decl from here ...
19519 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19520
19521 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19522
19523 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19524
19525 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19526
19527 * search.c (compile_pattern_1): Remove argument regp, unused since
19528 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19529 (compile_pattern): Don't pass it.
19530
19531 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19532
19533 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19534 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19535 for ! HAVE_GTK3.
19536 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19537
19538 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19539
19540 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19541 gdk_window_get_screen, gdk_window_get_geometry,
19542 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19543 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19544 (xg_get_pixbuf_from_pixmap): New function.
19545 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19546 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19547 Call xg_get_pixbuf_from_pixmap instead of
19548 gdk_pixbuf_get_from_drawable.
19549 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19550 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19551 (xg_check_special_colors): Use GtkStyleContext and its functions
19552 for HAVE_GTK3.
19553 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19554 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19555 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19556 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19557 Call gtk_widget_get_preferred_size.
19558 (xg_frame_resized): gdk_window_get_geometry only takes 5
19559 parameters.
19560 (xg_win_to_widget, xg_event_is_for_menubar):
19561 Call gdk_x11_window_lookup_for_display.
19562 (xg_set_widget_bg): New function.
19563 (delete_cb): New function.
19564 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19565 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19566 (xg_set_background_color): Call xg_set_widget_bg.
19567 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19568 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19569 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19570 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19571 if ! HAVE_GTK3.
19572 (update_frame_tool_bar): Call gtk_widget_hide.
19573 (xg_initialize): Use GDK_KEY_g.
19574
19575 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19576 if ! HAVE_GTK3
19577 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19578
19579 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19580 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19581 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19582
19583 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19584
19585 * w32xfns.c (select_palette): Check success of RealizePalette against
19586 GDI_ERROR, not zero.
19587
19588 See ChangeLog.11 for earlier changes.
19589
19590 ;; Local Variables:
19591 ;; coding: utf-8
19592 ;; End:
19593
19594 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19595
19596 This file is part of GNU Emacs.
19597
19598 GNU Emacs is free software: you can redistribute it and/or modify
19599 it under the terms of the GNU General Public License as published by
19600 the Free Software Foundation, either version 3 of the License, or
19601 (at your option) any later version.
19602
19603 GNU Emacs is distributed in the hope that it will be useful,
19604 but WITHOUT ANY WARRANTY; without even the implied warranty of
19605 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19606 GNU General Public License for more details.
19607
19608 You should have received a copy of the GNU General Public License
19609 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.