]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix one part of bug #13079 with temporary files in call-process-region.
[gnu-emacs] / src / ChangeLog
1 2012-12-05 Eli Zaretskii <eliz@gnu.org>
2
3 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4 fails, signal an error instead of continuing with an empty
5 string. (Bug#13079)
6
7 2012-12-04 Eli Zaretskii <eliz@gnu.org>
8
9 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
10 Encode the file name before passing it to dostounix_filename, in
11 case it will downcase it (under w32-downcase-file-names).
12 (Bug#12933)
13
14 2012-12-01 Chong Yidong <cyd@gnu.org>
15
16 * fileio.c (Vauto_save_list_file_name): Doc fix.
17
18 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
19
20 * w32fns.c: Remove prototype of atof.
21 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
22 builds.
23 (file_dialog_callback): Declared UINT_PTR.
24
25 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
26 with 64-bit builds.
27
28 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
29 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
30 defined.
31
32 2012-11-27 Glenn Morris <rgm@gnu.org>
33
34 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
35
36 2012-11-26 Eli Zaretskii <eliz@gnu.org>
37
38 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
39 (Bug#11964)
40
41 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
42
43 Revert recent change for Bug#8855.
44 As reported by Harald Hanche-Olsen in
45 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
46 the change introduces a further bug, of creating lots of zombie
47 processes in some cases. Further work is needed to come up with a
48 better fix for Bug#8855.
49
50 2012-11-24 Eli Zaretskii <eliz@gnu.org>
51
52 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
53 highlighting on the frame was cleared. Prevents assertion
54 violations when repeatedly clicking on the "Top" link of the
55 "bread-crumbs" in Info buffers.
56
57 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
58 Eli Zaretskii <eliz@gnu.org>
59
60 Fix a race condition with glib (Bug#8855).
61 The symptom is a diagnostic "GLib-WARNING **: In call to
62 g_spawn_sync(), exit status of a child process was requested but
63 SIGCHLD action was set to SIG_IGN and ECHILD was received by
64 waitpid(), so exit status can't be returned." The diagnostic
65 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
66 The real bug is a race condition between Emacs and glib: Emacs
67 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
68 so that glib can't find it. Work around the bug by invoking
69 waitpid only on subprocesses that Emacs itself creates.
70
71 This is a backport from the trunk, consisting of:
72
73 * w32proc.c (create_child): Don't clip the PID of the child
74 process to fit into an Emacs integer, as this is no longer a
75 restriction.
76 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
77 reaping only the process specified by PID argument, if that is
78 positive. Use PID instead of dead_child to know which process to
79 reap. Wait for the child to die only if WNOHANG is not in
80 OPTIONS.
81 (sys_select): Don't set dead_child.
82
83 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
84 as it is no longer needed.
85
86 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
87 no longer needed.
88 (create_process, record_child_status_change): Don't use special
89 value -1 in pid field, as the caller now must know the pid rather
90 than having the callee infer it. The inference was sometimes
91 incorrect anyway, due to another race.
92 (create_process): Set new 'alive' member if child is created.
93 (process_status_retrieved): New function.
94 (record_child_status_change): Use it.
95 Accept negative 1st argument, which means to wait for the
96 processes that Emacs already knows about. Move special-case code
97 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
98 processes that have already been waited for, by testing and
99 clearing new 'alive' member. Remove the setting of
100 record_at_most_one_child for the !WNOHANG case.
101 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
102 now does this internally.
103 (handle_child_signal): Let record_child_status_change do all
104 the work, since we do not want to reap all exited child processes,
105 only the child processes that Emacs itself created.
106 * process.h (Lisp_Process): New boolean member 'alive'.
107
108 2012-11-23 Eli Zaretskii <eliz@gnu.org>
109
110 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
111 between bpos_covered and bpos_max. This fixes cursor display when
112 several display strings follow each other.
113
114 * .gdbinit (pgx): If the glyph's object is a string, display the
115 pointer to string data, rather than the value of the string object
116 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
117
118 2012-11-21 Eli Zaretskii <eliz@gnu.org>
119
120 * indent.c (Fvertical_motion): If the starting position is covered
121 by a display string, return to one position before that, to avoid
122 overshooting it inside move_it_to. (Bug#12930)
123
124 2012-11-20 Daniel Colascione <dancol@dancol.org>
125
126 * w32fns.c (Fx_file_dialog):
127 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
128 cygwin_convert_file_name*.
129
130 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
131 Rename cygwin_convert_path* to cygwin_convert_file_name*.
132
133 2012-11-20 Ken Brown <kbrown@cornell.edu>
134
135 * emacs.c (main): Set the G_SLICE environment variable for all
136 Cygwin builds, not just GTK builds. See
137 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
138
139 2012-11-19 Eli Zaretskii <eliz@gnu.org>
140
141 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
142 w32_note_current_window with code. (Backport from trunk.)
143
144 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
145 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
146 Define for the MSVC compiler.
147
148 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
149 semi-colon.
150
151 2012-11-18 Eli Zaretskii <eliz@gnu.org>
152
153 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
154 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
155 dostounix_filename. Prevents crashes down the road, because
156 dostounix_filename assumes it gets a unibyte string. Reported by
157 Michel de Ruiter <michel@sentient.nl>, see
158 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
159
160 2012-11-17 Eli Zaretskii <eliz@gnu.org>
161
162 * w32select.c: Include w32common.h before w32term.h, so that
163 windows.h gets included before w32term.h uses some of its
164 features, see below.
165
166 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
167 typedefs.
168 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
169 prototypes.
170 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
171
172 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
173
174 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
175 (ns_select): Return at once if events are held (Bug#12834).
176
177 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
178
179 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
180 Needed following 2012-10-20 change. (Bug#12902)
181
182 2012-11-16 Glenn Morris <rgm@gnu.org>
183
184 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
185
186 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
187
188 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
189
190 2012-11-14 Eli Zaretskii <eliz@gnu.org>
191
192 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
193 use the same value of thread handle.
194 (start_timer_thread): If the timer thread exited (due to error),
195 clean up by closing the two handles it used. Duplicate the caller
196 thread's handle here, so it gets duplicated only once, when
197 launching the timer thread. Set priority of the timer thread, not
198 the caller thread.
199 (getitimer): Don't duplicate the caller thread's handle here.
200 (Bug#12832)
201
202 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
203
204 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
205 called (Bug#12834).
206
207 2012-11-12 Eli Zaretskii <eliz@gnu.org>
208
209 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
210 passed to pint2str and pint2hrstr to be at most the size of the
211 frame's decode_mode_spec_buffer. This avoids crashes with very
212 large values of FIELD_WIDTH argument to decode_mode_spec.
213 (Bug#12867)
214
215 2012-11-07 Martin Rudalics <rudalics@gmx.at>
216
217 * window.c (Fsplit_window_internal): Set combination limit of
218 new parent window to t iff Vwindow_combination_limit is t;
219 fixing a regression introduced with the change from 2012-09-22.
220 (Fwindow_combination_limit, Fset_window_combination_limit):
221 Fix doc-strings.
222
223 2012-11-06 Eli Zaretskii <eliz@gnu.org>
224
225 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
226 amount when the scroll margins are too large. When scrolling
227 backwards in the buffer, give up if cannot reach point or the
228 scroll margin within a reasonable number of screen lines.
229 Fixes point position in window under scroll-up/down-aggressively when
230 point is positioned many lines beyond the window top/bottom.
231 (Bug#12811)
232
233 2012-11-05 Eli Zaretskii <eliz@gnu.org>
234
235 * ralloc.c (relinquish): If real_morecore fails to return memory
236 to the system, don't crash; instead, leave the last heap
237 unchanged and return. (Bug#12774)
238
239 2012-11-03 Eli Zaretskii <eliz@gnu.org>
240
241 * lisp.mk: Adjust comments to the fact that term/internal is now
242 loaded from loadup.el.
243
244 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
245 (msdos_fatal_signal): New function.
246 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
247 its argument list.
248
249 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
250 for GCC versions before 4.
251 (emacs_raise): Define to call msdos_fatal_signal.
252
253 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
254 iterator when starting in the middle of a display or overlay
255 string. (Bug#12745)
256
257 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
258
259 * widget.c (resize_cb): New function.
260 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
261 (EmacsFrameResize): Check if all is up to date before changing frame
262 size.
263
264 2012-11-01 Eli Zaretskii <eliz@gnu.org>
265
266 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
267
268 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
269
270 Fix crash when using Emacs as commit editor for git (Bug#12697).
271 * callproc.c (setpgrp): Remove macro, as we now use setpgid
272 and it is configured in conf_post.h.
273 (Fcall_process): Don't invoke both setsid and setpgid; the former
274 is enough, if it exists.
275 * callproc.c (Fcall_process, child_setup):
276 * process.c (create_process): Use setpgid.
277 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
278 for the real thing.
279 * dispnew.c (init_display): Initialize the foreground group
280 if we are running a tty display.
281 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
282 * lisp.h (init_foreground_group): New decl.
283 * sysdep.c (inherited_pgroup): New static var.
284 (init_foreground_group, tcsetpgrp_without_stopping)
285 (narrow_foreground_group, widen_foreground_group): New functions.
286 (init_sys_modes): Narrow foreground group.
287 (reset_sys_modes): Widen foreground group.
288
289 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
290
291 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
292
293 2012-10-31 Martin Rudalics <rudalics@gmx.at>
294
295 * minibuf.c (read_minibuf): Restore current buffer since
296 choose_minibuf_frame calling Fset_frame_selected_window may
297 change it (Bug#12766).
298
299 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
300
301 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
302
303 2012-10-30 Kenichi Handa <handa@gnu.org>
304
305 * font.c (Ffont_at): If WINDOW is specified and it is not
306 displaying the current buffer, signal an error.
307
308 2012-10-29 Daniel Colascione <dancol@dancol.org>
309
310 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
311 In preparation for fixing bug#12739, move these functions from
312 here...
313
314 * coding.h, coding.c: ... to here, and compile them only when
315 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
316 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
317
318 2012-10-28 Eli Zaretskii <eliz@gnu.org>
319
320 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
321 (timer_loop, getitimer, setitimer): Use it instead of
322 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
323 'clock'.
324 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
325 literal 10000.
326
327 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
328
329 * nsterm.m (NO_APPDEFINED_DATA): New define.
330 (last_appdefined_event_data): New variable
331 (last_appdefined_event): Remove.
332 (ns_select): Initialize t from last_appdefined_event_data instead
333 of [last_appdefined_event data1].
334 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
335 remove last_appdefined_event (Bug#12698).
336
337 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
338
339 * frame.c (x_set_font): Catch internal error.
340
341 2012-10-27 Eli Zaretskii <eliz@gnu.org>
342
343 Avoid overflow in w32 implementation of interval timers.
344 When possible, for ITIMER_PROF count only times the main thread
345 actually executes.
346 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
347 'volatile ULONGLONG' types. All the other data which was
348 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
349 (GetThreadTimes_Proc): New typedef.
350 (w32_get_timer_time): New function, returns a suitable time value
351 for the timer.
352 (timer_loop): Enter critical section when accessing ULONGLONG
353 values of the itimer_data struct, as these accesses are no longer
354 atomic. Call 'w32_get_timer_time' instead of 'clock'.
355 Remove unused variable.
356 (init_timers): Initialize s_pfn_Get_Thread_Times.
357 (start_timer_thread): Don't assign itimer->caller_thread here.
358 (getitimer): Assign itimer->caller_thread here.
359 (setitimer): Always call getitimer to get the value of ticks_now.
360 (sys_spawnve): Avoid compiler warning about format mismatch.
361
362 2012-10-26 Eli Zaretskii <eliz@gnu.org>
363
364 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
365 mouse movement events if the menu bar is active. This avoids
366 producing a busy "hour-glass" cursor by Windows if the mouse
367 pointer is positioned over a tooltip shown for some menu item.
368
369 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
370
371 Don't assume process IDs fit in int.
372 * emacs.c (shut_down_emacs) [!DOS_NT]:
373 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
374 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
375 Use pid_t, not int, to store process IDs, as 'int'
376 is not wide enough on a few platforms (e.g., AIX and IRIX).
377
378 2012-10-23 Kenichi Handa <handa@gnu.org>
379
380 The following change is to make face-font-rescale-alist work
381 correctly for non-ASCII fonts.
382
383 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
384 (font_open_for_lface): Handle Vface_font_rescale_alist.
385
386 2012-10-23 Chong Yidong <cyd@gnu.org>
387
388 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
389
390 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
391
392 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
393 for screen font.
394 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
395
396 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
397 event (Bug#12681).
398
399 2012-10-21 Glenn Morris <rgm@gnu.org>
400
401 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
402
403 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
404
405 Port to OpenBSD 5.1.
406 * frame.c (Fmouse_position, Fmouse_pixel_position):
407 * xdisp.c (produce_stretch_glyph):
408 Declare local vars only when they're needed.
409 This is clearer and avoids a warning on OpenBSD about unused vars.
410 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
411 This is safer, and avoids OpenBSD warnings about unused vars.
412 * keyboard.c (record_menu_key): Remove unnecessary decl.
413 (poll_timer): Define only if POLL_FOR_INPUT is defined.
414 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
415 as our definition clashes with OpenBSD's.
416 * xfaces.c (load_face_colors, check_lface_attrs)
417 (get_lface_attributes_no_remap, get_lface_attributes)
418 (lface_fully_specified_p, x_supports_face_attributes_p)
419 (tty_supports_face_attributes_p, face_fontset, realize_face)
420 (realize_x_face, realize_tty_face):
421 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
422 merely Lisp_Object *. This is more informative and avoids
423 a warning on OpenBSD about accessing beyond an object's size.
424
425 2012-10-20 Chong Yidong <cyd@gnu.org>
426
427 * lread.c (Fload): Doc fix (Bug#12592).
428
429 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
430
431 * font.c (Ffont_at): Fix previous change.
432
433 2012-10-19 Eli Zaretskii <eliz@gnu.org>
434
435 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
436 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
437 for the reasons.
438
439 * alloc.c (NSTATICS): Decrease to 0x800.
440
441 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
442
443 * fns.c (Fnreverse): Include the problem element when signalling an
444 error (bug#12677).
445
446 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
447
448 * nsterm.m (ns_select): Check writefds before call to
449 FD_ISSET (Bug#12668).
450
451 2012-10-18 Daniel Colascione <dancol@dancol.org>
452
453 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
454 (staticpro): If we run out of staticpro slots, die with an
455 informative error instead of just calling emacs_abort.
456
457 2012-10-18 Martin Rudalics <rudalics@gmx.at>
458
459 Fix two flaws reported by Dmitry Antipov.
460 * window.c (Ftemp_output_buffer_show): Remove.
461 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
462 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
463
464 2012-10-17 Eli Zaretskii <eliz@gnu.org>
465
466 * makefile.w32-in ($(BLD)/w32.$(O)):
467 ($(BLD)/vm-limit.$(O)):
468 ($(BLD)/term.$(O)):
469 ($(BLD)/unexw32.$(O)):
470 ($(BLD)/fileio.$(O)):
471 ($(BLD)/dispnew.$(O)): Update dependencies.
472
473 * w32term.h (w32_initialize_display_info, initialize_w32_display):
474 Add prototypes.
475
476 * w32proc.c: Include ctype.h.
477
478 * w32.h (init_environment, check_windows_init_file)
479 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
480 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
481 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
482 (sys_link): Add prototypes.
483
484 * w32.c: Include w32select.h.
485 (sys_access, e_malloc, sys_select): Add prototypes.
486 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
487
488 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
489
490 * unexw32.c: Include lisp.h and w32.h.
491
492 * term.c [WINDOWSNT]: Include w32term.h.
493
494 * process.c [WINDOWSNT]: Add prototype of sys_select.
495
496 * fileio.c [WINDOWSNT]: Include w32.h.
497
498 * dispnew.c [WINDOWSNT]: Include w32.h.
499
500 * cygw32.c (Fcygwin_convert_path_to_windows)
501 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
502 Lisp_Object values. (Bug#12661)
503
504 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
505 to Lisp_Object. (Bug#12661)
506
507 2012-10-17 Kenichi Handa <handa@gnu.org>
508
509 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
510 invalidate.
511
512 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
513
514 * buffer.c (Fkill_buffer): When unchaining the marker,
515 reset its buffer pointer to NULL (Bug#12652).
516
517 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
518
519 Do not verify indirection counters of killed buffers (Bug#12579).
520 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
521 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
522
523 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
524
525 * alloc.c (Fmake_byte_code): Fix typo in comment.
526 * print.c (print_interval): Define as static to match prototype.
527 * indent.c (disptab_matches_widthtab, recompute_width_table):
528 Convert to eassert.
529
530 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
531
532 * editfns.c (get_system_name): Remove.
533 * lisp.h (get_system_name): Remove prototype.
534 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
535 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
536
537 2012-10-15 Daniel Colascione <dancol@dancol.org>
538
539 * dbusbind.c: Add comment explaining reason for previous change.
540
541 2012-10-15 Martin Rudalics <rudalics@gmx.at>
542
543 * window.c (Fwindow_end): Rewrite check whether cached position
544 can be used (Bug#12600).
545 (resize_frame_windows, grow_mini_window, shrink_mini_window):
546 Set windows_or_buffers_changed.
547
548 2012-10-15 Daniel Colascione <dancol@dancol.org>
549
550 * dbusbind.c: Fix cygw32 build break when compiling with dbus
551 enabled by undefining the symbol "interface", which the platform
552 headers define to something incompatible.
553
554 2012-10-14 Daniel Colascione <dancol@dancol.org>
555
556 * image.c (init_tiff_functions, init_imagemagick_functions)
557 (init_svg_functions): Fix cygw32 build break by using these
558 functions only when WINDOWSNT _and_ HAVE_NTGUI.
559
560 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
561
562 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
563
564 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
565
566 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
567
568 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
569
570 * coding.c (detect_coding): Set coding->id before calling
571 this->detector.
572
573 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
574
575 * fileio.c: Formatting fixes.
576
577 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
578
579 Fix some stat-related races.
580 * fileio.c (Fwrite_region): Avoid race condition if a file is
581 removed or renamed by some other process immediately after Emacs
582 writes it but before Emacs stats it. Do not assume that stat (or
583 fstat) succeeds.
584 * image.c (slurp_file): Resolve the file name with fopen + fstat
585 rather than stat + fopen.
586 (pbm_read_file) [0]: Remove unused code with stat race.
587 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
588 Remove ineffective code with stat race.
589
590 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
591
592 * doc.c (get_doc_string): Don't signal an error if the file is missing.
593
594 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
595
596 * nsterm.m (hold_event_q): New static variable.
597 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
598 ! q_event_ptr.
599 (hold_event): New function.
600 (ns_read_socket): If hold_event_q have events, store them and
601 return (Bug#12384).
602 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
603 is zero (Bug#12384).
604
605 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
606
607 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
608
609 2012-10-12 Eli Zaretskii <eliz@gnu.org>
610
611 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
612
613 * fileio.c (check_existing): New function.
614 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
615 instead of calling 'stat', when what's needed is to check whether
616 a file exists. This avoids expensive system calls on MS-Windows.
617 (Bug#12587)
618
619 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
620
621 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
622 determine whether a file exists and is not a directory.
623
624 * lisp.h (check_existing): Add prototype.
625
626 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
627
628 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
629
630 2012-10-12 Glenn Morris <rgm@gnu.org>
631
632 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
633
634 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
635
636 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
637
638 * eval.c (Fautoload): Remember previous autoload status in load-history.
639
640 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
641
642 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
643 * lread.c (load_each_byte, new_backquote_flag, readchar)
644 (read_filtered_event, lisp_file_lexically_bound_p)
645 (safe_to_load_version, Fload, complete_filename_p, openp)
646 (build_load_history, readevalloop, read_escape, read1)
647 (string_to_number, read_vector, read_list):
648 * macros.c (Fstart_kbd_macro):
649 * marker.c (CONSIDER):
650 * menu.c (parse_single_submenu, digest_single_submenu)
651 (find_and_return_menu_selection, Fx_popup_menu):
652 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
653 (Ftry_completion):
654 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
655 (ns_menu_show):
656 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
657 (xmenu_show, xdialog_show):
658 Use bool for booleans.
659 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
660 as it's not a predicate. All uses changed. Omit unnecessary
661 buffer termination.
662
663 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
664
665 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
666 (save_excursion_restore): Do not restore mark if it was not saved.
667
668 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
669
670 * marker.c (cached_modiff): EMACS_INT, not int.
671
672 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
673 instead of having a wrong decl.
674 * nsmenu.m (waiting_for_input): Remove wrong decl.
675
676 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
677
678 keyboard.c, keymap.c: Use bool for booleans.
679 * dispnew.c (sit_for): Distinguish between 3-way display_option
680 and boolean do_display.
681 * keyboard.c (single_kboard, this_command_key_count_reset)
682 (waiting_for_input, echoing, immediate_quit, input_pending)
683 (interrupt_input, interrupts_deferred, pop_kboard)
684 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
685 (command_loop_1, adjust_point_for_property)
686 (safe_run_hooks_error, input_polling_used, read_char):
687 (help_char_p, readable_events, kbd_buffer_events_waiting)
688 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
689 (lucid_event_type_list_p, get_input_pending):
690 (gobble_input, menu_separator_name_p, menu_bar_item)
691 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
692 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
693 (keyremap_step, test_undefined, read_key_sequence)
694 (detect_input_pending, detect_input_pending_ignore_squeezables)
695 (detect_input_pending_run_timers, requeued_events_pending_p)
696 (quit_throw_to_read_char, Fset_input_interrupt_mode):
697 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
698 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
699 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
700 (accessible_keymaps_1, Fkey_description, push_key_description):
701 (shadow_lookup, struct where_is_internal_data)
702 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
703 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
704 (describe_map, describe_vector):
705 * menu.c (single_menu_item):
706 * nsmenu.m (ns_update_menubar):
707 * process.c (wait_reading_process_output):
708 * search.c (scan_buffer, scan_newline):
709 Use bool for boolean.
710 * keyboard.c (timers_run, swallow_events)
711 (detect_input_pending_run_timers):
712 * process.c (wait_reading_process_output):
713 Use unsigned for counter where wraparound-on-overflow is desired,
714 since unsigned is guaranteed to have that behavior and signed is not.
715 (read_char): Use ptrdiff_t for string length.
716 (get_input_pending): Remove first argument, since it was always
717 the same pointer-to-int (now pointer-to-boolean) &input_pending,
718 and behave as if it had that value. Return new value of
719 input_pending. All callers changed.
720 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
721 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
722 a string length.
723 * keymap.c (push_key_description): Omit last arg, which was always 1.
724 All callers changed.
725
726 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
727
728 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
729
730 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
731 ($(BLD)/term.$(O)): Update dependencies.
732
733 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
734
735 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
736 * lisp.h (enum pvec_type): Adjust comments and omit explicit
737 initializer for PVEC_NORMAL_VECTOR.
738
739 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
740
741 Clean out old termopts cruft.
742 * termopts.h (flow_control, meta_key): Remove unused decls.
743 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
744 Don't include termopts.h.
745
746 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
747
748 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
749
750 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
751
752 * commands.h (immediate_quit): Remove duplicate decl.
753
754 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
755
756 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
757 caching.
758 (nsfont_open): Remove setting of Vfonts_in_cache.
759 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
760
761 2012-10-09 Eli Zaretskii <eliz@gnu.org>
762
763 * w32fns.c (w32_last_error): Change the return value to DWORD, to
764 match what GetLastError returns. Explain why the function is
765 needed.
766
767 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
768 'is_tooltip_frame', to avoid confusion with its global namesake.
769
770 2012-10-08 Daniel Colascione <dancol@dancol.org>
771
772 * xdisp.c (start_hourglass): Call w32_note_current_window when
773 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
774 build that caused Emacs to display the hourglass cursor forever.
775
776 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
777 which is broken under remote desktop, calculate the number of
778 colors available for a display based on the display's number of
779 planes and number of bits per pixel per plane. (bug#10397).
780
781 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
782
783 * nsfont.m (Vfonts_in_cache): New variable.
784 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
785 are used. Add cached fonts to Vfonts_in_cache.
786 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
787
788 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
789
790 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
791 in nt/config.nt.
792 (FONT_H): Define after FRAME_H.
793 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
794 Update dependencies.
795
796 * w32term.c: Remove leftover declaration of keyboard_codepage.
797
798 2012-10-08 Eli Zaretskii <eliz@gnu.org>
799
800 * makefile.w32-in (FONT_H): Add $(FRAME_H).
801 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
802 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
803 (GLOBAL_SOURCES): Add cygw32.c.
804 ($(BLD)/unexw32.$(O)):
805 ($(BLD)/w32.$(O)):
806 ($(BLD)/w32console.$(O)):
807 ($(BLD)/w32fns.$(O)):
808 ($(BLD)/w32heap.$(O)):
809 ($(BLD)/w32menu.$(O)):
810 ($(BLD)/w32proc.$(O)): Add w32common.h.
811
812 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
813 'const char *'.
814 (x_to_w32_color): Don't modify the argument, modify a copy instead.
815
816 2012-10-08 Daniel Colascione <dancol@dancol.org>
817
818 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
819 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
820 accidental message numbering hole. Change other messages to
821 match.
822
823 * w32select.h (HAVE_W32SELECT): Remove.
824
825 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
826 w32common.h instead of w32heap.h.
827
828 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
829 (get_allocation_unit, get_processor_type, get_w32_major_version)
830 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
831 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
832 (OS_NT, os_subtype, cache_system_info): Move declarations to
833 w32common.
834
835 * w32heap.c: Include w32common.h.
836 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
837 (w32_minor_version, w32_build_number, w32_subtype):
838 Remove duplicate definitions.
839
840 * w32fns.c: Include w32common.h; include w32heap.h only in
841 WINDOWSNT.
842
843 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
844 Use `report_file_error' instead of `error' in order to better
845 inform users of what went wrong. Increase NTGUI_UNICODE file
846 dialog box file name length to 32k, the maximum allowed by the NT
847 kernel.
848
849 * w32common.h: New file.
850 (ROUND_UP, ROUND_DOWN, get_page_size)
851 (get_allocation_unit, get_processor_type, get_w32_major_version)
852 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
853 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
854 (OS_NT, os_subtype, cache_system_info): Move here.
855
856 * unexw32.c, unexcw.c: Include w32common.h.
857
858 * emacs.c (main): Use (defined (WINDOWSNT) || defined
859 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
860 to call syms_of_w32select.
861
862 * cygw32.h: Remove obsolete EXFUN declarations.
863
864 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
865
866 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
867 of w32inevt.o from SOME_MACHINE_OBJECTS.
868
869 2012-10-08 Daniel Colascione <dancol@dancol.org>
870
871 * image.c: Permanent fix for JPEG compilation issue --- limit
872 jpeglib `boolean' redefinition to Cygwin builds.
873
874 2012-10-08 Eli Zaretskii <eliz@gnu.org>
875
876 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
877
878 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
879 Cygwin.
880
881 2012-10-08 Daniel Colascione <dancol@dancol.org>
882
883 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
884 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
885 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
886 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
887 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
888 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
889 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
890 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
891 now a supported configuration.
892
893 * Makefile.in: consolidate image variables into LIBIMAGE; add
894 W32_OBJ and W32_LIBS. Compile new files.
895
896 * conf_post.h:
897 (_DebPrint) declare tracing facility for W32 debugging. We need
898 to unify tracing later.
899
900 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
901 unconditional use of W32 Unicode functions. Cygwin runs only on
902 100% Unicode operating systems.
903
904 * cygw32.c: New file. Define Cygwin-specific facilities.
905 (Fcygwin_convert_path_to_windows)
906 (Fcygwin_convert_path_from_windows): New user functions for
907 accessing Cygwin path-munging routines.
908
909 * cygw32.h: New file.
910 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
911 UTF-16LE strings temporarily inside non-Lisp-visible string
912 objects.
913
914 (w32_strerror): Just what it says on the tin.
915
916 * emacs.c: Make the NS fork-then-exec code for daemon-launching
917 also run for Cygwin; both systems have the same problem with using
918 GUI facilities in a forked child. Also call syms_of_cygw32,
919 syms_of_w32select in correct places.
920
921 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
922 needs fork-then-exec for daemon launching.
923
924 * font.h: Include frame.h.
925
926 * image.c: Use the image library cache machinery only when we're
927 compiling for native WINDOWSNT; Cygwin can use shared libraries
928 like any other Unixlike system.
929
930 * keyboard.c: Clarify a comment regarding the input loop.
931
932 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
933 functions directly instead of trying to detect at runtime that our
934 host operating system supports them. We make this change for two
935 reasons: Cygwin lacks support for the multibyte character
936 conversion functions used by the legacy menu code, and Cygwin
937 never needs to rely on non-Unicode APIs.
938
939 * unexw32.c (hinst): Declare extern.
940
941 * w32.c: Change header order;
942 (w32_strerror): Move to w32fns.c because we need it for
943 non-WINDOWSNT builds.
944
945 * w32.h: Add #error macro to make sure we don't include w32.h for
946 Cygwin builds. Remove w32select declarations.
947
948 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
949 w32fns.c. w32console.c is WINDOWSNT-only.
950
951 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
952 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
953 POSIXy alternative.
954 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
955 (w32_major_version, w32_minor_version, w32_build_number)
956 (os_subtype, sound_type): Define here
957 (w32_defined_color): Make color parameter const for consistency
958 with other _defined_color functions.
959 (w32_createwindow): Unconditionally call w32_init_class instead of
960 doing so only when hprevinst is non-NULL. Plumbing hprevinst
961 through the code is complex and unnecessary because class
962 registration is practically free.
963 (w32_name_of_message): New EMACSDEBUG-only function.
964 (Fset_message_beep): Move here
965 (Fx_open_connection): Require that the display name for Windows be
966 "w32" for consistency, emacsclient disambiguation, and maybe, one
967 day, multi-window-system support.
968 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
969 Cygwin files for W32 GUI facilities, since these clearly don't
970 expect Cygwin names.
971 (_DebPrint): Define.
972 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
973 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
974 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
975 (w32_last_error): Remove.
976
977 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
978
979 * w32heap.c (syspage_mask): Declare here.
980 (cache_system_info): Remove.
981
982 * w32inevt.c (faked_key): Define globally, not statically.
983 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
984 (w32_console_toggle_lock_key): Move to w32fns.c.
985
986 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
987
988 * w32proc.c (_DebPrint): Move to w32fns.c.
989 * w32select.c: Include string.h, stdio.h for Cygwin.
990 * w32select.h: New File.
991
992 * w32term.c: Include io.h for non-CYGWIN builds; needed for
993 get_osfhandle.
994 (w32_message_fd): New variable. Under Cygwin, holds the file
995 descriptor the system used to tell us about pending thread
996 messages.
997
998 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
999 that prevented compilation under non-WINDOWSNT systems.
1000
1001 (w32_initialize): Open /dev/windows and assign it to
1002 w32_message_fd. Provide w32 feature.
1003
1004 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1005 (WM_EMACS_INPUT_READY): add.
1006 (prepend_msg, w32_message_fd): Declare globally.
1007
1008 * w32xfns.c:
1009 (keyboard_handle): Use only when WINDOWSNT.
1010 (notify_msg_ready): New function. Posts a message to the main
1011 thread's message queue under CYGWIN, which wakes up the main
1012 thread from select(2) by making the /dev/windows file descriptor
1013 ready. Under WINDOWSNT, it sets an event the same way the old
1014 code did.
1015
1016 (post, prepend_msg): Actually call notify_msg_ready instead of
1017 setting the input event directly.
1018
1019 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1020
1021 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1022 but it still has blocs in it, don't return it to the system,
1023 instead of aborting. (Bug#12402)
1024
1025 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1026
1027 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1028
1029 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1030 MAC_OS_X_VERSION_10_6.
1031 (syms_of_nsterm): Remove comment about Panther and above for
1032 ns-antialias-text.
1033 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1034 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1035 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1036
1037 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1038 MAC_OS_X_VERSION_10_4.
1039
1040 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1041 MAC_OS_X_VERSION_10_2.
1042
1043 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1044
1045 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1046 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1047
1048 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1049 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1050 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1051 Remove ns_in_resize check.
1052 (ns_clear_frame_area): Remove resize handle code.
1053
1054 * nsfns.m (ns_in_resize): Remove.
1055 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1056 Remove ns_in_resize check.
1057
1058 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1059
1060 Improve sys_siglist detection.
1061 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1062 defined as a macro, as is done in Solaris.
1063 (sys_siglist_entries): New macro.
1064 (save_strsignal): Use it.
1065 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1066 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1067
1068 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1069
1070 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1071 fullscreen/Fullscreen.
1072
1073 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1074 tobar_height is new.
1075
1076 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1077 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1078 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1079 (windowDidResize:): Check for correct window if old style fullscreen.
1080 Capitalize word in comment. Remove incorrect comment.
1081 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1082 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1083 error in drawing background.
1084 (toggleFullScreen:): Remove comment. Rearrange calls.
1085 Set toolbar values to zero, save old height in tobar_height.
1086 Restore tool bar height when leaving fullscreen.
1087 (canBecomeMainWindow): New function.
1088
1089 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1090
1091 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1092
1093 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1094
1095 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1096
1097 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1098 that time stamps of directories could also be changed.
1099 Don't request the too broad GENERIC_WRITE, only the more restrictive
1100 FILE_WRITE_ATTRIBUTES access rights.
1101
1102 * fileio.c (Fset_file_times): Special-case ignoring errors for
1103 directories only on MSDOS, not on MS-Windows.
1104
1105 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1106
1107 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1108
1109 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1110
1111 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1112 see whether CreateFile failed.
1113
1114 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1115
1116 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1117 to avoid similar races.
1118 * keyboard.c (pending_signals): Now bool, not int.
1119
1120 Port timers to OpenBSD, plus check for timer failures.
1121 OpenBSD problem reported by Han Boetes.
1122 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1123 and/or setitimer.
1124 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1125 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1126 like OpenBSD, which has timer_settime but does not declare it.
1127 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1128 whether to use itimerspec-related primitives. All uses of
1129 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1130
1131 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1132
1133 * profiler.c (handle_profiler_signal): Fix a malloc race
1134 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1135
1136 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1137
1138 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1139
1140 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1141
1142 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1143 consistent with the change in return value of 'safe_strsignal'.
1144
1145 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1146
1147 Prefer plain 'static' to 'static inline' (Bug#12541).
1148 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1149 (bidi_set_sor_type, bidi_push_embedding_level)
1150 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1151 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1152 (bidi_cache_search, bidi_cache_ensure_space)
1153 (bidi_cache_iterator_state, bidi_cache_find)
1154 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1155 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1156 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1157 Now 'static', not 'static inline'.
1158
1159 Count overruns when profiling; change units to ns.
1160 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1161 Give extra weight to samples after overruns, to attempt to count
1162 the time more accurately.
1163 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1164 the underlying primitives nominally do ns.
1165 (Fprofiler_cpu_start): Document the change. Mention that
1166 the sampling intervals are only approximate.
1167
1168 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1169
1170 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1171
1172 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1173 case for the special 0 coding-system.
1174
1175 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1176 (Fmake_overlay): Remove redundant tests.
1177 (fix_start_end_in_overlays): Remove redundant recentering.
1178
1179 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1180
1181 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1182 Update dependencies.
1183
1184 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1185
1186 Fix a malloc race condition involving strsignal.
1187 A signal can arrive in the middle of a malloc, and Emacs's signal
1188 handler can invoke strsignal, which can invoke malloc, which is
1189 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1190 Fix it by altering the signal handler so that it does not invoke
1191 strsignal.
1192 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1193 * process.c (status_message): Use const pointer, in case strsignal
1194 is #defined to safe_strsignal.
1195 * sysdep.c (sys_siglist, init_signals): Always define and
1196 initialize a substitute sys_siglist if the system does not define
1197 one, even if HAVE_STRSIGNAL.
1198 (safe_strsignal): Rename from strsignal. Always define,
1199 using sys_siglist. Return a const pointer.
1200 * syssignal.h (safe_strsignal): New decl.
1201 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1202
1203 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1204
1205 * w32proc.c (timer_loop): Fix code that waits for timer
1206 expiration, to avoid high CPU usage.
1207
1208 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1209
1210 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1211 (sweep_weak_table): Remove redundant prototypes.
1212
1213 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1214
1215 * emacs.c: Move the inclusion of TERM_HEADER after including
1216 windows.h on WINDOWSNT. This avoids compilation problems with
1217 MSVC.
1218
1219 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1220
1221 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1222 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1223 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1224 as the previous version used 'void *'.
1225
1226 * ralloc.c (ROUNDUP): Fix last change.
1227 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1228 'size_t'.
1229
1230 * w32proc.c <disable_itimers>: New static flag.
1231 (init_timers): Initialize it to zero, after creating the critical
1232 sections used by the timer threads.
1233 (term_timers): Set to 1 before deleting the critical sections.
1234 (getitimer, setitimer): If disable_itimers is non-zero, return an
1235 error indication without doing anything. Reported by Fabrice
1236 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1237 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1238 return results.
1239 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1240 support timers.
1241
1242 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1243 term_ntproc after all the other bookkeeping, to get timers working
1244 as long as possible.
1245
1246 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1247
1248 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1249 Suggested by Juri Linkov in
1250 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1251
1252 Prefer plain 'static' to 'static inline' (Bug#12541).
1253 With static functions, modern compilers inline pretty well by
1254 themselves; advice from programmers often hurts as much as it helps.
1255 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1256 this change shrinks the text size of the Emacs executable by 1.1%
1257 without affecting CPU significantly in my benchmark.
1258 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1259 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1260 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1261 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1262 (bset_auto_fill_function, bset_auto_save_file_format)
1263 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1264 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1265 (bset_cache_long_line_scans, bset_case_fold_search)
1266 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1267 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1268 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1269 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1270 (bset_header_line_format, bset_indicate_buffer_boundaries)
1271 (bset_indicate_empty_lines, bset_invisibility_spec)
1272 (bset_left_fringe_width, bset_major_mode, bset_mark)
1273 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1274 (bset_name, bset_overwrite_mode, bset_pt_marker)
1275 (bset_right_fringe_width, bset_save_length)
1276 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1277 (bset_scroll_up_aggressively, bset_selective_display)
1278 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1279 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1280 (set_buffer_overlays_after):
1281 * category.c (bset_category_table):
1282 * charset.c (read_hex):
1283 * coding.c (produce_composition, produce_charset)
1284 (handle_composition_annotation, handle_charset_annotation)
1285 (char_encodable_p):
1286 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1287 (assign_row, set_frame_matrix_frame, make_current)
1288 (add_row_entry):
1289 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1290 * fns.c (maybe_resize_hash_table):
1291 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1292 * gmalloc.c (register_heapinfo):
1293 * image.c (lookup_image_type):
1294 * intervals.c (set_interval_object, set_interval_left)
1295 (set_interval_right, copy_interval_parent, rotate_right)
1296 (rotate_left, balance_possible_root_interval):
1297 * keyboard.c (kset_echo_string, kset_kbd_queue)
1298 (kset_keyboard_translate_table, kset_last_prefix_arg)
1299 (kset_last_repeatable_command, kset_local_function_key_map)
1300 (kset_overriding_terminal_local_map, kset_real_last_command)
1301 (kset_system_key_syms, clear_event, set_prop):
1302 * lread.c (digit_to_number):
1303 * marker.c (attach_marker, live_buffer, set_marker_internal):
1304 * nsterm.m (ns_compute_glyph_string_overhangs):
1305 * process.c (pset_buffer, pset_command)
1306 (pset_decode_coding_system, pset_decoding_buf)
1307 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1308 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1309 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1310 * syntax.c (bset_syntax_table, dec_bytepos):
1311 * terminal.c (tset_param_alist):
1312 * textprop.c (interval_has_some_properties)
1313 (interval_has_some_properties_list):
1314 * window.c (wset_combination_limit, wset_dedicated)
1315 (wset_display_table, wset_hchild, wset_left_fringe_width)
1316 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1317 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1318 (wset_right_fringe_width, wset_right_margin_cols)
1319 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1320 (wset_vertical_scroll_bar_type, wset_window_parameters):
1321 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1322 (wset_column_number_displayed, wset_region_showing)
1323 (window_box_edges, run_window_scroll_functions)
1324 (append_glyph_string_lists, prepend_glyph_string_lists)
1325 (append_glyph_string, set_glyph_string_background_width)
1326 (append_glyph, append_composite_glyph)
1327 (take_vertical_position_into_account):
1328 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1329 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1330 (lface_hash, lface_same_font_attributes_p, lookup_face):
1331 * xml.c (libxml2_loaded_p):
1332 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1333 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1334 Now 'static', not 'static inline'.
1335
1336 * bidi.c: Tune.
1337 (bidi_copy_it): Do the whole copy with a single memcpy.
1338 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1339
1340 Revert the FOLLOW-SYMLINKS change for file-attributes.
1341 Doing it right would require several changes to Tramp, and there's
1342 not enough time to get that tested before the freeze today.
1343 * dired.c (directory_files_internal, Ffile_attributes):
1344 Undo last change.
1345
1346 * frame.c (x_report_frame_params): Port better to wider ints.
1347 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1348 or that pointers can be printed in 15 decimal digits.
1349 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1350
1351 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1352
1353 Support x64 build on MS-Windows.
1354 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1355 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1356 compatibility with x64.
1357 (x_get_focus_frame): Add prototype.
1358
1359 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1360 defining an XRectangle structure.
1361
1362 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1363 arithmetics for compatibility with x64.
1364
1365 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1366 compatibility with x64.
1367
1368 * w32heap.h: Adjust prototypes and declarations.
1369
1370 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1371 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1372 DWORD, long, and unsigned long, for compatibility with x64.
1373 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1374 (sbrk): Argument is now of type ptrdiff_t.
1375
1376 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1377 less than 0x0500.
1378 (w32_msg_pump): Use WPARAM type for 'result'.
1379
1380 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1381 architecture.
1382 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1383 compatibility with x64.
1384
1385 * vm-limit.c (lim_data): Now size_t.
1386 (check_memory_limits): Adjust prototypes of real_morecore and
1387 __morecore to receive argument of type ptrdiff_t. Use size_t for
1388 five_percent and data_size.
1389
1390 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1391 variables, for compatibility with x64.
1392 (rva_to_section, offset_to_section, relocate_offset)
1393 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1394 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1395 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1396 for compatibility with x64.
1397
1398 * sysdep.c (STDERR_FILENO): Define if not already defined.
1399
1400 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1401 (__morecore): Argument type is now ptrdiff_t.
1402 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1403 (relinquish): Use ptrdiff_t type for 'excess'.
1404 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1405
1406 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1407 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1408 instead of a literal number.
1409
1410 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1411 (min): Define only if not already defined.
1412
1413 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1414 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1415 hosts.
1416
1417 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1418 'bitmaps' is a pointer.
1419
1420 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1421
1422 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1423
1424 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1425
1426 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1427 * dired.c (directory_files_internal, Ffile_attributes):
1428 New arg follow_symlinks. All uses changed.
1429
1430 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1431
1432 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1433
1434 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1435
1436 Support atimers and CPU profiler via profile.c on MS-Windows.
1437 * w32proc.c (sig_mask, crit_sig): New static variables.
1438 (sys_signal): Support SIGALRM and SIGPROF.
1439 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1440 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1441 sigfillset, and sigprocmask are no longer no-ops.
1442 (sigismember): New function.
1443 (struct itimer_data): New definition.
1444 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1445 (crit_prof): New static variables.
1446 (MAX_SINGLE_SLEEP): New definition.
1447 (timer_loop, stop_timer_thread, term_timers, init_timers)
1448 (start_timer_thread, getitimer, setitimer): New functions.
1449 (alarm): No longer a no-op, calls setitimer.
1450
1451 * w32.c (term_ntproc): Call term_timers.
1452 (init_ntproc): Make sure all signals are unblocked at startup, to
1453 erase any traces of dumping. Call init_timers.
1454
1455 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1456 Windows-specific code to display the hourglass mouse pointer is no
1457 longer used.
1458 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1459 to hourglass timer expiration.
1460 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1461 Remove, no longer used.
1462 (w32_note_current_window, show_hourglass, hide_hourglass):
1463 New functions, in support of hourglass cursor display similar to other
1464 window systems.
1465 (syms_of_w32fns): Don't initialize hourglass_timer.
1466
1467 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1468 WINDOWSNT as well.
1469 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1470
1471 * w32.h (init_timers, term_timers): Add prototypes.
1472
1473 2012-09-30 Kenichi Handa <handa@gnu.org>
1474
1475 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1476 to the buffer relocation which may be caused by ccl_driver.
1477
1478 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1479
1480 * xfns.c (Fx_file_dialog): Update comment.
1481
1482 * w32fns.c (Fx_file_dialog): Update comment.
1483
1484 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1485 Initialize panel name field if OSX >= 10.6.
1486
1487 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1488
1489 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1490
1491 * nsterm.m (NEW_STYLE_FS): New define.
1492 (ns_fullscreen_hook, windowWillEnterFullScreen)
1493 (windowDidEnterFullScreen, windowWillExitFullScreen)
1494 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1495 (setFSValue): New functions.
1496 (EmacsFSWindow): New implementation.
1497 (canBecomeKeyWindow): New function for EmacsFSWindow.
1498 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1499 (dealloc): Release nonfs_window if in fullscreen.
1500 (updateFrameSize:): Call windowDidMove to update top/left.
1501 (windowWillResize:toSize:): Check if frame is still maximized.
1502 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1503 next_maximized, maximized_width, maximized_height and nonfs_window.
1504 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1505 tbar_height.
1506 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1507 fullscreen. Set maximized_width/height. Act on next_maximized.
1508
1509 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1510 (EmacsView): Add variables for fullscreen.
1511 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1512 (EmacsFSWindow): New interface for fullscreen.
1513
1514 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1515
1516 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1517
1518 2012-09-30 Chong Yidong <cyd@gnu.org>
1519
1520 * fns.c (Frandom): Doc fix.
1521
1522 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1523
1524 * window.c (Vwindow_combination_limit): New default value.
1525 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1526
1527 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1530 Suggested by Eli Zaretskii in
1531 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1532
1533 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1534
1535 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1536 HAVE_TIMER_SETTIME is defined.
1537
1538 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1539
1540 Profiler improvements: more-accurate timers, overflow checks.
1541 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1542 signal.h, setjmp.h. Include systime.h instead.
1543 (saturated_add): New function.
1544 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1545 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1546 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1547 New static vars.
1548 (enum profiler_cpu_running): New enum.
1549 (profiler_cpu_running): Now of that enum type, not bool.
1550 All uses changed to store the new value.
1551 (handle_profiler_signal): Rename from sigprof_handler_1,
1552 for consistency with other handlers. Do not check whether
1553 cpu_log is a hash-table if garbage collecting, since it
1554 doesn't matter in that case.
1555 (deliver_profiler_signal): Rename from sigprof_handler,
1556 for consistency with other handlers.
1557 (setup_cpu_timer): New function, with much of what used to be in
1558 Fprofiler_cpu_start. Check for out-of-range argument.
1559 Prefer timer_settime if available, and prefer
1560 thread cputime clocks, then process cputime clocks, then
1561 monotonic clocks, to the old realtime clock. Use make_timeval
1562 to round more-correctly when falling back to setitimer.
1563 (Fprofiler_cpu_start): Use it.
1564 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1565 Don't assume that passing NULL as the 2nd argument of setitimer
1566 is the same as passing a pointer to all-zero storage.
1567 Ignore SIGPROF afterwards.
1568 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1569 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1570 non-fatal signal handlers. Ignore SIGPROF on startup.
1571 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1572 in profiler.c, since sysdep.c now uses it.
1573
1574 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1575 Suggested by Eli Zaretskii in
1576 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1577
1578 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1579
1580 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1581
1582 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1583
1584 * lisp.h (struct backtrace): Remove indirection for `function' field.
1585 * xdisp.c (redisplay_internal):
1586 * profiler.c (record_backtrace, sigprof_handler_1):
1587 * alloc.c (Fgarbage_collect):
1588 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1589 (Fbacktrace_frame): Adjust accordingly.
1590
1591 2012-09-28 Glenn Morris <rgm@gnu.org>
1592
1593 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1594 (Frun_hook_with_args_until_failure): Doc fixes.
1595
1596 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1597
1598 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1599 Qautomatic_redisplay and change the symbol name. All users changed.
1600
1601 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1602
1603 * profiler.c (sigprof_handler): Fix race condition.
1604
1605 2012-09-28 Glenn Morris <rgm@gnu.org>
1606
1607 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1608
1609 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1610
1611 Check more robustly for timer_settime.
1612 * Makefile.in (LIB_TIMER_TIME): New macro.
1613 (LIBES): Add it.
1614 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1615 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1616 call timer_settime.
1617
1618 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1619
1620 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1621
1622 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1623
1624 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1625
1626 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1627
1628 * character.h (MAYBE_UNIFY_CHAR): Remove.
1629 * charset.c, charset.h (maybe_unify_char): Now static.
1630 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1631 Since this stuff is now private to charset.c, there's no need for
1632 a public macro and no need to inline by hand.
1633
1634 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1635 Stefan Monnier <monnier@iro.umontreal.ca>
1636 Juanma Barranquero <lekktu@gmail.com>
1637
1638 * profiler.c: New file.
1639 * Makefile.in (base_obj): Add profiler.o.
1640 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1641 ($(BLD)/profiler.$(O)): New target.
1642 * emacs.c (main): Call syms_of_profiler.
1643 * alloc.c (Qautomatic_gc): New constant.
1644 (MALLOC_PROBE): New macro.
1645 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1646 (total_bytes_of_live_objects): New function.
1647 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1648 Call malloc_probe for the memory profiler.
1649 (syms_of_alloc): Define Qautomatic_gc.
1650 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1651 race condition.
1652 (struct backtrace): Move definition...
1653 * lisp.h (struct backtrace): ..here.
1654 (Qautomatic_gc, profiler_memory_running): Declare vars.
1655 (malloc_probe, syms_of_profiler): Declare functions.
1656 * xdisp.c (Qautomatic_redisplay): New constant.
1657 (redisplay_internal): Record itself in backtrace_list.
1658 (syms_of_xdisp): Define Qautomatic_redisplay.
1659
1660 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1661 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1662
1663 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1664
1665 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 Prefer POSIX timers if available.
1668 They avoid a race if the timer is too close to the current time.
1669 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1670 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1671 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1672
1673 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1674
1675 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1676 CHAR_STRING_ADVANCE.
1677 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1678 STRING_CHAR_ADVANCE.
1679
1680 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1681
1682 Move Vlibrary_cache to emacs.c and reset before dumping.
1683
1684 * lisp.h (reset_image_types): Declare.
1685 [WINDOWSNT] (Vlibrary_cache): Declare.
1686
1687 * image.c (reset_image_types): New function.
1688
1689 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1690 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1691 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1692
1693 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1694 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1695
1696 * w32.h (Vlibrary_cache): Do not declare.
1697
1698 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1699
1700 * w32proc.c (sys_signal): Handle all signals defined by the
1701 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1702 handlers for signals supported by Windows. Don't override
1703 term_ntproc as the handler for SIGABRT.
1704 (sigaction): Rewrite to call sys_signal instead of duplicating its
1705 code.
1706 (sys_kill): Improve commentary.
1707
1708 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1709 consistency with a signature of a signal handler. All callers
1710 changed.
1711 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1712 install term_ntproc as a signal handler for SIGABRT, as that
1713 should be done by the dumped Emacs.
1714
1715 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1716
1717 * w32select.c (term_w32select): Protect against repeated
1718 invocation by setting clipboard_owner to NULL after calling
1719 DestroyWindow.
1720
1721 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1722 and term_ntproc to their modified signatures.
1723
1724 * character.c (char_string, string_char): Remove calls to
1725 MAYBE_UNIFY_CHAR. See the discussion starting at
1726 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1727 for the details.
1728
1729 2012-09-25 Chong Yidong <cyd@gnu.org>
1730
1731 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1732
1733 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1734
1735 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1736 when encountering an unknown bytecode.
1737
1738 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1739
1740 image.c, indent.c: Use bool for booleans.
1741 * dispextern.h (struct image_type): Members valid_p, load, init
1742 now return bool, not int. All uses changed.
1743 * image.c: Omit unnecessary static decls.
1744 (x_create_bitmap_mask, x_build_heuristic_mask):
1745 Return void, not int, since callers don't care about the return value.
1746 (x_create_bitmap_mask, define_image_type, valid_image_p)
1747 (struct image_keyword, parse_image_spec, image_spec_value)
1748 (check_image_size, image_background)
1749 (image_background_transparent, x_clear_image_1)
1750 (postprocess_image, lookup_image, x_check_image_size)
1751 (x_create_x_image_and_pixmap, xbm_image_p)
1752 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1753 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1754 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1755 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1756 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1757 (png_image_p, init_png_functions, png_load_body, png_load)
1758 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1759 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1760 (init_gif_functions, gif_load, imagemagick_image_p)
1761 (imagemagick_load_image, imagemagick_load, svg_image_p)
1762 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1763 (gs_load):
1764 * nsimage.m (ns_load_image):
1765 * nsterm.m (ns_defined_color):
1766 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1767 * xfns.c (x_defined_color):
1768 * xterm.c (x_alloc_lighter_color_for_widget)
1769 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1770 (x_alloc_lighter_color):
1771 * indent.c (disptab_matches_widthtab, current_column)
1772 (scan_for_column, string_display_width, indented_beyond_p)
1773 (compute_motion, vmotion, Fvertical_motion):
1774 Use bool for booleans.
1775
1776 2012-09-24 Chong Yidong <cyd@gnu.org>
1777
1778 * chartab.c (Fset_char_table_default): Obsolete function removed.
1779
1780 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1781
1782 Move pid_t related decls out of lisp.h.
1783 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1784 (interruptible_wait_for_termination):
1785 Move these decls from lisp.h to syswait.h, since they use pid_t.
1786 Needed on FreeBSD; see Herbert J. Skuhra in
1787 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1788 * callproc.c: Include syswait.h.
1789
1790 gnutls.c, gtkutil.c: Use bool for boolean.
1791 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1792 (emacs_gnutls_handle_error):
1793 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1794 (xg_hide_tooltip, xg_create_frame_widgets)
1795 (create_dialog, xg_uses_old_file_dialog)
1796 (xg_get_file_with_chooser, xg_get_file_with_selection)
1797 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1798 (xg_item_label_same_p, xg_update_menubar)
1799 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1800 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1801 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1802 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1803 (update_frame_tool_bar, free_frame_tool_bar):
1804 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1805 * nsmenu.m (ns_update_menubar):
1806 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1807 * xfns.c (Fx_show_tip) [USE_GTK]:
1808 Use bool for boolean.
1809 * gtkutil.c (xg_update_frame_menubar):
1810 * xmenu.c (update_frame_menubar):
1811 Return void, not int, since caller ignores return value.
1812 * gtkutil.c (xg_change_toolbar_position):
1813 Return void, not 1.
1814
1815 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1816
1817 * makefile.w32-in (BLOCKINPUT_H): Remove.
1818 (SYSSIGNAL_H): New macro.
1819 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1820 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1821 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1822 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1823 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1824 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1825 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1826 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1827 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1828 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1829 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1830 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1831 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1832 ($(BLD)/w32xfns.$(O)): Update dependencies.
1833
1834 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1835
1836 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1837 fatal_error_backtrace.
1838
1839 * w32proc.c (sys_kill): Undo last change: don't do anything when
1840 invoked to deliver SIGABRT to our own process. This is now
1841 handled by emacs_raise.
1842
1843 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1844
1845 * w32term.c (w32_read_socket): Remove leftover reference to
1846 interrupt_input_pending.
1847
1848 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1849
1850 Do not use SA_NODEFER.
1851 Problem reported by Dani Moncayo in
1852 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1853 * alloc.c (die):
1854 * sysdep.c (emacs_abort): Do not reset signal handler.
1855 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1856 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1857 wanted even on POSIXish hosts, and it doesn't work on Windows.
1858
1859 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1860
1861 * xterm.c (x_term_init): Call fixup_locale before and after calling
1862 gtk_init (Bug#12392).
1863
1864 2012-09-23 Chong Yidong <cyd@gnu.org>
1865
1866 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1867 Vdynamic_library_alist.
1868
1869 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1870 (Fgnutls_available_p): Caller changed.
1871
1872 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1873 (Flibxml_parse_xml_region): Likewise.
1874
1875 * dispextern.h (struct image_type): Remove arg from init function.
1876
1877 * image.c (Finit_image_library, lookup_image_type)
1878 (define_image_type): Remove now-unneeded second arg.
1879 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1880 (init_tiff_functions, init_gif_functions, init_svg_functions):
1881 Arglist and w32_delayed_load calling convention changed.
1882 (gs_type): Remove init_gs_functions; there is no such function.
1883 (valid_image_p, make_image): Fix caller to lookup_image_type.
1884
1885 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1886
1887 Simplify and avoid signal-handling races (Bug#12471).
1888 * alloc.c (die):
1889 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1890 Avoid recursive loop if there's a fatal error in the function itself.
1891 * atimer.c (pending_atimers):
1892 * blockinput.h: Don't include "atimer.h"; no longer needed.
1893 (interrupt_input_pending): Remove. All uses removed.
1894 pending_signals now counts both atimers and ordinary interrupts.
1895 This is less racy than having three separate pending-signal flags.
1896 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1897 (input_blocked_p):
1898 Rename from their upper-case counterparts BLOCK_INPUT,
1899 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1900 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1901 This makes it easier to access volatile variables more accurately.
1902 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1903 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1904 that's more reliable if the code is buggy and sets
1905 interrupt_input_blocked to a negative value. All uses changed.
1906 * atimer.c (deliver_alarm_signal):
1907 Remove. No need to deliver this to the parent; any thread can
1908 handle this signal now. All uses replaced by underlying handler.
1909 * atimer.c (turn_on_atimers):
1910 * dispnew.c (handle_window_change_signal):
1911 * emacs.c (handle_danger_signal):
1912 * keyboard.c (kbd_buffer_get_event):
1913 Don't reestablish signal handler; not needed with sigaction.
1914 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1915 (UNBLOCK_INPUT_TO):
1916 Rework to avoid unnecessary accesses to volatile variables.
1917 (UNBLOCK_INPUT_TO): Now a function.
1918 (totally_unblock_input, unblock_input): New decls.
1919 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1920 (init_data): Remove. Necessary stuff now done in init_signal.
1921 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1922 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1923 (fatal_error_code): Remove; no longer needed.
1924 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1925 it doesn't always backtrace. All uses changed. No need to reset
1926 signal to default, since sigaction and/or die does that for us now.
1927 Use emacs_raise (FOO), not kill (getpid (), FOO).
1928 (main): Check more-accurately whether we're dumping.
1929 Move fatal-error setup to sysdep.c
1930 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1931 * gtkutil.c (xg_get_file_name, xg_get_font):
1932 Remove no-longer-needed signal-mask manipulation.
1933 * keyboard.c, process.c (POLL_FOR_INPUT):
1934 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1935 * keyboard.c (read_avail_input): Remove.
1936 All uses replaced by gobble_input.
1937 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1938 (kbd_buffer_store_event_hold, gobble_input):
1939 (record_asynch_buffer_change) [USABLE_SIGIO]:
1940 (store_user_signal_events):
1941 No need to mess with signal mask.
1942 (gobble_input): If blocking input and there are terminals, simply
1943 set pending_signals to 1 and return. All hooks changed to not
1944 worry about whether input is blocked.
1945 (process_pending_signals): Clear pending_signals before processing
1946 them, in case a signal comes in while we're processing.
1947 By convention callers now test pending_signals before calling us.
1948 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1949 New functions, to support changes to blockinput.h.
1950 (handle_input_available_signal): Now extern.
1951 (reinvoke_input_signal): Remove. All uses replaced by
1952 handle_async_input.
1953 (quit_count): Now volatile, since a signal handler uses it.
1954 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1955 All callers changed. Block SIGINT only if not already blocked.
1956 Clear sigmask reliably, even if Fsignal returns, which it can.
1957 Omit unnecessary accesses to volatile var.
1958 (quit_throw_to_read_char): No need to restore sigmask.
1959 * keyboard.c (gobble_input, handle_user_signal):
1960 * process.c (wait_reading_process_output):
1961 Call signal-handling code rather than killing ourselves.
1962 * lisp.h: Include <float.h>, for...
1963 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1964 (pending_signals): Now volatile.
1965 (syms_of_data): Now const if IEEE floating point.
1966 (handle_input_available_signal) [USABLE_SIGIO]:
1967 (terminate_due_to_signal, record_child_status_change): New decls.
1968 * process.c (create_process): Avoid disaster if memory is exhausted
1969 while we're processing a vfork, by tightening the critical section
1970 around the vfork.
1971 (send_process_frame, process_sent_to, handle_pipe_signal)
1972 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1973 ignores SIGPIPE.
1974 (send_process): No need for setjmp/longjmp any more, since the
1975 SIGPIPE stuff is now gone. Instead, report an error if errno
1976 is EPIPE.
1977 (record_child_status_change): Now extern. PID and W are now args.
1978 Return void, not bool. All callers changed.
1979 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1980 Remove. All uses removed. This bug should be fixed now in a
1981 different way.
1982 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1983 and record the child status change directly. This avoids the
1984 need to futz with the signal mask.
1985 (process_fatal_action): Move here from emacs.c.
1986 (emacs_sigaction_flags): New function, containing
1987 much of what used to be in emacs_sigaction_init.
1988 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1989 caught by emacs, to make races less likely.
1990 (deliver_process_signal): Rename from handle_on_main_thread.
1991 All uses changed.
1992 (BACKTRACE_LIMIT_MAX): Now at top level.
1993 (thread_backtrace_buffer, threadback_backtrace_pointers):
1994 New static vars.
1995 (deliver_thread_signal, deliver_fatal_thread_signal):
1996 New functions, for more-accurate delivery of thread-specific signals.
1997 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1998 (deliver_arith_signal): Handle in this thread, not
1999 in the main thread, since it's triggered by this thread.
2000 (maybe_fatal_sig): New function.
2001 (init_signals): New arg DUMPING so that we can be more accurate
2002 about whether we're dumping. Caller changed.
2003 Treat thread-specific signals differently from process-general signals.
2004 Block all signals while handling fatal error; that's safer.
2005 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2006 on IEEE hosts.
2007 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2008 Ignore SIGPIPE unless batch.
2009 (emacs_backtrace): Output backtrace for the appropriate thread,
2010 which is not necessarily the main thread.
2011 * syssignal.h: Include <stdbool.h>.
2012 (emacs_raise): New macro.
2013 * xterm.c (x_connection_signal): Remove; no longer needed
2014 now that we use sigaction.
2015 (x_connection_closed): No need to mess with sigmask now.
2016 (x_initialize): No need to reset SIGPIPE handler here, since
2017 init_signals does this for us now.
2018
2019 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2020
2021 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2022 background rect may be larger (Bug#12245).
2023
2024 2012-09-23 Chong Yidong <cyd@gnu.org>
2025
2026 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2027
2028 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2029
2030 * .gdbinit: Just stop at fatal_error_backtrace.
2031 See Stefan Monnier's request in
2032 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2033 Remove no-longer-used query of system type.
2034
2035 2012-09-22 Chong Yidong <cyd@gnu.org>
2036
2037 * search.c (Freplace_match): Doc fix (Bug#12325).
2038
2039 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2040
2041 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2042 (Fline_end_position): Doc fix.
2043
2044 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2045
2046 2012-09-22 Chong Yidong <cyd@gnu.org>
2047
2048 * dispextern.h (struct image_type): Add new slot, storing a type
2049 initialization function.
2050
2051 * image.c (define_image_type): Call the image initializer function
2052 if it is defined. Arguments and return value changed.
2053 (valid_image_p, make_image): Callers changed.
2054 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2055 (gif_type, imagemagick_type, svg_type, gs_type):
2056 Add initialization functions.
2057 (Finit_image_library): Call lookup_image_type.
2058 (CHECK_LIB_AVAILABLE): Macro deleted.
2059 (lookup_image_type): Call define_image_type here, rather than via
2060 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2061 (syms_of_image): Move define_image_type calls for xbm_type and
2062 pbm_type to lookup_image_type.
2063
2064 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2065
2066 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2067 'idle_timers' from here ...
2068 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2069 lists, to avoid infloops when the timer does something stupid,
2070 like reinvoke itself with the same or smaller time-out.
2071 (Bug#12447)
2072
2073 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2074
2075 * window.c (Fsplit_window_internal): Handle only Qt value of
2076 Vwindow_combination_limit separately.
2077 (Qtemp_buffer_resize): New symbol.
2078 (Vwindow_combination_limit): New default value.
2079 Rewrite doc-string.
2080
2081 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2082
2083 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2084 the new overlay string. (Bug#10159)
2085
2086 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2089 or that fprintf is async-signal-safe. POSIX doesn't require
2090 either assumption.
2091
2092 2012-09-22 Chong Yidong <cyd@gnu.org>
2093
2094 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2095 (Bug#8207).
2096
2097 2012-09-22 Kenichi Handa <handa@gnu.org>
2098
2099 * composite.c (composition_reseat_it): Handle the case that a
2100 grapheme cluster is not covered by a single font (Bug#12352).
2101
2102 2012-09-21 Chong Yidong <cyd@gnu.org>
2103
2104 * image.c (define_image_type): Avoid adding duplicate types to
2105 image_types (Bug#12463). Suggested by Jörg Walter.
2106
2107 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2108
2109 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2110 (print_load_command_name): Add case LC_DATA_IN_CODE.
2111 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2112
2113 2012-09-21 Glenn Morris <rgm@gnu.org>
2114
2115 * eval.c (Frun_hook_with_args_until_success)
2116 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2117
2118 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2119
2120 * fileio.c (Ffile_selinux_context): Only call freecon when
2121 lgetfilecon succeeded.
2122 (Fset_file_selinux_context): Likewise. (Bug#12444)
2123
2124 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2125
2126 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2127 reordering, locate the cursor by calling set_cursor_from_row; if
2128 that fails, clear the desired glyph matrix before returning a
2129 failure indication to the caller. Fixes leaving garbled display
2130 when fast scrolling with a down-key. (Bug#12403)
2131 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2132 scrolling through multibyte text.
2133
2134 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2135
2136 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2137 calling mark_vectorlike since that's the one that marks the window.
2138 (mark_discard_killed_buffers): Mark the final cdr.
2139 * window.h (struct window): Move prev/next_buffers to the
2140 non-standard fields.
2141 * window.c (make_window): Initialize prev/next_buffers manually.
2142
2143 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 Omit unused arg EXPECTED from socket hooks.
2146 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2147 * nsterm.m (ns_term_init):
2148 * termhooks.h (struct terminal.read_socket_hook):
2149 * w32inevt.c (w32_console_read_socket):
2150 * w32term.c (w32_read_socket):
2151 * xterm.c (XTread_socket):
2152 Omit unused arg EXPECTED. All callers changed.
2153 (store_user_signal_events): Return void, not int, since callers no
2154 longer care about the return value. All uses changed.
2155
2156 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2157
2158 * w32gui.h (XParseGeometry): Do not declare.
2159
2160 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2161
2162 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2163 Ignore 'expected'. See Eli Zaretskii in
2164 <http://bugs.gnu.org/12471#8> (last line).
2165
2166 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2167 (XParseGeometry): Now static. Substitute extremal values for
2168 values that are out of range.
2169
2170 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2171
2172 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2173
2174 * nsfns.m (XParseGeometry): Remove.
2175 (Fx_create_frame): Call x_set_offset to correctly interpret
2176 top_pos in geometry.
2177
2178 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2179 (Fx_parse_geometry): If there is a space in string, call
2180 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2181
2182 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2183
2184 * search.c (scan_buffer): Use character positions in calls to
2185 region_cache_forward and region_cache_backward, not byte
2186 positions. (Bug#12196)
2187
2188 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2189 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2190
2191 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2192 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2193 emacs_blocked_malloc, now deleted.
2194
2195 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2196
2197 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2198 The workaround was for improving performance on Solaris 2.4, but
2199 is getting in the way now. Emacs will still work if someone is
2200 still running Solaris 2.4 in a museum somewhere; Sun dropped
2201 support for Solaris 2.4 in 2003.
2202 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2203 * process.c (create_process) [HAVE_WORKING_VFORK]:
2204 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2205 since Emacs no longer uses vfork on that platform.
2206
2207 2012-09-17 Glenn Morris <rgm@gnu.org>
2208
2209 * emacs.c: Use COPYRIGHT.
2210
2211 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2212
2213 Remove configure's --without-sync-input option (Bug#12450).
2214 When auditing signal-handling in preparation for cleaning it up,
2215 I found that SYNC_INPUT has race conditions and would be a real
2216 pain to fix. Since it's an undocumented and deprecated
2217 configure-time option, now seems like a good time to remove it.
2218 Also see <http://bugs.gnu.org/11080#16>.
2219 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2220 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2221 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2222 (malloc_hysteresis):
2223 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2224 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2225 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2226 (dont_register_blocks, bytes_used_when_reconsidered)
2227 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2228 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2229 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2230 Remove. All uses removed.
2231 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2232 implementation, one that depends on whether the new macro
2233 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2234 is defined.
2235 * atimer.c (run_timers, handle_alarm_signal):
2236 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2237 (handle_async_input, process_pending_signals)
2238 (handle_input_available_signal, init_keyboard):
2239 * nsterm.m (ns_read_socket):
2240 * process.c (wait_reading_process_output):
2241 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2242 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2243 (emacs_write):
2244 * xterm.c (XTread_socket):
2245 Assume SYNC_INPUT.
2246 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2247 * eval.c (handling_signal): Remove. All uses removed.
2248 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2249 All uses replaced with the SYNC_INPUT version.
2250 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2251 Remove decls.
2252 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2253 Now static.
2254
2255 * font.c (Ffont_shape_gstring): Remove unused local.
2256
2257 2012-09-16 Glenn Morris <rgm@gnu.org>
2258
2259 * Makefile.in (clean): No longer run nextstep's clean.
2260
2261 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2262 (ns_frag): Remove.
2263 (ns-app): Move here from ns.mk, and simplify.
2264 (clean): Simplify nextstep entry.
2265 * ns.mk: Remove file.
2266
2267 2012-09-17 Kenichi Handa <handa@gnu.org>
2268
2269 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2270 not covert the last few charactes.
2271
2272 2012-09-16 Kenichi Handa <handa@gnu.org>
2273
2274 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2275 here, but just check the validity of glyphs in the glyph-string.
2276
2277 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2278
2279 * window.c (Fwindow_parameter, Fset_window_parameter):
2280 Accept any window as argument (Bug#12452).
2281
2282 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2283
2284 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2285 to ns_term_init to avoid memory leak.
2286
2287 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2288 explicit retain/release.
2289 (ns_term_init): Only allow one display. Initialize outerpool and
2290 ns_*_types.
2291
2292 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2295 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2296 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2297 the Microsoft problem in a different way, by altering ../nt/config.nt.
2298
2299 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2300
2301 * w32xfns.c:
2302 * w32uniscribe.c:
2303 * w32term.c:
2304 * w32select.c:
2305 * w32reg.c:
2306 * w32proc.c:
2307 * w32menu.c:
2308 * w32inevt.c:
2309 * w32heap.c:
2310 * w32font.c:
2311 * w32fns.c:
2312 * w32console.c:
2313 * w32.c:
2314 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2315 by lisp.h. This completes removal of setjmp.h inclusion
2316 erroneously announced in the previous commit. (Bug#12446)
2317
2318 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2319 more accurate.
2320
2321 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2322 not defined as a macro. The latter happens on MS-Windows.
2323 (Bug#12446)
2324
2325 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2326
2327 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2328 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2329 Some instances of '#include <setjmp.h>' removed, if the
2330 only reason for the instance was because "lisp.h" was included.
2331 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2332 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2333 and _longjmp with the new symbols. Emacs already uses _setjmp if
2334 available, so this change affects only POSIXish hosts that have
2335 sigsetjmp but not _setjmp, such as some versions of Solaris and
2336 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2337 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2338 (png_load_body) [HAVE_PNG]:
2339 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2340 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2341 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2342 since PNG requires jmp_buf. This is the only exception to the
2343 general rule that we now use sys_setjmp and sys_longjmp.
2344 This exception is OK since this code does not change the signal
2345 mask or longjmp out of a signal handler.
2346
2347 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2350 Include "syssignal.h", for 'main_thread'.
2351
2352 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2353
2354 Avoid out-of-range marker position (Bug#12426).
2355 * insdel.c (replace_range, replace_range_2):
2356 Adjust markers before overlays, as suggested by comments.
2357 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2358 Remove redundant check before calling offset_intervals.
2359
2360 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2361
2362 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2363 current buffer (Bug#12387).
2364
2365 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2366
2367 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2368
2369 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2370
2371 Use a more backwards-compatible timer format (Bug#12430).
2372 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2373 vector element, not from the 4th, since PSECS is now at the end.
2374 (Fcurrent_idle_time): Doc fix.
2375
2376 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2377
2378 Function to mark objects and remove killed buffers at once.
2379 * alloc.c (discard_killed_buffers): Rename to ...
2380 (mark_discard_killed buffers) ... new name. Add marking
2381 of remaining objects. Fix comment. Adjust users.
2382 (mark_object): Do not touch frame buffer lists here.
2383 * frame.c (delete_frame): Reset frame buffer lists here.
2384
2385 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2386
2387 Better workaround for GNOME bug when --enable-gcc-warnings.
2388 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2389 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2390 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2391
2392 Simplify SIGIO usage (Bug#12408).
2393 The code that dealt with SIGIO was crufty and confusing, e.g., it
2394 played tricks like "#undef SIGIO" but these tricks were not used
2395 consistently. Simplify mostly by not #undeffing standard symbols,
2396 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2397 or not as we please) rather than "defined SIGIO" (standard symbol
2398 that we probably shouldn't #undef).
2399 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2400 Modules that need it can include it.
2401 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2402 * dispextern.h (ignore_sigio): New decl.
2403 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2404 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2405 * emacs.c (shut_down_emacs):
2406 * keyboard.c (kbd_buffer_store_event_hold):
2407 Use ignore_sigio rather than invoking 'signal' directly.
2408 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2409 for FIONREAD.
2410 (FIONREAD, SIGIO): Do not #undef.
2411 (tty_read_avail_input): Use #error rather than a syntax error.
2412 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2413 for I_PIPE, used by SETUP_SLAVE_PTY.
2414 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2415 * sysdep.c (croak): Remove; no longer needed. This bit of
2416 temporary code, with Fred N. Fish's comment that it's temporary,
2417 has been in Emacs since at least 1992!
2418 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2419 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2420 * syssignal.h (croak): Remove decl.
2421 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2422 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2423 now that we're termios-only.
2424 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2425 * term.c (dissociate_if_controlling_tty): Use #error rather than
2426 a run-time error.
2427
2428 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2429 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2430 to work around GNOME bug 683906.
2431 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2432 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2433 This works around GCC bug 54561.
2434
2435 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 More fixes for 'volatile' and setjmp/longjmp.
2438 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2439 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2440 (png_load_body) [HAVE_PNG]:
2441 (jpeg_load_body) [HAVE_JPEG]:
2442 New function, with most of the old parent function's body.
2443 (png_load) [HAVE_PNG]:
2444 (jpeg_load) [HAVE_JPEG]:
2445 Invoke the new function, to avoid longjmp munging our locals.
2446 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2447 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2448 longjmp is passed 2, as the C standard doesn't guarantee this.
2449 Instead, store the failure code into mgr->failure_code.
2450
2451 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2452
2453 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2454 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2455 (syms_of_keyboard): Remove support for unread-command-char.
2456
2457 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2458
2459 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2460 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2461 violation. (Bug#12426)
2462
2463 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2464
2465 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2466
2467 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2468
2469 * eval.c: Add `inhibit-debugger'.
2470 (Qinhibit_debugger): New symbol.
2471 (call_debugger): Bind it instead of Qdebug_on_error.
2472 (maybe_call_debugger): Test Vinhibit_debugger.
2473 (syms_of_eval): Define inhibit-debugger.
2474 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2475 (syms_of_xdisp): Remove inhibit-debug-on-message.
2476
2477 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2480 If a nonvolatile local variable is written before a _longjmp to
2481 the frame containing the variable, and is read after the _longjmp,
2482 the value read is indeterminate. Some local variables of type
2483 'struct handler' and 'struct catchtag' are used in this way, so
2484 mark each of their slots as volatile if the slot can be set before
2485 _longjmp and read afterwards.
2486 * lisp.h (struct handler): var and chosen_clause are now volatile.
2487 (struct catchtag): val, next, and pdlcount are now volatile.
2488
2489 * bidi.c (bidi_push_it, bidi_pop_it):
2490 * fns.c (copy_hash_table):
2491 * image.c (define_image_type):
2492 * keyboard.c (kbd_buffer_store_event_hold):
2493 * process.c (Fprocess_send_eof):
2494 * xfaces.c (x_create_gc) [HAVE_NS]:
2495 * xgselect.c (xg_select):
2496 Prefer assignment to memcpy when either will do.
2497
2498 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2499 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2500 time an item is removed. No need to mark this function 'inline';
2501 the compiler knows better than we do.
2502
2503 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2504
2505 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2506 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2507 to change_frame_size (Bug#12388).
2508 (windowDidResize:): Pass YES to updateFrameSize.
2509
2510 * nsterm.h: Add delay parameter to updateFrameSize.
2511
2512 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2513
2514 Discard killed buffers from deleted window and frame objects.
2515 This reduces an amount of references to killed buffers and
2516 helps GC to reclaim them faster.
2517 * alloc.c (discard_killed_buffers): New function.
2518 (mark_object): Use it for deleted windows and frames.
2519 (mark_object): If symbol's value is set up for a killed buffer
2520 or deleted frame, restore its global binding.
2521 * data.c (swap_in_global_binding): Add GC notice.
2522 (swap_in_symval_forwarding): Use convenient set_blv_where.
2523 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2524 * window.h: ... to here.
2525
2526 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2527
2528 Convenient macro to check whether the buffer is live.
2529 * buffer.h (BUFFER_LIVE_P): New macro.
2530 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2531 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2532
2533 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2534
2535 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2536 composition cases (Bug#12364).
2537
2538 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2539 overhang of succeeding glyphs overlapping box cursor.
2540
2541 * w32term.c (x_draw_glyph_string): Likewise.
2542
2543 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2544
2545 Simplify, document, and port floating-point (Bug#12381).
2546 The porting part of this patch fixes bugs on non-IEEE platforms
2547 with frexp, ldexp, logb.
2548 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2549 Now static.
2550 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2551 support, by removing commented-out code and briefly listing the
2552 C89 functions excluded. The commented-out stuff was confusing
2553 maintenance, e.g., we thought we needed cbrt but it was commented out.
2554 (logb): Remove decl; no longer needed.
2555 (isfinite): New macro, if not already supplied.
2556 (isnan): Don't replace any existing macro.
2557 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2558 are present on all C89 platforms.
2559 (Ffrexp): Do not special-case zero, as frexp does the right thing
2560 for that case.
2561 (Flogb): Do not use logb, as it doesn't have the desired meaning
2562 on hosts that use non-base-2 floating point. Instead, stick with
2563 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2564 frexp, to avoid getting an unspecified result.
2565
2566 * xdisp.c (Qinhibit_debug_on_message): Now static.
2567
2568 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2569
2570 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2571 NSBezierPath (Bug#12131).
2572
2573 2012-09-10 Chong Yidong <cyd@gnu.org>
2574
2575 * fns.c (Fdelq, Fdelete): Doc fix.
2576
2577 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2578
2579 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2580 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2581
2582 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2583
2584 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2585 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2586 Use it.
2587
2588 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2589
2590 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2591 left fringe if the window has a left margin. This avoids leaving
2592 traces of the cursor because its leftmost pixel is not drawn over.
2593
2594 * dispnew.c (update_window_line): When the left margin area of a
2595 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2596 that screen line. (Bug#12277)
2597
2598 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2599
2600 Assume C89 or later for math functions (Bug#12381).
2601 This simplifies the code, and makes it a bit smaller and faster,
2602 and (most important) makes it easier to clean up signal handling
2603 since we can stop worring about floating-point exceptions in
2604 library code. That was a problem before C89, but the problem
2605 went away many years ago on all practical Emacs targets.
2606 * data.c, image.c, lread.c, print.c:
2607 Don't include <math.h>; no longer needed.
2608 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2609 might be autoconfigured, as that never happens.
2610 * data.c (fmod):
2611 * doprnt.c (DBL_MAX_10_EXP):
2612 * print.c (DBL_DIG):
2613 Remove. C89 or later always defines these.
2614 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2615 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2616 (arith_error, domain_error, domain_error2):
2617 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2618 no longer needed -- we simply return what C returns. All uses removed.
2619 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2620 the wrapped code.
2621 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2622 Remove. All uses expanded, as these macros are no longer used
2623 more than once and are now more trouble than they're worth.
2624 (Ftan): Use tan, not sin / cos.
2625 (Flogb): Assume C89 frexp.
2626 (fmod_float): Assume C89 fmod.
2627 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2628 (init_floatfns): Remove. All uses removed.
2629
2630 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2631
2632 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2633 compositeToPoint for OSX < 10.6 (Bug#12390).
2634
2635 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2636
2637 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2638 This produces more-accurate results.
2639
2640 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2641
2642 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2643 changes (Bug#12088).
2644
2645 2012-09-08 Chong Yidong <cyd@gnu.org>
2646
2647 * syntax.c (Fstring_to_syntax): Doc fix.
2648
2649 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2650
2651 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2652 in the internal border.
2653 (x_set_window_size): Remove static variables and their usage.
2654 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2655 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2656 Remove fringe/internal border adjustment (Bug#11052).
2657 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2658 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2659 (ns_fix_rect_ibw): Remove.
2660 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2661 (ns_dumpglyphs_box_or_relief): Ditto.
2662 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2663 adjustment.
2664 (ns_dumpglyphs_image): Ditto.
2665 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2666 border adjustment.
2667 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2668 their usage. Add fringe_extended_p and its use as in other terms.
2669 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2670 scroll bar was removed.
2671 (updateFrameSize): New function.
2672 (windowDidResize): Move code to updateFrameSize and call it.
2673
2674 * nsterm.h (EmacsView): Add updateFrameSize.
2675
2676 2012-09-07 Chong Yidong <cyd@gnu.org>
2677
2678 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2679
2680 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2681
2682 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2683
2684 More signal-handler cleanup (Bug#12327).
2685 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2686 Problem introduced when merging patches. Noted by Eli Zaretskii in
2687 <http://bugs.gnu.org/12327#67>.
2688 * floatfns.c: Comment fix.
2689 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2690 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2691 and anyway the declaration is harmless even if SIGDANGER is not defined.
2692 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2693 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2694 source files not surprisingly expected syssignal.h to define, or
2695 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2696 Include <sys/ioctl.h>, for FIONREAD.
2697 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2698 This eliminates a problem whereby other files mysteriously had
2699 to include "syssignal.h" before including "systty.h" if they
2700 wanted to use "#ifdef SIGIO".
2701
2702 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2703
2704 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2705
2706 * w32.c (sigemptyset): Empty the set.
2707 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2708
2709 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2710
2711 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2712
2713 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2714 (mark_object): Likewise for frame objects.
2715
2716 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2717
2718 * syssignal.h (handle_on_main_thread): Always declare,
2719 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2720 This ports to platforms without HAVE_PTHREAD.
2721
2722 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2723
2724 Signal-handler cleanup (Bug#12327).
2725 Emacs's signal handlers were written in the old 4.2BSD style with
2726 sigblock and sigmask and so forth, and this led to some
2727 inefficiencies and confusion. Rewrite these to use
2728 pthread_sigmask etc. without copying signal sets around. Also,
2729 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2730 'signal', and instead use functions that do not attempt to take
2731 over the system name space. This patch causes Emacs's text
2732 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2733 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2734 Do not include <signal.h> or "syssignal.h", as these
2735 modules do not use signals.
2736 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2737 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2738 Do not include <signal.h>, as "syssignal.h" does that for us now.
2739 * atimer.c (sigmask_atimers): New function.
2740 (block_atimers, unblock_atimers): New functions,
2741 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2742 All uses replaced.
2743 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2744 no longer needed here.
2745 * emacs.c (main): Inspect existing signal handler with sigaction,
2746 so that there's no need to block and unblock SIGHUP.
2747 * sysdep.c (struct save_signal): New member 'action', replacing
2748 old member 'handler'.
2749 (save_signal_handlers, restore_signal_handlers):
2750 Use sigaction instead of 'signal' to save and restore.
2751 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2752 New function. All users of 'signal' modified to use set_sighandler
2753 if they're writeonly, and to use sys_signal if they're read+write.
2754 (emacs_sigaction_init, forwarded_signal): New functions.
2755 (sys_signal): Remove. All uses replaced by calls to sigaction
2756 and emacs_sigaction_init, or by direct calls to 'signal'.
2757 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2758 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2759 all uses replaced by pthread_sigmask etc. calls.
2760 * syssignal.h: Include <signal.h>.
2761 (emacs_sigaction_init, forwarded_signal): New decls.
2762 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2763 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2764 (sigmask, sys_sigmask): Remove; no longer needed.
2765 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2766 (sigblock, sigunblock, sigfree):
2767 (sigsetmask) [!defined sigsetmask]:
2768 Remove. All uses replaced by pthread_sigmask.
2769 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2770 no longer need to be replaced, and its typical old uses
2771 are now done via emacs_sigaction_init and sigaction.
2772 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2773 (sys_sigdel): Remove; unused.
2774 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2775
2776 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2777
2778 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2779 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2780
2781 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2782
2783 Explicitly mark buffer_defaults and buffer_local_symbols.
2784 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2785 mark_local_symbols here.
2786 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2787 since special buffers aren't marked here any more.
2788 (allocate_buffer): Chain new buffer with all_buffers here...
2789 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2790 not here.
2791 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2792 (syms_of_buffer): Remove staticpro of the above.
2793 (init_buffer_once): Set names for buffer_defaults and
2794 buffer_local_symbols.
2795
2796 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 Use bool for booleans in font-related modules.
2799 * font.c (font_intern_prop, font_style_to_value)
2800 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2801 (generate_otf_features, font_check_otf_features, font_check_otf)
2802 (font_match_p, font_list_entities, font_at):
2803 * fontset.c (fontset_id_valid_p, reorder_font_vector
2804 (fontset_find_font, Fset_fontset_font)
2805 (face_suitable_for_char_p) [0]:
2806 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2807 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2808 (m17n_flt_initialized, ftfont_shape_by_flt):
2809 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2810 * nsfont.m (nsfont_draw):
2811 * w32font.c (w32font_draw):
2812 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2813 Use bool for booleans.
2814 * font.h: Adjust to above API changes.
2815 (struct font, struct font_driver, struct font_driver_list):
2816 Use bool for booleans.
2817 (struct font): Remove useless member encoding_type.
2818 All users removed.
2819 * fontset.c, xftfont.c: Omit unnecessary static decls.
2820
2821 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2822
2823 * alloc.c (mark_object): Revert window marking code
2824 since it's unsafe for the Fset_window_configuration.
2825
2826 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2827
2828 Fix race conditions with signal handlers and errno (Bug#12327).
2829 Be more systematic about preserving errno whenever a signal
2830 handler returns, even if it's not in the main thread. Do this by
2831 renaming signal handlers to distinguish between signal delivery
2832 and signal handling. All uses changed.
2833 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2834 * data.c (deliver_arith_signal): Rename from arith_error.
2835 * dispnew.c (deliver_window_change_signal): Rename from
2836 window_change_signal.
2837 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2838 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2839 * keyboard.c (deliver_input_available_signal): Rename from
2840 input_available_signal.
2841 (deliver_user_signal): Rename from handle_user_signal.
2842 (deliver_interrupt_signal): Rename from interrupt_signal.
2843 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2844 (deliver_child_signal): Rename from sigchld_handler.
2845 * atimer.c (handle_alarm_signal):
2846 * data.c (handle_arith_signal):
2847 * dispnew.c (handle_window_change_signal):
2848 * emacs.c (handle_fatal_signal, handle_danger_signal):
2849 * keyboard.c (handle_input_available_signal):
2850 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2851 * process.c (handle_pipe_signal, handle_child_signal):
2852 New functions, with the actual signal-handling code taken from the
2853 original respective signal handlers, sans the sporadic attempts to
2854 preserve errno, since that's now done by handle_on_main_thread.
2855 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2856 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2857 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2858 Move to sysdep.c.
2859 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2860 Move initialization of main_thread to sysdep.c's init_signals.
2861 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2862 our usage, and simplifies the mainline code.
2863 (record_child_status_change): New static function, as a helper
2864 for handle_child_signal, and with most of the old child handler's
2865 contents.
2866 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2867 (handle_child_signal): Use the above.
2868 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2869 Moved here from emacs.c.
2870 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2871 code moved here from emacs.c's main function.
2872 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2873 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2874 This lets callers save and restore errno properly.
2875
2876 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Remove redundant or unused things here and there.
2879 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2880 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2881 * editfns.c (Fcompare_buffer_substrings): Likewise.
2882 * frame.h (struct terminal, struct font_driver_list):
2883 Remove redundant declarations.
2884 * window.h (Qleft, Qright): Likewise.
2885
2886 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2887
2888 Do not mark objects from deleted buffers, windows and frames.
2889 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2890 (mark_object): Likewise for windows and frames.
2891
2892 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2895 buffer_defaults and buffer_local_symbols as valid objects.
2896 Return special value to denote them.
2897
2898 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2899
2900 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2901 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2902 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2903 (file_name_absolute_p, Fsubstitute_in_file_name):
2904 (check_executable, check_writable, Ffile_accessible_directory_p)
2905 (Fset_file_selinux_context, Fdefault_file_modes)
2906 (Finsert_file_contents, choose_write_coding_system)
2907 (Fwrite_region, build_annotations, a_write, e_write)
2908 (Fdo_auto_save):
2909 * filelock.c (boot_time_initialized, get_boot_time)
2910 (get_boot_time_1, lock_file_1, within_one_second):
2911 * floatfns.c (in_float):
2912 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2913 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2914 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2915 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2916 * window.c (compare_window_configurations):
2917 Use bool for booleans.
2918 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2919 (Fdefault_file_modes): Now mode_t, not int, for modes.
2920 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2921 (internal_delete_file): Now returns void, not a (boolean) int,
2922 since nobody was looking at the return value.
2923 * lisp.h, window.h: Adjust to above API changes.
2924
2925 * xdisp.c (set_message): Simplify and reindent last change.
2926
2927 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2928
2929 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2930
2931 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2932
2933 * eval.c (call_debugger): Make the function non-static so that we
2934 can call it from set_message.
2935
2936 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2937 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2938
2939 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2940
2941 Give more-useful info on a fatal error (Bug#12328).
2942 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2943 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2944 of doing the work ourselves.
2945 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2946 do most of the work.
2947 (fatal_error_backtrace): New function, taken from the guts
2948 of the old fatal_error_signal, but with a new option to output
2949 a backtrace.
2950 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2951 info about the signal than just its number.
2952 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2953 * sysdep.c: Include <execinfo.h>
2954 (emacs_backtrace): New function, taken partly from the previous
2955 code of the 'die' function.
2956 (emacs_abort): Call fatal_error_backtrace rather than abort.
2957
2958 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2959
2960 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2961 eager (load-time) macro-expansion.
2962 * lisp.mk (lisp): Add macroexp.
2963
2964 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2965
2966 Simplify redefinition of 'abort' (Bug#12316).
2967 Do not try to redefine the 'abort' function. Instead, redo
2968 the code so that it calls 'emacs_abort' rather than 'abort'.
2969 This removes the need for the NO_ABORT configure-time macro
2970 and makes it easier to change the abort code to do a backtrace.
2971 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2972 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2973 Remove; sysdep.c's emacs_abort now takes its place.
2974 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2975 'abort' changed to use 'emacs_abort'.
2976 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2977 (abort) [!defined abort]: Rename to ...
2978 (emacs_abort): ... new name.
2979 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2980 the place of the old 'abort' in emacs.c.
2981 * w32.c, w32fns.c (abort): Do not #undef.
2982 * w32.c (emacs_abort): Rename from w32_abort.
2983
2984 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2985
2986 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2987 offsets[j].dv, since the y axis of the screen coordinates points
2988 down, while the y axis of the font definition coordinates points
2989 up. This fixes display of Arabic diacritics such as KASRA and
2990 KASRATAN. (Bug#11860)
2991
2992 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 Be more systematic about _setjmp vs setjmp.
2995 * alloc.c (test_setjmp, mark_stack):
2996 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2997 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2998 (png_load, my_error_exit, jpeg_load):
2999 * process.c (send_process_trap, send_process):
3000 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3001 The underscored versions are up to 30x faster on some hosts.
3002 Formerly, the code used setjmp+longjmp sometimes and
3003 _setjmp+_longjmp at other times, with no particular reason to
3004 prefer setjmp+longjmp.
3005
3006 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3007
3008 Fix minor problem found by static checking.
3009 * buffer.c (Fdelete_all_overlays): Return nil.
3010
3011 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3012
3013 * buffer.c (Fdelete_all_overlays): New function.
3014
3015 2012-09-03 Chong Yidong <cyd@gnu.org>
3016
3017 * gtkutil.c: Add extern decl for Qxft.
3018
3019 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 * emacs.c, eval.c: Use bool for boolean.
3022 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3023 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3024 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3025 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3026 (main, decode_env_path, Fdaemon_initialized):
3027 * eval.c (call_debugger, Finteractive_p, interactive_p):
3028 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3029 (maybe_call_debugger, Fbacktrace):
3030 * process.c (read_process_output, exec_sentinel):
3031 Use bool for booleans.
3032 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3033 All callers changed.
3034 * eval.c (interactive_p): Omit always-true boolean argument
3035 EXCLUDE_SUBRS_P. All callers changed.
3036 * dispextern.h, lisp.h: Reflect above API changes.
3037 * firstfile.c (dummy): Use the address of 'main', whose signature
3038 won't change, instead of the address of 'initialize', whose
3039 signature just changed from int to bool.
3040 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3041 * msdos.c (fatal_error_in_progress): ... from here.
3042 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3043 of incrementing it.
3044 (redisplay_internal, unwind_redisplay): Simply clear
3045 REDISPLAYING_P when unwinding, instead of saving its previous,
3046 always-false value and then restoring it.
3047
3048 Clean up some extern decls.
3049 Mostly, this hoists extern decls out of .c files and into .h files.
3050 That way, we're more likely to catch errors if the interfaces change.
3051 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3052 declare xg_mark_data.
3053 * dispextern.h (x_frame_parm_handlers):
3054 * font.h (Qxft):
3055 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3056 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3057 (Qultra_bold, Qoblique, Qitalic):
3058 Move extern decl here from .c file.
3059 * alloc.c (xg_mark_data) [USE_GTK]:
3060 * doc.c (Qclosure):
3061 * eval.c (Qlexical_binding):
3062 * fns.c (time) [!HAVE_UNISTD_H]:
3063 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3064 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3065 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3066 * lread.c (Qinternal_interpreter_environment):
3067 * minibuf.c (Qbuffer):
3068 * process.c (QCfamily, QCfilter):
3069 * widget.c (free_frame_faces):
3070 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3071 * xfont.c (x_clear_errors):
3072 * xterm.c (x_frame_parm_handlers):
3073 Remove now-redundant extern decls.
3074 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3075 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3076 Now static.
3077 * xfaces.c: Remove unnecessary static decls.
3078 * xterm.c (updating_frame): Remove decl of nonexistent object.
3079
3080 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3081 when building globals.h, as the objects that are not built on
3082 this host are not needed to compile C files on this host.
3083
3084 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3085
3086 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3087
3088 * frame.h: Add missing prototype for x_wm_set_size_hint.
3089
3090 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3093 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3094 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3095 (Fsubstitute_command_keys):
3096 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3097 (save_excursion_save, save_excursion_restore)
3098 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3099 (format_time_string, general_insert_function)
3100 (make_buffer_string, make_buffer_string_both)
3101 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3102 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3103 (copy_text, insert_1, insert_1_both, insert_from_string)
3104 (insert_from_string_before_markers, insert_from_string_1)
3105 (insert_from_buffer, insert_from_buffer_1, replace_range)
3106 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3107 (del_range_2, modify_region):
3108 * intervals.c (intervals_equal, balance_possible_root_interval)
3109 (adjust_intervals_for_insertion, merge_properties_sticky)
3110 (graft_intervals_into_buffer, lookup_char_property)
3111 (adjust_for_invis_intang, set_point_both)
3112 (get_property_and_range, compare_string_intervals)
3113 (set_intervals_multibyte_1, set_intervals_multibyte):
3114 * keyboard.c (decode_timer):
3115 Use bool for boolean.
3116 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3117 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3118
3119 2012-09-02 Chong Yidong <cyd@gnu.org>
3120
3121 * keymap.c (push_key_description): Print M-TAB as C-M-i
3122 (Bug#11758).
3123
3124 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3125
3126 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3127 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3128 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3129 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3130 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3131 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3132 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3133
3134 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3135
3136 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3137 more than one grapheme cluster passed to the shaper: compute the
3138 offset adjustment values separately for each cluster. (Bug#11860)
3139
3140 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3141 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3142 about implicit conversions from integer to pointer.
3143
3144 2012-09-01 Daniel Colascione <dancol@dancol.org>
3145
3146 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3147 system used too early.
3148
3149 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 Better seed support for (random).
3152 * emacs.c (main): Call init_random.
3153 * fns.c (Frandom): Set the seed from a string argument, if given.
3154 Remove long-obsolete Gentzel cruft.
3155 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3156 (init_random): New function.
3157
3158 2012-09-01 Daniel Colascione <dancol@dancol.org>
3159
3160 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3161 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3162 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3163 x_wm_set_size_hint, x_query_colors, x_real_positions,
3164 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3165 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3166 all of which have been moved to common code.
3167
3168 * xfaces.c: Include TERM_HEADER instead of listing all possible
3169 window-system headers.
3170
3171 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3172 to match header.
3173
3174 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3175 directly accessing frame internals.
3176
3177 * w32font.h: Include font.h. Define syms_of_w32font and
3178 globals_of_w32font.
3179
3180 * process.c: Include TERM_HEADER instead of listing all possible
3181 window-system headers.
3182
3183 * nsterm.h: Remove declarations now in frame.h.
3184 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3185
3186 * menu.c: Include TERM_HEADER instead of listing all possible
3187 window-system headers.
3188
3189 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3190 window system.
3191
3192 * keyboard.c: Include TERM_HEADER instead of listing all possible
3193 window-system headers.
3194
3195 * image.c: Include TERM_HEADER instead of listing all possible
3196 window-system headers. Declare Vlibrary_cache when compiling for
3197 Windows.
3198
3199 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3200 window system declarations.
3201
3202 * frame.h: Move common functions here: set_frame_menubar,
3203 x_set_window_size, x_sync, x_get_focus_frame,
3204 x_set_mouse_position, x_set_mouse_pixel_position,
3205 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3206 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3207 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3208 x_activate_menubar, x_real_positions, x_bitmap_icon,
3209 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3210 and x_query_colors.
3211
3212 * frame.c: Include TERM_HEADER instead of listing all possible
3213 window-system headers.
3214
3215 * font.c: Include TERM_HEADER instead of listing all possible
3216 window-system headers.
3217
3218 * emacs.c: Include TERM_HEADER.
3219
3220 * dispnew.c: Include TERM_HEADER instead of listing all possible
3221 window-system headers.
3222
3223 * ccl.h: Include character.h.
3224
3225 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3226 the current window system; include in list of objects to link into
3227 Emacs.
3228
3229 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3230
3231 Remove mark_ttys function and fix tty_display_info initialization.
3232 * lisp.h (mark_ttys): Remove prototype.
3233 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3234 to mark_ttys because all possible values of 'top_frame' slot are
3235 the frames which are reachable from Vframe_list.
3236 * term.c (mark_ttys): Remove.
3237 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3238
3239 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3240
3241 Change struct frame bitfields from unsigned char to unsigned.
3242 * frame.h (struct frame): Change type of 'display_preempted',
3243 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3244 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3245 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3246 bitfields from unsigned char to unsigned.
3247
3248 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3249
3250 Remove unused member of struct x_output and struct w32_output.
3251 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3252 * w32term.h (struct w32_output): Likewise.
3253
3254 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3255
3256 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3257 does not become zero (Bug#12234).
3258
3259 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3262 for GCC 4.7.1 x86-64.
3263
3264 2012-08-30 Glenn Morris <rgm@gnu.org>
3265
3266 * lread.c (init_lread): For out-of-tree builds, only add the
3267 source directory's site-lisp dir to the load-path if it exists,
3268 consistent with in-tree builds. (Bug#12302)
3269
3270 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3271
3272 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3273 button_values to NULL. Call setStykeMask so dialogs get a close button.
3274 (windowShouldClose:): Set window_closed.
3275 (dealloc): New member, free button_values.
3276 (process_dialog:): Make member function. Remove window argument,
3277 replace window with self. Count buttons and allocate and store values
3278 in button_values.
3279 (addButton:value:row:): value is int with the name tag. Call setTag
3280 with tag. Remove return self, declare return value as void.
3281 (addString:row:): Remove return self, declare return value as void.
3282 (addSplit): Remove return self, declare return value as void.
3283 (clicked:): Remove return self, declare return value as void.
3284 Set dialog_return to button_values[seltag]. Code formatting change.
3285 (initFromContents:isQuestion:): Adjust call to process_dialog.
3286 Code formatting change.
3287 (timeout_handler:): Set timer_fired to YES.
3288 (runDialogAt:): Set timer_fired to NO.
3289 Handle click on close button as quit.
3290
3291 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3292 Add window_closed and button_values. Add void as return value for
3293 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3294 Add process_dialog as new member.
3295
3296 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3297
3298 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3299 is not one of the heaps we manage. (Bug#12242)
3300
3301 2012-08-28 Glenn Morris <rgm@gnu.org>
3302
3303 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3304
3305 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3306
3307 * window.c (Fset_window_configuration): Remove handling of
3308 auto-buffer-name window parameter. Install revision of reverted
3309 fix.
3310
3311 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3312
3313 Do not allow to set major mode for a dead buffer.
3314 * buffer.c (Fset_buffer_major_mode): Signal an error
3315 if the buffer is dead.
3316 (Fother_buffer, other_buffer_safely): Remove redundant
3317 nested declaration.
3318
3319 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3320
3321 Always use set_buffer_if_live to restore original buffer at unwind.
3322 * buffer.h (record_unwind_current_buffer): New function.
3323 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3324 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3325 * undo.c, window.c: Adjust users.
3326 * buffer.c (set_buffer_if_live): Fix comment.
3327
3328 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3329
3330 Fix usage of set_buffer_internal.
3331 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3332 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3333 * coding.c (decode_coding): Omit redundant test.
3334 * fileio.c (decide_coding_unwind): Likewise.
3335 * fns.c (secure_hash): Likewise.
3336 * insdel.c (modify_region): Likewise.
3337 * keyboard.c (command_loop_1): Likewise.
3338 * print.c (PRINTFINISH): Likewise.
3339 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3340
3341 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3342
3343 * dispnew.c: Use bool for boolean.
3344 (frame_garbaged, display_completed, delayed_size_change)
3345 (fonts_changed_p, add_window_display_history)
3346 (add_frame_display_history, verify_row_hash)
3347 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3348 (row_equal_p, realloc_glyph_pool)
3349 (allocate_matrices_for_frame_redisplay)
3350 (showing_window_margins_p)
3351 (adjust_frame_glyphs_for_frame_redisplay)
3352 (build_frame_matrix_from_leaf_window, make_current)
3353 (mirrored_line_dance, mirror_line_dance, update_frame)
3354 (update_window_tree, update_single_window)
3355 (check_current_matrix_flags, update_window, update_text_area)
3356 (update_window_line, set_window_update_flags, scrolling_window)
3357 (update_frame_1, scrolling, buffer_posn_from_coords)
3358 (do_pending_window_change, change_frame_size)
3359 (change_frame_size_1, sit_for):
3360 Use bool for boolean.
3361 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3362 and remove last int (actually boolean) argument, which was always 0.
3363 All callers changed.
3364 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3365 * dispextern.h (struct composition_it): Use bool for boolean.
3366 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3367 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3368 * dired.c (file_name_completion):
3369 Use bool for boolean. (This was missed in an earlier change.)
3370
3371 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3372
3373 * window.c (Fset_window_configuration): Revert first part of
3374 last change.
3375
3376 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3377
3378 * nsterm.h (NSPanel): New class variable dialog_return.
3379
3380 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3381 Initialize dialog_return.
3382 (windowShouldClose:): Use stop instead of stopModalWithCode.
3383 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3384 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3385 event.
3386 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3387 modal loop returns.
3388
3389 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3390
3391 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3392 * composite.c (find_composition, composition_gstring_p)
3393 (composition_reseat_it, find_automatic_composition):
3394 * data.c (let_shadows_buffer_binding_p)
3395 (let_shadows_global_binding_p, set_internal, make_blv)
3396 (Fmake_variable_buffer_local, Fmake_local_variable)
3397 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3398 (cons_to_signed, arith_driver):
3399 * dbusbind.c (xd_in_read_queued_messages):
3400 * dired.c (directory_files_internal, file_name_completion):
3401 Use bool for booleans.
3402 * dired.c (file_name_completion):
3403 * process.h (fd_callback):
3404 Omit int (actually boolean) argument. It wasn't being used.
3405 All uses changed.
3406 * composite.h, lisp.h: Reflect above API changes.
3407
3408 * cmds.c, coding.c: Use bool for booleans.
3409 * cmds.c (move_point, Fself_insert_command):
3410 * coding.h (struct composition status, struct coding_system):
3411 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3412 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3413 (emacs_mule_char, decode_coding_emacs_mule)
3414 (encode_coding_emacs_mule, detect_coding_iso_2022)
3415 (decode_coding_iso_2022, encode_invocation_designation)
3416 (encode_designation_at_bol, encode_coding_iso_2022)
3417 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3418 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3419 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3420 (encode_coding_raw_text, detect_coding_charset)
3421 (decode_coding_charset, encode_coding_charset, detect_eol)
3422 (detect_coding, get_translation_table, produce_chars)
3423 (consume_chars, reused_workbuf_in_use)
3424 (make_conversion_work_buffer, code_conversion_save)
3425 (decode_coding_object, encode_coding_object)
3426 (detect_coding_system, char_encodable_p)
3427 (Funencodable_char_position, code_convert_region)
3428 (code_convert_string, code_convert_string_norecord)
3429 (Fset_coding_system_priority):
3430 * fileio.c (Finsert_file_contents):
3431 Use bool for booleans.
3432 * coding.h, lisp.h: Reflect above API changes.
3433 * coding.c: Remove unnecessary static function decls.
3434 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3435 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3436 not a boolean 'int', since callers never look at the return value.
3437 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3438 * coding.h (decoding_buffer_size, encoding_buffer_size)
3439 (emacs_mule_string_char): Remove unused extern decls.
3440 (struct iso_2022_spec, struct coding_system):
3441 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3442 (struct emacs_mule_spec): Remove unused field 'full_support'.
3443 All initializations removed.
3444 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3445
3446 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3447
3448 Fix spare memory change (Bug#12286).
3449 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3450 (valid_lisp_object_p): Likewise.
3451
3452 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3453
3454 * window.c (Fset_window_configuration): Record any window's old
3455 buffer if it's replaced (see Bug#8789). If the new current
3456 buffer doesn't appear in the selected window, go to its old
3457 point (Bug#12208).
3458
3459 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3460
3461 Special MEM_TYPE_SPARE to denote reserved memory.
3462 * alloc.c (enum mem_type): New memory type.
3463 (refill_memory_reserve): Use new type for spare memory.
3464 This prevents live_cons_p and live_string_p from incorrect
3465 detection of uninitialized objects from spare memory as live.
3466
3467 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 Spelling fixes.
3470 * Makefile.in (.PHONY): versioclean -> versionclean.
3471
3472 Remove unused external symbols.
3473 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3474 * window.c (Qwindow_valid_p, decode_valid_window):
3475 Now static, not extern.
3476 * data.c (Qinterval): Remove; unused.
3477 (syms_of_data): Do not define 'interval'.
3478 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3479 * window.h (decode_valid_window):
3480 Remove decls.
3481
3482 * character.c, charset.c, chartab.c: Use bool for booleans.
3483 * character.c (lisp_string_width, string_count_byte8)
3484 (string_escape_byte8):
3485 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3486 (load_charset_map_from_file, map_charset_chars)
3487 (Fdefine_charset_internal, define_charset_internal)
3488 (Fdeclare_equiv_charset, find_charsets_in_text)
3489 (Ffind_charset_region, char_charset, Fiso_charset):
3490 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3491 (sub_char_table_set, sub_char_table_set_range)
3492 (char_table_set_range, optimize_sub_char_table)
3493 (map_sub_char_table):
3494 Use bool for boolean.
3495 * character.c (str_to_unibyte): Omit last boolean argument; it was
3496 always 0. All callers changed.
3497 * character.h, charset.h: Adjust to match previous changes.
3498 * character.h (char_printable_p): Remove decl of nonexistent function.
3499 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3500 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3501 are all boolean, so make them single-bit bitfields.
3502
3503 * lisp.h (ASET): Remove attempt to detect side effects.
3504 It was meant to be temporary and it often doesn't work,
3505 because when IDX has side effects the behavior of IDX==IDX
3506 is undefined. See Stefan Monnier in
3507 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3508
3509 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3510
3511 * lisp.h (functionp): New function (extracted from Ffunctionp).
3512 (FUNCTIONP): Use it.
3513 * eval.c (Ffunctionp): Use it.
3514
3515 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3516
3517 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3518 as that's faster and simpler than static storage. Don't bother
3519 with the g_main_context_query overhead if g_main_context_pending
3520 says no events are pending.
3521 (gfds, gfds_size): Remove these static vars.
3522 (xgselect_initialize): Remove; no longer needed.
3523 All uses and decls removed.
3524
3525 * emacs.c (fatal_error_signal_hook): Remove.
3526 All uses removed. This leftover from old code was always 0.
3527
3528 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3529 * casefiddle.c (casify_object, casify_region):
3530 * casetab.c (set_case_table):
3531 * category.c, category.h (word_boundary_p):
3532 * category.h (CHAR_HAS_CATEGORY):
3533 Use bool for booleans, instead of int.
3534
3535 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3536
3537 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3538
3539 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3540
3541 On assertion failure, print backtrace if available.
3542 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3543 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3544 * Makefile.in (LIB_EXECINFO): New macro.
3545 (LIBES): Use it.
3546
3547 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3548 * bytecode.c (exec_byte_code):
3549 * callint.c (check_mark, Fcall_interactively):
3550 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3551 (getenv_internal, sync_process_alive, call_process_exited):
3552 * lisp.h (USE_SAFE_ALLOCA):
3553 Use bool for booleans, instead of int.
3554 * lisp.h, process.h: Adjust prototypes to match above changes.
3555 * callint.c (Fcall_interactively): Don't assume the mark's
3556 offset fits in 'int'.
3557
3558 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3559
3560 * buffer.c, buffer.h: Use bool for boolean.
3561 * buffer.c (reset_buffer_local_variables)
3562 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3563 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3564 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3565 (overlay_touches_p, overlay_strings, Foverlay_put)
3566 (report_overlay_modification, call_overlay_mod_hooks):
3567 (mmap_enlarge, mmap_set_vars):
3568 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3569 Use bool for booleans, instead of int.
3570 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3571 since the 1-or-0 return value is always ignored anyway.
3572 (mmap_initialized_p):
3573 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3574 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3575
3576 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * bidi.c: Use bool for boolean.
3579 This is a bit more readable, and makes the text segment of bidi.o
3580 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3581 Presumably it's faster too.
3582 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3583 Now bool.
3584 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3585 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3586 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3587 (bidi_explicit_dir_char, bidi_level_of_next_char)
3588 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3589 Use bool for booleans, instead of int.
3590 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3591 (bidi_unshelve_cache): Adjust decls to match code.
3592
3593 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3594
3595 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3596 argument.
3597
3598 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3599
3600 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3601 * atimer.h: Include <stdbool.h>.
3602
3603 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3604
3605 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3606 compile time tests instead of run time tests on systems that do
3607 not use them.
3608 (FRAME_MAC_P): Remove leftover from deleted code.
3609 * frame.c (syms_of_frame): Remove leftover from deleted code.
3610
3611 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3612
3613 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3614
3615 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3618 Otherwise, the compiler complains about (A?B:C) where B is void
3619 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3620 (fontset_add): Return void, for FONTSET_ADD.
3621
3622 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3623
3624 * alloc.c: Use bool for booleans.
3625 (gc_in_progress, abort_on_gc)
3626 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3627 (dont_register_blocks) [GC_MALLOC_CHECK]:
3628 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3629 (check_string_bytes, make_specified_string, memory_full)
3630 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3631 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3632 (mark_stack, valid_pointer_p, make_pure_string)
3633 (Fgarbage_collect, survives_gc_p, gc_sweep):
3634 Use bool for booleans, instead of int.
3635 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3636 Remove unused local.
3637 * alloc.c (PURE_POINTER_P):
3638 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3639 * editfns.c (Fformat):
3640 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3641 (Fdo_auto_save):
3642 * fns.c (sweep_weak_table):
3643 * lisp.h (suppress_checking, push_message, survives_gc_p)
3644 (make_pure_string, gc_in_progress, abort_on_gc):
3645 * lread.c (readchar, read1):
3646 * print.c (Fprin1_to_string):
3647 * xdisp.c (push_message):
3648 Use bool for booleans affected directly or indirectly by
3649 alloc.c's changes.
3650
3651 Make recently-introduced setters macros.
3652 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3653 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3654 (set_fontset_default, set_fontset_fallback): Rename from their
3655 upper-case counterparts, and make them functions rather than macros.
3656 This is more consistent with the other recently-introduced setters.
3657 These don't need to be inline, since they're local.
3658
3659 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3660
3661 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3662 the loop (Bug#12247).
3663
3664 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 * lisp.h (vcopy): Use memcpy rather than our own loop.
3667 This fixes a performance regression introduced by the recent
3668 addition of vcopy. This means 'vcopy' will need to be modified
3669 for a copying collector, but that's OK. Also, tighten the
3670 checking in the assertion.
3671
3672 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3673
3674 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3675 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3676 non-base glyph for the width of the base character, according to
3677 what x_draw_composite_glyph_string_foreground expects.
3678 Generate WADJUST value according to composition_gstring_width's
3679 expectations, to produce correct width of the composed character.
3680 Reverse the sign of the DU offset produced by ScriptPlace.
3681
3682 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3683
3684 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3685
3686 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3687
3688 Avoid direct writes to contents member of struct Lisp_Vector.
3689 * lisp.h (vcopy): New function to copy data into vector.
3690 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3691 * fns.c (Ffillarray): Use ASET.
3692 * keyboard.c (timer_check_2): Use AREF and ASET.
3693 (append_tool_bar_item, Frecent_keys): Use vcopy.
3694 * lread.c (read_vector): Use ASET.
3695 * msdos.c (Frecent_doskeys): Use vcopy.
3696 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3697 (Finternal_merge_in_global_face): Use ASET and vcopy.
3698 * xfont.c (xfont_list_pattern): Likewise.
3699
3700 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3701
3702 * window.c (Fwindow_point): For the selected window always return
3703 the position of its buffer's point.
3704 (Fset_window_point): For the selected window always go in its
3705 buffer to the specified position.
3706
3707 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3708
3709 Setter macros for fontsets.
3710 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3711 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3712 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3713 Adjust users.
3714
3715 2012-08-20 Glenn Morris <rgm@gnu.org>
3716
3717 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3718 Don't assume that `ln -f' works.
3719
3720 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3721
3722 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3723 and later about non-assignments with no effect. See discussion at
3724 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3725 details.
3726
3727 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3728
3729 Inline setter functions for Lisp_Objects slots of struct specbinding.
3730 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3731 Adjust users.
3732
3733 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3734
3735 * window.c (select_window): Always make selected window's buffer
3736 current.
3737
3738 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3739
3740 Use AREF and ASET for docstrings of category tables.
3741 * category.h (CATEGORY_DOCSTRING): Use AREF.
3742 (SET_CATEGORY_DOCSTRING): Use ASET.
3743 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3744
3745 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3746
3747 Inline setter functions for hash table members.
3748 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3749 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3750 (set_hash_key_and_value, set_hash_index, set_hash_next)
3751 (set_hash_hash): New functions.
3752 * charset.c, fns.c: Adjust users.
3753
3754 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3755
3756 Inline getter and setter functions for per-buffer values.
3757 * buffer.h (per_buffer_default, set_per_buffer_default)
3758 (per_buffer_value, set_per_buffer_value): New functions.
3759 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3760 * buffer.c, data.c: Adjust users.
3761
3762 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3763
3764 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3765
3766 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 Rely on <config.h> + <unistd.h> to declare 'environ',
3769 as gnulib does this if the system doesn't.
3770 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3771 Remove declaration. MS-Windows declares it on stdlib.h which is
3772 included by conf_post.h.
3773 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3774 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3775 * vm-limit.c: Include <unistd.h>, for 'environ'.
3776
3777 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3778 (start_of_data): Remove decl; mem-limits.h provides it.
3779
3780 * xdisp.c (handle_invisible_prop): Make it a bit faster
3781 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3782
3783 2012-08-19 Chong Yidong <cyd@gnu.org>
3784
3785 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3786 ends (Bug#3874).
3787
3788 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3789
3790 * .gdbinit: Use call instead of set when calling a function in the
3791 inferior.
3792
3793 * data.c (set_internal): Don't use set_blv_found.
3794 (Fkill_local_variable): Likewise.
3795
3796 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3797
3798 * nsfont.m (ns_ascii_average_width): Ensure the string
3799 ascii_printable is initialized with a null-terminated character
3800 array. Otherwise, it can contain undesired extra characters.
3801
3802 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3803
3804 port new setting code to Sun C 5.8 2005/10/13
3805 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3806 Return void, not Lisp_Object. Otherwise, the compiler
3807 complains about (A?B:C) where B is void and C is Lisp_Object
3808 when compiling CHAR_TABLE_SET, due to the recent change to
3809 the API of sub_char_table_set_contents.
3810
3811 2012-08-18 Chong Yidong <cyd@gnu.org>
3812
3813 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3814 for the string case (Bug#3874).
3815
3816 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3817
3818 * buffer.h (BSET): Remove (Bug#12215).
3819 Replace all uses with calls to new setter functions.
3820 (bset_bidi_paragraph_direction, bset_case_canon_table)
3821 (bset_case_eqv_table, bset_directory, bset_display_count)
3822 (bset_display_time, bset_downcase_table)
3823 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3824 (bset_last_selected_window, bset_local_var_alist)
3825 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3826 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3827 (bset_width_table):
3828 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3829 (bset_auto_fill_function, bset_auto_save_file_format)
3830 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3831 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3832 (bset_cache_long_line_scans, bset_case_fold_search)
3833 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3834 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3835 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3836 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3837 (bset_header_line_format, bset_indicate_buffer_boundaries)
3838 (bset_indicate_empty_lines, bset_invisibility_spec)
3839 (bset_left_fringe_width, bset_major_mode, bset_mark)
3840 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3841 (bset_name, bset_overwrite_mode, bset_pt_marker)
3842 (bset_right_fringe_width, bset_save_length)
3843 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3844 (bset_scroll_up_aggressively, bset_selective_display)
3845 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3846 (bset_word_wrap, bset_zv_marker):
3847 * category.c (bset_category_table):
3848 * syntax.c (bset_syntax_table):
3849 New setter functions.
3850
3851 * process.h (PSET): Remove (Bug#12215).
3852 Replace all uses with calls to new setter functions.
3853 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3854 (PROCESS_INLINE): New macro.
3855 (pset_childp): New setter function.
3856 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3857 * process.c (PROCESS_INLINE):
3858 Define to EXTERN_INLINE, so that the corresponding functions
3859 are compiled into code.
3860 (pset_buffer, pset_command, pset_decode_coding_system)
3861 (pset_decoding_buf, pset_encode_coding_system)
3862 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3863 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3864 (pset_type, pset_write_queue): New setter functions.
3865
3866 * window.h (WSET): Remove (Bug#12215).
3867 Replace all uses with calls to new setter functions.
3868 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3869 (WINDOW_INLINE): New macro.
3870 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3871 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3872 (wset_total_lines, wset_vertical_scroll_bar)
3873 (wset_window_end_pos, wset_window_end_valid)
3874 (wset_window_end_vpos): New setter functions.
3875 * window.c (WINDOW_INLINE):
3876 Define to EXTERN_INLINE, so that the corresponding functions
3877 are compiled into code.
3878 (wset_combination_limit, wset_dedicated, wset_display_table)
3879 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3880 (wset_new_normal, wset_new_total, wset_next_buffers)
3881 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3882 (wset_prev_buffers, wset_right_fringe_width)
3883 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3884 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3885 (wset_window_parameters):
3886 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3887 (wset_column_number_displayed, wset_region_showing):
3888 New setter functions.
3889
3890 * termhooks.h (TSET): Remove (Bug#12215).
3891 Replace all uses with calls to new setter functions.
3892 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3893 (TERMHOOKS_INLINE): New macro.
3894 (tset_charset_list, tset_selection_alist): New setter functions.
3895 * terminal.c (TERMHOOKS_INLINE):
3896 Define to EXTERN_INLINE, so that the corresponding functions
3897 are compiled into code.
3898 (tset_param_alist): New setter function.
3899
3900 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 * keyboard.h (KSET): Remove (Bug#12215).
3903 Replace all uses with calls to new setter functions.
3904 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3905 (KEYBOARD_INLINE): New macro.
3906 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3907 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3908 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3909 New setter functions.
3910 * keyboard.c (KEYBOARD_INLINE):
3911 Define to EXTERN_INLINE, so that the corresponding functions
3912 are compiled into code.
3913 (kset_echo_string, kset_kbd_queue)
3914 (kset_keyboard_translate_table, kset_last_prefix_arg)
3915 (kset_last_repeatable_command, kset_local_function_key_map)
3916 (kset_overriding_terminal_local_map, kset_real_last_command)
3917 (kset_system_key_syms): New setter functions.
3918
3919 * frame.h (FSET): Remove (Bug#12215).
3920 Replace all uses with calls to new setter functions.
3921 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3922 (FRAME_INLINE): New macro.
3923 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3924 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3925 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3926 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3927 (fset_param_alist, fset_root_window, fset_scroll_bars)
3928 (fset_selected_window, fset_title, fset_tool_bar_items)
3929 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3930 * frame.c (FRAME_INLINE):
3931 Define to EXTERN_INLINE, so that the corresponding functions
3932 are compiled into code.
3933 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3934
3935 A few more naming-convention fixes for getters and setters.
3936 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3937 and rename from buffer_overlays_set_before.
3938 (set_buffer_overlays_after): Move here from buffer.h, and rename
3939 from buffer_overlays_set_after.
3940 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3941 All uses changed.
3942 (set_buffer_intervals): Rename from buffer_set_intervals.
3943 * intervals.c (set_interval_object): Move here from intervals.h,
3944 and rename from interval_set_object.
3945 (set_interval_left): Move here from intervals.h, and rename from
3946 interval_set_left.
3947 (set_interval_right): Move here from intervals.h, and rename from
3948 interval_set_right.
3949 (copy_interval_parent): Move here from intervals.h, and rename from
3950 interval_copy_parent.
3951 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3952 (set_interval_plist): Rename from interval_set_plist.
3953 Return void, not Lisp_Object, since no caller uses the result.
3954 * lisp.h (string_intervals): Rename from string_get_intervals.
3955 (set_string_intervals): Rename from string_set_intervals.
3956
3957 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3958 (set_char_table_contents): Rename from char_table_set_contents.
3959 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3960 All uses changed. See the end of
3961 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3962
3963 * lisp.h (CSET): Remove (Bug#12215).
3964 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3965 (set_char_table_purpose): New functions,
3966 replacing CSET. All uses changed. For example, replace
3967 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3968 "set_char_table_parent (char_table, parent);".
3969 The old version was confusing because it used the same name
3970 'parent' for two different things.
3971
3972 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3973
3974 Functions to get and set Lisp_Object fields of buffer-local variables.
3975 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3976 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3977 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3978 * data.c, eval.c, frame.c: Adjust users.
3979
3980 2012-08-17 Chong Yidong <cyd@gnu.org>
3981
3982 * xfaces.c (merge_face_vectors): If the target font specfies a
3983 font spec, make the font's attributes take precedence over
3984 directly-specified attributes.
3985 (merge_face_ref): Recognize :font.
3986
3987 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3988
3989 Do not use memcpy for copying intervals.
3990 * intervals.c (reproduce_interval): New function.
3991 (reproduce_tree, reproduce_tree_obj): Use it.
3992 (reproduce_tree_obj): Remove prototype.
3993
3994 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3995
3996 * lisp.h (duration_to_sec_usec): Remove unused decl.
3997
3998 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3999
4000 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4001 to an allocated instance of NSString, not to the class itself.
4002
4003 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
4004
4005 * makefile.w32-in (C_CTYPE_H): New macro.
4006 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4007 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4008 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4009
4010 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4011
4012 Use ASCII tests for character types.
4013 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4014 * xfns.c, xterm.c:
4015 Don't include <ctype.h>; was not needed.
4016 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4017 * sysdep.c, xfaces.c:
4018 Include <c-ctype.h> instead of <ctype.h>.
4019 * nsterm.m: Include <c-ctype.h>.
4020 * charset.c (read_hex):
4021 * doc.c (Fsnarf_documentation):
4022 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4023 (DRIVE_LETTER) [DOS_NT]:
4024 (Ffile_name_directory, Fexpand_file_name)
4025 (Fsubstitute_in_file_name):
4026 * font.c (font_parse_xlfd, font_parse_fcname):
4027 * frame.c (x_set_font_backend):
4028 * gtkutil.c (xg_get_font):
4029 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4030 * nsimage.m (hexchar):
4031 * nsterm.m (ns_xlfd_to_fontname):
4032 * sysdep.c (system_process_attributes):
4033 * xfaces.c (hash_string_case_insensitive):
4034 Use C-locale tests instead of locale-specific tests for character
4035 types, since we want the ASCII interpretation here, not the
4036 interpretation suitable for whatever happens to be the current locale.
4037
4038 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4039
4040 Consistently check windows for validity/liveness
4041 (Bug#11984, Bug#12025, Bug#12026).
4042 * lisp.h (CHECK_VALID_WINDOW): New macro.
4043 * window.c (decode_window): Rename to decode_live_window.
4044 (decode_valid_window, Fwindow_valid_p): New functions.
4045 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4046 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4047 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4048 (Fwindow_prev_sibling, Fwindow_combination_limit)
4049 (Fset_window_combination_limit, Fwindow_use_time)
4050 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4051 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4052 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4053 (Fwindow_hscroll, Fset_window_hscroll)
4054 (Fwindow_redisplay_end_trigger)
4055 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4056 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4057 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4058 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4059 (Fwindow_end, Fset_window_point, Fset_window_start)
4060 (Fpos_visible_in_window_p, Fwindow_line_height)
4061 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4062 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4063 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4064 (Fset_window_parameter, Fwindow_display_table)
4065 (Fset_window_display_table, Fdelete_other_windows_internal)
4066 (Fset_window_buffer, Fset_window_new_total)
4067 (Fset_window_new_normal, Fdelete_window_internal)
4068 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4069 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4070 (Fwindow_scroll_bars): Check whether argument window is a valid or
4071 live window. Update doc-strings.
4072 (syms_of_window): New symbol Qwindow_valid_p.
4073 * keyboard.c (Fposn_at_x_y): Check whether argument
4074 frame_or_window denotes a valid window.
4075
4076 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4077
4078 Fix previous char table change.
4079 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4080 * chartab.c (optimize_sub_char_table): Likewise.
4081
4082 2012-08-16 Chong Yidong <cyd@gnu.org>
4083
4084 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4085
4086 * xfont.c (xfont_open):
4087 * xftfont.c (xftfont_open): Set the font's max_width field.
4088
4089 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4090 min_width to space_width and average_width to the average over
4091 printable ASCII characters.
4092 (ns_char_width): Code cleanup.
4093 (ns_ascii_average_width): New utility function.
4094
4095 * font.h (struct font): Update comments.
4096
4097 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Simple interface to set Lisp_Object fields of character tables.
4100 * lisp.h (CSET): New macro.
4101 (char_table_set_extras, char_table_set_contents)
4102 (sub_char_table_set_contents): New function.
4103 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4104 * syntax.c: Adjust users.
4105
4106 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4107
4108 * eval.c (eval_sub): Bind lexical-binding.
4109 * lread.c (Qlexical_binding): Make non-static.
4110
4111 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4112
4113 * nsmenu.m (popupSession): Remove.
4114 (pop_down_menu): Remove endModalSession.
4115 (timeout_handler:): New method.
4116 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4117 Call runModalForWindow. Check timer_fired when it returns.
4118 If not set, cancel timer and break out of loop.
4119 Otherwise loop again, with a new timeout.
4120
4121 * nsterm.m: Include fcntl.h if present.
4122 (fd_entry, t_readfds, inNsSelect): Remove.
4123 (select_writefds, select_valid, select_timeout, selfds)
4124 (select_mutex, apploopnr): Add.
4125 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4126 Otherwise call kbd_buffer_store_event.
4127 (ns_send_appdefined): Remove release of fd_entry.
4128 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4129 Increment and decrement apploopnr.
4130 (ns_select): If no file descriptors, just do a NSTimer.
4131 Otherwise copy read/write masks and start select thread (fd_handler).
4132 Start main loop and wait for application defined event.
4133 Inform select thread to stop selecting after main loop is exited.
4134 (ns_term_init): Create selfds pipe and set non-blocking.
4135 Initialize select_mutex. Start the select thread (fd_handler).
4136 (fd_handler:): Loop forever, wait for info from the main thread
4137 to either start or stop selecting. When select returns, send
4138 and appdefined event.
4139 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4140 If not call kbd_buffer_store_event.
4141
4142 * nsterm.h (EmacsApp): fd_handler takes id argument.
4143 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4144
4145 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4146
4147 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4148
4149 * region-cache.c (move_cache_gap): Update gap_len using the actual
4150 growth of the boundaries array. Do not change cache_len.
4151 (Bug#12196)
4152
4153 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4154
4155 Generalize and cleanup font subsystem checks.
4156 * font.h (FONT_DEBUG, font_assert): Remove.
4157 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4158 Change font_assert to eassert. Use eassert where appropriate.
4159
4160 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4161
4162 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4163
4164 2012-08-15 Chong Yidong <cyd@gnu.org>
4165
4166 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4167 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4168 extract the font descriptor instead of just the font name.
4169 In that case, return a font spec instead of a string.
4170 (x_last_font_name): Move to this file from xfns.c.
4171
4172 * xfns.c (Fx_select_font): The return value can also be a font
4173 spec. Move x_last_font_name management to gtkutil.c.
4174
4175 * xfaces.c: Make font weight and style symbols non-static.
4176
4177 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4178
4179 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4180 (bug#12117).
4181
4182 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4183
4184 * alloc.c (Fgarbage_collect): Use plural form consistently.
4185
4186 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4187
4188 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4189 iteration through the command loop. Fixes a problem whereby mouse
4190 movements are ignored until the first mouse click.
4191
4192 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4193
4194 Use bool, not int, for Lisp booleans.
4195 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4196 makes Emacs a bit smaller and presumably a bit faster.
4197 * lisp.h: Include <stdbool.h>.
4198 (struct Lisp_Boolfwd, defvar_bool):
4199 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4200 * regex.c [!emacs]: Include <stdbool.h>.
4201 (false, true): Remove; <stdbool.h> does this for us now.
4202
4203 2012-08-14 Chong Yidong <cyd@gnu.org>
4204
4205 * character.c (Fcharacterp): Doc fix (Bug#12076).
4206
4207 * data.c (Findirect_variable): Doc fix (Bug#11040).
4208
4209 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4210
4211 * editfns.c (Fformat): Doc fix (Bug#12059).
4212 (Fsave_current_buffer): Doc fix (Bug#11542).
4213
4214 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4215
4216 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4217 (bug#12022).
4218
4219 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4220
4221 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4222 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4223 * minibuf.c (choose_minibuf_frame, read_minibuf):
4224 * w32fns.c (x_create_tip_frame):
4225 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4226 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4227
4228 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4229
4230 * intervals.c (offset_intervals): Remove obsolete comment.
4231
4232 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4233
4234 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4235
4236 2012-08-14 Gergely Risko <gergely@risko.hu>
4237
4238 * coding.c (decode_coding): Record buffer modification before
4239 disabling undo_list (Bug#11773).
4240
4241 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4242
4243 Revert and cleanup some recent overlay changes.
4244 * buffer.h (enum overlay_type): Remove.
4245 (buffer_get_overlays, buffer_set_overlays): Likewise.
4246 (buffer_set_overlays_before, buffer_set_overlays_after):
4247 New function. Adjust users.
4248 (unchain_both): Add eassert.
4249
4250 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4253
4254 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4255
4256 * gtkutil.c (xg_mark_data): Don't assume C99.
4257
4258 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4259
4260 * gtkutil.c (xg_frame_tb_info): New struct.
4261 (TB_INFO_KEY): New define.
4262 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4263 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4264 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4265 if not present.
4266 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4267 is up to date. Otherwise store new data.
4268 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4269
4270 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Use KSET for write access to Lisp_Object members of struct kboard.
4273 * keyboard.h (KSET): New macro.
4274 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4275 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4276 * xterm.c: Adjust users.
4277
4278 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4279
4280 Use BSET for write access to Lisp_Object members of struct buffer.
4281 * buffer.h (BSET): New macro.
4282 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4283 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4284 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4285 * window.c, xdisp.c, xfns.c: Adjust users.
4286
4287 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4288
4289 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4290
4291 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4292
4293 * nsterm.m (not_in_argv): New function.
4294 (application:openFile, application:openTempFile:):
4295 (application:openFileWithoutUI:, application:openFiles:): Open file
4296 if not_in_argv returns non-zero (bug#12171).
4297
4298 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4299 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4300 Define for Gtk+ versions less than 3.2.
4301 (xg_get_font_name): Use those functions/macros here.
4302 Reported by Frans Oilinki <moilinki@gmail.com>.
4303
4304 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4305
4306 * unexmacosx.c (copy_data_segment): Copy initialized data in
4307 statically linked libraries from input file rather than memory.
4308
4309 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4310 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4311 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4312
4313 2012-08-10 Glenn Morris <rgm@gnu.org>
4314
4315 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4316 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4317
4318 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Fix last change to allow compilation with low optimization levels.
4321 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4322 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4323
4324 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4325
4326 Use common inline syntax in intervals.h.
4327 * intervals.h (INTERVALS_INLINE): New macro.
4328 Change all users from LISP_INLINE.
4329
4330 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4331
4332 Define Qnone once for all platforms.
4333 * frame.c (Qnone): Define here.
4334 (syms_of_frame): DEFSYM it.
4335 * lisp.h (Qnone): New declaration.
4336 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4337 * xfns.c: Remove duplication. Adjust users.
4338
4339 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4340
4341 Remove unused macros from intervals.h.
4342 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4343 * intervals.c: Adjust comment.
4344
4345 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4346
4347 * w32fns.c <w32_unicode_gui>: New static variable.
4348 (globals_of_w32fns): Initialize it according to os_subtype.
4349 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4350 testing os_subtype.
4351
4352 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4353 Eli Zaretskii <eliz@gnu.org>
4354
4355 Fix bug #10299 with Unicode characters sent by customized
4356 keyboards created by MSKLC.
4357 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4358 (w32_init_class): Use it to initialize the Emacs class with either
4359 ANSI or Unicode API calls.
4360 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4361 later.
4362 (w32_wnd_proc): If the character code sent by WM_CHAR or
4363 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4364 original message. Call DefWindowProcW on NT and later.
4365
4366 2012-08-10 Glenn Morris <rgm@gnu.org>
4367
4368 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4369
4370 * lisp.h (DIRECTORY_SEP): Let configure set it.
4371
4372 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 Use TSET for write access to Lisp_Object slots of struct terminal.
4375 * termhooks.h (TSET): New macro.
4376 * coding.c, terminal.c, xselect.c: Adjust users.
4377
4378 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4379
4380 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4381 the failing expression, include them in the error message.
4382 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4383 * lisp.h (internal_condition_case_n): Update declaration.
4384
4385 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4386
4387 Inline functions to examine and change buffer overlays.
4388 * buffer.c (unchain_both): New function.
4389 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4390 (buffer_has_overlays): New function.
4391 (enum overlay_type): New enum.
4392 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4393 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4394
4395 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4396
4397 Inline functions to examine and change buffer intervals.
4398 * alloc.c (mark_interval_tree): Remove.
4399 (MARK_INTERVAL_TREE): Simplify.
4400 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4401 * intervals.c (buffer_balance_intervals): New function.
4402 (graft_intervals_into_buffer): Adjust indentation.
4403 (set_intervals_multibyte): Simplify.
4404 * buffer.h (BUF_INTERVALS): Remove.
4405 (buffer_get_intervals, buffer_set_intervals): New function.
4406 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4407 * intervals.c, textprop.c: Adjust users.
4408
4409 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4410
4411 Inline functions to examine and change string intervals.
4412 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4413 (string_get_intervals, string_set_intervals): New function.
4414 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4415 * lread.c, print.c, textprop.c: Adjust users.
4416
4417 2012-08-08 Glenn Morris <rgm@gnu.org>
4418
4419 * lisp.mk (lisp): Remove language/persian.elc.
4420
4421 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4422
4423 Cleanup intervals.
4424 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4425 (NULL_INTERVAL_P): Likewise. Adjust users.
4426 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4427 Adjust comment. Move under #if 0.
4428 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4429 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4430
4431 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Check total length of intervals with eassert.
4434 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4435 * intervals.c: Change all users to eassert.
4436
4437 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4438
4439 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4440 Rename fields to match removal of FGET and WGET and disuse of
4441 INTERNAL_FIELD in Lisp_Cons.
4442
4443 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4444
4445 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4446 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4447 name since all xname users are fixed long time ago. Do not
4448 use INTERNAL_FIELD.
4449 (set_symbol_name, set_symbol_function, set_symbol_plist):
4450 (set_symbol_next, set_overlay_plist): New function.
4451 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4452 (struct Lisp_Overlay): Likewise.
4453 (CVAR, MVAR, SVAR): Remove.
4454 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4455 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4456 * xterm.c: Adjust users.
4457 * .gdbinit: Change to use name field of struct Lisp_Symbol
4458 where appropriate.
4459
4460 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4461
4462 Basic functions to set Lisp_Object and pointer slots of intervals.
4463 * intervals.h (interval_set_parent, interval_set_object):
4464 (interval_set_left, interval_set_right, interval_set_plist):
4465 (interval_copy_parent): New function.
4466 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4467 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4468 Adjust indentation.
4469 (INTERVAL_SIZE): Remove. Adjust users.
4470 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4471
4472 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4473
4474 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4475 * process.h (PGET): Remove.
4476 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4477 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4478
4479 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4480
4481 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4482 * window.h (WGET): Remove.
4483 (struct window): Do not use INTERNAL_FIELD.
4484 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4485 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4486 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4487 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4488 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4489 Adjust users.
4490
4491 2012-08-07 Chong Yidong <cyd@gnu.org>
4492
4493 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4494 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4495 (Fdelete_window_internal): Signal an error if the window is not on
4496 a live frame (Bug#12025).
4497
4498 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4499
4500 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4501 * frame.h (FGET): Remove.
4502 (struct frame): Do not use INTERNAL_FIELD.
4503 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4504 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4505 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4506 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4507
4508 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4509
4510 * w32.c: Silence compiler warnings.
4511 (map_w32_filename): Remove unused variable `is_fat'.
4512 (chase_symlinks): Add parentheses around expression.
4513
4514 2012-08-06 Glenn Morris <rgm@gnu.org>
4515
4516 * sysdep.c: Respect BROKEN_GETWD.
4517
4518 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4519 Let configure handle it.
4520 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4521
4522 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4523
4524 Use GCALIGNMENT where appropriate.
4525 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4526 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4527 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4528
4529 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4530
4531 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4532 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4533
4534 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4535
4536 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4537 that should be sufficient for everyone.
4538
4539 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4540
4541 * keyboard.c (timer_check_2): Add break so timer_check returns next
4542 timeout.
4543
4544 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4545
4546 Fix Windows build errors introduced after converting to WGET and WSET.
4547 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4548 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4549
4550 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4551
4552 * nsterm.m (ns_frame_rehighlight): Use FSET.
4553
4554 * nsmenu.m (ns_update_menubar): Use FSET.
4555
4556 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Separate read and write access to Lisp_Object slots of Lisp_Process.
4559 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4560 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4561
4562 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4563
4564 Separate read and write access to Lisp_Object slots of struct window.
4565 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4566 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4567 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4568 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4569 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4570 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4571 Adjust users.
4572
4573 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Fix Windows build errors introduced after converting to FGET and FSET.
4576 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4577 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4578 (w32_judge_scroll_bars): Change to use FSET.
4579 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4580
4581 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4582
4583 Fix replacement typo.
4584 * window.c (replace_window): Set root_window instead of
4585 selected_window. This fixes a total window subsystem
4586 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4587
4588 2012-08-06 Glenn Morris <rgm@gnu.org>
4589
4590 * lisp.mk (lisp): Add language/persian.elc.
4591
4592 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4593
4594 Separate read and write access to Lisp_Object slots of struct frame.
4595 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4596 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4597 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4598 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4599 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4600
4601 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4602
4603 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4604
4605 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4606
4607 Generalize common compile-time constants.
4608 * lisp.h (header_size, bool_header_size, word_size): Now here.
4609 (struct Lisp_Vector): Add comment.
4610 (struct Lisp_Bool_Vector): Move up to define handy constants.
4611 (VECSIZE, PSEUDOVECSIZE): Simplify.
4612 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4613 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4614 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4615 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4616 * xfont.c, xmenu.c: Use word_size where appropriate.
4617
4618 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4619
4620 * search.c (Freplace_match): Treat \? in the replacement text
4621 literally (Bug#8161).
4622
4623 2012-08-05 Chong Yidong <cyd@gnu.org>
4624
4625 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4626 * frame.c (Vdelete_frame_functions):
4627 * emacs.c (Vkill_emacs_hook): Doc fix.
4628
4629 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4630
4631 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4632 --with-x-toolkit=no builds.
4633 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4634
4635 2012-08-04 Chong Yidong <cyd@gnu.org>
4636
4637 * syntax.c (Fmodify_syntax_entry): Doc fix.
4638
4639 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4640
4641 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4642 * w32.c (init_environment): Change the default values of many
4643 environment variables in dflt_envvars[] to NULL, to avoid pushing
4644 them into environment when they were not already defined.
4645 Remove the code that deletes site-lisp subdirectories from the default
4646 value of EMACSLOADPATH, as it is no longer needed.
4647 (check_windows_init_file): Now external, not static.
4648 Use Vload_path as is, without adding anything, as this function is now
4649 called when Vload_path is already set up.
4650
4651 * w32.h (check_windows_init_file): Add prototype.
4652
4653 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4654 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4655 compatibility with Posix platforms.
4656 (main): Move the call to check_windows_init_file to here from
4657 w32.c.
4658 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4659 any, in the DEFALT argument into the root of the Emacs build or
4660 installation tree, as appropriate.
4661
4662 * callproc.c (init_callproc_1): Call decode_env_path instead of
4663 doing its equivalent by hand.
4664 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4665 the code that sets Vexec_path run on MS-Windows.
4666
4667 * lread.c (init_lread): Add comments to #ifdef's.
4668
4669 * msdos.c (dos_set_window_size, IT_update_begin)
4670 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4671 instead of direct references.
4672
4673 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 Export DEFAULT_REHASH_* to GDB.
4676 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4677 Now constants, not macros.
4678
4679 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 Remove unnecessary casts involving pointers.
4682 These casts are no longer needed now that we assume C89 or later,
4683 since they involve casting to or from void *.
4684 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4685 (make_pure_float, make_pure_vector):
4686 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4687 * macros.c (Fstart_kbd_macro):
4688 * menu.c (find_and_return_menu_selection):
4689 * minibuf.c (read_minibuf_noninteractive):
4690 * sysdep.c (closedir):
4691 * xdisp.c (x_produce_glyphs):
4692 * xfaces.c (compare_fonts_by_sort_order):
4693 * xfns.c (x_real_positions, select_visual):
4694 * xselect.c (x_stop_queuing_selection_requests)
4695 (x_get_window_property, x_get_window_property_as_lisp_data):
4696 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4697 Remove unnecessary pointer casts.
4698 * alloc.c (record_xmalloc): New function.
4699 * lisp.h (record_xmalloc): New decl.
4700 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4701 more like a function. This is because the pointer cast is not
4702 needed. All uses changed.
4703 * print.c (print_string, print_error_message): Avoid length recalc.
4704
4705 Improve fix for macroexp crash with debugging (Bug#12118).
4706 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4707 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4708 not supposed to be invoked from the garbage collector.
4709 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4710 (gc_aset): New function, which is like ASET but can be
4711 used in the garbage collector.
4712 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4713 (set_hash_index): Use it instead of ASET.
4714
4715 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4716
4717 Support symlinks on latest versions of MS-Windows.
4718 * w32.c: Include winioctl.h and aclapi.h.
4719 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4720 (revert_to_self): Forward declarations of static functions.
4721 <static BOOL g_b_init_get_security_info>:
4722 <g_b_init_create_symbolic_link>: New static flags.
4723 (globals_of_w32): Initialize them to zero.
4724 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4725 (map_w32_filename): Improve commentary. Simplify switch.
4726 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4727 headers (most versions of MinGW w32api don't).
4728 (get_security_info, create_symbolic_link)
4729 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4730 New functions.
4731 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4732 in the argument file name.
4733 (sys_access): Call unc_volume_file_attributes only if
4734 GetFileAttributes fails with network-related error codes.
4735 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4736 have the required privileges.
4737 (get_file_security_desc_by_name): Rename from
4738 get_file_security_desc.
4739 (stat_worker): New function, with most of the guts of 'stat', and
4740 with addition of handling of symlinks and support for 'lstat'.
4741 If possible, get file's attributes and security information by
4742 handle, not by name. Produce S_IFLNK bit for symlinks, when
4743 called from 'lstat'.
4744 (stat, lstat): New functions, call 'stat_worker'.
4745 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4746 symlinks when the underlying filesystem supports them.
4747
4748 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 Fix macroexp crash on Windows with debugging (Bug#12118).
4751 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4752 checking subscripts; problem introduced with the recent
4753 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4754 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4755 since it's used in non-static inline functions now.
4756
4757 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4758 Don't assume buffer size fits in 'int'. Remove unused local.
4759
4760 Use C99-style 'extern inline' if available.
4761 * buffer.h (BUFFER_INLINE):
4762 * category.h (CATEGORY_INLINE):
4763 * character.h (CHARACTER_INLINE):
4764 * charset.h (CHARSET_INLINE):
4765 * composite.h (COMPOSITE_INLINE):
4766 * dispextern.h (DISPEXTERN_INLINE):
4767 * lisp.h (LISP_INLINE):
4768 * systime.h (SYSTIME_INLINE):
4769 New macro, replacing 'static inline' in this header.
4770 * buffer.h, category.h, character.h, charset.h, composite.h:
4771 * dispextern.h, lisp.h, systime.h:
4772 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4773 * alloc.c (LISP_INLINE):
4774 * buffer.c (BUFFER_INLINE):
4775 * category.c (CATEGORY_INLINE):
4776 * character.c (CHARACTER_INLINE):
4777 * charset.c (CHARSET_INLINE):
4778 * composite.c (COMPOSITE_INLINE):
4779 * dispnew.c (DISPEXTERN_INLINE):
4780 * sysdep.c (SYSTIME_INLINE):
4781 Define to EXTERN_INLINE, so that the corresponding functions
4782 are compiled into code.
4783 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4784 (INLINE_HEADER_END): New macros.
4785 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4786 since it's used in non-static inline functions now.
4787 (VALMASK) [!USE_LSB_TAG]: Likewise.
4788
4789 2012-08-02 Glenn Morris <rgm@gnu.org>
4790
4791 * s/: Remove empty directory.
4792
4793 * s/ms-w32.h: Move to ../nt/inc.
4794 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4795 Update for new ms-w32.h location.
4796
4797 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 Port to Solaris 8.
4800 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4801
4802 2012-08-02 Glenn Morris <rgm@gnu.org>
4803
4804 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4805 hard-coding the path separator.
4806
4807 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4810 This how ASET and AREF are supposed to work, and makes
4811 it easier to think about future improvements. See
4812 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4813 * charset.h (set_charset_attr): New function.
4814 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4815 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4816 (aref_addr): New function. All uses of &AREF(...) changed.
4817 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4818 (set_hash_index): New functions. All lvalue-style uses of
4819 HASH_KEY etc. changed.
4820 * keyboard.c (set_prop): New function. All lvalue-style uses
4821 of PROP changed.
4822
4823 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4824
4825 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4826 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4827 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4828 * nsfns.m (ns_set_name_as_filename): Likewise.
4829 * nsmenu.m (ns_update_menubar): Likewise.
4830 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4831
4832 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4833
4834 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4835 Adapt to latest changes in field names of the corresponding Lisp
4836 objects.
4837
4838 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4839
4840 2012-08-01 Glenn Morris <rgm@gnu.org>
4841
4842 * s/msdos.h: Remove file.
4843 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4844 * Makefile.in (S_FILE): Remove.
4845 (config_h): Remove S_FILE.
4846
4847 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4848
4849 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4850 Remove; moved to nt/config.nt.
4851
4852 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4853
4854 Use INTERNAL_FIELD for conses and overlays.
4855 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4856 Remove obsolete comment.
4857 (MVAR): New macro.
4858 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4859 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4860
4861 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4862
4863 Use INTERNAL_FIELD for symbols.
4864 * lisp.h (SVAR): New macro. Adjust users.
4865 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4866 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4867
4868 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4869
4870 Use INTERNAL_FIELD for processes.
4871 * process.h (PVAR): New macro. Adjust style.
4872 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4873 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4874
4875 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4876
4877 Use INTERNAL_FIELD for windows.
4878 * window.h (WVAR): New macro.
4879 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4880 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4881 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4882 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4883 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4884 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4885
4886 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4889
4890 2012-08-01 Glenn Morris <rgm@gnu.org>
4891
4892 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4893 Move to configure.ac.
4894
4895 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4896
4897 * makefile.w32-in (CONFIG_H): Update dependencies.
4898 (CONF_POST_H): New macro.
4899
4900 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4901
4902 2012-07-31 Glenn Morris <rgm@gnu.org>
4903
4904 * Makefile.in (S_FILE): No longer set by configure.
4905
4906 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4907 is available.
4908 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4909
4910 * process.h (NULL_DEVICE):
4911 * emacs.c (SEPCHAR):
4912 * editfns.c (USER_FULL_NAME): Let configure set them.
4913
4914 * s/README, s/template.h: Remove files.
4915
4916 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4917
4918 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4919 Move to configure.ac.
4920
4921 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4922
4923 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4924 resulting renaming of 'struct frame' members.
4925
4926 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4927
4928 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4929 after introduction of FVAR.
4930
4931 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4932
4933 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4934
4935 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4936 instead of compositeToPoint.
4937 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4938
4939 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4940
4941 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4942
4943 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4944 * lisp.h (INTERNAL_FIELD): New macro.
4945 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4946 (BVAR): Change to use INTERNAL_FIELD.
4947 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4948 (KVAR): Change to use INTERNAL_FIELD.
4949 * frame.h (FVAR): New macro.
4950 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4951 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4952 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4953 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4954 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4955
4956 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4957
4958 Miscellaneous fixes for non-default X toolkits.
4959 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4960 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4961 Move under #ifdef USE_LUCID.
4962 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4963 definition and usage to avoid warnings.
4964
4965 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4966
4967 * nsterm.m (openFiles): Fix previous checkin.
4968
4969 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 * indent.c (compute_motion): Remove unused local.
4972
4973 2012-07-31 Glenn Morris <rgm@gnu.org>
4974
4975 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4976
4977 * conf_post.h [USG5_4]:
4978 Move remaining contents of s/usg5-4-common.h here.
4979 * s/usg5-4-common.h: Remove file.
4980
4981 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4982 * s/irix6-5.h: Remove file.
4983
4984 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4985 * s/darwin.h: Remove file.
4986
4987 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4988 * s/hpux10-20.h: Remove file, which is now empty.
4989
4990 2012-07-30 Glenn Morris <rgm@gnu.org>
4991
4992 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4993 * Makefile.in (config_h): Add conf_post.h.
4994 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4995
4996 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4997
4998 * nsterm.m (ns_do_open_file): New variable.
4999 (ns_term_init): Set ns_do_open_file to YES after run returns.
5000 (openFile, openTempFile, openFileWithoutUI, openFiles):
5001 Open files only if ns_do_open_file.
5002
5003 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5006 This no-op macro hasn't been needed for many years.
5007 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5008
5009 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5010 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5011 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5012 gdb_make_enums_visible.
5013 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5014 (DIRECTORY_SEP): Now a constant, not a macro.
5015
5016 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5017
5018 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5019 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5020
5021 * w32term.c <w32_keyboard_codepage>: Renamed from
5022 keyboard_codepage and now external. All users changed.
5023
5024 * w32term.h: Add declaration of w32_keyboard_codepage.
5025
5026 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5027 the codepage to translate keys to Unicode. If this argument is
5028 -1, use the value returned by GetConsoleCP. All callers changed.
5029
5030 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 Update .PHONY listings in makefiles.
5033 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5034 bootstrap-clean, distclean, maintainer-clean, versioclean,
5035 extraclean, frc.
5036
5037 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5038 This is a bit clearer. Fix some commentary typos.
5039
5040 2012-07-30 Glenn Morris <rgm@gnu.org>
5041
5042 * s/netbsd.h: Let configure include signal.h if needed.
5043 Remove file, which is now empty.
5044
5045 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5046 Let configure set them.
5047 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5048 No more need to undefine.
5049
5050 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5051
5052 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5053 non-single-byte char when adding meta modifier. (Bug#12090)
5054
5055 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5056
5057 Convert safe_call to use variable number of arguments.
5058 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5059 (safe_call2): Fix comment.
5060 * lisp.h (safe_call): Adjust prototype.
5061 * coding.c (encode_coding_object): Change to use safe_call2.
5062 * xfaces.c (merge_face_heights): Change to use safe_call1.
5063
5064 2012-07-30 Glenn Morris <rgm@gnu.org>
5065
5066 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5067 does that unconditionally. Remove file, which is now empty.
5068
5069 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5070 Remove empty files.
5071
5072 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5073
5074 Export to GDB most of lisp.h's remaining object-like macros.
5075 * lisp.h (min, max): Move earlier, because they're used earlier now.
5076 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5077 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5078 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5079 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5080 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5081 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5082 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5083 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5084 Now constants, for GDB. They need not be macros.
5085 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5086 Now constants, for GDB, as well as macros, for static initializers.
5087 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5088 Move to after the definition of struct Lisp_Char_Table,
5089 since the former now needs that type defined.
5090 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5091 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5092 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5093 New enums, for gdb_make_enums_visible.
5094 (GLYPH_MODE_LINE_FACE): Remove; unused.
5095 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5096 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5097 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5098 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5099 enum maxargs, enum MAX_ALLOCA.
5100 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5101 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5102 no longer needed, now that they are done in lisp.h.
5103
5104 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5105
5106 Cleanup string bytes checking.
5107 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5108 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5109 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5110 (check_sblock, compact_small_strings): Simplify.
5111
5112 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5113
5114 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5115 These macros are confusing and no longer need to be defined, as
5116 the enum values now suffice. All uses replaced with definiens.
5117 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5118
5119 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5120
5121 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5122 ($(BLD)/w32console.$(O)): Update dependencies.
5123
5124 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5125
5126 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5127 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5128 time. Adjust users.
5129 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5130
5131 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5132
5133 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5134 setting sitelisp (Bug#12010).
5135
5136 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5137
5138 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5139
5140 * w32heap.c (cache_system_info):
5141 * w32.c (sys_rename):
5142 * w32proc.c (find_child_console, sys_kill): All users changed.
5143
5144 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5147
5148 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5149
5150 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5151
5152 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5153
5154 Cleanup statistics calculation in Fgarbage_collect.
5155 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5156 Fix zombies percentage calculation. Simplify elapsed time calculation.
5157
5158 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5159
5160 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5161 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5162 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5163 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5164 (replace_range, replace_range_2, del_range_2): Change to eassert.
5165 * marker.c (byte_char_debug_check): Adjust style.
5166
5167 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5168
5169 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5170 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5171 long-ago-commented-out code that talks about "WIN32".
5172 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5173 All uses changed.
5174
5175 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5178 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5179 Simplify by using alignof.
5180 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5181 * lisp.h: Include <stdalign.h>.
5182 (GCALIGNMENT): New macro and constant.
5183 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5184 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5185 (stdalign): New macro, if not already defined.
5186
5187 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5188
5189 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5190 * w32inevt.c: Include w32inevt.h.
5191 (w32_read_console_input): New inline function, calls either
5192 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5193 w32_console_unicode_input.
5194 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5195 (w32_kbd_patch_key, key_event): Use the codepage returned by
5196 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5197 (key_event): use uChar.UnicodeChar only if
5198 w32_console_unicode_input is non-zero.
5199
5200 * w32console.c: Include w32heap.h.
5201 <w32_console_unicode_input>: New global variable.
5202 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5203 family of Windows, zero otherwise.
5204
5205 * w32inevt.h: Declare w32_console_unicode_input.
5206
5207 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5208 --without-x. (Bug#11742)
5209
5210 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5211
5212 Adjust GDB to reflect pvec_type changes (Bug#12036).
5213 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5214 2012-07-04 changes to pseudovector representation.
5215 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5216
5217 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5218
5219 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5220 bus address.
5221 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5222
5223 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5224
5225 * alloc.c (listn): Fix the order the arguments are consed onto the
5226 list.
5227
5228 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5229 enumeration constants, as PURE and HEAP are too general, and clash
5230 with other headers and sources, such as gmalloc.c and the
5231 MS-Windows system headers. All users changed.
5232
5233 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5234
5235 Revert last save_excursion_save and save_excursion_restore changes.
5236 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5237 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5238
5239 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5240
5241 Fix recently-introduced typos in Windows port.
5242 Reported by Martin Rudalics <rudalics@gmx.at>.
5243 * w32.c (init_environment): Replace comma with semicolon.
5244 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5245
5246 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 Improve GDB symbol export (Bug#12036).
5249 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5250 arms of an 'if', not using conditional expressions; otherwise GDB
5251 complains about the types in the unevaluated arm when the argument
5252 is an integer literal.
5253 (xgetint): Simplify expression.
5254 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5255 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5256 Zaretskii in <http://bugs.gnu.org/12036#13>.
5257 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5258 needed now that we have gdb_make_enums_visible.
5259 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5260 (enum enum_USE_LSB_TAG):
5261 New enum types, packaging up enums that need to be exported to GDB.
5262
5263 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5264
5265 Utility function to make a list from specified amount of objects.
5266 * lisp.h (enum constype): New datatype.
5267 (listn): New prototype.
5268 * alloc.c (listn): New function.
5269 (Fmemory_use_count, syms_of_alloc): Use it.
5270 * buffer.c (syms_of_buffer): Likewise.
5271 * callint.c (syms_of_callint): Likewise.
5272 * charset.c (define_charset_internal): Likewise.
5273 * coding.c (syms_of_coding): Likewise.
5274 * keymap.c (syms_of_keymap): Likewise.
5275 * search.c (syms_of_search): Likewise.
5276 * syntax.c (syms_of_syntax): Likewise.
5277 * w32.c (init_environment): Likewise.
5278 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5279 * xdisp.c (syms_of_xdisp): Likewise.
5280 * xfns.c (syms_of_xfns): Likewise.
5281
5282 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5283
5284 Fast save_excursion_save and save_excursion_restore.
5285 * lisp.h (struct Lisp_Excursion): New data type.
5286 (PVEC_EXCURSION): New pseudovector type.
5287 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5288 to deal with it. Adjust comments.
5289 (init_marker, attach_marker): New prototype.
5290 (unchain_marker): Adjust prototype.
5291 * marker.c (attach_marker): Change to global.
5292 (init_marker): New function.
5293 * alloc.c (Fmake_marker, build_marker): Use it.
5294 (build_marker): More easserts.
5295 (mark_object): Handle struct Lisp_Excursion.
5296 * editfns.c (save_excursion_save, save_excursion_restore):
5297 Reimplement to use struct Lisp_Excursion. Add comments.
5298
5299 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 Fix export of symbols to GDB (Bug#12036).
5302 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5303 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5304 emacs.c, as this is a more-suitable home. Had this been done earlier
5305 the fix for 12036 would have avoided some of the problems noted in
5306 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5307 would have been more obvious.
5308 * emacs.c: Do not include <verify.h>; no longer needed.
5309 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5310 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5311 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5312 Remove; now done in lisp.h.
5313 * lisp.h (PUBLISH_TO_GDB): New macro.
5314 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5315 (DATA_SEG_BITS): Use it.
5316 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5317 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5318 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5319 not be usable in #if. This simplifies things.
5320
5321 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5322
5323 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5324
5325 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 Simplify export of symbols to GDB (Bug#12036).
5328 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5329 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5330 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5331 Adjust to changes in lisp.h and emacs.c, by using
5332 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5333 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5334 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5335 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5336 instead of gdb_valbits.
5337 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5338 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5339 instead of gdb_array_mark_flag.
5340 (xboolvector): Get size from $->size, not $->header.size.
5341 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5342 (xreload, hook-run, hookpost-run): Remove.
5343 * emacs.c: Include <verify.h>.
5344 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5345 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5346 Remove.
5347 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5348 (gdb_USE_LSB_TAG): New enum constants.
5349 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5350 Also define these as enum constants, so they're visible to GDB.
5351 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5352 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5353 as constants, so they're visible to GDB.
5354 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5355 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5356 Now enum constants, not macros, so they're visible to GDB.
5357 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5358 more convenient now. All uses changed.
5359 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5360 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5361
5362 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5363
5364 Explicitly free restriction data that are not needed anymore.
5365 * editfns.c (save_restriction_restore): Free restriction data.
5366
5367 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5368
5369 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5370 add argument, tune behavior, and adjust all callers.
5371
5372 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 Use typedef for EMACS_INT, EMACS_UINT.
5375 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5376 than macros. This simplifies debugging in the usual case, since
5377 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5378 and it allows expressions involving EMACS_INT casts.
5379 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5380
5381 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5382
5383 * nsterm.m (ns_read_socket): Return early if there is a modal
5384 window (Bug#12043).
5385
5386 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5387
5388 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5389 that FOCUS-FRAME can be omitted.
5390
5391 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5392
5393 Adjust buffer text indirection counters at the end of Fkill_buffer.
5394 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5395 buffer is definitely dead. This should really fix an issue reported
5396 by Christoph Scholtes again. (Bug#12007).
5397 (init_buffer_once): Initialize indirection counters of
5398 buffer_defaults and buffer_local_symbols (for sanity and safety).
5399
5400 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5401
5402 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5403 and continuation glyphs on tooltip frames, leave them at zero.
5404 Avoids continued lines in tooltips. (Bug#11832)
5405
5406 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 Simplify copy_overlay.
5409 * buffer.c (copy_overlay): Simplify. Use build_marker.
5410 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5411
5412 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5413
5414 * print.c (print_object): Don't crash when a frame's name is nil
5415 or invalid. (Bug#12025)
5416
5417 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5418 it signals an error when a tooltip frame is being created.
5419
5420 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5421
5422 Cleanup miscellaneous objects allocation and initialization.
5423 * alloc.c (allocate_misc): Change to static. Add argument to
5424 specify the subtype. Adjust comment and users.
5425 (build_overlay): New function.
5426 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5427 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5428 (allocate_misc): Remove prototype.
5429 (build_overlay): Add prototype.
5430
5431 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5432
5433 Swap buffer text indirection counters in Fbuffer_swap_text.
5434 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5435 This avoids crash reported by Christoph Scholtes at
5436 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5437
5438 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5439
5440 * nsmenu.m (Popdown_data): New struct.
5441 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5442 free Popdown_data.
5443 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5444 (initWithContentRect): Make imgView and contentView non-static
5445 and autorelease them. Also autorelease img and matrix (Bug#12005).
5446 (dealloc): Remove (Bug#12005).
5447
5448 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5449
5450 Adjust consing_since_gc when objects are explicitly freed.
5451 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5452 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5453 (free_cons, free_misc): Subtract object size from consing_since_gc.
5454
5455 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5456
5457 Simplify and cleanup markers positioning code.
5458 * marker.c (attach_marker): More useful eassert.
5459 (live_buffer, set_marker_internal): New function.
5460 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5461 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5462
5463 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5464
5465 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5466 as it's limited by the amount of memory, not by INT_MAX.
5467
5468 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5469
5470 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5471 in special-event-map. See the discussion at
5472 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5473 for the reasons.
5474
5475 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5476 info.dwItemData. Fixes crashes on 64-bit Windows.
5477 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5478
5479 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5480
5481 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5482 (conversationIdentifier): Return value is NSInteger.
5483 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5484
5485 2012-07-21 Chong Yidong <cyd@gnu.org>
5486
5487 * window.c (decode_any_window): Signal an error if the window is
5488 on a dead frame (Bug#11984).
5489
5490 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5491
5492 Add indirection counting to speed up Fkill_buffer.
5493 * buffer.h (struct buffer): New member.
5494 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5495 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5496 base buffer indirection counter.
5497 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5498 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5499 through buffer list if indirection counter is 0.
5500
5501 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5502
5503 Extend the value returned by Fgarbage_collect with heap statistics.
5504 * alloc.c (Qheap): New symbol.
5505 (syms_of_alloc): DEFSYM it.
5506 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5507 (Fmemory_free): Remove.
5508 (syms_of_alloc): Don't defsubr it.
5509 * buffer.c (Fcompact_buffer): Remove.
5510 (syms_of_buffer): Don't defsubr it.
5511
5512 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5513
5514 Make maybe_gc inline.
5515 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5516 * lisp.h (consing_since_gc, gc_relative_threshold)
5517 (memory_full_cons_threshold): Revert declaration.
5518 (maybe_gc): Remove prototype, define as inline.
5519 * alloc.c: Remove old commented-out code.
5520 (consing_since_gc, gc_relative_threshold)
5521 (memory_full_cons_threshold): Revert to global.
5522 (maybe_gc): Remove.
5523
5524 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5527 * lisp.h (build_unibyte_string): New function.
5528 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5529 * sysdep.c, w32fns.c, xfns.c: Use it.
5530 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5531 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5532 Adjust users accordingly.
5533 * font.h (font_open_by_name): Adjust prototype.
5534
5535 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 Cleanup calls to Fgarbage_collect.
5538 * lisp.h (maybe_gc): New prototype.
5539 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5540 Remove declarations.
5541 * alloc.c (maybe_gc): New function.
5542 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5543 Make them static.
5544 * bytecode.c (MAYBE_GC): Use maybe_gc.
5545 * eval.c (eval_sub, Ffuncall): Likewise.
5546 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5547 to avoid dependency from auto-save feature.
5548
5549 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5550
5551 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5552 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5553 'for_each_per_buffer_object_at'.
5554 All uses changed. It's better to use upper-case for macros that
5555 cannot be implemented as functions, to give the reader a clue
5556 that they're special.
5557
5558 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5559
5560 * alloc.c (Fgarbage_collect): Tweak docstring.
5561
5562 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5563
5564 Tweak the value returned from Fgarbage_collect again.
5565 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5566 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5567 Adjust documentation.
5568 (total_vector_bytes): Rename to total_vector_slots, adjust
5569 accounting.
5570 (total_free_vector_bytes): Rename to total_free_vector_slots,
5571 adjust accounting.
5572 (Qstring_bytes, Qvector_slots): New symbols.
5573 (syms_of_alloc): DEFSYM them.
5574
5575 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5576
5577 Buffer compaction primitive which may be used from Lisp.
5578 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5579 (syms_of_buffer): Register Fcompact_buffer.
5580 * alloc.c (Fgarbage_collect): Use compact_buffer.
5581 * buffer.h (compact_buffer): New prototype.
5582 (struct buffer_text): New member.
5583
5584 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5585
5586 New macro to iterate over all buffers, miscellaneous cleanups.
5587 * lisp.h (all_buffers): Remove declaration.
5588 * buffer.h (all_buffers): Add declaration, with comment.
5589 (for_each_buffer): New macro.
5590 * alloc.c (Fgarbage_collect, mark_object): Use it.
5591 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5592 (init_buffer): Likewise.
5593 * data.c (Fset_default): Likewise.
5594 * coding.c (code_conversion_restore): Remove redundant check
5595 for dead buffer.
5596 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5597
5598 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5599
5600 Fix bug that created negative-length intervals.
5601 * intervals.c (merge_interval_right, merge_interval_left):
5602 Do not zero out this interval if it is absorbed by its children,
5603 as this interval's total length doesn't change in that case. See
5604 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5605
5606 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5607
5608 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5609 when invoking (make-bool-vector N t) and N is a positive
5610 multiple of 8 -- the last 8 bits were mistakenly cleared.
5611
5612 Remove some struct layout assumptions in bool vectors.
5613 * alloc.c (bool_header_size): New constant.
5614 (header_size, word_size): Move earlier, as they're now used earlier.
5615 Use 'word_size' in a few more places, where it's appropriate.
5616 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5617 padding before the data member of a bool vector.
5618 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5619 than doing the check by hand with an abort ().
5620
5621 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5622
5623 * eval.c (Fdefvar): Don't check constants since we only set the var if
5624 it's not yet defined anyway (bug#11904).
5625
5626 * lisp.h (last_undo_boundary): Declare new var.
5627 * keyboard.c (command_loop_1): Set it.
5628 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5629 were auto-added by the command loop (bug#11774).
5630
5631 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5632
5633 * w32font.c (Qsymbol): Remove local definition.
5634 (syms_of_w32font): Don't DEFSYM it.
5635
5636 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5637
5638 Fix sweep_vectors to handle large bool vectors correctly.
5639 * alloc.c (sweep_vectors): Account total_vector_bytes for
5640 bool vectors larger than VBLOCK_BYTES_MAX.
5641
5642 2012-07-18 Chong Yidong <cyd@gnu.org>
5643
5644 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5645 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5646
5647 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5648
5649 Return more descriptive data from Fgarbage_collect.
5650 Suggested by Stefan Monnier in
5651 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5652 * alloc.c (bounded_number): New function.
5653 (total_buffers, total_vectors): New variable.
5654 (total_string_size): Rename to total_string_bytes, adjust users.
5655 (total_vector_size): Rename to total_vector_bytes, adjust users.
5656 (sweep_vectors): Account total_vectors and total_vector_bytes.
5657 (Fgarbage_collect): New return value. Adjust documentation.
5658 (gc_sweep): Account total_buffers.
5659 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5660 (VECTOR_SIZE): Remove.
5661 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5662 (Qinterval, Qmisc): New symbols.
5663 (syms_of_data): Initialize them.
5664 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5665 (Qcons, Qbuffer): New declarations.
5666
5667 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5668
5669 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5670 Round up, not down. Improve doc.
5671
5672 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5673
5674 Restore old code in allocate_string_data to avoid Faset breakage.
5675 Reported by Julien Danjou <julien@danjou.info> in
5676 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5677 * alloc.c (allocate_string_data): Restore old code with minor
5678 adjustments, fix comment to explain this subtle issue.
5679
5680 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5681
5682 Remove FILE_SYSTEM_CASE.
5683 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5684
5685 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5686 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5687 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5688 call-process-region passes it through expand-file-name.
5689
5690 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5691
5692 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5693
5694 Fix crash when creating indirect buffer (Bug#11917)
5695 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5696 Don't handle unbound variables specially if non-zero.
5697 (Fbuffer_local_variables): Pass zero.
5698 (clone_per_buffer_values): Pass non-zero.
5699
5700 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5701
5702 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5703 to make the loop interruptible.
5704
5705 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5706
5707 * gnutls.c (emacs_gnutls_handshake): Only retry if
5708 GNUTLS_E_INTERRUPTED.
5709
5710 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5711
5712 Cleanup and convert miscellaneous checks to eassert.
5713 * alloc.c (mark_interval): Fix comment, partially rephrase
5714 old comment from intervals.h (see below).
5715 * intervals.c (find_interval, adjust_intervals_for_insertion)
5716 (delete_interval, adjust_intervals_for_deletion)
5717 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5718 Convert to eassert.
5719 (adjust_intervals_for_insertion, make_new_interval):
5720 Remove obsolete and unused code.
5721 * intervals.h (struct interval): Remove obsolete comment.
5722 * textprotp.c (erase_properties): Remove unused code.
5723 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5724 (Fremove_list_of_text_properties): Convert to eassert.
5725
5726 2012-07-17 Chong Yidong <cyd@gnu.org>
5727
5728 * editfns.c (Finsert_char): Doc fix.
5729
5730 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5731
5732 Fix previous change to make Fmemory_free always accurate.
5733 * alloc.c (make_interval): Update total_free_intervals.
5734 (make_float): Likewise for total_free_floats.
5735 (free_cons, Fcons): Likewise for total_free_conses.
5736 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5737 Likewise for total_free_vector_bytes.
5738 (Fmake_symbol): Likewise for total_free_symbols.
5739 (bytes_free): Remove.
5740
5741 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5742
5743 Simple free memory accounting feature.
5744 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5745 (sweep_vectors): Accumulate size of free vectors.
5746 (Fgarbage_collect): Setup bytes_free.
5747 (Fmemory_free): New function.
5748 (syms_of_alloc): Register it.
5749
5750 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 Cleanup overlays checking.
5753 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5754 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5755 eassert and OVERLAYP.
5756 (sort_overlays): Change to use OVERLAYP.
5757
5758 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5759
5760 * editfns.c (Finsert_char): Make it interactive, and make the
5761 second arg optional. Copy interactive spec and docstring from
5762 ucs-insert.
5763
5764 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5765
5766 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5767 Unlike the other wrapped functions, fabs has an unspecified
5768 effect on errno.
5769
5770 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5771
5772 * nsterm.m (keyDown): Interpret flags without left/right bits
5773 as the left key (Bug#11670).
5774
5775 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5776
5777 Remove empty and useless init functions.
5778 * lisp.h (init_character_once, init_fns, init_image)
5779 (init_filelock, init_sound): Remove prototype.
5780 * character.c (init_character_once): Remove.
5781 * filelock.c (init_filelock): Likewise.
5782 * fns.c (init_fns): Likewise.
5783 * image.c (init_image): Likewise.
5784 * sound.c (init_sound): Likewise.
5785 * emacs.c (main): Adjust accordingly.
5786
5787 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5788
5789 * gtkutil.h: Tiny cleanups.
5790 (use_old_gtk_file_dialog): Remove useless declaration.
5791 (xg_uses_old_file_dialog): Add suggested const attribute.
5792
5793 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5794
5795 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5796 (bidi_paragraph_init): Use it to limit search forward for a strong
5797 directional character in abnormally large paragraphs full of
5798 neutral or weak characters. (Bug#11943)
5799
5800 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5801
5802 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5803 the toolbar (Bug#9451).
5804 (xg_make_tool_item): Give the widget event box a transparent
5805 background.
5806
5807 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5808
5809 Cleanup basic allocation variables and functions.
5810 * alloc.c (ignore_warnings, init_intervals, init_float)
5811 (init_cons, init_symbol, init_marker): Remove.
5812 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5813 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5814 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5815 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5816 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5817 (staticidx, init_alloc_once, init_strings, free_ablock):
5818 Remove redundant initialization.
5819 * fns.c (init_weak_hash_tables): Remove.
5820 * lisp.h (init_weak_hash_tables): Remove prototype.
5821
5822 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5823
5824 Use zero_vector where appropriate.
5825 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5826 accordingly.
5827 * lisp.h (zero_vector): New declaration.
5828 * font.c (null_vector): Remove.
5829 (syms_of_font): Remove initialization and staticpro.
5830 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5831 * keymap.c (Faccessible_keymaps): Likewise.
5832
5833 2012-07-15 Leo Liu <sdl.web@gmail.com>
5834
5835 * fringe.c: Fix typo in comments.
5836
5837 2012-07-14 Leo Liu <sdl.web@gmail.com>
5838
5839 * fringe.c: Add a new bitmap exclamation-mark.
5840
5841 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5842
5843 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5844
5845 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5846 (HAVE_MENUS): Don't define, defined by editing config.in with
5847 msdos/sed2v2.inp.
5848 (GMALLOC_INHIBIT_VALLOC): Don't define.
5849 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5850
5851 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5852
5853 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5854
5855 2012-07-14 Glenn Morris <rgm@gnu.org>
5856
5857 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5858 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5859 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5860
5861 2012-07-13 Glenn Morris <rgm@gnu.org>
5862
5863 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5864
5865 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5866 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5867
5868 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5869
5870 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5871 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5872 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5873 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5874 where appropriate.
5875 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5876 as boolean expression.
5877 (x_set_window_size): Remove unused variable toolbar.
5878 (ns_get_color_default, ns_mod_to_lisp): Remove.
5879 (ns_mouse_position): Remove unused variables xchar and ychar.
5880 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5881 (ns_set_vertical_scroll_bar): Remove unused variable count.
5882 (ns_delete_terminal): Remove unused variable i.
5883 (ns_term_init): Remove unused variables r, g and b.
5884 (mouseDown): Remove unused variable window.
5885 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5886 (initFrameFromEmacs): Remove unused variable vbextra.
5887 (mouseEntered): Remove unused variables p and dpyinfo.
5888 (mouseExited): Remove unused variables p and r.
5889 (ns_define_frame_cursor, ns_clear_frame_area)
5890 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5891 (menuDown): Assign [sender tag] to variable and cast the variable.
5892
5893 * nsterm.h (menuDown): Add id as type to argument sender.
5894 (ns_display_info_for_name): Add Lisp_Object argument.
5895 (ns_term_init): Add Lisp_Object argument.
5896 (ns_map_event_to_object): Add void argument.
5897 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5898 prototype with arguments and only declare if __OBJC__.
5899 (nxatoms_of_nsselect): Add void argument.
5900 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5901 (ns_alloc_autorelease_pool): Add void argument.
5902 (ns_release_autorelease_pool): Add void* argument.
5903 (ns_get_defaults_value): Add const char* argument.
5904
5905 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5906 (initFromContents): Use SSDATA where appropriate.
5907 (ns_update_menubar): Add braces to ambigous if-else.
5908 (initWithTitle): Put () around assignment in if statement.
5909 (ns_menu_show): Remove unused variables window and keymap.
5910 (update_frame_tool_bar): Remove unused variable selected_p.
5911 (initWithContentRect): Remove unused variable this_cmd_name.
5912
5913 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5914 appropriate.
5915 (setXBMColor): Remove unused variable len.
5916 (setPixmapData): Put () around assignment in loop statement.
5917
5918 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5919 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5920 where appropriate.
5921 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5922 around assignment in loop statement.
5923 (nsfont_open): Remove unused variable i.
5924 (nsfont_open): Remove unused variable len.
5925 (nsfont_draw): Remove unused variable cs.
5926
5927 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5928 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5929 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5930 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5931 (Fns_font_name, Fns_perform_service)
5932 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5933 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5934 (ns_set_name): Remove unused variable view.
5935 (x_set_menu_bar_lines): Remove unused variable olines.
5936 (x_set_tool_bar_lines): Remove unused variable root_window.
5937 (Fns_list_colors): Put () around assignment in while statement.
5938 (Fns_perform_service): Remove unused variable len.
5939 (Fns_display_usable_bounds): Remove unused variable top.
5940 (syms_of_nsfns): Remove unused variable i.
5941
5942 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5943 memcpy (Bug#11907).
5944
5945 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5946
5947 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5948 and free it with DestroyExceptionInfo (Bug#11558).
5949
5950 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5951
5952 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5953 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5954 Set here, not in nt/config.nt.
5955
5956 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5957
5958 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5959 cursor overflow into the last glyph on display line when the right
5960 fringe is off. (Bug#11832)
5961
5962 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5963
5964 * xdisp.c (produce_special_glyphs): Now static.
5965 * dispextern.h (produce_special_glyphs): Remove decl.
5966
5967 2012-07-13 Glenn Morris <rgm@gnu.org>
5968
5969 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5970 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5971
5972 * s/usg5-4-common.h (USG, USG5):
5973 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5974 * s/sol2-6.h (SOLARIS2):
5975 * s/irix6-5.h (IRIX6_5):
5976 * s/hpux10-20.h (USG, USG5, HPUX):
5977 * s/gnu-linux.h (USG, GNU_LINUX):
5978 * s/freebsd.h (BSD_SYSTEM):
5979 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5980 * s/cygwin.h (CYGWIN):
5981 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5982 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5983
5984 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5985
5986 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5987
5988 2012-07-13 Glenn Morris <rgm@gnu.org>
5989
5990 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5991
5992 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5993
5994 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5995 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5996
5997 2012-07-12 Glenn Morris <rgm@gnu.org>
5998
5999 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
6000
6001 * process.c (init_process_emacs): Rename from init_process.
6002 The old name is also the name of a Mach system call.
6003 * lisp.h, emacs.c: Update for this name change.
6004 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6005 longer needed.
6006
6007 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6008
6009 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6010 memmove call that removes glyphs covered by the left truncation
6011 glyph. Improve commentary.
6012 (display_line): Fix display of continuation glyphs on GUI frames
6013 when the right fringe is turned off and variable-size fonts are
6014 used in the window. Move the code that appends a stretch glyph to
6015 produce_special_glyphs, so that it could be used for truncation
6016 and continuation glyphs alike.
6017 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6018 glyph of a suitably computed width, to align the special glyphs at
6019 the window margin. Code moved from display_line. (Bug#11832)
6020
6021 2012-07-12 Glenn Morris <rgm@gnu.org>
6022
6023 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6024
6025 * s/gnu-linux.h, s/hpux10-20.h:
6026 Do not unconditionally define HAVE_XRMSETDATABASE.
6027
6028 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6029
6030 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6031
6032 Fix typos that broke OS X build.
6033 Reported by Randal L. Schwartz in
6034 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6035 * nsterm.m (ns_timeout): Add missing local decl.
6036 (ns_get_color): snprintf -> sprintf, to fix typo.
6037
6038 2012-07-12 Glenn Morris <rgm@gnu.org>
6039
6040 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6041 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6042 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6043 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6044
6045 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6046 Move PTY_OPEN to configure.
6047
6048 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6049 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6050 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6051
6052 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6053
6054 Use empty_unibyte_string where applicable.
6055 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6056 * lread.c (read1): Likewise.
6057 * xsettings.c (syms_of_xsettings): Likewise.
6058
6059 2012-07-12 Glenn Morris <rgm@gnu.org>
6060
6061 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6062 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6063 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6064 * s/hpux10-20.h (RUN_TIME_REMAP):
6065 * s/bsd-common.h (TABDLY): Move to configure.
6066
6067 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6068
6069 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6070
6071 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6072 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6073
6074 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6075
6076 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6077 * s/template.h: Move NARROWPROTO to configure.
6078
6079 2012-07-11 Glenn Morris <rgm@gnu.org>
6080
6081 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6082 unused since 2011-01-17 change to systty.h.
6083
6084 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6085 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6086 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6087
6088 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6089
6090 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6091
6092 2012-07-11 Glenn Morris <rgm@gnu.org>
6093
6094 * s/darwin.h, s/gnu-linux.h, s/template.h:
6095 Move INTERRUPT_INPUT to configure.
6096
6097 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 Minor adjustments to interning code.
6100 * lisp.h (intern, intern_c_string): Redefine as static inline
6101 wrappers for intern_1 and intern_c_string_1, respectively.
6102 (intern_1, intern_c_string_1): Rename prototypes.
6103 * lread.c (intern_1, intern_c_string_1, oblookup):
6104 Simplify Vobarray checking.
6105 * font.c (font_intern_prop): Likewise. Adjust comment.
6106 * w32font.c (intern_font_name): Likewise.
6107
6108 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6109
6110 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6111
6112 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6113 of Fcar/Fcdr if possible.
6114 * font.c (check_otf_features): Likewise.
6115 * fontset.c (Fnew_fontset): Likewise.
6116 * gnutls.c (Fgnutls_boot): Likewise.
6117 * minibuf.c (read_minibuf): Likewise.
6118 * msdos.c (IT_set_frame_parameters): Likewise.
6119 * xmenu.c (Fx_popup_dialog): Likewise.
6120 * w32menu.c (Fx_popup_dialog): Likewise.
6121
6122 2012-07-11 Glenn Morris <rgm@gnu.org>
6123
6124 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6125 since nothing has defined it on these platforms.
6126
6127 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6128 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6129
6130 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6131 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6132 Move CLASH_DETECTION to configure.
6133
6134 * s/gnu.h: Remove file, which is now empty.
6135
6136 * s/gnu.h, s/gnu-linux.h:
6137 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6138
6139 2012-07-11 John Wiegley <johnw@newartisans.com>
6140
6141 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6142 function attribute, so we only use it if it exists in the
6143 compiler.
6144
6145 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6146
6147 Avoid call to strlen in fast_c_string_match_ignore_case.
6148 * search.c (fast_c_string_match_ignore_case): Change to use
6149 length argument. Adjust users accordingly.
6150 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6151
6152 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6153
6154 Assume mkdir, rmdir.
6155 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6156 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6157
6158 Assume rename.
6159 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6160
6161 Assume perror.
6162 * s/hpux10-20.h (HAVE_PERROR): Remove.
6163 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6164 Remove dummy definition, as this problem was obsolete long ago.
6165
6166 Assume strerror.
6167 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6168
6169 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6170
6171 Avoid calls to strlen in font processing functions.
6172 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6173 (font_open_by_name): Change to use length argument.
6174 Adjust users accordingly.
6175 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6176 Adjust prototypes.
6177 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6178 Change to return ptrdiff_t.
6179 (xfont_list_pattern, xfont_match): Use length returned by
6180 xfont_decode_coding_xlfd.
6181 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6182
6183 2012-07-11 Glenn Morris <rgm@gnu.org>
6184
6185 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6186 Move DONT_REOPEN_PTY to configure.
6187
6188 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6189 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6190
6191 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 Remove "#define unix" that is no longer needed (Bug#11905).
6194 * s/aix4-2.h (unix): Remove; no longer needed.
6195
6196 EMACS_TIME simplification (Bug#11875).
6197 This replaces macros (which typically do not work in GDB)
6198 with functions, typedefs and enums, making the code easier to debug.
6199 The functional style also makes code easier to read and maintain.
6200 * systime.h: Include <sys/time.h> on all hosts, not just if
6201 WINDOWSNT, since 'struct timeval' is needed in general.
6202 (EMACS_TIME): Now a typedef, not a macro.
6203 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6204 not macros.
6205 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6206 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6207 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6208 (EMACS_TIME_LE): Now functions, not macros.
6209 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6210 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6211 which are not functions. All uses rewritten to use:
6212 (make_emacs_time): New function.
6213 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6214 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6215 not functions. All uses rewritten to use the following, respectively:
6216 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6217 (add_emacs_time, sub_emacs_time): New functions.
6218 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6219 * fileio.c (Fcopy_file):
6220 * xterm.c (XTflash): Get the current time closer to when it's used.
6221 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6222
6223 * bytecode.c (targets): Suppress -Woverride-init warnings.
6224
6225 Simplify by avoiding confusing use of strncpy etc.
6226 * doc.c (Fsnarf_documentation):
6227 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6228 * frame.c (Fmake_terminal_frame):
6229 * gtkutil.c (get_utf8_string):
6230 * lread.c (openp):
6231 * nsmenu.m (ns_update_menubar):
6232 * regex.c (regerror):
6233 Prefer memcpy to strncpy and strncat when either will do.
6234 * fileio.c (Fsubstitute_in_file_name):
6235 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6236 (menu_separator_name_p):
6237 * nsmenu.m (ns_update_menubar):
6238 Prefer memcmp to strncmp when either will do.
6239 * nsterm.m: Include <ftoastr.h>.
6240 (ns_get_color):
6241 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6242 Prefer snprintf to strncpy.
6243 * nsterm.m (ns_term_init):
6244 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6245 * nsterm.m (ns_term_init):
6246 Avoid the need for strncpy, by using build_string or
6247 make_unibyte_string directly. Use dtoastr, not snprintf.
6248 * process.c (Fmake_network_process): Diagnose service names that
6249 are too long, rather than silently truncating them or creating
6250 non-null-terminated names.
6251 (Fnetwork_interface_info): Likewise, for interface names.
6252 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6253 Prefer sprintf to strncat.
6254 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6255 Prefer vsnprintf to vsprintf + strncpy.
6256
6257 2012-07-10 Glenn Morris <rgm@gnu.org>
6258
6259 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6260 Clarify fallback case.
6261
6262 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6263
6264 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6265 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6266 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6267 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6268 where argument type is known to be a Lisp_Cons.
6269
6270 2012-07-10 Tom Tromey <tromey@redhat.com>
6271
6272 * bytecode.c (BYTE_CODE_THREADED): New macro.
6273 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6274 (enum byte_code_op): New type.
6275 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6276 (exec_byte_code): Use them. Use token threading when applicable.
6277
6278 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Optimize pure C strings initialization.
6281 * lisp.h (make_pure_string): Fix prototype.
6282 (build_pure_c_string): New function, defined as static inline. This
6283 provides a better opportunity to optimize away calls to strlen when
6284 the function is called with compile-time constant argument.
6285 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6286 argument, adjust users accordingly. Use build_pure_c_string where
6287 appropriate.
6288 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6289 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6290 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6291
6292 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6293
6294 Avoid calls to strlen in miscellaneous functions.
6295 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6296 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6297 * lread.c (openp): Likewise.
6298
6299 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6300
6301 Avoid calls to strlen in path processing functions.
6302 * fileio.c (file_name_as_directory): Add comment. Change to add
6303 srclen argument and return the length of result. Adjust users
6304 accordingly.
6305 (directory_file_name): Fix comment. Change to add srclen argument,
6306 swap 1st and 2nd arguments to obey the common convention.
6307 Adjust users accordingly.
6308 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6309
6310 2012-07-10 Glenn Morris <rgm@gnu.org>
6311
6312 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6313 Move PENDING_OUTPUT_COUNT definition to configure.
6314
6315 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6316 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6317 * s/gnu.h (DATA_START): Move definitions to configure.
6318
6319 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6320 We include usg5-4-common.h, which defines them both.
6321
6322 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6323 O_RDONLY already includes it).
6324
6325 Stop ns builds setting the EMACSLOADPATH environment variable.
6326 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6327 Now it does not set EMACSLOADPATH, just returns the load-path string.
6328 * nsterm.h: Update accordingly.
6329 * lread.c [HAVE_NS]: Include nsterm.h.
6330 (init_lread) [HAVE_NS]: Use ns_load_path.
6331 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6332
6333 2012-07-09 Glenn Morris <rgm@gnu.org>
6334
6335 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6336 since the included bsd-common.h does so.
6337
6338 Stop ns builds setting the EMACSPATH environment variable.
6339 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6340 (ns_init_paths): Do not set EMACSPATH.
6341 * nsterm.h (ns_exec_path): Add it.
6342 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6343 Use ns_exec_path.
6344
6345 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6346
6347 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6348
6349 * process.c (wait_reading_process_output): 'waitchannels' was unset
6350 when read_kbd || !NILP (wait_for_cell); fix this.
6351
6352 Add GCC-style 'const' attribute to functions that can use it.
6353 * character.h (char_resolve_modifier_mask):
6354 * keyboard.h (make_ctrl_char):
6355 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6356 (init_character_once, next_almost_prime, init_fns, init_image)
6357 (flush_pending_output, init_sound):
6358 * mem-limits.h (start_of_data):
6359 * menu.h (finish_menu_items):
6360 Add ATTRIBUTE_CONST.
6361 * emacs.c (DEFINE_DUMMY_FUNCTION):
6362 Declare the dummy function with ATTRIBUTE_CONST.
6363 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6364 Add decls with ATTRIBUTE_CONST.
6365
6366 Minor improvements to make_formatted_string.
6367 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6368 where int is good enough, as vsprintf returns an int.
6369 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6370
6371 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6372
6373 Use make_formatted_string to avoid double length calculation.
6374 * lisp.h (make_formatted_string): New prototype.
6375 * alloc.c (make_formatted_string): New function.
6376 * buffer.c (Fgenerate_new_buffer_name): Use it.
6377 * dbusbind.c (syms_of_dbusbind): Likewise.
6378 * editfns.c (Fcurrent_time_zone): Likewise.
6379 * filelock.c (get_boot_time): Likewise.
6380 * frame.c (make_terminal_frame, set_term_frame_name)
6381 (x_report_frame_params): Likewise.
6382 * image.c (gs_load): Likewise.
6383 * minibuf.c (get_minibuffer): Likewise.
6384 * msdos.c (dos_set_window_size): Likewise.
6385 * process.c (make_process): Likewise.
6386 * xdisp.c (ensure_echo_area_buffers): Likewise.
6387 * xsettings.c (apply_xft_settings): Likewise.
6388
6389 2012-07-09 Glenn Morris <rgm@gnu.org>
6390
6391 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6392 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6393 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6394 * nsterm.h (ns_etc_directory): Add it.
6395 * callproc.c [HAVE_NS]: Include nsterm.h.
6396 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6397
6398 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6399
6400 Move marker debugging code under MARKER_DEBUG.
6401 * marker.c (MARKER_DEBUG): Move marker debugging code under
6402 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6403 for bootstrap with --enable-checking (~3x slowdown reported
6404 by Juanma Barranquero <lekktu@gmail.com>).
6405 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6406
6407 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6410 See <http://bugs.gnu.org/11825#29>.
6411
6412 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6413
6414 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6415 has no font, use the frame's font. (Bug#11813)
6416 (display_line): Add commentary about displaying truncation glyphs
6417 on GUI frames.
6418 (produce_special_glyphs): Move here from term.c.
6419
6420 * term.c (produce_special_glyphs): Move to xdisp.c.
6421
6422 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6423 section.
6424
6425 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6426
6427 * xdisp.c (display_line): Avoid warning about implicit declaration
6428 of FRAME_FONT.
6429
6430 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6431
6432 * lisp.h: Remove empty conditional.
6433
6434 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6435
6436 * lread.c (load_path_check): Now static.
6437
6438 Fix some minor --with-ns problems found by static checking.
6439 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6440 (x_set_font) [!HAVE_X_WINDOWS]:
6441 * image.c (xpm_load_image) [HAVE_NS]:
6442 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6443 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6444 Remove unused local.
6445 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6446 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6447 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6448 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6449 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6450 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6451 Fix pointer signedness problem.
6452 * xfaces.c (FRAME_X_FONT_TABLE):
6453 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6454
6455 2012-07-07 Glenn Morris <rgm@gnu.org>
6456
6457 * lread.c (load_path_check): New function, split from init_lread.
6458 (init_lread): Reorganize. Motivation:
6459 If EMACSLOADPATH is set, check/warn about that rather than the
6460 defaults, which we are not going to use. Hence we can remove
6461 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6462 Don't warn if site-lisp directories are missing.
6463 If not installed, start from a blank load-path, since
6464 PATH_LOADSEARCH refers to the eventual installation directories.
6465
6466 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6467
6468 Support truncation and continuation glyphs on GUI frames, when
6469 fringes are disabled. (Bug#11832)
6470 * xdisp.c (init_iterator): Get dimensions of truncation and
6471 continuation glyphs even if on GUI frames.
6472 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6473 or both, are absent.
6474 (start_display, move_it_in_display_line_to): Handle the case of a
6475 GUI frame without a fringe to display continuation or truncation
6476 glyphs.
6477 (insert_left_trunc_glyphs): Support GUI frames: make sure
6478 truncation glyphs overwrite enough glyphs from the current line to
6479 have sufficient space in pixels.
6480 (display_line): Support truncation and continuation glyphs on GUI
6481 frames. If some spare pixels are left on the line after inserting
6482 the truncation glyphs, fill that space with a stretch glyph of a
6483 suitably computed width.
6484
6485 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6486 produce_glyphs, to support GUI sessions.
6487
6488 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6489
6490 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6491
6492 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6493
6494 Do not require float-time's arg to fit in time_t (Bug#11825).
6495 This works better on hosts where time_t is unsigned, and where
6496 float-time is applied to the (negative) difference between two times.
6497 * editfns.c (decode_time_components): Last arg is now double *,
6498 not int *, and means to store all the result as a double, without
6499 worrying about whether the seconds part fits in time_t.
6500 All callers changed.
6501 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6502 All callers changed.
6503 (Ffloat_time): Do not fail merely because the specified time falls
6504 outside of time_t range.
6505
6506 2012-07-07 Glenn Morris <rgm@gnu.org>
6507
6508 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6509 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6510 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6511
6512 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6513
6514 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6515 Update dependencies.
6516
6517 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6518
6519 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6520
6521 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6522 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6523 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6524 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6525 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6526 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6527
6528 * xfont.c (compare_font_names): Redo to omit the need for casts.
6529
6530 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6531
6532 * xfns.c (Fx_change_window_property): Doc fix.
6533 * w32fns.c (Fx_change_window_property): Doc fix.
6534
6535 * w32fns.c (Fx_window_property): Accept the same arguments as the
6536 X Windows version. Doc fix.
6537 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6538
6539 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6540 Eli Zaretskii <eliz@gnu.org>
6541
6542 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6543 Windows-specific code from nt/config.nt moved here.
6544 Obsolete settings removed.
6545
6546 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 * process.c: Avoid unnecessary calls to gettime.
6549 (wait_reading_process_output): Don't get the time of day
6550 when gobbling data immediately and not waiting, as there's no need
6551 for it in that case. This removes a FIXME.
6552
6553 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6554
6555 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6556 is defined (Bug#11768).
6557
6558 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6559
6560 Fix marker debugging code.
6561 * marker.c (byte_char_debug_check): Do not perform the check
6562 if buffer is not multibyte.
6563 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6564 Call byte_char_debug_check with correct arguments.
6565
6566 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6567
6568 Compile marker debugging code only if ENABLE_CHECKING is defined.
6569 * marker.c (byte_char_debug_check, count_markers):
6570 Use only if ENABLE_CHECKING is defined.
6571 (byte_debug_flag): Remove.
6572 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6573 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6574
6575 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6576
6577 Avoid code repetition in marker-related functions.
6578 * marker.c (attach_marker): New function.
6579 (Fset_marker, set_marker_restricted, set_marker_both)
6580 (set_marker_restricted_both): Use it.
6581 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6582 Consistently rename charno to charpos.
6583 (marker_position): Add eassert.
6584 (marker_byte_position): Convert to eassert.
6585
6586 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6587
6588 Simplify list operations in unchain_overlay and unchain_marker.
6589 * buffer.c (unchain_overlay): Simplify. Add comment.
6590 * marker.c (unchain_marker): Simplify. Fix comments.
6591
6592 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6593
6594 Introduce fast path for the widely used marker operation.
6595 * alloc.c (build_marker): New function.
6596 * lisp.h (build_marker): New prototype.
6597 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6598 * composite.c (autocmp_chars): Likewise.
6599 * editfns.c (buildmark): Remove.
6600 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6601 (save_restriction_save): Use build_marker.
6602 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6603 * window.c (save_window_save): Likewise.
6604
6605 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6606
6607 Do not use Fdelete_overlay in delete_all_overlays
6608 to avoid redundant calls to unchain_overlay.
6609 * buffer.c (drop_overlay): New function.
6610 (delete_all_overlays, Fdelete_overlay): Use it.
6611 * minibuf.c (get_minibuffer): Fix comment.
6612
6613 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 Port to OpenBSD 5.1 amd64.
6616 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6617 This is needed for OpenBSD, and should be harmless on all BSD systems.
6618 Also, include <sys/sysctl.h>, as it should be available on all
6619 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6620 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6621 use p_pid member, not kp_proc.pid.
6622
6623 2012-07-06 Glenn Morris <rgm@gnu.org>
6624
6625 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6626
6627 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 More xmalloc and related cleanup.
6630 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6631 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6632 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6633 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6634 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6635 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6636 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6637 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6638 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6639 * xterm.c:
6640 Omit needless casts involving void * pointers and allocation.
6641 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6642 as the former is more robust if P's type is changed.
6643 Prefer xzalloc to xmalloc + memset 0.
6644 Simplify malloc-or-realloc to realloc.
6645 Don't worry about xmalloc returning a null pointer.
6646 Prefer xstrdup to xmalloc + strcpy.
6647 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6648 growing it.
6649 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6650 alloca of a constant.
6651
6652 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6653
6654 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6655 hscroll is larger than the line width. Fixes long and futile
6656 looping inside extend_face_to_end_of_line (on a TTY) producing
6657 glyphs that are not needed and thrown away.
6658
6659 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6660
6661 * marker.c (set_marker_restricted_both): Simplify by using
6662 clip_to_bounds.
6663
6664 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6667
6668 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6669
6670 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6671 not defined (Bug#11768).
6672 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6673 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6674 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6675 followed by gtk_box_set_homogeneous (Bug#11768).
6676 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6677 (update_theme_scrollbar_width, xg_create_scroll_bar):
6678 Use gtk_scrollbar_new (Bug#11768).
6679 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6680 (is_box_type): New function (Bug#11768).
6681 (xg_tool_item_stale_p): Call is_box_type.
6682 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6683 with default display (Bug#11768).
6684
6685 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6686
6687 * xdisp.c (window_hscroll_limited): New function.
6688 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6689 coordinates when window's hscroll is set to insanely large
6690 values. (Bug#11857)
6691
6692 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6693
6694 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6695 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6696
6697 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6698
6699 Cleanup xmalloc.
6700 * lisp.h (xzalloc): New prototype. Omit needless casts.
6701 * alloc.c (xzalloc): New function. Omit needless casts.
6702 * charset.c: Omit needless casts. Convert all calls to
6703 xmalloc with following memset to xzalloc.
6704 * dispnew.c: Likewise.
6705 * fringe.c: Likewise.
6706 * image.c: Likewise.
6707 * sound.c: Likewise.
6708 * term.c: Likewise.
6709 * w32fns.c: Likewise.
6710 * w32font.c: Likewise.
6711 * w32term.c: Likewise.
6712 * xfaces.c: Likewise.
6713 * xfns.c: Likewise.
6714 * xterm.c: Likewise.
6715 * atimer.c: Omit needless casts.
6716 * buffer.c: Likewise.
6717 * callproc.c: Likewise.
6718 * ccl.c: Likewise.
6719 * coding.c: Likewise.
6720 * composite.c: Likewise.
6721 * doc.c: Likewise.
6722 * doprnt.c: Likewise.
6723 * editfns.c: Likewise.
6724 * emacs.c: Likewise.
6725 * eval.c: Likewise.
6726 * filelock.c: Likewise.
6727 * fns.c: Likewise.
6728 * gtkutil.c: Likewise.
6729 * keyboard.c: Likewise.
6730 * lisp.h: Likewise.
6731 * lread.c: Likewise.
6732 * minibuf.c: Likewise.
6733 * msdos.c: Likewise.
6734 * print.c: Likewise.
6735 * process.c: Likewise.
6736 * region-cache.c: Likewise.
6737 * search.c: Likewise.
6738 * sysdep.c: Likewise.
6739 * termcap.c: Likewise.
6740 * terminal.c: Likewise.
6741 * tparam.c: Likewise.
6742 * w16select.c: Likewise.
6743 * w32.c: Likewise.
6744 * w32reg.c: Likewise.
6745 * w32select.c: Likewise.
6746 * w32uniscribe.c: Likewise.
6747 * widget.c: Likewise.
6748 * xdisp.c: Likewise.
6749 * xmenu.c: Likewise.
6750 * xrdb.c: Likewise.
6751 * xselect.c: Likewise.
6752
6753 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 * fileio.c (time_error_value): Check the right error number.
6756 Problem reported by Troels Nielsen in
6757 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6758
6759 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6762 This should be fixed in a better way; see Eli Zaretskii in
6763 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6764 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6765
6766 * fileio.c (time_error_value): Rename from special_mtime.
6767 The old name's problems were noted by Eli Zaretskii in
6768 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6769
6770 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6771 This variable's comment says Emacs needs at least one GDB-visible
6772 symbol of type enum pvec_type, to work around GDB problems.
6773 The symbol's value doesn't matter.
6774
6775 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6776 that causes compilation to fail on pre-C99 compilers.
6777
6778 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6779
6780 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6781 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6782
6783 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6784
6785 * buffer.c (init_buffer_once): Fix initialization of
6786 headers for buffer_defaults and buffer_local_symbols.
6787 Reported by Juanma Barranquero <lekktu@gmail.com>.
6788
6789 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6790
6791 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6792 * lisp.h (enum pvec_type): Use fewer bits.
6793 (PSEUDOVECTOR_SIZE_BITS): New constant.
6794 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6795 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6796 change in pvec_type.
6797 (PSEUDOVECTOR_TYPEP): New macro.
6798 (TYPED_PSEUDOVECTORP): Use it.
6799 * fns.c (internal_equal): Adapt code to extract pvectype.
6800 * emacs.c (gdb_pvec_type): Update type.
6801 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6802 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6803 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6804 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6805 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6806 abusing vector->header.next.nbytes.
6807 (live_vector_p): Use PVEC_TYPE.
6808 (mark_object): Adapt code to extract pvectype. Use switch.
6809
6810 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6811
6812 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6813 Tighten new eassert a bit.
6814
6815 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6816
6817 Fix compilation with --enable-gcc-warnings and -O1
6818 optimization level.
6819 * doprnt.c (doprnt): Change type of tem to int, initialize
6820 to avoid compiler warning. Add eassert.
6821 * search.c (simple_search): Initialize match_byte to avoid
6822 compiler warning. Add eassert.
6823
6824 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 Avoid weird behavior with large horizontal scrolls.
6827 Without this change, for example, large hscroll values would
6828 mess up Emacs's display on Fedora 15 x86, presumably due to
6829 overflows in int calculations in the display code.
6830 Also, if buffers had long lines, Emacs would freeze.
6831 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6832 (set_window_hscroll): New function, containing the old guts of
6833 Fset_window_hscroll. Return the clipped value.
6834 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6835 This avoids the need to check against PTRDIFF_MAX.
6836
6837 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6838
6839 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6840
6841 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6842
6843 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6844
6845 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6846 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6847 since GCC 4.4.6 issues a bogus warning for them.
6848
6849 Fix bugs in file timestamp newness comparisons.
6850 * fileio.c (Ffile_newer_than_file_p):
6851 * lread.c (Fload): Use full timestamp resolution of files,
6852 not just the 1-second resolution, so that files that are only
6853 slightly newer still count as newer.
6854 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6855 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6856
6857 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6858
6859 * fileio.c: Improve handling of file time marker. (Bug#11852)
6860 (special_mtime): New function.
6861 (Finsert_file_contents, Fverify_visited_file_modtime):
6862 Use it to set special mtime values consistently.
6863
6864 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6865
6866 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6867 marker for non-existing file. (Bug#11852)
6868
6869 2012-07-03 Glenn Morris <rgm@gnu.org>
6870
6871 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6872 and did not make it into globals.h).
6873
6874 2012-07-03 Tom Tromey <tromey@redhat.com>
6875
6876 * window.c (Fset_window_margins, Fset_window_fringes)
6877 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6878 * textprop.c (Fprevious_property_change): No longer static.
6879 * syntax.c (Fsyntax_table_p): No longer static.
6880 * process.c (Fget_process, Fprocess_datagram_address): No longer
6881 static.
6882 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6883 * keyboard.c (Fcommand_execute): No longer static.
6884 Remove EXFUN.
6885 * insdel.c (Fcombine_after_change_execute): No longer static.
6886 * image.c (Finit_image_library): No longer static.
6887 * fileio.c (Fmake_symbolic_link): No longer static.
6888 * eval.c (Ffetch_bytecode): No longer static.
6889 * editfns.c (Fuser_full_name): No longer static.
6890 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6891 No longer static.
6892 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6893 static.
6894 * dired.c (Ffile_attributes): No longer static.
6895 * composite.c (Fcomposition_get_gstring): No longer static.
6896 * callproc.c (Fgetenv_internal): No longer static.
6897
6898 * ccl.h: Remove EXFUNs.
6899 * buffer.h: Remove EXFUNs.
6900 * dispextern.h: Remove EXFUNs.
6901 * intervals.h: Remove EXFUNs.
6902 * fontset.h: Remove EXFUN.
6903 * font.h: Remove EXFUNs.
6904 * dosfns.c (system_process_attributes): Remove EXFUN.
6905 * keymap.h: Remove EXFUNs.
6906 * lisp.h: Remove EXFUNs.
6907 * w32term.h: Remove EXFUNs.
6908 * window.h: Remove EXFUNs.
6909 * xsettings.h: Remove EXFUN.
6910 * xterm.h: Remove EXFUN.
6911
6912 2012-07-03 Glenn Morris <rgm@gnu.org>
6913
6914 * lisp.h (Frandom): Make it visible to C.
6915 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6916 buffer for invisible buffers. (Bug#1229)
6917
6918 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6919
6920 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6921 values which aren't power of 2.
6922 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6923 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6924 accordingly.
6925
6926 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6927
6928 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6929
6930 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6931
6932 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6933
6934 * alloc.c (allocate_vector_block): Remove redundant
6935 calls to mallopt if DOUG_LEA_MALLOC is defined.
6936 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6937 avoid calls to mallopt if zero_vector is returned.
6938
6939 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6940
6941 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6942 is enabled, avoid dereferencing NULL current_sblock if
6943 running undumped.
6944
6945 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6946
6947 Cleanup basic buffer management.
6948 * buffer.h (struct buffer): Change layout to use generic vector
6949 marking code. Fix some comments. Change type of 'clip_changed'
6950 to bitfield. Remove unused #ifndef old.
6951 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6952 (GET_OVERLAYS_AT): Fix indentation.
6953 (for_each_per_buffer_object_at): New macro.
6954 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6955 (Fbuffer_local_variables): Use it.
6956 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6957 * alloc.c (allocate_buffer): Adjust to match new layout of
6958 struct buffer. Fix comment.
6959 (mark_overlay): New function.
6960 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6961 Lisp area of struct buffer.
6962 (mark_object): Use it. Adjust marking of misc objects
6963 and related comments.
6964
6965 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6968 wrapper that is not needed because the wrapped code is a no-op (zero
6969 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6970 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6971
6972 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6973
6974 * alloc.c (mark_buffer): Simplify. Remove prototype.
6975 (mark_object): Add comment. Reorganize marking of vector-like
6976 objects. Use CHECK_LIVE for all vector-like objects except buffers
6977 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6978 Avoid redundant calls to mark_vectorlike for bool vectors.
6979
6980 2012-06-30 Glenn Morris <rgm@gnu.org>
6981
6982 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6983
6984 * epaths.in (PATH_SITELOADSEARCH): New.
6985 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6986 This is rather than relying on --enable-locallisppath elements
6987 having "site-lisp" in their names. (Bug#10208#25, 11658)
6988
6989 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6990
6991 * w32proc.c (sys_select): Accept and ignore one more argument.
6992
6993 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6994
6995 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6996 (pselect) [!MS_DOS]: Redirect to sys_select.
6997
6998 * sysdep.c: Don't include dos.h and dosfns.h.
6999
7000 * process.c (sys_select):
7001 * msdos.c (sys_select): Accept one more argument and ignore it.
7002
7003 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7004 adapt data types and code to that.
7005
7006 * dosfns.c:
7007 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7008 which clashes with the gnulib function of the same name.
7009
7010 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7011
7012 * font.c (font_style_to_value, font_style_symbolic)
7013 (font_prop_validate_style): Add type checks for values in
7014 font_style_table.
7015
7016 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7017 argument.
7018 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7019 uses.
7020
7021 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7022
7023 * xdisp.c (try_window_id): Undo last change.
7024
7025 * w32.c (getwd): Adjust commentary about startup_dir.
7026 (init_environment): Always call sys_access, even in non-MSVC
7027 builds. Don't chdir to the directory of the Emacs executable.
7028 This undoes code from 1997 which was justified by the need to
7029 "avoid conflicts when removing and renaming directories". But its
7030 downside was that every relative file name was being interpreted
7031 relative to the directory of the Emacs executable, which can never
7032 be TRT. In particular, it broke sys_access when called with
7033 relative file names.
7034 (sys_access): Map GetLastError to errno.
7035
7036 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7037
7038 * window.h (struct window): Change type of 'fringes_outside_margins'
7039 to bitfield. Fix comment. Adjust users accordingly.
7040 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7041 Adjust comment.
7042 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7043 to ptrdiff_t.
7044
7045 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7046
7047 * gnutls.c (emacs_gnutls_handshake):
7048 Add QUIT to make the loop interruptible.
7049
7050 2012-06-29 Glenn Morris <rgm@gnu.org>
7051
7052 * charset.c (init_charset): Make lack of etc/charsets fatal.
7053
7054 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7055
7056 * editfns.c (region_limit): Fix type mismatch.
7057
7058 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7059
7060 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7061 undefined. Convert from xassert to eassert.
7062 * nsmenu.m: Convert from xassert to eassert.
7063 * nsterm.m: Likewise.
7064
7065 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7066
7067 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7068
7069 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7070
7071 Avoid integer overflow on scroll-left and scroll-right.
7072 * window.c (HSCROLL_MAX): New macro.
7073 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7074 overflow when requested scroll falls outside ptrdiff_t range.
7075
7076 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7077
7078 * window.h (struct window): Change type of 'hscroll',
7079 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7080 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7081 Adjust users accordingly.
7082 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7083 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7084 from EMACS_INT to ptrdiff_t.
7085 (make_window): Omit redundant initialization.
7086
7087 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7088
7089 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7090
7091 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7092
7093 * window.h (struct window): Change type of 'use_time' and
7094 'sequence_number' from Lisp_Object to int.
7095 * frame.c (make_frame): Adjust users accordingly.
7096 * print.c (print_object): Likewise.
7097 * window.c (select_window, Fwindow_use_time, make_parent_window)
7098 (make_window): Likewise.
7099
7100 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7101
7102 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7103 enabled with --enable-checking=[all,glyphs] configure option.
7104 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7105 adjust comments accordingly.
7106 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7107 undefined, adjust comments accordingly.
7108 * image.c: Likewise.
7109 * scroll.c: Likewise.
7110 * w32fns.c: Likewise.
7111 * w32term.c: Likewise.
7112 * xdisp.c: Likewise.
7113 * xfaces.c: Likewise.
7114 * xfns.c: Likewise.
7115 * xterm.c: Likewise.
7116
7117 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7118
7119 Generalize run-time debugging checks.
7120 * dispextern.h (XASSERTS): Remove.
7121 * fontset.c (xassert): Remove.
7122 Convert from xassert to eassert.
7123 * alloc.c: Convert from xassert to eassert.
7124 * bidi.c: Likewise.
7125 * dispnew.c: Likewise.
7126 * fns.c: Likewise.
7127 * fringe.c: Likewise.
7128 * ftfont.c: Likewise.
7129 * gtkutil.c: Likewise.
7130 * image.c: Likewise.
7131 * keyboard.c: Likewise.
7132 * menu.c: Likewise.
7133 * process.c: Likewise.
7134 * scroll.c: Likewise.
7135 * sound.c: Likewise.
7136 * term.c: Likewise.
7137 * w32console.c: Likewise.
7138 * w32fns.c: Likewise.
7139 * w32term.c: Likewise.
7140 * window.c: Likewise.
7141 * xdisp.c: Likewise.
7142 * xfaces.c: Likewise.
7143 * xfns.c: Likewise.
7144 * xselect.c: Likewise.
7145 * xterm.c: Likewise.
7146
7147 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7148
7149 * fns.c (maybe_resize_hash_table): Output message when growing the
7150 purify-hashtable.
7151
7152 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 * alloc.c (allocate_string_data): Remove dead code.
7155 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7156 avoid GCC warning about unused macro.
7157
7158 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7159
7160 * alloc.c (allocate_string): Omit intervals initialization.
7161 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7162 as in make_pure_string and make_pure_c_string.
7163
7164 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7165
7166 * alloc.c (allocate_string): Fix last change.
7167
7168 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7169
7170 * alloc.c (allocate_string): Remove two redundant calls
7171 to memset, add explicit initialization where appropriate.
7172
7173 2012-06-27 Glenn Morris <rgm@gnu.org>
7174
7175 * lisp.mk (lisp): Remove paths.elc.
7176
7177 2012-06-27 Chong Yidong <cyd@gnu.org>
7178
7179 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7180
7181 2012-06-26 John Wiegley <johnw@newartisans.com>
7182
7183 * unexmacosx.c (copy_data_segment): Add two section names used
7184 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7185
7186 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7187 when building with Clang.
7188
7189 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7190
7191 * eval.c (Fapply): Allow calling it with a single argument.
7192
7193 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7194
7195 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7196 _stricmp and _strnicmp.
7197 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7198
7199 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7200
7201 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7202 allocated window.
7203 (allocate_process): Likewise for new process.
7204 (allocate_terminal): Change to use offsetof.
7205 (allocate_frame): Likewise.
7206 * frame.c (make_frame): Omit redundant initialization.
7207 * window.c (make_parent_window): Use memset.
7208 (make_window): Omit redundant initialization.
7209 * process.c (make_process): Omit redundant initialization.
7210 * terminal.c (create_terminal): Likewise.
7211
7212 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7213
7214 * term.c (delete_tty): Remove redundant call to memset.
7215
7216 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7217
7218 * alloc.c: Remove build_string.
7219 * lisp.h: Define build_string as static inline. This provides
7220 a better opportunity to optimize away calls to strlen when the
7221 function is called with compile-time constant argument.
7222 * image.c (imagemagick_error): Convert to build_string.
7223 * w32proc.c (sys_spawnve): Likewise.
7224 * xterm.c (x_term_init): Likewise.
7225
7226 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 Use sprintf return value instead of invoking strlen on result.
7229 In the old days this wasn't portable, since some sprintf
7230 implementations returned char *. But they died out years ago and
7231 Emacs already assumes sprintf returns int.
7232 Similarly for float_to_string.
7233 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7234 * ccl.c (ccl_driver):
7235 * character.c (string_escape_byte8):
7236 * data.c (Fnumber_to_string):
7237 * doprnt.c (doprnt):
7238 * print.c (print_object):
7239 * xdisp.c (message_dolog):
7240 * xfns.c (syms_of_xfns):
7241 Use sprintf or float_to_string result to avoid need to call strlen.
7242 * data.c (Fnumber_to_string):
7243 Use make_unibyte_string, since the string must be ASCII.
7244 * lisp.h, print.c (float_to_string): Now returns int length.
7245 * term.c (produce_glyphless_glyph):
7246 Use sprintf result rather than recomputing it.
7247
7248 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7249 * Makefile.in (ALL_CFLAGS):
7250 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7251 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7252
7253 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7254
7255 * dispextern.h (xstrcasecmp): Define to library function
7256 strcasecmp if available.
7257 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7258
7259 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7260
7261 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7262 Avoid comma operator.
7263 * menu.c (push_submenu_start, push_submenu_end)
7264 (push_left_right_boundary, push_menu_pane): Likewise.
7265 * msdos.c (dos_rawgetc): Likewise.
7266
7267 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7268
7269 * xfns.c (xic_create_fontsetname): Remove redundant calls
7270 to memset.
7271
7272 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7273
7274 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7275 sprintf already null-terminates its output.
7276
7277 * xfns.c (x_window): Remove redundant cast.
7278
7279 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7280
7281 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7282 `const char *' to `char *' to avoid compiler warning.
7283
7284 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7287 instead of truncating it to 63 (admittedly a generous limit).
7288
7289 * process.c: Fix spelling and caps in comments.
7290
7291 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7292
7293 * emacs.c (setpgrp): Remove definition, unused.
7294 * sysdep.c (setpgrp): Remove definition, not used in this file.
7295
7296 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7297
7298 * makefile.w32-in: Update dependencies.
7299
7300 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7301
7302 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7303 (SYSTIME_H): Add nt/inc/sys/time.h.
7304
7305 * systime.h [WINDOWSNT]: Include sys/time.h.
7306
7307 * s/ms-w32.h (struct timespec): Definition moved from
7308 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7309
7310 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7313 * buffer.h (buffer_slot_type_mismatch):
7314 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7315 * eval.c (unwind_to_catch):
7316 * image.c (my_png_error, my_error_exit):
7317 * keyboard.c (quit_throw_to_read_char, user_error)
7318 (Fexit_recursive_edit, Fabort_recursive_edit):
7319 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7320 (wrong_type_argument, buffer_overflow, __executable_start)
7321 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7322 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7323 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7324 (fatal):
7325 (child_setup) [!DOS_NT]:
7326 * lread.c (end_of_file_error, invalid_syntax):
7327 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7328 * puresize.h (pure_write_error):
7329 * search.c (matcher_overflow):
7330 * sound.c (sound_perror, alsa_sound_perror):
7331 * sysdep.c, syssignal.h (croak):
7332 * term.c (maybe_fatal, vfatal):
7333 * textprop.c (text_read_only):
7334 * undo.c (user_error):
7335 * unexmacosx.c (unexec_error):
7336 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7337 Use _Noreturn rather than NO_RETURN.
7338 No need for separate decl merely because of _Noreturn.
7339 * sound.c (sound_warning, parse_sound):
7340 Remove unnecessary forward decls.
7341
7342 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7343
7344 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7345 * lisp.h (WAIT_READING_MAX): New macro.
7346 * dispnew.c (Fsleep_for, sit_for):
7347 * keyboard.c (kbd_buffer_get_event):
7348 * process.c (Faccept_process_output):
7349 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7350 This improves on the previous patch, which introduced a bug
7351 when time_t is unsigned and as wide as intmax_t.
7352 See <http://bugs.gnu.org/9000#51>.
7353
7354 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7355
7356 * dispnew.c (sit_for, Fsleep_for):
7357 * keyboard.c (kbd_buffer_get_event):
7358 * process.c (Faccept_process_output): Avoid compiler warnings when
7359 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7360
7361 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7362
7363 * makefile.w32-in: Update dependencies.
7364
7365 * w32.c (ltime): Add return type and declare static.
7366 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7367
7368 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7371 Privately reported by Herbert J. Skuhra.
7372 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7373 All uses changed.
7374 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7375 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7376
7377 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7378
7379 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7380 last argument of make_unibyte_string.
7381
7382 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7383 language ID in the event parameters.
7384
7385 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7386 event.code, not the obscure "character set ID".
7387
7388 2012-06-23 Chong Yidong <cyd@gnu.org>
7389
7390 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7391
7392 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7393
7394 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7395 * w32.c (fdutimens): New function.
7396
7397 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7398
7399 * s/ms-w32.h (pselect): Redirect to sys_select.
7400
7401 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7402
7403 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7404 in the logic of incrementing and decrementing the value of
7405 use_relocatable_buffers.
7406
7407 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7408
7409 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7410 Privately reported by Herbert J. Skuhra.
7411 [__FreeBSD__]: Remove "*/" typo after "#include".
7412 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7413 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7414 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7415 Don't assume EMACS_TIME and struct timeval are the same type.
7416
7417 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7418
7419 Support higher-resolution time stamps (Bug#9000).
7420 The time stamps are only nanosecond-resolution at the C level,
7421 since that's the best that any real-world system supports now.
7422 But they are picosecond-resolution at the Lisp level, as that's
7423 easy, and leaves room for future OS improvements.
7424
7425 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7426 (LIBES): Use it.
7427
7428 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7429 Don't get current time unless it's needed.
7430
7431 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7432 now provides it if it's absent.
7433 (start_atimer): Port to higher-res time stamps.
7434 Check for time stamp overflow. Don't get current time more
7435 often than is needed.
7436
7437 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7438 Include systime.h, not time.h.
7439 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7440
7441 * dired.c: Include stat-time.h.
7442 (Ffile-attributes): File times now have higher resolution.
7443
7444 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7445 (struct image): Timestamp now has higher resolution.
7446
7447 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7448 has at least microseconds now. All uses removed.
7449 (update_frame, update_single_window, update_window, update_frame_1)
7450 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7451 (duration_to_sec_usec): Remove; no longer needed.
7452
7453 * editfns.c (time_overflow): Now extern.
7454 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7455 (float-time, Fformat_time_string, Fcurrent_time_string)
7456 (Fcurrent_time_zone): Accept and generate higher-resolution
7457 time stamps.
7458 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7459 (decode_time_components, lisp_seconds_argument): New functions.
7460 (make_time): Now static.
7461 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7462 Report an error if the time is invalid, rather than having the caller
7463 do that.
7464
7465 * fileio.c: Include <stat-time.h>
7466 (Fcopy_file): Copy higher-resolution time stamps.
7467 Prefer to set the time stamp via a file descriptor if that works.
7468 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7469 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7470 (Fvisited_file_modtime, Fset_visited_file_modtime):
7471 Support higher-resolution time stamps.
7472
7473 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7474
7475 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7476
7477 * image.c (prepare_image_for_display, clear_image_cache)
7478 (lookup_image): Port to higer-resolution time stamps.
7479
7480 * keyboard.c (start_polling, bind_polling_period):
7481 Check for time stamp overflow.
7482 (read_char, kbd_buffer_get_event, timer_start_idle)
7483 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7484 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7485 Port to higher-resolution time stamps. Do not assume time_t is signed.
7486 (decode_timer): New function. Timers are now vectors of length 9,
7487 not 8, to accommodate the picosecond component.
7488 (timer_check_2): Use it.
7489
7490 * nsterm.m (select_timeout, timeval_subtract): Remove.
7491 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7492 as they're a bit more accurate and handle overflow better.
7493 (ns_select): Change prototype to be compatible with pselect.
7494 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7495 * nsterm.h (ns_select): Adjust prototype.
7496
7497 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7498 us-resolution time stamps.
7499 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7500
7501 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7502
7503 * lisp.h (time_overflow): New decl.
7504 (wait_reading_process_output): First arg is now intmax_t, not int,
7505 to accommodate larger waits.
7506
7507 * process.h (struct Lisp_Process.read_output_delay):
7508 Now counts nanoseconds, not microseconds.
7509 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7510 EMACS_HAS_USECS.
7511 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7512 (wait_reading_process_output):
7513 Port to ns-resolution time stamps.
7514 (Faccept_process_output, wait_reading_process_output):
7515 Check for time stamp overflow. Do not assume time_t is signed.
7516 (select_wrapper): Remove; we now use pselect.
7517 (Fprocess_attributes): Now generates ns-resolution time stamps.
7518
7519 * sysdep.c: Include utimens.h. Don't include utime.h
7520 or worry about struct utimbuf; gnulib does that for us now.
7521 (gettimeofday): Remove; gnulib provides a substitute.
7522 (make_timeval): New function.
7523 (set_file_times): Now sets ns-resolution time stamps.
7524 New arg FD; all uses changed.
7525 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7526 (system_process_attributes):
7527 Now returns ns-resolution time stamp. All uses changed.
7528 Check for time stamp overflow.
7529
7530 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7531 provides a substitute now.
7532
7533 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7534 since it guarantees struct timespec.
7535 (EMACS_TIME): Now struct timespec, so that we can support
7536 ns-resolution time stamps.
7537 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7538 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7539 (EMACS_USECS): Remove.
7540 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7541 so multiply the arg by 1000 before storing it.
7542 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7543 New macros.
7544 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7545 Port to ns-resolution time stamps.
7546 (EMACS_TIME_NEG_P): Remove; replaced by....
7547 (EMACS_TIME_SIGN): New macro.
7548 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7549 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7550 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7551 (make_timeval, make_lisp_time, decode_time_components): New decls.
7552 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7553 that it mishandled time_t overflow. You can't compare by subtracting!
7554 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7555 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7556
7557 * term.c: Include <sys/time.h>.
7558 (timeval_to_Time): New function, for proper overflow wraparound.
7559 (term_mouse_position, term_mouse_click): Use it.
7560
7561 * undo.c (record_first_change): Support higher-resolution time stamps
7562 in the undo buffer.
7563 (Fprimitive_undo): Use them when restoring time stamps.
7564
7565 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7566 (w32_get_internal_run_time):
7567 Port to higher-resolution Emacs time stamps.
7568 (ltime): Now accepts single 64-bit integer, as that's more convenient
7569 for callers.
7570
7571 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7572
7573 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7574 for compatibility with pselect. Support ns-resolution time stamps.
7575
7576 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7577
7578 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7579 Check for time stamp overflow, and support ns-resolution time stamps.
7580
7581 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7582 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7583 (timeval_subtract): Remove; no longer needed.
7584 (XTflash, XTring_bell, x_wait_for_event):
7585 Port to ns-resolution time stamps. Don't assume time_t is signed.
7586
7587 2012-06-22 Chong Yidong <cyd@gnu.org>
7588
7589 * xdisp.c (x_consider_frame_title): Revert last change.
7590
7591 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7592
7593 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7594 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7595 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7596 staticidx goes up to 1597 out of 1600 = 0x640.)
7597
7598 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7601 Otherwise, the umask might be mistakenly 0 while handling input signals.
7602
7603 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7604
7605 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7606
7607 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7608
7609 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7610 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7611 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7612 access to `contents' member of Lisp_Vector objects with AREF and ASET
7613 where appropriate.
7614
7615 2012-06-19 Chong Yidong <cyd@gnu.org>
7616
7617 * frame.c (delete_frame): When selecting a frame on a different
7618 text terminal, do not alter the terminal's top-frame.
7619
7620 * xdisp.c (format_mode_line_unwind_data): Record the target
7621 frame's selected window and its terminal's top-frame.
7622 (unwind_format_mode_line): Restore them.
7623 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7624 Callers changed.
7625 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7626 since tty frames can be explicitly named.
7627 (prepare_menu_bars): Likewise.
7628
7629 * term.c (Ftty_top_frame): New function.
7630
7631 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7632
7633 Port byte-code-meter to modern targets.
7634 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7635 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7636 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7637 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7638 (METER_1, METER_2): Simplify.
7639
7640 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7641
7642 * data.c (Fdefalias): Return `symbol' (bug#11686).
7643
7644 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7645
7646 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7647 gets killed during executing of this function (Bug#11665).
7648 Try to always return Qt when the buffer has been actually killed.
7649 (Vkill_buffer_query_functions): In doc-string say that functions
7650 run by this hook should not change the current buffer.
7651
7652 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7653
7654 Fix recently-introduced process.c problems found by static checking.
7655 * process.c (write_queue_push, write_queue_pop, send_process):
7656 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7657 (write_queue_pop): Fix pointer signedness problem.
7658 (send_process): Remove unused local.
7659
7660 2012-06-17 Chong Yidong <cyd@gnu.org>
7661
7662 * xdisp.c (redisplay_internal): No need to redisplay terminal
7663 frames that are not on top.
7664
7665 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7666
7667 * process.c (make_process): Initialize write_queue.
7668 (write_queue_push, write_queue_pop): New functions.
7669 (send_process): Use them to maintain correct ordering of process
7670 writes (Bug#10815).
7671
7672 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7673
7674 * lisp.h (eassert): Assume C89 or later.
7675 This removes the need for CHECK.
7676 (CHECK): Remove. Its comments about always evaluating its
7677 argument were confusing, as 'eassert' typically does not evaluate
7678 its argument.
7679
7680 * coding.c (produce_chars): Use ptrdiff_t, not int.
7681
7682 * xterm.c (x_draw_underwave): Check for integer overflow.
7683 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7684
7685 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7686
7687 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7688 referenced (Bug#11583).
7689
7690 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7691
7692 Implement wave-style variant of underlining.
7693 * dispextern.h (face_underline_type): New enum.
7694 (face): Add field for underline type.
7695 * nsterm.m (ns_draw_underwave): New function.
7696 (ns_draw_text_decoration): Use it.
7697 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7698 New functions.
7699 (x_draw_glyph_string): Use them.
7700 * xfaces.c (Qline, Qwave): New Lisp objects.
7701 (check_lface_attrs, merge_face_ref)
7702 (Finternal_set_lisp_face_attribute, realize_x_face):
7703 Handle wave-style underline face attributes.
7704 * xterm.c (x_draw_underwave): New function.
7705 (x_draw_glyph_string): Use it.
7706
7707 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7708
7709 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7710 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7711 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7712 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7713 ($(BLD)/w32select.$(O)): Update dependencies.
7714
7715 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7716
7717 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7718 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7719 * character.c (_fetch_multibyte_char_p): Remove.
7720 * alloc.c: Include "character.h" before "buffer.h".
7721 * bidi.c: Likewise.
7722 * buffer.c: Likewise.
7723 * bytecode.c: Likewise.
7724 * callint.c: Likewise.
7725 * callproc.c: Likewise.
7726 * casefiddle.c: Likewise.
7727 * casetab.c: Likewise.
7728 * category.c: Likewise.
7729 * cmds.c: Likewise.
7730 * coding.c: Likewise.
7731 * composite.c: Likewise.
7732 * dired.c: Likewise.
7733 * dispnew.c: Likewise.
7734 * doc.c: Likewise.
7735 * dosfns.c: Likewise.
7736 * editfns.c: Likewise.
7737 * emacs.c: Likewise.
7738 * fileio.c: Likewise.
7739 * filelock.c: Likewise.
7740 * font.c: Likewise.
7741 * fontset.c: Likewise.
7742 * fringe.c: Likewise.
7743 * indent.c: Likewise.
7744 * insdel.c: Likewise.
7745 * intervals.c: Likewise.
7746 * keyboard.c: Likewise.
7747 * keymap.c: Likewise.
7748 * lread.c: Likewise.
7749 * macros.c: Likewise.
7750 * marker.c: Likewise.
7751 * minibuf.c: Likewise.
7752 * nsfns.m: Likewise.
7753 * nsmenu.m: Likewise.
7754 * print.c: Likewise.
7755 * process.c: Likewise.
7756 * regex.c: Likewise.
7757 * region-cache.c: Likewise.
7758 * search.c: Likewise.
7759 * syntax.c: Likewise.
7760 * term.c: Likewise.
7761 * textprop.c: Likewise.
7762 * undo.c: Likewise.
7763 * unexsol.c: Likewise.
7764 * w16select.c: Likewise.
7765 * w32fns.c: Likewise.
7766 * w32menu.c: Likewise.
7767 * window.c: Likewise.
7768 * xdisp.c: Likewise.
7769 * xfns.c: Likewise.
7770 * xmenu.c: Likewise.
7771 * xml.c: Likewise.
7772 * xselect.c: Likewise.
7773
7774 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7775
7776 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7777 If all the glyphs of the glyph row came from strings, and we have no
7778 cursor positioning clues, put the cursor on the first glyph of the
7779 row.
7780 (handle_face_prop): Use chunk-relative overlay string index when
7781 indexing into it->string_overlays array. (Bug#11653)
7782 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7783 the rightmost. (Bug#11720)
7784
7785 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7786
7787 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7788 (CATEGORY_MEMBER): Enforce 1/0 value.
7789 * category.c (_temp_category_set): Remove.
7790
7791 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7792
7793 * window.c (Fdelete_other_windows_internal)
7794 (Fdelete_window_internal): Don't access frame's mouse highlight
7795 info of the initial frame. (Bug#11677)
7796
7797 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7798
7799 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7800 Assume USE_2_TAGS_FOR_INTS.
7801 (xreload): Adjust $tagmask width to match recent lisp.h change.
7802
7803 Simplify lisp.h in minor ways that should not affect code.
7804 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7805 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7806 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7807 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7808 (INTTYPEBITS): New macro, for clarity.
7809 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7810 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7811 Simplify now that USE_LSB_TAG is always defined.
7812 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7813 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7814
7815 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7816
7817 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7818
7819 2012-06-13 Glenn Morris <rgm@gnu.org>
7820
7821 * s/bsd-common.h (BSD4_3):
7822 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7823
7824 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7825
7826 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7827 instead of union.
7828 (XLI, XIL): Define.
7829 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7830 Use them.
7831 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7832 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7833 * alloc.c (widen_to_Lisp_Object): Remove.
7834 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7835 * frame.c (delete_frame): Remove outdated comment.
7836 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7837 USE_LISP_UNION_TYPE.
7838 (Fw32_unregister_hot_key): Likewise.
7839 (Fw32_toggle_lock_key): Likewise.
7840 * w32menu.c (add_menu_item): Likewise.
7841 (w32_menu_display_help): Use XIL instead of checking
7842 USE_LISP_UNION_TYPE.
7843 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7844 (init_heap): Likewise.
7845 * w32term.c (w32_read_socket): Update comment.
7846
7847 2012-06-13 Glenn Morris <rgm@gnu.org>
7848
7849 * s/usg5-4-common.h, src/s/unixware.h:
7850 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7851
7852 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7853
7854 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7855
7856 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7857 * alloc.c (make_number) [!defined make_number]:
7858 Remove, as lisp.h always defines this now.
7859 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7860 (roundup_size): Verify that it is a power of 2.
7861 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7862 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7863 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7864 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7865 USE_LSB_TAG now is always defined to be either 0 or 1.
7866 All uses changed.
7867 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7868 code works fine either way, and efficiency is not a concern here,
7869 as the union type is for debugging, not for production.
7870 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7871 Use an inline function on all platforms when using the union type,
7872 since this is simpler and 'static inline' can be used portably
7873 within Emacs now.
7874 (LISP_INITIALLY_ZERO): New macro.
7875 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7876 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7877
7878 2012-06-12 Glenn Morris <rgm@gnu.org>
7879
7880 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7881
7882 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7883
7884 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7885 Move BROKEN_SIGIO to configure.
7886
7887 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7888 Move NO_TERMIO to configure.
7889
7890 2012-06-12 Chong Yidong <cyd@gnu.org>
7891
7892 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7893 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7894 MagickExportImagePixels is undefined.
7895
7896 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 * image.c (imagemagick_load_image): Remove unused label.
7899
7900 2012-06-11 Glenn Morris <rgm@gnu.org>
7901
7902 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7903 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7904 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7905 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7906
7907 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7908
7909 * alloc.c (make_byte_code): New function.
7910 (Fmake_byte_code): Use it. Don't purify here.
7911 * lread.c (read1): Use it as well to avoid extra allocation.
7912
7913 2012-06-11 Chong Yidong <cyd@gnu.org>
7914
7915 * image.c (imagemagick_load_image): Implement transparency.
7916
7917 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7918
7919 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7920 account for preceding backslashes. (Bug#11663)
7921
7922 2012-06-09 Chong Yidong <cyd@gnu.org>
7923
7924 * term.c: Support italics in capable terminals (Bug#9652).
7925 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7926 (turn_on_face): Output using TS_enter_italic_mode if available.
7927 Don't handle unused blinking and alt-charset cases.
7928 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7929 and tty_alt_charset_p cases.
7930 (tty_capable_p, init_tty): Support italics.
7931
7932 * termchar.h (struct tty_display_info): Add field for italics.
7933 Remove unused blink field.
7934
7935 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7936 Handle slant.
7937
7938 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7939 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7940 tty_alt_charset_p. Add tty_italic_p.
7941
7942 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7943
7944 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7945 dbus_type_is_basic if available.
7946 (xd_extract_signed, xd_extract_unsigned): Rename from
7947 extract_signed and extract_unsigned, respectively. Adapt callers.
7948
7949 2012-06-09 Chong Yidong <cyd@gnu.org>
7950
7951 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7952
7953 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7954 case (Bug#9752).
7955
7956 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7957
7958 * xdisp.c (vmessage): Treat frame message as multibyte.
7959 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7960 would generate the diagnostic "Making \302\247 buffer-local while
7961 let-bound!".
7962
7963 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7964
7965 * dispnew.c (showing_window_margins_p): Undo last change, which
7966 was done due to an inadvertent commit.
7967 (adjust_frame_glyphs_for_frame_redisplay): Do call
7968 showing_window_margins_p.
7969
7970 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7971
7972 * eval.c (Fmake_var_non_special): New primitive.
7973 (syms_of_eval): Defsubr it.
7974 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7975
7976 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7977
7978 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7979 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7980
7981 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7982
7983 * alloc.c (allocate_vectorlike): Fix last change.
7984
7985 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7986
7987 Block-based vector allocation of small vectors.
7988 * lisp.h (struct vectorlike_header): New field `nbytes',
7989 adjust comment accordingly.
7990 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7991 to denote vector blocks. Adjust users (live_vector_p,
7992 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7993 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7994 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7995 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7996 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7997 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7998 (roundup_size): New constant.
7999 (struct vector_block): New data type.
8000 (vector_blocks, vector_free_lists, zero_vector): New variables.
8001 (all_vectors): Rename to `large_vectors'.
8002 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8003 (sweep_vectors): New functions.
8004 (allocate_vectorlike): Return `zero_vector' as the only vector of
8005 0 items. Allocate new vector from block if vector size is less than
8006 or equal to VBLOCK_BYTES_MAX.
8007 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8008 (init_alloc_once): Add call to init_vectors.
8009
8010 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8011
8012 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8013
8014 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8015
8016 * doprnt.c (doprnt): Truncate multibyte char correctly.
8017 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8018 would mishandle a string argument "Xc" if X was a multibyte
8019 character of length 2: it would truncate after X's first byte
8020 rather than including all of X.
8021
8022 2012-06-06 Chong Yidong <cyd@gnu.org>
8023
8024 * buffer.c (word_wrap): Doc fix.
8025
8026 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8027
8028 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8029
8030 2012-06-03 Glenn Morris <rgm@gnu.org>
8031
8032 * xdisp.c (tool-bar-style): Doc fix.
8033
8034 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8035
8036 * Makefile.in (PAXCTL): Define.
8037 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8038 binary via PaX flags if the paxctl utility is available.
8039 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8040 Restore PaX flags to their default. (Bug#11398)
8041
8042 2012-06-03 Chong Yidong <cyd@gnu.org>
8043
8044 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8045 buffer (Bug#11226).
8046
8047 2012-06-03 Chong Yidong <cyd@gnu.org>
8048
8049 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8050 (note_mode_line_or_margin_highlight): If there is no help echo,
8051 use mode-line-default-help-echo. Handle the case where the mouse
8052 position is past the end of the mode line string.
8053
8054 * buffer.c (buffer_local_value_1): New function, split from
8055 Fbuffer_local_value; can return Qunbound.
8056 (Fbuffer_local_value): Use it.
8057 (Vmode_line_format): Docstring tweaks.
8058
8059 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8060
8061 * sysdep.c (system_process_attributes): Improve comment.
8062
8063 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8064
8065 * keyboard.c: Export real-this-command to Elisp.
8066 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8067 and DEFVAR it. Update all users.
8068
8069 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8072
8073 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8074 Convert pctcpu and pctmem to Lisp float properly.
8075 Let the compiler fold better, as 100.0/0x8000 is exact.
8076
8077 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8078
8079 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8080 cons_block.
8081
8082 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8083
8084 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8085
8086 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8087
8088 For a 'struct window', replace some Lisp_Object fields to
8089 bitfields where appropriate, remove unused fields.
8090 * window.h (struct window): Remove unused 'last_mark_x' and
8091 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8092 change its type from Lisp_Object to bitfield.
8093 Change type of 'force_start', 'optional_new_start',
8094 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8095 fields from Lisp_Object to bitfield. Adjust users accordingly.
8096
8097 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 Pacify gcc -Wdouble-precision when using Xaw.
8100 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8101 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8102 Use 'float' consistently, rather than 'float' in most places
8103 and 'double' in a couple of places.
8104
8105 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8106
8107 * xdisp.c (handle_stop): Detect whether we have overlay strings
8108 loaded by testing it->current.overlay_string_index to be
8109 non-negative, instead of checking whether n_overlay_strings is
8110 positive. (Bug#11587)
8111
8112 2012-05-31 Chong Yidong <cyd@gnu.org>
8113
8114 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8115
8116 * doc.c (Fsubstitute_command_keys): Doc fix.
8117
8118 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8119
8120 * search.c (search_buffer): Remove calls to
8121 r_alloc_inhibit_buffer_relocation, as it is now called by
8122 maybe_unify_char, which was the cause of relocation of buffer text
8123 in bug#11519.
8124
8125 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8126
8127 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8128 for the duration of call to load_charset, to avoid problems with
8129 callers of maybe_unify_char that access buffer text through C
8130 pointers.
8131
8132 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8133 decrement the inhibition flag, instead of just setting or
8134 resetting it.
8135
8136 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8137
8138 Remove obsolete '#define static' cruft.
8139 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8140 This #undef was "temporary" in 2000; it is no longer needed
8141 now that '#define static' has gone away.
8142 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8143 (gray_bitmap_bits): Remove; no longer needed.
8144 All uses replaced with definiens.
8145 * xterm.c: Include "bitmaps/gray.xbm".
8146
8147 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 Clean up __executable_start, monstartup when --enable-profiling.
8150 The following changes affect the code only when profiling.
8151 * dispnew.c (__executable_start): Rename from safe_bcopy.
8152 Define only on platforms that need it.
8153 * emacs.c: Include <sys/gmon.h> when profiling.
8154 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8155 (__executable_start): Remove decl, since lisp.h does it now.
8156 (safe_bcopy): Remove decl; no longer has that name.
8157 (main): Coalesce #if into single bit of code, for simplicity.
8158 Cast pointers to uintptr_t, since standard libraries want integers
8159 and not pointers.
8160 * lisp.h (__executable_start): New decl.
8161
8162 2012-05-31 Glenn Morris <rgm@gnu.org>
8163
8164 * image.c (Fimagemagick_types): Doc fix.
8165
8166 2012-05-30 Jim Meyering <meyering@redhat.com>
8167
8168 * callproc.c (Fcall_process_region): Include directory component
8169 in mkstemp error message (Bug#11586).
8170
8171 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * alloc.c, lisp.h (make_pure_vector): Now static.
8174
8175 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8176
8177 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8178 Move to byte-run.el.
8179 (Fautoload): Do the hash-doc more carefully.
8180 * data.c (Fdefalias): Purify definition, except for keymaps.
8181 (Qdefun): Move from eval.c.
8182 * lisp.h (Qdefun): Remove.
8183 * lread.c (read1): Tiny simplification.
8184
8185 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8186
8187 Do not create empty overlays with the evaporate property (Bug#9642).
8188 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8189 Bug#9642, but explicitly check that the buffer the overlay would
8190 be moved to is live and rearrange lines to make sure that errors
8191 will not put the overlay in an inconsistent state.
8192 (Fdelete_overlay): Cosmetics.
8193
8194 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8195
8196 * w32term.c (my_bring_window_to_top): New function.
8197 (x_raise_frame): Use handle returned by DeferWindowPos, which
8198 could be different from the original one.
8199 Call my_bring_window_to_top instead of my_set_foreground_window.
8200 (Bug#11513)
8201
8202 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8203 by calling BringWindowToTop.
8204
8205 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8206 (WM_EMACS_END): Increase by one.
8207
8208 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8209
8210 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8211 This avoids undefined behavior that might cause the eassert
8212 to not catch an out-of-range value.
8213
8214 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8215
8216 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8217 Update dependencies.
8218
8219 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8220
8221 * bidi.c (bidi_mirror_char): Fix last change.
8222
8223 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8224
8225 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8226 when referring to sectname field in printf format.
8227
8228 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8229
8230 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8231 Only r_alloc_inhibit_buffer_relocation needed to be added;
8232 the others were already declared.
8233
8234 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8235 before checking whether it's out of range. Put the check inside
8236 eassert. See
8237 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8238
8239 2012-05-27 Ken Brown <kbrown@cornell.edu>
8240
8241 * callproc.c (Fcall_process): Restore a line that was accidentally
8242 commented out in the 2011-02-13 change (bug#11547).
8243
8244 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8245
8246 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8247 defined on ralloc.c.
8248
8249 * buffer.c [REL_ALLOC]: Remove prototypes of
8250 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8251 they are now on lisp.h.
8252
8253 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8254
8255 * search.c (search_buffer): Use it to inhibit relocation of buffer
8256 text while re_search_2 is doing its job, because re_search_2 is
8257 passed C pointers to buffer text. (Bug#11519)
8258
8259 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8260 Update value to 24.
8261
8262 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8263 state after an additional call to move_it_in_display_line_to, keep
8264 the values of it->max_ascent and it->max_descent found for the
8265 entire line.
8266 (pos_visible_p): Revert the comparison against bottom_y to what it
8267 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8268 (Bug#11464)
8269
8270 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8271
8272 Fix coding-related core dumps with gcc -ftrapv.
8273 The code was computing A - B, where A and B are pointers, and B is
8274 random garbage. This can lead to core dumps on platforms that
8275 have special pointer registers, and it also leads to core dumps on
8276 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8277 A - B only when B is initialized properly.
8278 * coding.c (coding_set_source, coding_set_destination): Return void.
8279 (coding_change_source, coding_change_destinations): New functions,
8280 with the old behaviors of coding_set_source and coding_set_destination.
8281 All callers that need an offset changed to use these new functions.
8282
8283 2012-05-26 Glenn Morris <rgm@gnu.org>
8284
8285 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8286
8287 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8288
8289 Extend mouse support on W32 text-mode console.
8290 * xdisp.c (draw_row_with_mouse_face):
8291 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8292
8293 * w32console.c: Include window.h.
8294 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8295 New functions.
8296 (initialize_w32_display): Initialize mouse-highlight data.
8297
8298 * w32inevt.c: Include termchar.h and window.h.
8299 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8300 moves, call note_mouse_highlight. If help_echo changed, call
8301 gen_help_event to produce help-echo message in the echo area.
8302 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8303 highlight info.
8304
8305 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8306
8307 * lread.c (read1): Simplify slightly to avoid an overflow warning
8308 with GCC 4.7.0 on x86-64.
8309
8310 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8311
8312 * bidi.c (bidi_mirror_char): Revert last change: an int is
8313 definitely wide enough here.
8314
8315 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 Fix integer width and related bugs (Bug#9874).
8318 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8319 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8320 (string_bytes, check_sblock, allocate_string_data):
8321 (compact_small_strings, Fmake_bool_vector, make_string)
8322 (make_unibyte_string, make_multibyte_string)
8323 (make_string_from_bytes, make_specified_string)
8324 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8325 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8326 (mark_vectorlike):
8327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8328 (allocate_pseudovector):
8329 Use int, not EMACS_INT, where int is wide enough.
8330 (inhibit_garbage_collection, Fgarbage_collect):
8331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8332 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8333 int might not be wide enough.
8334 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8335 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8336 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8337 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8338 (bidi_level_of_next_char, bidi_move_to_visually_next):
8339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8340 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8341 (Fkill_buffer, Fset_buffer_major_mode)
8342 (advance_to_char_boundary, Fbuffer_swap_text)
8343 (Fset_buffer_multibyte, overlays_at, overlays_in)
8344 (overlay_touches_p, struct sortvec, record_overlay_string)
8345 (overlay_strings, recenter_overlay_lists)
8346 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8347 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8348 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8349 (Foverlay_recenter, last_overlay_modification_hooks_used)
8350 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8352 (validate_region): Omit unnecessary test for b <= e,
8353 since that's guaranteed by the previous test.
8354 (adjust_overlays_for_delete): Avoid pos + length overflow.
8355 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8356 (report_overlay_modification):
8357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8358 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8359 Omit pointer cast, which isn't needed anyway, and doesn't work
8360 after the EMACS_INT -> ptrdiff_t change.
8361 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8362 * buffer.h: Adjust decls to match defn changes elsewhere.
8363 (struct buffer_text, struct buffer):
8364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8365 Use EMACS_INT, not int, where int might not be wide enough.
8366 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8367 not int, to avoid needless 32-bit limit on 64-bit hosts.
8368 (exec_byte_code): Use tighter memory-full test, one that checks
8369 for alloca overflow. Don't compute the address of the object just
8370 before an array, as that's not portable. Use EMACS_INT, not
8371 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8372 * callint.c (Fcall_interactively):
8373 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8374 * callproc.c (call_process_kill, Fcall_process):
8375 Don't assume pid_t fits into an Emacs fixnum.
8376 (call_process_cleanup, Fcall_process, child_setup):
8377 Don't assume pid_t fits into int.
8378 (call_process_cleanup, Fcall_process, delete_temp_file)
8379 (Fcall_process_region):
8380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8381 (Fcall_process): Simplify handling of volatile integers.
8382 Use int, not EMACS_INT, where int will do.
8383 * casefiddle.c (casify_object, casify_region, operate_on_word)
8384 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8385 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8386 (casify_object): Avoid integer overflow when overallocating buffer.
8387 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8388 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8389 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8390 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8391 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8392 integers are now checked earlier. All uses replaced with XINT.
8393 (ccl_driver):
8394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8395 For CCL_MapSingle, check that content and value are in int range.
8396 (ccl_driver, Fregister_code_conversion_map):
8397 Check that Vcode_version_map_vector is a vector.
8398 (resolve_symbol_ccl_program): Check that vector header is in range.
8399 Always copy the vector, so that we can check its contents reliably
8400 now rather than having to recheck each instruction as it's being
8401 executed. Check that vector words fit in 'int'.
8402 (ccl_get_compiled_code, Fregister_ccl_program)
8403 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8404 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8405 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8406 contents are in range.
8407 (Fccl_execute_on_string): Check that status is in range.
8408 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8409 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8410 Accept and return EMACS_INT, not int, because callers can pass values
8411 out of 'int' range.
8412 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8413 (multibyte_chars_in_text, parse_str_as_multibyte)
8414 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8415 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8416 (string_escape_byte8, Fget_byte):
8417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8418 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8419 avoid mishandling large integers.
8420 * character.h: Adjust decls to match defn changes elsewhere.
8421 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8422 (Ffind_charset_region):
8423 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8424 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8425 (load_charset_map_from_vector, Fdefine_charset_internal):
8426 Don't assume fixnum fits in int.
8427 (load_charset_map_from_vector, Fmap_charset_chars):
8428 Remove now-unnecessary CHECK_NATNUMs.
8429 (Fdefine_charset_internal): Check ranges here, more carefully.
8430 Don't rely on undefined behavior with signed left shift overflow.
8431 Don't assume unsigned int fits into fixnum, or that fixnum fits
8432 into unsigned int. Don't require max_code to be a valid fixnum;
8433 that's not true for gb10830 4-byte on a 32-bit host. Allow
8434 invalid_code to be a cons, for the same reason. Require code_offset
8435 to be a character. Avoid int overflow if max_char is close
8436 to INT_MAX.
8437 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8438 this is intended anyway and avoids some undefined behavior.
8439 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8440 INDEX_TO_CODE_POINT, as that's what it expects.
8441 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8442 * charset.h (DECODE_CHAR): Return int, not unsigned;
8443 this is what was intended anyway, and it avoids undefined behavior.
8444 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8445 integer-overflow issues.
8446 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8447 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8448 where the argument is EMACS_INT, and this behavior is not intended.
8449 * chartab.c (Fmake_char_table, Fset_char_table_range)
8450 (uniprop_get_decoder, uniprop_get_encoder):
8451 Don't assume fixnum fits in int.
8452 * cmds.c (move_point): New function, that does the gist of
8453 Fforward_char and Fbackward_char, but does so while checking
8454 for integer overflow more accurately.
8455 (Fforward_char, Fbackward_char): Use it.
8456 (Fforward_line, Fend_of_line, internal_self_insert)
8457 (internal_self_insert):
8458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8459 Fix a FIXME, by checking for integer overflow when calculating
8460 target_clm and actual_clm.
8461 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8462 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8463 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8464 (coding_alloc_by_making_gap, alloc_destination)
8465 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8466 (encode_coding_utf_16, detect_coding_emacs_mule)
8467 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8468 (detect_coding_iso_2022, decode_coding_iso_2022)
8469 (encode_invocation_designation, encode_designation_at_bol)
8470 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8471 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8472 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8473 (encode_coding_ccl, encode_coding_raw_text)
8474 (detect_coding_charset, decode_coding_charset)
8475 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8476 (produce_composition, produce_charset, produce_annotation)
8477 (decode_coding, handle_composition_annotation)
8478 (handle_charset_annotation, consume_chars, decode_coding_gap)
8479 (decode_coding_object, encode_coding_object, detect_coding_system)
8480 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8481 (code_convert_region, code_convert_string)
8482 (Fdefine_coding_system_internal)
8483 (coding_set_source, coding_set_destination):
8484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8485 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8486 (Fdefine_coding_system_internal):
8487 Don't assume fixnums fit in int.
8488 (decode_coding_gap, decode_coding_object, encode_coding_object)
8489 (Fread_coding_system, Fdetect_coding_region)
8490 (Funencodable_char_position, Fcheck_coding_systems_region)
8491 (get_translation, handle_composition_annotation, consume_chars):
8492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8493 (consume_chars): Rewrite to not calculate an address outside buffer.
8494 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8495 Don't access memory outside of the args array.
8496 (Fdefine_coding_system_internal): Check for charset-id overflow.
8497 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8498 result of ENCODE_CHAR.
8499 * coding.h: Adjust decls to match defn changes elsewhere.
8500 (struct coding_system):
8501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8502 * composite.c (get_composition_id, find_composition)
8503 (run_composition_function, update_compositions)
8504 (compose_text, composition_gstring_put_cache)
8505 (composition_gstring_p, composition_gstring_width)
8506 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8507 (composition_compute_stop_pos, composition_reseat_it)
8508 (composition_update_it, struct position_record)
8509 (find_automatic_composition, composition_adjust_point)
8510 (Fcomposition_get_gstring, Ffind_composition_internal):
8511 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8512 (update_compositions):
8513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8514 * composite.h: Adjust decls to match defn changes elsewhere.
8515 (struct composition):
8516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8517 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8518 Do not attempt to compute the address of the object just before a
8519 buffer; this is not portable.
8520 (Faref, Faset):
8521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8522 (Faset): Use int, not EMACS_INT, where int is wide enough.
8523 (Fstring_to_number): Don't assume fixnums fit in int.
8524 (Frem): Don't assume arg is nonnegative.
8525 * dbusbind.c (xd_append_arg): Check for integers out of range.
8526 (Fdbus_call_method): Don't overflow the timeout int.
8527 (extract_signed, extract_unsigned): New functions.
8528 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8529 (xd_get_connection_references): Return ptrdiff_t, not int.
8530 All uses changed.
8531 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8532 (xd_read_message_1):
8533 Use int, not unsigned, where the dbus API uses int.
8534 (Fdbus_message_internal): Don't overflow mtype.
8535 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8536 * dired.c (directory_files_internal, file_name_completion, scmp)
8537 (file_name_completion_stat):
8538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8539 (file_name_completion): Don't overflow matchcount.
8540 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8541 * dispextern.h: Adjust decls to match defn changes elsewhere.
8542 (struct text_pos, struct glyph, struct bidi_saved_info)
8543 (struct bidi_string_data, struct bidi_it, struct composition_it)
8544 (struct it):
8545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8546 (struct display_pos, struct composition_it, struct it):
8547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8548 * dispnew.c (increment_matrix_positions)
8549 (increment_row_positions, mode_line_string)
8550 (marginal_area_string):
8551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8552 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8554 (duration_to_sec_usec): New function, to check for overflow better.
8555 (Fsleep_for, sit_for): Use it.
8556 * doc.c (get_doc_string, store_function_docstring):
8557 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8558 (get_doc_string, Fsnarf_documentation):
8559 Use int, not EMACS_INT, where int is wide enough.
8560 (get_doc_string):
8561 Use SAFE_ALLOCA, not alloca.
8562 Check for overflow when converting EMACS_INT to off_t.
8563 * doprnt.c (doprnt):
8564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8565 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8566 Don't assume uid_t fits into fixnum.
8567 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8568 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8569 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8570 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8571 (general_insert_function)
8572 (Finsert_char, make_buffer_string, make_buffer_string_both)
8573 (update_buffer_properties, Fbuffer_substring)
8574 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8575 (Fsubst_char_in_region, check_translation)
8576 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8577 (transpose_markers, Ftranspose_regions):
8578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8579 (clip_to_bounds): Move to lisp.h as an inline function).
8580 (Fconstrain_to_field): Don't assume integers are nonnegative.
8581 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8582 (Fsubst_char_in_region, Fsave_restriction):
8583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8584 (Femacs_pid): Don't assume pid_t fits into fixnum.
8585 (lo_time): Use int, not EMACS_INT, when int suffices.
8586 (lisp_time_argument): Check for usec out of range.
8587 (Fencode_time): Don't assume fixnum fits in int.
8588 (Fuser_login_name, Fuser_full_name): Signal an error
8589 if a uid argument is out of range, rather than relying on
8590 undefined behavior.
8591 (Fformat_time_string): Remove now-unnecessary check.
8592 lisp_time_argument checks for out-of-range usec now.
8593 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8594 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8595 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8596 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8597 (init_cmdargs, Fdump_emacs):
8598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8599 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8600 the bottom (typically) 32 bits of the fixnum.
8601 * eval.c (specpdl_size, call_debugger):
8602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8603 (when_entered_debugger, Fbacktrace_debug):
8604 Don't assume fixnum can fit in int.
8605 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8606 the object just before a buffer; this is not portable.
8607 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8608 (grow_specpdl, unbind_to):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8611 (grow_specpdl): Simplify allocation by using xpalloc.
8612 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8613 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8614 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8616 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8617 (a_write, e_write):
8618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8619 (Fcopy_file, non_regular_nbytes, read_non_regular)
8620 (Finsert_file_contents):
8621 Use int, not EMACS_INT, where int is wide enough.
8622 (READ_BUF_SIZE): Verify that it fits in int.
8623 (Finsert_file_contents): Check that counts are in proper range,
8624 rather than assuming fixnums fit into ptrdiff_t etc.
8625 Don't assume fixnums fit into int.
8626 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8627 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8628 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8629 (string_char_to_byte, string_byte_to_char)
8630 (string_make_multibyte, string_to_multibyte)
8631 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8632 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8633 (substring_both, Fdelete, internal_equal, Ffillarray)
8634 (Fclear_string, mapcar1)
8635 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8636 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8637 (larger_vector, make_hash_table, maybe_resize_hash_table)
8638 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8639 (Fmaphash, secure_hash):
8640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8641 (concat): Check for string index and length overflow.
8642 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8643 (Frequire):
8644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8645 (larger_vector): New API (vec, incr_min, size_max) replaces old
8646 one (vec, new_size, init). This catches size overflow.
8647 INIT was removed because it was always Qnil.
8648 All callers changed.
8649 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8650 the upper bound on a hash table index size.
8651 (make_hash_table, maybe_resize_hash_table): Use it.
8652 (secure_hash): Computer start_byte and end_byte only after
8653 they're known to be in ptrdiff_t range.
8654 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8655 (Ffont_get_glyphs, Ffont_at):
8656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8657 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8658 (Flist_fonts, Fopen_font):
8659 Don't assume fixnum can fit in int.
8660 (check_gstring): Don't assume index can fit in int.
8661 (font_match_p): Check that fixnum is a character, not a nonnegative
8662 fixnum, since the later code needs to stuff it into an int.
8663 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8664 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8665 conversion overflow issues.
8666 (Fopen_font): Check for integer out of range.
8667 (Ffont_get_glyphs): Don't assume index can fit in int.
8668 * font.h: Adjust decls to match defn changes elsewhere.
8669 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8670 integer overflow.
8671 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8672 printmax_t, where ptrdiff_t is wide enough.
8673 (Finternal_char_font):
8674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8675 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8676 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8677 (Fset_frame_position, x_set_frame_parameters)
8678 (x_set_line_spacing, x_set_border_width)
8679 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8680 Check that fixnums are in proper range for system types.
8681 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8683 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8684 Use SAFE_ALLOCA_LISP, not alloca.
8685 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8686 intptr_t is wide enough.
8687 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8688 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8689 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8690 Check for fixnum out of range.
8691 * ftfont.c (ftfont_list): Don't assume index fits in int.
8692 Check that fixnums are in proper range for system types.
8693 (ftfont_shape_by_flt):
8694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8695 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8697 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8698 Check that fixnums are in proper range for system types.
8699 * gnutls.h: Adjust decls to match defn changes elsewhere.
8700 * gtkutil.c (xg_dialog_run):
8701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8702 (update_frame_tool_bar):
8703 Check that fixnums are in proper range for system types.
8704 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8705 (lookup_image): Check that fixnums are in range for system types.
8706 * indent.c (last_known_column, last_known_column_point):
8707 (current_column_bol_cache):
8708 (skip_invisible, current_column, check_display_width):
8709 (check_display_width, scan_for_column, current_column_1)
8710 (Findent_to, Fcurrent_indentation, position_indentation)
8711 (indented_beyond_p, Fmove_to_column, compute_motion):
8712 (Fcompute_motion, Fvertical_motion):
8713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8714 (last_known_column_modified): Use EMACS_INT, not int.
8715 (check_display_width):
8716 (Fcompute_motion):
8717 Check that fixnums and floats are in proper range for system types.
8718 (compute_motion): Don't assume index or fixnum fits in int.
8719 (compute_motion, Fcompute_motion):
8720 Use int, not EMACS_INT, when it is wide enough.
8721 (vmotion): Omit local var start_hpos that is always 0; that way
8722 we don't need to worry about overflow in expressions involving it.
8723 * indent.h: Adjust decls to match defn changes elsewhere.
8724 (struct position):
8725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8726 Use int, not EMACS_INT, where int is wide enough.
8727 Remove unused members ovstring_chars_done and tab_offset;
8728 all uses removed.
8729 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8730 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8731 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8732 (make_gap, copy_text, insert, insert_and_inherit)
8733 (insert_before_markers, insert_before_markers_and_inherit)
8734 (insert_1, count_combining_before, count_combining_after)
8735 (insert_1_both, insert_from_string)
8736 (insert_from_string_before_markers, insert_from_string_1)
8737 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8738 (adjust_after_replace, adjust_after_insert, replace_range)
8739 (replace_range_2, del_range, del_range_1, del_range_byte)
8740 (del_range_both, del_range_2, modify_region)
8741 (prepare_to_modify_buffer, signal_before_change)
8742 (signal_after_change, Fcombine_after_change_execute):
8743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8744 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8745 (balance_an_interval, split_interval_right, split_interval_left)
8746 (find_interval, next_interval, update_interval)
8747 (adjust_intervals_for_insertion, delete_node, delete_interval)
8748 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8749 (static_offset_intervals, offset_intervals)
8750 (merge_interval_right, merge_interval_left, make_new_interval)
8751 (graft_intervals_into_buffer, temp_set_point_both)
8752 (temp_set_point, set_point, adjust_for_invis_intang)
8753 (set_point_both, move_if_not_intangible, get_property_and_range)
8754 (get_local_map, copy_intervals, copy_intervals_to_string)
8755 (compare_string_intervals, set_intervals_multibyte_1):
8756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8757 * intervals.h: Adjust decls to match defn changes elsewhere.
8758 (struct interval):
8759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8760 * keyboard.c (this_command_key_count, this_single_command_key_start)
8761 (before_command_key_count, before_command_echo_length, echo_now)
8762 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8763 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8764 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8765 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8767 (last_non_minibuf_size, last_point_position, echo_truncate)
8768 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8769 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8770 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8771 (stuff_buffered_input):
8772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8773 (last_auto_save, command_loop_1, read_char):
8774 Use EMACS_INT, not int, to avoid integer overflow.
8775 (record_char): Avoid overflow in total_keys computation.
8776 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8777 * keyboard.h: Adjust decls to match defn changes elsewhere.
8778 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8779 (Fkey_description, Fdescribe_vector, Flookup_key):
8780 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8781 (click_position): New function, to check that positions are in range.
8782 (Fcurrent_active_maps):
8783 (describe_command):
8784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8785 (Faccessible_keymaps, Fkey_description):
8786 (preferred_sequence_p):
8787 Don't assume fixnum can fit into int.
8788 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8789 Check for integer overflow in size calculations.
8790 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8791 avoid mishandling large integers.
8792 * lisp.h: Adjust decls to match defn changes elsewhere.
8793 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8794 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8795 (struct Lisp_Marker):
8796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8797 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8798 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8799 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8800 All callers changed.
8801 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8802 Assume the arg has valid form, since it always does.
8803 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8804 unsigned integer system type.
8805 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8806 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8808 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8809 (duration_to_sec_usec): New decl.
8810 * lread.c (read_from_string_index, read_from_string_index_byte)
8811 (read_from_string_limit, readchar, unreadchar, openp)
8812 (read_internal_start, read1, oblookup):
8813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8814 (Fload, readevalloop, Feval_buffer, Feval_region):
8815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8816 (openp): Check for out-of-range argument to 'access'.
8817 (read1): Use int, not EMACS_INT, where int is wide enough.
8818 Don't assume fixnum fits into int.
8819 Fix off-by-one error that can read outside a buffer.
8820 (read_filtered_event): Use duration_to_sec_usec
8821 to do proper overflow checking on durations.
8822 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8823 in size calculation.
8824 (Fexecute_kbd_macro):
8825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8826 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8827 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8828 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8829 (set_marker_both, set_marker_restricted_both, marker_position)
8830 (marker_byte_position, Fbuffer_has_markers_at):
8831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8832 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8833 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8834 It now merely ensures that the menu is large enough, without
8835 necessarily growing it, as this avoids some integer overflow issues.
8836 All callers changed.
8837 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8839 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8840 Use SAFE_ALLOCA_LISP, not alloca.
8841 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8842 to EMACS_INT. Check that fixnums are in proper range for system types.
8843 * minibuf.c (minibuf_prompt_width, string_to_object)
8844 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8845 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8847 (get_minibuffer, read_minibuf_unwind):
8848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8849 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8850 this simplifies overflow checking. All callers changed.
8851 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8852 (Ftest_completion):
8853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8854 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8855 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8856 Check that fixnums are in proper range for system types.
8857 (Fx_create_frame, Fx_show_tip):
8858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8859 * nsfont.m (ns_findfonts, nsfont_list_family):
8860 Don't assume fixnum fits in long.
8861 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8863 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8864 wide enough.
8865 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8867 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8868 (PRINTDECLARE, PRINTPREPARE):
8869 (strout, print_string):
8870 (print, print_preprocess, print_check_string_charset_prop)
8871 (print_object):
8872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8873 (PRINTDECLARE):
8874 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8875 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8876 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8877 (printchar, strout): Use xpalloc to catch size calculation overflow.
8878 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8879 (print_error_message): Use SAFE_ALLOCA, not alloca.
8880 (print_object): Use int, not EMACS_INT, where int is wide enough.
8881 (print_depth, new_backquote_output, print_number_index):
8882 Use ptrdiff_t, not int, where int might not be wide enough.
8883 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8884 (Fset_process_window_size, Fformat_network_address)
8885 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8886 (sigchld_handler):
8887 Check that fixnums are in proper range for system types.
8888 (Fsignal_process): Simplify by avoiding a goto.
8889 Check for process-ids out of pid_t range rather than relying on
8890 undefined behavior.
8891 (process_tick, update_tick): Use EMACS_INT, not int.
8892 (Fformat_network_address, read_process_output, send_process)
8893 (Fprocess_send_region, status_notify):
8894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8895 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8896 (wait_reading_process_output, read_process_output, exec_sentinel):
8897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8898 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8899 (Faccept_process_output): Use duration_to_sec_usec to do proper
8900 overflow checking on durations.
8901 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8902 Don't assume pid_t fits in int.
8903 * process.h (struct Lisp_Process): Members tick and update_tick
8904 are now of type EMACS_INT, not int.
8905 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8906 configured --with-wide-int.
8907 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8908 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8909 * search.c (looking_at_1, string_match_1):
8910 (fast_string_match, fast_c_string_match_ignore_case)
8911 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8912 (scan_newline, find_before_next_newline, search_command)
8913 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8914 (set_search_regs, wordify):
8915 (Freplace_match):
8916 (Fmatch_data):
8917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8918 (string_match_1, search_buffer, set_search_regs):
8919 (Fmatch_data):
8920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8921 (wordify): Check for overflow in size calculation.
8922 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8923 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8924 Check that fixnums are in proper range for system types.
8925 * sound.c (struct sound_device)
8926 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8928 (Fplay_sound_internal):
8929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8930 * syntax.c (struct lisp_parse_state, find_start_modiff)
8931 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8932 (Fparse_partial_sexp):
8933 Don't assume fixnums can fit in int.
8934 (struct lisp_parse_state, find_start_pos, find_start_value)
8935 (find_start_value_byte, find_start_begv)
8936 (update_syntax_table, char_quoted, dec_bytepos)
8937 (find_defun_start, prev_char_comend_first, back_comment):
8938 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8939 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8941 (Finternal_describe_syntax_value): Check that match_lisp is a
8942 character, not an integer, since the code stuffs it into int.
8943 (scan_words, scan_sexps_forward):
8944 Check that fixnums are in proper range for system types.
8945 (Fforward_word):
8946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8947 (scan_sexps_forward):
8948 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8949 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8950 * syntax.h: Adjust decls to match defn changes elsewhere.
8951 (struct gl_state_s):
8952 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8953 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8954 MOST_POSITIVE_FIXNUM.
8955 * sysdep.c (wait_for_termination_1, wait_for_termination)
8956 (interruptible_wait_for_termination, mkdir):
8957 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8958 (emacs_read, emacs_write):
8959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8960 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8961 and double all fit in int.
8962 * term.c (set_tty_color_mode):
8963 Check that fixnums are in proper range for system types.
8964 * termhooks.h (struct input_event):
8965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8966 * textprop.c (validate_interval_range, interval_of)
8967 (Fadd_text_properties, set_text_properties_1)
8968 (Fremove_text_properties, Fremove_list_of_text_properties)
8969 (Ftext_property_any, Ftext_property_not_all)
8970 (copy_text_properties, text_property_list, extend_property_ranges)
8971 (verify_interval_modification):
8972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8973 (Fnext_single_char_property_change)
8974 (Fprevious_single_char_property_change):
8975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8976 (copy_text_properties):
8977 Check for integer overflow in index calculation.
8978 * undo.c (last_boundary_position, record_point, record_insert)
8979 (record_delete, record_marker_adjustment, record_change)
8980 (record_property_change):
8981 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8982 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8983 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8984 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8985 (Fx_hide_tip, Fx_file_dialog):
8986 * w32menu.c (set_frame_menubar):
8987 Use ptrdiff_t, not int, for consistency with rest of code.
8988 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8989 (select_window, Fdelete_other_windows_internal)
8990 (window_scroll_pixel_based, window_scroll_line_based)
8991 (Frecenter, Fset_window_configuration):
8992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8993 (Fset_window_hscroll, run_window_configuration_change_hook)
8994 (set_window_buffer, temp_output_buffer_show, scroll_command)
8995 (Fscroll_other_window, Frecenter):
8996 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8997 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8998 Don't assume fixnum fits in int.
8999 (Fset_window_scroll_bars):
9000 Check that fixnums are in proper range for system types.
9001 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9002 (string_pos, c_string_pos, number_of_chars, init_iterator)
9003 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9004 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9005 (compute_display_string_end, handle_face_prop)
9006 (face_before_or_after_it_pos, handle_invisible_prop)
9007 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9008 (display_prop_intangible_p, string_buffer_position_lim)
9009 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9010 (get_overlay_strings_1, get_overlay_strings)
9011 (iterate_out_of_display_property, forward_to_next_line_start)
9012 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9013 (get_next_display_element, set_iterator_to_next)
9014 (get_visually_first_element, compute_stop_pos_backwards)
9015 (handle_stop_backwards, next_element_from_buffer)
9016 (move_it_in_display_line_to, move_it_in_display_line)
9017 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9018 (add_to_log, message_dolog, message_log_check_duplicate)
9019 (message2, message2_nolog, message3, message3_nolog
9020 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9021 (current_message_1, truncate_echo_area, truncate_message_1)
9022 (set_message, set_message_1, store_mode_line_noprop)
9023 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9024 (text_outside_line_unchanged_p, check_point_in_composition)
9025 (reconsider_clip_changes)
9026 (redisplay_internal, set_cursor_from_row, try_scrolling)
9027 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9028 (redisplay_window, find_last_unchanged_at_beg_row)
9029 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9030 (trailing_whitespace_p, find_row_edges, display_line)
9031 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9032 (display_mode_element, store_mode_line_string)
9033 (pint2str, pint2hrstr, decode_mode_spec)
9034 (display_count_lines, display_string, draw_glyphs)
9035 (x_produce_glyphs, x_insert_glyphs)
9036 (rows_from_pos_range, mouse_face_from_buffer_pos)
9037 (fast_find_string_pos, mouse_face_from_string_pos)
9038 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9040 (safe_call, init_from_display_pos, handle_fontified_prop)
9041 (handle_single_display_spec, load_overlay_strings)
9042 (with_echo_area_buffer, setup_echo_area_for_printing)
9043 (display_echo_area, echo_area_display)
9044 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9045 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9046 (redisplay_window, dump_glyph_row, display_mode_line)
9047 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9048 (handle_display_spec, display_prop_string_p):
9049 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9050 (handle_single_display_spec, build_desired_tool_bar_string)
9051 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9052 (get_specified_cursor_type):
9053 Check that fixnums are in proper range for system types.
9054 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9055 (Flookup_image_map):
9056 Don't assume fixnums fit in int.
9057 (compare_overlay_entries):
9058 Avoid mishandling comparisons due to subtraction overflow.
9059 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9060 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9061 (handle_tool_bar_click):
9062 Use int, not unsigned, since we prefer signed and the signedness
9063 doesn't matter here.
9064 (get_next_display_element, next_element_from_display_vector):
9065 Use int, not EMACS_INT, when int is wide enough.
9066 (start_hourglass): Use duration_to_sec_usec to do proper
9067 overflow checking on durations.
9068 * xfaces.c (Fbitmap_spec_p):
9069 Check that fixnums are in proper range for system types.
9070 (compare_fonts_by_sort_order):
9071 Avoid mishandling comparisons due to subtraction overflow.
9072 (Fx_family_fonts, realize_basic_faces):
9073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9074 (Fx_family_fonts):
9075 Don't assume fixnum fits in int.
9076 Use SAFE_ALLOCA_LISP, not alloca.
9077 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9078 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9079 (face_at_buffer_position, face_for_overlay_string)
9080 (face_at_string_position):
9081 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9082 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9083 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9084 (Fx_show_tip):
9085 Check that fixnums are in proper range for system types.
9086 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9087 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9089 (Fx_change_window_property): Don't assume fixnums fit in int.
9090 * xfont.c (xfont_chars_supported):
9091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9092 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9093 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9095 * xml.c (parse_region):
9096 * xrdb.c (magic_file_p):
9097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9098 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9099 (x_get_local_selection, x_reply_selection_request)
9100 (x_handle_selection_request, wait_for_property_change):
9101 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9102 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9103 short is wide enough.
9104 (x_send_client_event): Don't assume fixnum fits in int.
9105 * xterm.c (x_x_to_emacs_modifiers):
9106 Don't assume EMACS_INT overflows nicely into int.
9107 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9108 may come from Lisp.
9109 (handle_one_xevent): NATNUMP can eval its arg twice.
9110 (x_connection_closed):
9111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9112 * xterm.h: Adjust decls to match defn changes elsewhere.
9113 (struct scroll_bar): Use struct vectorlike_header
9114 rather than rolling our own approximation.
9115 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9116
9117 2012-05-25 Glenn Morris <rgm@gnu.org>
9118
9119 * lisp.mk (lisp): Update for more files being compiled now.
9120
9121 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9122
9123 * lread.c: Remove `read_pure' which makes no difference.
9124 (read_pure): Remove var.
9125 (unreadpure): Remove function.
9126 (readevalloop): Don't call read_list with -1 flag.
9127 (read1, read_vector): Don't test read_pure any more.
9128 (read_list): Simplify.
9129
9130 * fileio.c, character.h: Minor style tweaks.
9131
9132 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9133
9134 * window.h (clip_changed): Remove useless declaration.
9135
9136 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9137
9138 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9139 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9140
9141 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9142
9143 Remove src/m/*.
9144 This directory predates autoconf and is no longer needed nowadays.
9145 Move its few remaining bits of functionality to where they're needed.
9146 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9147 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9148 * m/template.h: Remove.
9149 * Makefile.in (M_FILE): Remove. All uses removed.
9150 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9151 * lisp.h (USE_LSB_TAG):
9152 * mem-limits.h (EXCEEDS_LISP_PTR):
9153 Use VAL_MAX, not VALBITS, in #if.
9154 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9155 (EMACS_UINT): Define unconditionally now.
9156 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9157 (BITS_PER_EMACS_INT): New constants, replacing
9158 what used to be in config.h, but not useful in #if.
9159 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9160 define them any more.
9161 (VAL_MAX): New macro.
9162 (VALMASK): Use it.
9163 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9164 BITS_PER_EMACS_INT, in #if.
9165 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9166 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9167 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9168 * s/ms-w32.h (DATA_START):
9169 Move here from removed file m/intel386.h.
9170 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9171 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9172
9173 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9174
9175 Assume C89 or later.
9176 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9177 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9178 (xrealloc):
9179 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9180 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9181 * textprop.c, tparam.c (NULL): Remove.
9182 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9183 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9184 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9185 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9186 * xterm.c (input_signal_count): Assume volatile works.
9187
9188 2012-05-21 Ken Brown <kbrown@cornell.edu>
9189
9190 * xgselect.c (xg_select): Fix first argument in call to 'select'
9191 (bug#11508).
9192
9193 2012-05-20 Ken Brown <kbrown@cornell.edu>
9194
9195 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9196 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9197
9198 2012-05-19 Ken Brown <kbrown@cornell.edu>
9199
9200 * xfns.c (x_in_use): Remove `static' qualifier.
9201 * xterm.h (x_in_use): Declare.
9202 * xgselect.c: Include xterm.h.
9203 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9204 and `display_arg' (bug#9754).
9205
9206 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9207
9208 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9209
9210 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9211 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9212
9213 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9214
9215 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9216
9217 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9218 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9219
9220 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9221 reference to image_cache->refcount.
9222 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9223
9224 2012-05-17 Juri Linkov <juri@jurta.org>
9225
9226 * search.c (Fword_search_regexp, Fword_search_backward)
9227 (Fword_search_forward, Fword_search_backward_lax)
9228 (Fword_search_forward_lax): Move functions to isearch.el
9229 (bug#10145, bug#11381).
9230
9231 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9234
9235 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9236
9237 * lread.c (init_obarray): Declare Qt and Qnil as special.
9238
9239 2012-05-14 Glenn Morris <rgm@gnu.org>
9240
9241 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9242 Put "libexec" before "bin", for the sake of init_callproc_1.
9243
9244 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9245
9246 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9247
9248 * unexaix.c: Port to more-recent AIX compilers.
9249 (report_error, report_error_1, make_hdr, copy_sym)
9250 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9251 Make arguments const char *, not char *, to avoid violations of C
9252 standard and to fix some AIX warnings reported by Gilles Pion.
9253
9254 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9255
9256 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9257 already have overlays loaded.
9258 (handle_single_display_spec): Before returning without displaying
9259 fringe bitmap, synchronize the bidi iterator with the main display
9260 iterator, by calling iterate_out_of_display_property.
9261 (iterate_out_of_display_property): Detect buffer iteration by
9262 testing that it->string is a Lisp string.
9263 (get_next_display_element): When the current object is exhausted,
9264 and there's something on it->stack, call set_iterator_to_next to
9265 proceed with what's on the stack, instead of returning zero.
9266 (set_iterator_to_next): If called at the end of a Lisp string,
9267 proceed to consider_string_end without incrementing string
9268 position. Don't increment display vector index past the end of
9269 the display vector. (Bug#11417)
9270 (pos_visible_p): Don't report a position visible when move_it_to
9271 stopped at the last line of window, which happens to be scanned
9272 backwards by the bidi iteration. (Bug#11464)
9273
9274 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9275
9276 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9277 and right-margin display specs even if the spec is invalid or we
9278 are on a TTY, and thus unable to display on the fringes.
9279 That's because the text with the property will not be displayed anyway,
9280 so we need to signal to the caller that this is a "replacing"
9281 display spec. This fixes display when the spec is invalid or we
9282 are on a TTY.
9283
9284 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9285
9286 * unexaix.c (make_hdr): Fix typo in prototype.
9287 This bug broke the build on AIX. Problem reported by Gilles Pion.
9288
9289 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9290
9291 * keyboard.c (kbd_buffer_get_event): Read special events also in
9292 batch mode. (Bug#11415)
9293
9294 2012-05-12 Glenn Morris <rgm@gnu.org>
9295
9296 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9297
9298 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9299
9300 * lisp.mk (lisp): Add newcomment.elc.
9301
9302 2012-05-12 Glenn Morris <rgm@gnu.org>
9303
9304 * Makefile.in (MKDIR_P): New, set by configure.
9305 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9306
9307 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 Remove unused function hourglass_started.
9310 * dispextern.h (hourglass_started):
9311 * w32fns.c (hourglass_started):
9312 * xdisp.c (hourglass_started): Remove.
9313
9314 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9315
9316 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9317 Update dependencies.
9318
9319 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9320
9321 * xgselect.c (xg_select): Put maxfds+1 into a var.
9322 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9323
9324 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9325
9326 2012-05-10 Dave Abrahams <dave@boostpro.com>
9327
9328 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9329 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9330
9331 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9332
9333 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9334 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9335 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9336 Initialize xd_registered_buses.
9337
9338 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9339
9340 Untag more efficiently if USE_LSB_TAG.
9341 This is based on a proposal by YAMAMOTO Mitsuharu in
9342 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9343 For an admittedly artificial (nth 8000 longlist) benchmark on
9344 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9345 Emacs's overall text size by 1%.
9346 * lisp.h (XUNTAG): New macro.
9347 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9348 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9349 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9350 * eval.c (Fautoload):
9351 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9352 * frame.h (XFRAME): Use XUNTAG.
9353
9354 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9355 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9356 Remove unportable assumptions about print widths of types like
9357 dbus_uint32_t.
9358 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9359 intptr_t when converting between pointer and integer, to avoid GCC
9360 warnings about wrong width.
9361
9362 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9363
9364 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9365 stack for each reader_thread, instead of defaulting to 8MB
9366 determined by the linker. This avoids failures in creating
9367 subprocesses on Windows 7, see the discussion in this thread:
9368 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9369
9370 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9371
9372 Fix up display of the *Minibuf-0* buffer in the mini window.
9373 * keyboard.c (read_char): Don't clear the echo area if there's no
9374 message to clear.
9375 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9376 contents of *Minibuf-0*) if there's no message displayed in its stead.
9377
9378 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9379
9380 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9381 batch mode.
9382
9383 2012-05-06 Chong Yidong <cyd@gnu.org>
9384
9385 * lisp.mk (lisp): Update.
9386
9387 2012-05-05 Jim Meyering <meyering@redhat.com>
9388
9389 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9390
9391 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9392
9393 * data.c (PUT_ERROR): New macro.
9394 (syms_of_data): Use it. Add new error type `user-error'.
9395 * undo.c (user_error): New function.
9396 (Fprimitive_undo): Use it.
9397 * print.c (print_error_message): Adjust print style for `user-error'.
9398 * keyboard.c (user_error): New function.
9399 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9400
9401 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 Do not limit current-time-string to years 1000..9999.
9404 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9405 (Fcurrent_time_string): Support any year that is supported by the
9406 underlying localtime representation. Don't use asctime, as it
9407 has undefined behavior for years outside the range -999..9999.
9408
9409 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9410
9411 Fix race conditions involving setenv, gmtime, localtime, asctime.
9412 Without this fix, interrupts could mess up code that uses these
9413 nonreentrant functions, since setting TZ invalidates existing
9414 tm_zone or tzname values, and since most of these functions return
9415 pointers to static storage.
9416 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9417 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9418 Grow the critical sections to include not just invoking
9419 localtime/gmtime, but also accessing these functions' results
9420 including their tm_zone values if any, and any related TZ setting.
9421 (format_time_string): Last arg is now struct tm *, not struct tm **,
9422 so that the struct tm is saved in the critical section.
9423 All callers changed. Simplify allocation of initial buffer, partly
9424 motivated by the fact that memory allocation needs to be outside
9425 the critical section.
9426
9427 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9428
9429 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9430 with RESET_INTERVAL.
9431
9432 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9433 Remove duplicated buffer name initialization.
9434
9435 2012-05-02 Jim Meyering <jim@meyering.net>
9436
9437 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9438
9439 * xfns.c (x_window): Use xstrdup (Bug#11375).
9440
9441 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9442
9443 * xdisp.c (pos_visible_p): If already at a newline from the
9444 display string before the 'while' loop, don't walk back the glyphs
9445 from it3.glyph_row. Solves assertion violation when the display
9446 string begins with a newline (egg.el). (Bug#11367)
9447
9448 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9449
9450 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9451 Move to simple.el.
9452
9453 2012-05-01 Glenn Morris <rgm@gnu.org>
9454
9455 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9456 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9457 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9458 All were removed before 23.1.
9459
9460 * dispnew.c: Remove HAVE_LIBNCURSES test;
9461 it is always true on relevant platforms.
9462
9463 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9464 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9465
9466 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9467
9468 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9469
9470 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9471 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9472 Remove.
9473
9474 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9475
9476 Do not avoid creating empty evaporating overlays (Bug#9642).
9477 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9478 That is, do not delete an evaporating overlay if it becomes
9479 empty after its bounds are adjusted to fit within its buffer.
9480 This fix caused other problems, and I'm reverting it until we get
9481 to the bottom of them.
9482
9483 2012-04-27 Chong Yidong <cyd@gnu.org>
9484
9485 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9486
9487 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9488
9489 * xdisp.c (pos_visible_p): If the window start position is beyond
9490 ZV, start the display from buffer beginning. Prevents assertion
9491 violation in init_iterator when the minibuffer window is scrolled
9492 via the scroll bar.
9493
9494 * window.c (window_scroll_pixel_based): Likewise.
9495
9496 2012-04-27 Chong Yidong <cyd@gnu.org>
9497
9498 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9499
9500 2012-04-27 Glenn Morris <rgm@gnu.org>
9501
9502 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9503 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9504
9505 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9506
9507 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9508 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9509
9510 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9511
9512 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9513 display element, check also the underlying string or buffer
9514 character. (Bug#11341)
9515
9516 * w32menu.c: Include w32heap.h.
9517 (add_menu_item): If the call to AppendMenuW (via
9518 unicode_append_menu) fails, disable Unicode menus only if we are
9519 running on Windows 9X/Me.
9520
9521 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9522
9523 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9524 (xgetint): Add missing shift for LSB tags.
9525
9526 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9527
9528 * keyboard.c (read_char): Don't wipe echo area for select window
9529 events: These might get delayed via `mouse-autoselect-window'
9530 (Bug#11304).
9531
9532 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9533
9534 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9535 manipulation of :loaded-from data.
9536
9537 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9538
9539 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9540 now a cons (bug#11311).
9541
9542 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9543
9544 Do not create empty overlays with the evaporate property (Bug#9642).
9545 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9546 if it becomes empty after its bounds are adjusted to fit within
9547 its buffer. Without this fix, in a nonempty buffer (let ((o
9548 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9549 yields an empty overlay that has the evaporate property, which is
9550 not supposed to happen.
9551
9552 Fix minor GTK3 problems found by static checking.
9553 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9554 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9555 (struct _EmacsFixedClass, emacs_fixed_get_type):
9556 Move decls here from emacsgtkfixed.h, since they needn't be public.
9557 (emacs_fixed_get_type): Now static.
9558 (emacs_fixed_class_init): Omit unused local.
9559 (emacs_fixed_child_type): Remove; unused.
9560 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9561 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9562 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9563 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9564 (EMACS_FIXED_GET_CLASS): Remove; unused.
9565 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9566
9567 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9568 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9569
9570 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9571
9572 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9573 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9574 (__malloc_size_t, __malloc_ptrdiff_t):
9575 Remove. All uses removed, replaced by the definiens if needed,
9576 since we can assume C89 or better now.
9577 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9578 (protect_malloc_state, align, get_contiguous_space)
9579 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9580 (malloc_atfork_handler_child, malloc_enable_thread)
9581 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9582 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9583 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9584 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9585 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9586 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9587 Define using prototypes, not old style.
9588 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9589 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9590 (align): Don't assume that signed integer overflow wraps around.
9591 Omit unused local var.
9592 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9593 (_free_internal_nolock, memalign, mallochook, reallochook):
9594 Omit no-longer-needed casts.
9595 (valloc): Use getpagesize, not __getpagesize.
9596 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9597 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9598
9599 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9600
9601 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9602
9603 Move functions from C to Lisp. Make non-blocking method calls
9604 the default. Implement further D-Bus standard interfaces.
9605
9606 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9607 (QCdbus_request_name_allow_replacement)
9608 (QCdbus_request_name_replace_existing)
9609 (QCdbus_request_name_do_not_queue)
9610 (QCdbus_request_name_reply_primary_owner)
9611 (QCdbus_request_name_reply_in_queue)
9612 (QCdbus_request_name_reply_exists)
9613 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9614 (QCdbus_registered_serial, QCdbus_registered_method)
9615 (QCdbus_registered_signal): New Lisp objects.
9616 (XD_DEBUG_MESSAGE): Use sizeof.
9617 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9618 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9619 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9620 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9621 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9622 (xd_signature, xd_append_arg): Allow float for integer types.
9623 (xd_get_connection_references): New function.
9624 (xd_get_connection_address): Rename from xd_initialize.
9625 Return cached address.
9626 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9627 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9628 level.
9629 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9630 Return number of refcounts.
9631 (Fdbus_get_unique_name): Make stronger parameter check.
9632 (Fdbus_message_internal): New defun.
9633 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9634 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9635 (Fdbus_send_signal, Fdbus_register_service)
9636 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9637 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9638 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9639 (Vdbus_compiled_version, Vdbus_runtime_version)
9640 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9641 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9642 (Vdbus_message_type_signal): New defvars.
9643 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9644 Adapt docstring.
9645
9646 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9647
9648 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9649 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9650 Do not assume ptrdiff_t is the same width as 'int'.
9651
9652 * alloc.c: Handle unusual debugging option combinations.
9653 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9654 since the two debugging options are incompatible.
9655 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9656 is defined.
9657 (mem_init, mem_insert, mem_insert_fixup):
9658 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9659 (NEED_MEM_INSERT): Remove; no longer needed.
9660
9661 2012-04-22 Leo Liu <sdl.web@gmail.com>
9662
9663 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9664
9665 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9666
9667 * sysdep.c [__FreeBSD__]: Minor cleanups.
9668 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9669 Use Emacs indenting style more consistently. Avoid some casts.
9670 Use 'double' consistently rather than mixing 'float' and 'double'.
9671
9672 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9673
9674 * sysdep.c (list_system_processes, system_process_attributes):
9675 Add implementation for FreeBSD (Bug#5243).
9676
9677 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9678
9679 * lisp.mk (lisp): Update.
9680
9681 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9684 It is never used otherwise.
9685
9686 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9687
9688 * print.c (print_preprocess): Only check print_depth if print-circle
9689 is nil.
9690 (print_object): Check for cycles even when print-circle is nil and
9691 print-gensym is t, but only check print_depth if print-circle is nil.
9692
9693 2012-04-20 Chong Yidong <cyd@gnu.org>
9694
9695 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9696 set the status to "failed" and ensure that sentinel is run.
9697
9698 2012-04-20 Glenn Morris <rgm@gnu.org>
9699
9700 * process.c (Fset_process_inherit_coding_system_flag)
9701 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9702 (Fmake_network_process, Fmake_serial_process): Doc fix.
9703
9704 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9705
9706 * xdisp.c (string_buffer_position_lim): Limit starting position to
9707 BEGV.
9708 (set_cursor_from_row): If called for a mode-line or header-line
9709 row, return zero immediately.
9710 (try_cursor_movement): If inside continuation line, don't back up
9711 farther than the first row after the header line, if any.
9712 Don't consider the header-line row as "partially visible", even if
9713 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9714
9715 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9716
9717 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9718 (bug#11238).
9719
9720 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9721 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 configure: new option --enable-gcc-warnings (Bug#11207)
9724 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9725 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9726 (ALL_CFLAGS): Use new macros rather than old.
9727 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9728 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9729 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9730 -Wunused-result, -Wunused-variable. This should go away once
9731 the Emacs and Gnulib regex code is merged.
9732 (xmalloc, xrealloc): Now static.
9733
9734 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9735
9736 * dired.c (Fsystem_groups): Remove unused local.
9737
9738 2012-04-17 Glenn Morris <rgm@gnu.org>
9739
9740 * dired.c (Fsystem_users): Doc fix.
9741
9742 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9743
9744 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9745 (syms_of_dired): Add them.
9746
9747 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9748
9749 Fix minor alloc.c problems found by static checking.
9750 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9751 New extern decls, to avoid calling undeclared functions.
9752 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9753 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9754 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9755 (NEED_MEM_INSERT): New macro.
9756 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9757 Remove one incorrect comment and fix another.
9758
9759 Fix minor ralloc.c problems found by static checking.
9760 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9761 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9762 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9763 (r_alloc_sbrk): Now static.
9764
9765 Improve ralloc.c interface checking.
9766 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9767 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9768 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9769 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9770 [REL_ALLOC]: ... to here, to check interface.
9771 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9772 Remove decls. This fixes an "It stinks!".
9773
9774 * alloc.c (which_symbols): Fix alignment issue / type clash.
9775
9776 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9777
9778 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9779 (struct Lisp_Misc_Any): Likewise.
9780 (struct Lisp_Free): Likewise.
9781 * alloc.c (union aligned_Lisp_Symbol): Define.
9782 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9783 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9784 (union aligned_Lisp_Misc): Define.
9785 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9786 aligned_Lisp_Misc instead of union Lisp_Misc.
9787 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9788
9789 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9790
9791 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9792 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9793 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9794 * s/netbsd.h, s/sol2-6.h:
9795 Remove definition of GC_MARK_STACK, since the default now works.
9796 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9797 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9798 no longer the default.
9799 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9800
9801 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9802
9803 * lread.c (lisp_file_lexically_bound_p):
9804 Fix hang at ";-*-\n" (bug#11238).
9805
9806 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9807
9808 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9809 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9810
9811 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9812
9813 * nsterm.m (constrainFrameRect): Always constrain when there is only
9814 one screen (Bug#10962).
9815
9816 2012-04-13 Ken Brown <kbrown@cornell.edu>
9817
9818 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9819
9820 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9821
9822 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9823
9824 2012-04-11 Daniel Colascione <dancol@dancol.org>
9825
9826 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9827 against is gone. It's better to use vfork now so that when Cygwin
9828 gains a new, working vfork, we use it automatically (bug#10398).
9829
9830 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9831
9832 * window.c (save_window_save): Obey window-point-insertion-type.
9833
9834 2012-04-11 Glenn Morris <rgm@gnu.org>
9835
9836 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9837
9838 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9839
9840 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9841
9842 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9843
9844 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9845 (force_quit_count): New var.
9846 (handle_interrupt): Use it.
9847
9848 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9849
9850 * w32.c (w32_delayed_load): Record the full path of the library
9851 being loaded (bug#10424).
9852
9853 2012-04-09 Glenn Morris <rgm@gnu.org>
9854
9855 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9856 not just in the obarray, before snarfing them. (Bug#11036)
9857
9858 * Makefile.in ($(leimdir)/leim-list.el):
9859 Pass EMACS rather than BUILT_EMACS.
9860
9861 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9862
9863 * process.c (make_process):
9864 * process.h: Add integer `gnutls_handshakes_tried' member to
9865 process struct.
9866
9867 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9868 Add convenience `GNUTLS_LOG2i' macro.
9869
9870 * gnutls.c (gnutls_log_function2i): Convenience log function.
9871 (emacs_gnutls_read): Use new log functions,
9872 `gnutls_handshakes_tried' process member, and
9873 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9874 attempts per process (connection).
9875
9876 2012-04-09 Chong Yidong <cyd@gnu.org>
9877
9878 * eval.c (Fuser_variable_p, user_variable_p_eh)
9879 (lisp_indirect_variable): Functions deleted.
9880 (Fdefvar): Caller changed.
9881
9882 * callint.c (Finteractive, Fcall_interactively):
9883 * minibuf.c (Fread_variable): Callers changed.
9884
9885 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9886
9887 * xdisp.c (set_cursor_from_row): If the display string appears in
9888 the buffer at position that is closer to point than the position
9889 after the display string, display the cursor on the first glyph of
9890 the display string. Fixes cursor display when a 'display' text
9891 property immediately follows invisible text. (Bug#11094)
9892
9893 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9894
9895 composite.c: use 'double' consistently
9896 * composite.c (get_composition_id): Use 'double' consistently
9897 instead of converting 'float' to 'double' and vice versa; this is
9898 easier to understand and avoids a GCC warning.
9899
9900 2012-04-09 Glenn Morris <rgm@gnu.org>
9901
9902 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9903 preparation for dumping it with emacs. (Bug#4789)
9904 (leimdir): New variable.
9905 ($(leimdir)/leim-list.el): New rule.
9906 (emacs$(EXEEXT)): Depend on leim-list.el.
9907
9908 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9909 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9910 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9911
9912 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9913
9914 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9915 proper alignment.
9916
9917 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9918
9919 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9920 Remove unused local variable.
9921
9922 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9925 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9926 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9927 objects, as mark_maybe_pointer will catch them otherwise.
9928 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9929 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9930
9931 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9932
9933 Fix typo that broke non-Windows builds.
9934 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9935
9936 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9937
9938 Support building on MS-Windows with libxml2.
9939
9940 * makefile.w32-in (OBJ2): Add xml.$(O).
9941 (GLOBAL_SOURCES): Add xml.c.
9942 ($(BLD)/xml.$(O)): New dependency list.
9943
9944 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9945 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9946 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9947 [!WINDOWSNT]: New macros.
9948 (init_libxml2_functions, libxml2_loaded_p): New functions.
9949 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9950 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9951 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9952 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9953 linked in).
9954 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9955 Call init_libxml2_functions before calling libxml2 functions.
9956 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9957
9958 * emacs.c: Don't include libxml/parser.h.
9959 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9960 xmlCleanupParser directly.
9961
9962 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9963
9964 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9965
9966 * indent.c (Fvertical_motion): If there is a display string at
9967 point, use it.vpos to compute how many lines to backtrack after
9968 move_it_to point. (Bug#11133)
9969
9970 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9971
9972 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9973 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9974 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9975 macros related to unification of CJK characters. For the details,
9976 see the discussion following the message here:
9977 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9978
9979 2012-04-04 Chong Yidong <cyd@gnu.org>
9980
9981 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9982
9983 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9984
9985 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9986 instead of alloca. (Bug#11138)
9987
9988 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9989
9990 * w32menu.c (is_simple_dialog): Properly check lisp types.
9991 (Bug#11141)
9992
9993 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9994
9995 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9996 position we get to after a call to move_it_to fails the
9997 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9998 only if we wind up in a string from display property. (Bug#11063)
9999
10000 * window.c (Fdelete_other_windows_internal): Invalidate the row
10001 and column information about mouse highlight, so that redisplay
10002 restores it after reallocating the glyph matrices. (Bug#7464)
10003
10004 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10005 string comes from a `display' text property, use the buffer
10006 position of that property as if we actually saw that position in
10007 the row's glyphs.
10008 (move_it_by_lines): Remove the assertion that
10009 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10010 violated when there's a before-string at the beginning of a line.
10011 (Bug#11063)
10012
10013 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10014
10015 * xdisp.c (append_space_for_newline): If the default face was
10016 remapped, use the remapped face for the appended newline.
10017 (extend_face_to_end_of_line): Use the remapped default face for
10018 extending the face to the end of the line.
10019 (display_line): Call extend_face_to_end_of_line when the default
10020 face was remapped. (Bug#11068)
10021
10022 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10023
10024 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10025
10026 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10027
10028 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10029
10030 2012-03-27 Glenn Morris <rgm@gnu.org>
10031
10032 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10033 Doc fixes.
10034
10035 2012-03-26 Kenichi Handa <handa@m17n.org>
10036
10037 * dispextern.h (struct glyph): Fix previous change. Change the
10038 bit length of glyphless.ch to 25 (Bug#11082).
10039
10040 2012-03-26 Chong Yidong <cyd@gnu.org>
10041
10042 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10043 (command_loop_1): Use it; inhibit selection update for
10044 handle-select-window too (Bug#8996).
10045
10046 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10047
10048 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10049
10050 2012-03-25 Kenichi Handa <handa@m17n.org>
10051
10052 * dispextern.h (struct glyph): Change the bit length of
10053 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10054
10055 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10056
10057 * s/ms-w32.h (tzname): Include time.h before redirecting to
10058 _tzname. Fixes the MSVC build. (Bug#9960)
10059
10060 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10061
10062 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10063 characters.
10064
10065 * xterm.c (XTread_socket): Only modify handling_signal if
10066 !SYNC_INPUT. (Bug#11080)
10067
10068 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10069
10070 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10071 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10072 when fetching a multibyte character consumes more bytes than
10073 CHAR_BYTES returns, due to unification of CJK characters in
10074 string_char. (Bug#11073)
10075
10076 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10077
10078 * process.c (wait_reading_process_output): Handle pty disconnect
10079 by refraining from sending oneself a SIGCHLD (bug#10933).
10080
10081 2012-03-22 Chong Yidong <cyd@gnu.org>
10082
10083 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10084
10085 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10086 Mark string as coming from a prefix property.
10087 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10088 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10089
10090 2012-03-21 Chong Yidong <cyd@gnu.org>
10091
10092 * xfaces.c (Vface_remapping_alist): Doc fix.
10093
10094 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10095
10096 * w32proc.c (Fw32_set_console_codepage)
10097 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10098 Doc fixes.
10099
10100 2012-03-20 Chong Yidong <cyd@gnu.org>
10101
10102 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10103 to reflect default non-nil value of redisplay-dont-pause.
10104
10105 2012-03-19 Kenichi Handa <handa@m17n.org>
10106
10107 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10108 it fit in a valid range (Bug#11003).
10109
10110 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10111
10112 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10113 that is not from display property, accept the row as a "cursor
10114 row" if one of the string's character has a non-nil `cursor'
10115 property. Fixes cursor positioning when there are newlines in
10116 overlay strings, e.g. in icomplete.el. (Bug#11035)
10117
10118 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10121
10122 2012-03-12 Chong Yidong <cyd@gnu.org>
10123
10124 * eval.c (inhibit_lisp_code): Rename from
10125 inhibit_window_configuration_change_hook; move from window.c.
10126
10127 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10128 * window.c (run_window_configuration_change_hook)
10129 (syms_of_window): Callers changed.
10130
10131 2012-03-11 Chong Yidong <cyd@gnu.org>
10132
10133 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10134
10135 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10136
10137 2012-03-10 Chong Yidong <cyd@gnu.org>
10138
10139 * frame.c (other_visible_frames): Don't assume the selected frame
10140 is visible (Bug#10955).
10141
10142 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10143
10144 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10145
10146 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10147
10148 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10149 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10150 zero (Bug#10954).
10151
10152 2012-03-03 Glenn Morris <rgm@gnu.org>
10153
10154 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10155
10156 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10157
10158 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10159 position past the first glyph_row that ends at ZV. (Bug#10902)
10160 (redisplay_window, next_element_from_string): Fix typos in
10161 comments.
10162 (redisplay_window): Pass to move_it_vertically the margin in
10163 pixels, not in screen lines.
10164
10165 2012-03-02 Glenn Morris <rgm@gnu.org>
10166
10167 * buffer.c (buffer-list-update-hook): Doc fix.
10168
10169 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10170
10171 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10172 push_it before setting up the iterator for the first overlay
10173 string, even if we have an empty string loaded.
10174 (next_overlay_string): If there's an empty string on the iterator
10175 stack, pop the stack. (Bug#10903)
10176
10177 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10178
10179 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10180 Suggested by Stefan Monnier in
10181 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10182 * alloc.c (widen_to_Lisp_Object): New static function.
10183 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10184 and widening them to Lisp_Objects. This would work even if
10185 USE_LSB_TAG is defined and wide integers are used, which might
10186 happen in a future version of Emacs.
10187
10188 2012-02-25 Chong Yidong <cyd@gnu.org>
10189
10190 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10191 Doc fix.
10192
10193 * xselect.c (Fx_selection_exists_p): Doc fix.
10194 (x_clipboard_manager_save_all): Print an informative message
10195 before saving to clipboard manager.
10196
10197 2012-02-24 Chong Yidong <cyd@gnu.org>
10198
10199 * keyboard.c (process_special_events): Handle all X selection
10200 requests in kbd_buffer, not just the next one (Bug#8869).
10201
10202 2012-02-23 Chong Yidong <cyd@gnu.org>
10203
10204 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10205 call when setting menu-bar-lines and tool-bar-lines parameters.
10206 (unwind_create_frame_1): New helper function.
10207
10208 * window.c (inhibit_window_configuration_change_hook): New var.
10209 (run_window_configuration_change_hook): Obey it.
10210 (syms_of_window): Initialize it.
10211
10212 2012-02-22 Chong Yidong <cyd@gnu.org>
10213
10214 * xterm.c (x_draw_image_relief): Add missing type check for
10215 Vtool_bar_button_margin (Bug#10743).
10216
10217 2012-02-21 Chong Yidong <cyd@gnu.org>
10218
10219 * fileio.c (Vfile_name_handler_alist): Doc fix.
10220
10221 * buffer.c (Fget_file_buffer): Protect against invalid file
10222 handler return value.
10223
10224 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10225
10226 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10227 when computing $valmask.
10228
10229 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10230 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10231 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10232 It's useless in that case, and it can cause problems on hosts
10233 that allocate halves of EMACS_INT values separately.
10234 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10235 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10236 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10237 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10238 it avoids undefined behavior on hosts where shifting right by more
10239 than the word width has undefined behavior.
10240
10241 2012-02-19 Chong Yidong <cyd@gnu.org>
10242
10243 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10244 (Funhandled_file_name_directory, Ffile_name_as_directory)
10245 (Fdirectory_file_name, Fexpand_file_name)
10246 (Fsubstitute_in_file_name): Protect against invalid file handler
10247 return values (Bug#10845).
10248
10249 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10250
10251 * .gdbinit (pitx): Fix incorrect references to fields of the
10252 iterator stack.
10253
10254 2012-02-17 Chong Yidong <cyd@gnu.org>
10255
10256 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10257
10258 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10261 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10262
10263 2012-02-15 Chong Yidong <cyd@gnu.org>
10264
10265 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10266 marked as special. Also, starting docstrings with * is obsolete.
10267
10268 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10269
10270 * gnutls.c (emacs_gnutls_write): Fix last change.
10271
10272 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10273
10274 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10275 send_process.
10276
10277 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10278
10279 * keymap.c (Fsingle_key_description): Handle char ranges.
10280
10281 2012-02-12 Chong Yidong <cyd@gnu.org>
10282
10283 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10284 as that creates a dangerous corner case.
10285
10286 * window.c (Fdelete_window_internal): Invalidate the mouse
10287 highlight (Bug#9904).
10288
10289 2012-02-12 Glenn Morris <rgm@gnu.org>
10290
10291 * xselect.c (Fx_own_selection_internal)
10292 (Fx_get_selection_internal, Fx_disown_selection_internal)
10293 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10294 * nsselect.m (Fx_own_selection_internal)
10295 (Fx_disown_selection_internal, Fx_selection_exists_p)
10296 (Fx_selection_owner_p, Fx_get_selection_internal):
10297 Sync docs and argument specs with the xselect.c versions.
10298
10299 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10300
10301 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10302
10303 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10304
10305 * w32select.c (Fx_selection_exists_p): Sync doc string and
10306 argument list with xselect.c. (Bug#10783)
10307
10308 * w16select.c (Fx_selection_exists_p): Sync doc string and
10309 argument list with xselect.c. (Bug#10783)
10310
10311 2012-02-10 Glenn Morris <rgm@gnu.org>
10312
10313 * fns.c (Fsecure_hash): Doc fix.
10314
10315 2012-02-09 Kenichi Handa <handa@m17n.org>
10316
10317 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10318
10319 2012-02-07 Chong Yidong <cyd@gnu.org>
10320
10321 * buffer.c (Fbuffer_local_variables)
10322 (buffer_lisp_local_variables): Handle unbound vars correctly;
10323 don't let Qunbound leak into Lisp.
10324
10325 2012-02-07 Glenn Morris <rgm@gnu.org>
10326
10327 * image.c (Fimagemagick_types): Doc fix.
10328
10329 * image.c (imagemagick-render-type): Change it from a lisp object
10330 to an integer. Move the doc here from the lisp manual.
10331 Treat all values not equal to 0 the same.
10332
10333 2012-02-06 Chong Yidong <cyd@gnu.org>
10334
10335 * doc.c (store_function_docstring): Avoid applying docstring of
10336 alias to base function (Bug#2603).
10337
10338 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10339
10340 * .gdbinit (pp1, pv1): Remove redundant defines.
10341 (pr): Use pp.
10342
10343 2012-02-04 Chong Yidong <cyd@gnu.org>
10344
10345 * nsterm.m: Declare a global (Bug#10694).
10346
10347 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10348
10349 * w32.c (get_emacs_configuration_options):
10350 Include --enable-checking, if specified, in the return value.
10351
10352 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10353
10354 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10355 after rounding frame sizes. (Bug#9723)
10356
10357 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10358
10359 * keyboard.c (adjust_point_for_property): Don't position point
10360 before BEGV. (Bug#10696)
10361
10362 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10363
10364 Handle overflow when computing char display width (Bug#9496).
10365 * character.c (char_width): Return EMACS_INT, not int.
10366 (char_width, c_string_width): Check for overflow when
10367 computing the width; this is possible now that individual
10368 characters can have unbounded width. Problem introduced
10369 by merge from Emacs 23 on 2012-01-19.
10370
10371 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10372
10373 * dbusbind.c (Fdbus_register_method): Mention the return value
10374 :ignore in the docstring.
10375
10376 2012-02-02 Glenn Morris <rgm@gnu.org>
10377
10378 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10379
10380 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10381 Unconditionally set to t. (Bug#10673)
10382 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10383 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10384 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10385
10386 2012-02-02 Kenichi Handa <handa@m17n.org>
10387
10388 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10389 0, do not call append_composite_glyph.
10390
10391 2012-02-02 Kenichi Handa <handa@m17n.org>
10392
10393 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10394 NULL (Bug#6988).
10395 (x_produce_glyphs): If the component of a composition is a null
10396 string, set it->pixel_width to 1 to avoid zero-width glyph.
10397
10398 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10399
10400 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10401 first 2 arguments are identical. This makes inserting large
10402 output from a subprocess an order of magnitude faster on
10403 MS-Windows, where all sbrk'ed memory is always contiguous.
10404
10405 2012-01-31 Glenn Morris <rgm@gnu.org>
10406
10407 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10408 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10409 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10410
10411 2012-01-29 Glenn Morris <rgm@gnu.org>
10412
10413 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10414
10415 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10416
10417 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10418
10419 2012-01-28 Chong Yidong <cyd@gnu.org>
10420
10421 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10422
10423 2012-01-26 Chong Yidong <cyd@gnu.org>
10424
10425 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10426
10427 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10428 repeat counts (Bug#10507).
10429
10430 2012-01-26 Glenn Morris <rgm@gnu.org>
10431
10432 * lread.c (syms_of_lread): Doc fix.
10433
10434 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10435
10436 * coding.c (encode_designation_at_bol): Change return value to
10437 EMACS_INT.
10438
10439 2012-01-25 Chong Yidong <cyd@gnu.org>
10440
10441 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10442
10443 2012-01-21 Chong Yidong <cyd@gnu.org>
10444
10445 * floatfns.c (Fcopysign): Make the second argument non-optional,
10446 since nil is not allowed anyway.
10447
10448 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10449
10450 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10451 (send_process): Likewise.
10452
10453 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10454
10455 * window.c (save_window_save, Fcurrent_window_configuration)
10456 (Vwindow_persistent_parameters): Do not use Qstate.
10457 Rewrite doc-strings.
10458
10459 2012-01-19 Kenichi Handa <handa@m17n.org>
10460
10461 * character.c (char_width): New function.
10462 (Fchar_width, c_string_width, lisp_string_width):
10463 Use char_width (Bug#9496).
10464
10465 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10466
10467 * window.c (Vwindow_persistent_parameters): New variable.
10468 (Fset_window_configuration, save_window_save): Handle persistent
10469 window parameters.
10470
10471 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10472
10473 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10474 thrashing the stack of the thread. (Bug#9087)
10475
10476 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10477
10478 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10479
10480 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10481
10482 * xdisp.c (rows_from_pos_range): Handle the case where the
10483 highlight ends on a newline. (Bug#10464)
10484 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10485 he end column for display of highlight that ends on a newline
10486 before a R2L line.
10487
10488 2012-01-11 Glenn Morris <rgm@gnu.org>
10489
10490 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10491 from load-path also when installation-directory is nil. (Bug#10208)
10492
10493 2012-01-10 Glenn Morris <rgm@gnu.org>
10494
10495 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10496
10497 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10498 Update template values to be closer to their typical values these days.
10499
10500 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10501
10502 * xdisp.c (rows_from_pos_range): Accept additional argument
10503 DISP_STRING, and accept any glyph in a row whose object is that
10504 string as eligible for mouse highlight. Fixes mouse highlight of
10505 display strings from overlays. (Bug#10464)
10506
10507 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10508
10509 emacs: fix an auto-save permissions race condition (Bug#10400)
10510 * fileio.c (auto_saving_dir_umask): New static var.
10511 (Fmake_directory_internal): Use it.
10512 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10513 creating the directory. The old code temporarily assigns
10514 too-generous permissions to the directory.
10515 (do_auto_save_eh): Clear it.
10516 (Fdo_auto_save): Catch all errors, not just file errors, so
10517 that the var is always cleared.
10518
10519 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10520
10521 * search.c (scan_buffer): Pass character positions to
10522 know_region_cache, not byte positions. (Bug#6540)
10523
10524 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10525
10526 * w32.c (sys_rename): Report EXDEV when rename of a directory
10527 fails because the target is on another logical disk. (Bug#10284)
10528
10529 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10530
10531 * xterm.c (x_embed_request_focus): New function.
10532
10533 * xterm.h: Add prototype.
10534
10535 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10536
10537 2012-01-05 Glenn Morris <rgm@gnu.org>
10538
10539 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10540
10541 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10542
10543 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10544 Load gnutls_transport_set_lowat only if GnuTLS version is below
10545 2.11.1.
10546 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10547 GnuTLS versions below 2.11.1.
10548
10549 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10550
10551 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10552 to the doc string advising against its use for altering the way
10553 windows are scrolled.
10554
10555 2011-12-28 Kenichi Handa <handa@m17n.org>
10556
10557 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10558 coding-system ASCII compatible only when it does not produce BOM
10559 on encoding (Bug#10383).
10560
10561 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10562
10563 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10564 can scroll.
10565 (create_and_show_popup_menu): Always use menu_position_func for
10566 Gtk3 (Bug#10361).
10567
10568 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10569
10570 * callint.c (Fcall_interactively): Don't truncate prompt string.
10571
10572 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10573
10574 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10575 property that ends at ZV, so that the bidi iteration could be
10576 resumed from there (after widening). (Bug#10360)
10577
10578 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10579
10580 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10581
10582 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10583
10584 * nsterm.m (x_free_frame_resources):
10585 Release f->output_data.ns->miniimage.
10586 (ns_index_color): Fix indentation. Do not retain
10587 color_table->colors[i].
10588
10589 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10590 before returning.
10591
10592 * nsfns.m (x_set_background_color): Assign return value from
10593 ns_index_color to face-background instead of NSColor*.
10594 (ns_implicitly_set_icon_type): Fix indentation.
10595 Change assignment in for loop to comparison.
10596
10597 * emacs.c (ns_pool): New variable.
10598 (main): Assign ns_pool.
10599 (Fkill_emacs): Call ns_release_autorelease_pool.
10600
10601 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10602 autorelease fdesc, release fdAttrs and tdict.
10603 (ns_get_covering_families): Release charset.
10604 (ns_findfonts): Release NSFontDescriptor created with new.
10605 (ns_uni_to_glyphs): Fix indentation.
10606 (setString): Release attrStr before assigning new value.
10607
10608 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10609
10610 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10611 and NS_IMPL_COCOA.
10612 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10613 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10614
10615 2011-12-18 David Reitter <reitter@cmu.edu>
10616
10617 * nsterm.m (ns_term_init): Subscribe for notifications
10618 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10619 to method trackingNotification in EmacsMenu.
10620
10621 * nsmenu.m (trackingMenu): New variable.
10622 (trackingNotification): New method (from Aquamacs).
10623 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10624 from Aquamacs (Bug#7030).
10625
10626 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10627
10628 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10629 (symbol_to_nsstring): Fix indentation.
10630 (ns_symbol_to_pb): New function.
10631 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10632 (Fns_rotate_cut_buffers_internal): Remove.
10633 (Fns_store_selection_internal): Rename from
10634 Fns_store_cut_buffer_internal.
10635 (ns_get_foreign_selection, Fx_own_selection_internal)
10636 (Fx_disown_selection_internal, Fx_selection_exists_p)
10637 (Fns_get_selection_internal, Fns_store_selection_internal):
10638 Use ns_symbol_to_pb and check if return value is nil.
10639 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10640 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10641 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10642 renamed to Sns_store_selection_internal.
10643 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10644 and remove this function.
10645 (ns_handle_selection_clear): Remove, never used.
10646 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10647 here.
10648
10649 2011-12-17 Ken Brown <kbrown@cornell.edu>
10650
10651 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10652 GID is unknown (Bug#10257).
10653
10654 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10657 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10658 which caused a build failure on GNU/Linux IA-64. This problem was
10659 introduced by my 2011-10-07 patch.
10660
10661 2011-12-15 Juri Linkov <juri@jurta.org>
10662
10663 * image.c (imagemagick_error): New function. (Bug#10112)
10664 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10665 Use `imagemagick_error' where ImageMagick functions return
10666 `MagickFalse'.
10667 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10668 proper order.
10669
10670 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10671
10672 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10673 fill background (Bug#8992).
10674
10675 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10676
10677 * window.c (Vwindow_combination_resize)
10678 (Vwindow_combination_limit): Use t instead of non-nil in
10679 doc-strings.
10680 (Vrecenter_redisplay): Add first sentence of doc-string on
10681 separate line.
10682 (Frecenter): Fix doc-string typo.
10683
10684 2011-12-11 Kenichi Handa <handa@m17n.org>
10685
10686 * coding.c (Funencodable_char_position): Pay attention to the
10687 buffer text relocation (Bug#9389).
10688
10689 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10690
10691 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10692 gtk_init (Bug#10100).
10693
10694 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10695
10696 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10697 IT->string is nil. (Bug#10263)
10698
10699 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10700
10701 * nsterm.h (x_free_frame_resources): Declare.
10702
10703 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10704 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10705
10706 * nsterm.h (ns_get_defaults_value): Declare.
10707
10708 * nsterm.m (ns_default): Call ns_get_defaults_value.
10709
10710 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10711
10712 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10713 (Bug#10170)
10714
10715 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10716
10717 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10718 that where the value of an _OBJC_* symbol points to is in the .bss
10719 section (Bug#10240).
10720
10721 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10722
10723 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10724 after the loop to call ccl_driver at least once (Bug#8619).
10725
10726 2011-12-08 Kenichi Handa <handa@m17n.org>
10727
10728 * ftfont.c (get_adstyle_property): Fix previous change
10729 (Bug#10233).
10730
10731 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10732
10733 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10734 dirs from the default value of EMACSLOADPATH (bug#10208).
10735
10736 2011-12-07 Glenn Morris <rgm@gnu.org>
10737
10738 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10739 installation and source directories as well. (Bug#10208)
10740
10741 2011-12-06 Chong Yidong <cyd@gnu.org>
10742
10743 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10744
10745 2011-12-06 Glenn Morris <rgm@gnu.org>
10746
10747 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10748 as an error, not just -1. (Bug#10217)
10749
10750 2011-12-05 Chong Yidong <cyd@gnu.org>
10751
10752 * keyboard.c (process_special_events): New function.
10753 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10754
10755 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10756
10757 * coding.c (encode_designation_at_bol): Don't use uninitialized
10758 local variable (Bug#9318).
10759
10760 2011-12-05 Kenichi Handa <handa@m17n.org>
10761
10762 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10763 return Qnil (Bug#8046, Bug#10193).
10764
10765 2011-12-05 Kenichi Handa <handa@m17n.org>
10766
10767 * coding.c (encode_designation_at_bol): New args charbuf_end and
10768 dst. Return the number of produced bytes. Callers changed.
10769 (coding_set_source): Return how many bytes coding->source was
10770 relocated.
10771 (coding_set_destination): Return how many bytes
10772 coding->destination was relocated.
10773 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10774 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10775
10776 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10777
10778 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10779 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10780 macro (Bug#9318).
10781
10782 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10783
10784 The following changes are to fix Bug#9318.
10785
10786 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10787 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10788 (encode_coding_iso_2022, encode_coding_sjis)
10789 (encode_coding_big5, encode_coding_charset): Use the above macros.
10790
10791 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10792
10793 * lisp.h (process_quit_flag): Fix external declaration.
10794
10795 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10796
10797 Don't macro-inline non-performance-critical code.
10798 * eval.c (process_quit_flag): New function.
10799 * lisp.h (QUIT): Use it.
10800
10801 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10802
10803 * nsfns.m (get_geometry_from_preferences): New function.
10804 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10805
10806 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10807
10808 * emacs.c (Qkill_emacs): Define.
10809 (syms_of_emacs): Initialize it.
10810 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10811 Qquit_flag to `kill-emacs' instead.
10812 (quit_throw_to_read_char): Add parameter `from_signal'.
10813 All callers changed. Call Fkill_emacs if requested and safe.
10814 * lisp.h (QUIT): Call Fkill_emacs if requested.
10815
10816 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10817
10818 * widget.c (update_wm_hints): Return if wmshell is null.
10819 (widget_update_wm_size_hints): New function.
10820
10821 * widget.h (widget_update_wm_size_hints): Declare.
10822
10823 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10824 widget_update_wm_size_hints (Bug#10104).
10825
10826 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10827
10828 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10829 before a newline, prepare the bidi iterator for consuming the
10830 newline, and keep the current paragraph direction. (Bug#10183)
10831 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10832
10833 2011-12-02 Juri Linkov <juri@jurta.org>
10834
10835 * search.c (Fword_search_regexp): New Lisp function created from
10836 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10837 (Fword_search_backward, Fword_search_forward)
10838 (Fword_search_backward_lax, Fword_search_forward_lax):
10839 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10840 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10841
10842 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10843
10844 * fileio.c (Finsert_file_contents): Move after-change-function call
10845 to before the "handled:" label, since all "goto handled" appear in
10846 cases where the *-change-functions have already been properly called
10847 (bug#10117).
10848
10849 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10850
10851 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10852 waiting for input. (Bug#10169)
10853
10854 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10855
10856 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10857 verifies glyph row's hash code--we have just reallocated the
10858 glyphs, so their contents can be complete garbage. (Bug#10164)
10859
10860 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10861
10862 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10863
10864 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10865
10866 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10867 attributes are tested _before_ calling verify_row_hash, to protect
10868 against GCC re-ordering of the tests. (Bug#10164)
10869
10870 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10871
10872 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10873
10874 * xterm.c (handle_one_xevent): Only set async_visible and friends
10875 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10876 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10877 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10878
10879 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10880
10881 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10882 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10883 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10884 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10885 All uses changed to use GCPRO1 etc.
10886 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10887 Revert to old implementation (i.e., before 2011-03-11).
10888
10889 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10890
10891 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10892 of scroll runs so as to avoid assigning disabled bogus rows and
10893 unnecessary graphics copy operations.
10894
10895 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10896
10897 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10898 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10899 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10900 (malloc, free, realloc, calloc): Redirect to e_* only when
10901 compiling Emacs.
10902
10903 * lisp.h (GCTYPEBITS): Move before first use.
10904 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10905 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10906 this macro definition.
10907
10908 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10909 _MSC_VER.
10910
10911 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10912
10913 * gtkutil.c (xg_create_frame_widgets):
10914 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10915 present with Gtk+ 2.0.
10916
10917 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 * fileio.c (Finsert_file_contents): Undo previous change; see
10920 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10921
10922 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 Rename locals to avoid shadowing.
10925 * fileio.c (Finsert_file_contents):
10926 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10927 * process.c (wait_reading_process_output):
10928 Rename inner 'proc' to 'p' to avoid shadowing.
10929 Indent for consistency with usual Emacs style.
10930
10931 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10932
10933 * xdisp.c (redisplay_window): If cursor row is not fully visible
10934 after recentering, and scroll-conservatively is set to a large
10935 number, scroll window by a few more lines to make the cursor fully
10936 visible and out of scroll-margin. (Bug#10105)
10937 (start_display): Don't move to the next line if the display should
10938 start at a newline that is part of a display vector or an overlay
10939 string. (Bug#10119)
10940
10941 2011-11-24 Juri Linkov <juri@jurta.org>
10942
10943 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10944 after the `MagickPingImage' call. (Bug#10112)
10945
10946 2011-11-23 Chong Yidong <cyd@gnu.org>
10947
10948 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10949
10950 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10951
10952 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10953 making another buffer current. (Bug#10114)
10954
10955 2011-11-23 Glenn Morris <rgm@gnu.org>
10956
10957 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10958
10959 2011-11-23 Chong Yidong <cyd@gnu.org>
10960
10961 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10962 using it (Bug#5984).
10963
10964 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10965
10966 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10967 and header-lines, as they don't have one computed for them.
10968 (Bug#10098)
10969
10970 * .gdbinit (prow): Make displayed values more self-explaining.
10971 Add row's hash code.
10972
10973 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10974
10975 * process.c (wait_reading_process_output): Fix asynchrounous
10976 GnuTLS socket handling on some versions of the GnuTLS library.
10977 (wait_reading_process_output): Add comment and URL.
10978
10979 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10980
10981 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10982
10983 2011-11-21 Chong Yidong <cyd@gnu.org>
10984
10985 * window.c (Fnext_window, Fprevious_window): Doc fix.
10986
10987 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10988
10989 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10990
10991 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10992
10993 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10994
10995 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10996
10997 * window.c (Fset_window_combination_limit): Rename argument
10998 STATUS to LIMIT.
10999 (Vwindow_combination_limit): Remove "status" from doc-string.
11000
11001 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11002
11003 * m/ibms390.h: Remove.
11004 * m/ibms390x.h: Don't include "ibms390.h".
11005
11006 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11007
11008 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11009 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11010
11011 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11012
11013 * casetab.c (Fset_case_table):
11014 * charset.c (Fcharset_after): Fix typos.
11015
11016 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11017
11018 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11019 Otherwise, valgrind does not work on some platforms.
11020 Problem reported by Andreas Schwab in
11021 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11022 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11023 is set, removing the need for VIRT_ADDRESS_VARIES.
11024 (PURE_P): Use a more-efficient implementation that needs just one
11025 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11026 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11027 to 4 (xorl, subq, cmpq, setbe).
11028 * alloc.c (pure): Always extern now, since that's the
11029 VIRT_ADDR_VARIES behavior.
11030 (PURE_POINTER_P): Use a single comparison, not two, for
11031 consistency with the new puresize.h.
11032 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11033 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11034 Remove VIRT_ADDR_VARIES no longer needed.
11035
11036 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11037
11038 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11039 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11040 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11041 behave as if the cursor position were at the window margin.
11042
11043 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11044 and the cursor position is out of bounds, behave as if the cursor
11045 position were at the window margin. (Bug#10075)
11046
11047 2011-11-18 Chong Yidong <cyd@gnu.org>
11048
11049 * window.c (Fwindow_combination_limit): Make first argument
11050 non-optional, since it is meaningless for live windows like the
11051 selected window.
11052
11053 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11054
11055 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11056
11057 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11058
11059 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11060 (graft_intervals_into_buffer): Simplify.
11061
11062 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11063
11064 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11065 hash values of the two rows.
11066 (copy_row_except_pointers): Preserve the used[] arrays and the
11067 hash values of the two rows. (Bug#10035)
11068 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11069
11070 * xdisp.c (row_hash): New function, body extracted from
11071 compute_line_metrics.
11072 (compute_line_metrics): Call row_hash, instead of computing the
11073 hash code inline.
11074
11075 * dispnew.c (verify_row_hash): Call row_hash for computing the
11076 hash code of a row, instead of duplicating code from xdisp.c.
11077
11078 * dispextern.h (row_hash): Add prototype.
11079
11080 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11081
11082 * frame.c (delete_frame): Don't delete the terminal when the last
11083 X frame is closed if emacs is built with GTK toolkit.
11084
11085 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11086
11087 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11088
11089 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11090
11091 * window.c (Vwindow_splits): Rename to
11092 Vwindow_combination_resize. Suggested by Juri Linkov.
11093 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11094 of Vwindow_splits.
11095
11096 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11097
11098 * nsfns.m (Fns_font_name):
11099 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11100
11101 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11102
11103 * window.h (window): Rename slot "nest" to "combination_limit".
11104 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11105 (Fset_window_nest): Rename to Fset_window_combination_limit.
11106 (Vwindow_nest): Rename to Vwindow_combination_limit.
11107 (recombine_windows, make_parent_window, make_window)
11108 (Fsplit_window_internal, saved_window)
11109 (Fset_window_configuration, save_window_save): Rename all
11110 occurrences of window_nest to window_combination_limit.
11111
11112 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11113
11114 * image.c (imagemagick_load_image): Fix typo.
11115
11116 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11117
11118 * xdisp.c (display_line): Move the call to
11119 highlight_trailing_whitespace before the call to
11120 compute_line_metrics, since the latter needs to see the final
11121 faces of all the glyphs to compute ROW's hash value.
11122 Fixes assertion violations in row_equal_p. (Bug#10035)
11123
11124 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11125
11126 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11127 just return (bug#10044).
11128
11129 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11130
11131 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11132 with user-defined heap size. Bump the default size of the temacs
11133 heap to 27MB, to avoid memory warning when running temacs.
11134 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11135
11136 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11137 current_matrix and desired_matrix. (Bug#9990)
11138 (verify_row_hash) [XASSERTS]: New function.
11139 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11140 that the hash value of glyph rows is correct.
11141
11142 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11143
11144 * window.h (window): Remove splits slot.
11145 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11146 (Fdelete_other_windows_internal, make_parent_window)
11147 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11148 (Fset_window_configuration, save_window_save): Don't deal with
11149 split status of windows.
11150 (saved_window): Remove splits slot.
11151 (Vwindow_splits): Rewrite doc-string.
11152
11153 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11154
11155 * xfns.c (unwind_create_frame):
11156 * nsfns.m (unwind_create_frame):
11157 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11158 Vframe_list (Bug#9999).
11159
11160 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11161
11162 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11163
11164 2011-11-11 Kenichi Handa <handa@m17n.org>
11165
11166 * callproc.c (Fcall_process): Set the member dst_multibyte of
11167 process_coding.
11168
11169 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11170
11171 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11172 avoid a crash (bug#9496).
11173
11174 2011-11-09 Chong Yidong <cyd@gnu.org>
11175
11176 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11177 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11178
11179 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11180
11181 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11182
11183 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11184
11185 Avoid some portability problems by eschewing 'extern inline' functions.
11186 The trivial performance wins aren't worth the portability hassles; see
11187 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11188 et seq.
11189 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11190 (window_box_width, window_box_left, window_box_left_offset)
11191 (window_box_right, window_box_right_offset): Undo previous change,
11192 by removing the "extern"s.
11193 * intervals.c (adjust_intervals_for_insertion)
11194 (adjust_intervals_for_deletion): Undo previous change,
11195 making these static again.
11196 (offset_intervals, temp_set_point_both, temp_set_point)
11197 (copy_intervals_to_string): No longer inline.
11198 * xdisp.c (window_text_bottom_y, window_box_width)
11199 (window_box_height, window_box_left_offset)
11200 (window_box_right_offset, window_box_left, window_box_right)
11201 (window_box): No longer inline.
11202
11203 2011-11-08 Chong Yidong <cyd@gnu.org>
11204
11205 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11206 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11207 Signal an error if not a live window.
11208 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11209 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11210
11211 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11212
11213 * lisp.h (syms_of_abbrev): Remove declaration.
11214 Reported by CHENG Gao <chenggao@royau.me>.
11215
11216 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11217
11218 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11219 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11220 of temacs in GUI mode.
11221
11222 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11223
11224 * window.h: Declare delete_all_child_windows instead of
11225 delete_all_subwindows.
11226 * window.c (Fwindow_nest, Fset_window_nest)
11227 (Fset_window_new_total, Fset_window_new_normal)
11228 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11229 (delete_all_subwindows): Rename to delete_all_child_windows.
11230 (Fdelete_other_windows_internal, Fset_window_configuration):
11231 Call delete_all_child_windows instead of delete_all_subwindows.
11232 * frame.c (delete_frame): Call delete_all_child_windows instead
11233 of delete_all_subwindows.
11234
11235 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11236
11237 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11238 This is also needed for porting to any host where GC_MARK_STACK is
11239 not GC_MAKE_GCPROS_NOOPS.
11240 (which_symbols): Use it.
11241
11242 2011-11-07 Kenichi Handa <handa@m17n.org>
11243
11244 * coding.c (coding_set_destination): Check coding->src_pos only
11245 when coding->src_object is a buffer (bug#9910).
11246
11247 * process.c (send_process): Set the member src_multibyte of coding
11248 to 0 (bug#9911) when sending a unibyte text.
11249
11250 * callproc.c (Fcall_process): Set the member src_multibyte of
11251 process_coding to 0 (bug#9912).
11252
11253 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11254
11255 * xmenu.c (cleanup_widget_value_tree): New function.
11256 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11257 calling free_menubar_widget_value_tree directly (Bug#9830).
11258
11259 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11260
11261 Fix some portability problems with 'inline'.
11262 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11263 (window_box_width, window_box_left, window_box_left_offset)
11264 (window_box_right, window_box_right_offset): Declare extern.
11265 Otherwise, these inline functions do not conform to C99 and
11266 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11267 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11268 * intervals.c (adjust_intervals_for_insertion)
11269 (adjust_intervals_for_deletion): Now extern, because otherwise the
11270 extern inline functions 'offset_intervals' couldn't refer to it.
11271 (static_offset_intervals): Remove.
11272 (offset_intervals): Rewrite using the old contents of
11273 static_offset_intervals. The old version didn't conform to C99
11274 because an extern inline function contained a reference to an
11275 identifier with static linkage.
11276
11277 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11278
11279 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11280 GC.
11281
11282 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11283
11284 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11285 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11286 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11287 return Qleft_to_right.
11288
11289 2011-11-06 Chong Yidong <cyd@gnu.org>
11290
11291 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11292 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11293 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11294 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11295 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11296 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11297 (Fwindow_vscroll): Doc fix.
11298 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11299 argument, since it makes no sense to pass a live window and for
11300 consistency with window-child.
11301
11302 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11303
11304 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11305 support MSVC.
11306
11307 2011-11-05 Jason Rumney <jasonr@gnu.org>
11308
11309 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11310 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11311 fonts (Bug#6029).
11312 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11313 bitwise arithmetic preventing use of unicode-sip and non-truetype
11314 opentype fonts.
11315
11316 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11317
11318 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11319 "emacs"-only part.
11320
11321 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11322 initialization code to keep similarity to xfns.c after changes
11323 from 2011-11-05.
11324
11325 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11326
11327 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11328 (unwind_create_frame): New function (Bug#9943).
11329 (Fx_create_frame): Restructure code to be more similar to the one in
11330 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11331 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11332 Move terminal->reference_count++ just before making the frame official
11333 (Bug#9943).
11334
11335 * nsterm.m (x_free_frame_resources): New function.
11336 (x_destroy_window): Move code to x_free_frame_resources.
11337
11338 * xfns.c (unwind_create_frame): Fix comment.
11339 (Fx_create_frame, x_create_tip_frame):
11340 Move terminal->reference_count++ just before making the frame
11341 official. Move initialization of image_cache_refcount and
11342 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11343
11344 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11345
11346 Support MSVC build with newer versions of Visual Studio.
11347 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11348 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11349 nt/gmake.defs.
11350
11351 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11352 which are not supported by MSVC.
11353 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11354 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11355 bitfields.
11356 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11357 types in bitfields.
11358 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11359
11360 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11361
11362 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11363
11364 Support MSVC build with newer versions of Visual Studio.
11365 * w32.c: Don't include w32api.h for MSVC.
11366 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11367
11368 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11369 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11370 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11371 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11372 e_* cousins.
11373 (alloca) [_MSC_VER]: Define to _alloca.
11374
11375 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11376
11377 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11378
11379 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11380
11381 * xdisp.c (note_mouse_highlight): If either of
11382 previous/next-single-property-change returns nil, treat that as
11383 the beginning or the end of the buffer. (Bug#9955)
11384
11385 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11386
11387 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11388 label is not null (Bug#9951).
11389 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11390 may be NULL.
11391
11392 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11393
11394 * window.c (Fwindow_body_size): Mention in the doc string that the
11395 return value is in frame's canonical units. (Bug#9949)
11396
11397 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11398
11399 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11400
11401 * w32fns.c (unwind_create_frame): If needed, free the glyph
11402 matrices of the partially constructed frame. (Bug#9943)
11403 * xfns.c (unwind_create_frame): Likewise.
11404
11405 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11406
11407 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11408 Don't stop backward scan on the continuation glyph, even though
11409 its CHARPOS is positive.
11410 (mouse_face_from_buffer_pos, note_mouse_highlight):
11411 Rename cover_string to disp_string.
11412
11413 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11414
11415 * window.c (temp_output_buffer_show): Don't use
11416 Vtemp_buffer_show_specifiers.
11417 (Vtemp_buffer_show_specifiers): Remove unused variable.
11418
11419 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11420
11421 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11422 past the beginning of the current glyph matrix.
11423
11424 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11425
11426 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11427 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11428 HAVE_GTK3 (Bug#9869).
11429
11430 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11431 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11432
11433 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11434
11435 * xterm.c: Declare x_handle_net_wm_state to return int.
11436 (handle_one_xevent): Check if we are iconified but don't have
11437 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11438 (get_current_wm_state): Return non-zero if not hidden,
11439 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11440 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11441 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11442 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11443
11444 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11445
11446 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11447 so that this new function doesn't get optimized away by a
11448 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11449
11450 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11451
11452 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11453
11454 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11455
11456 Fix the `xbytecode' command.
11457 * .gdbinit (xprintbytestr): New command.
11458 (xwhichsymbols): Rename from `which'; all callers changed.
11459 (xbytecode): Print the byte-code string as well.
11460
11461 2011-10-29 Kim Storm <storm@cua.dk>
11462
11463 * alloc.c (which_symbols): New function.
11464
11465 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11466
11467 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11468 line. (Bug#9903)
11469
11470 2011-10-29 Glenn Morris <rgm@gnu.org>
11471
11472 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11473 Not clear what it was for, and it causes various bugs. (Bug#9839)
11474
11475 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11476
11477 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11478 possible random value that matches one of those tested as
11479 condition to clear the mouse face.
11480
11481 2011-10-28 Chong Yidong <cyd@gnu.org>
11482
11483 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11484
11485 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11486
11487 * window.c (make_window): Initialize phys_cursor_on_p.
11488
11489 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11490
11491 * lisp.h (struct Lisp_Symbol): Update comments.
11492
11493 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11494
11495 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11496
11497 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11498
11499 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11500 <oslsachem@gmail.com> for helping to debug this.
11501
11502 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11503 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11504 (g_b_init_get_glyph_outline_w): New static variables.
11505 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11506 (GetGlyphOutlineW_Proc): New typedefs.
11507 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11508 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11509 New functions.
11510 (w32font_open_internal, compute_metrics):
11511 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11512 instead of calling the "wide" APIs directly.
11513
11514 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11515
11516 * w32.h (syms_of_w32font): Add prototype.
11517
11518 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11519
11520 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11521 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11522 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11523 (Fmove_to_window_line): Doc fix.
11524
11525 2011-10-27 Chong Yidong <cyd@gnu.org>
11526
11527 * process.c (make_process): Set gnutls_state to NULL.
11528
11529 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11530 non-NULL, regardless of GNUTLS_INITSTAGE.
11531 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11532 an error. Set process slots as soon as we allocate them.
11533
11534 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11535
11536 2011-10-27 Chong Yidong <cyd@gnu.org>
11537
11538 * gnutls.c (emacs_gnutls_deinit): New function.
11539 Deallocate credentials structures as well as calling gnutls_deinit.
11540 (Fgnutls_deinit, Fgnutls_boot): Use it.
11541
11542 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11543 (deactivate_process): Call emacs_gnutls_deinit.
11544
11545 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11546
11547 * image.c (x_create_x_image_and_pixmap):
11548 * w32.c (sys_rename, w32_delayed_load):
11549 * w32font.c (fill_in_logfont):
11550 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11551
11552 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11553
11554 * w32fns.c (w32_default_color_map): New function,
11555 extracted from Fw32_default_color_map.
11556 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11557
11558 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11559
11560 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11561
11562 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11563
11564 * keyboard.c (test_undefined): New function (bug#9751).
11565 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11566
11567 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11568
11569 * sysdep.c (init_sys_modes): Fix the check for the controlling
11570 terminal (Bug#6649).
11571
11572 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11573
11574 * dispextern.h (struct bidi_it): New member next_en_type.
11575
11576 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11577 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11578 current character, check also for next_en_type being WEAK_EN.
11579 (bidi_resolve_weak): Don't enter the expensive loop if the current
11580 position is before next_en_pos. Record the bidi type of the first
11581 non-ET, non-BN character we find, in addition to its position.
11582 (bidi_level_of_next_char): Invalidate next_en_type when
11583 next_en_pos is over-stepped.
11584
11585 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11586
11587 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11588 * editfns.c: Rewrite current-time-zone so that it invokes
11589 the equivalent of (format-time-string "%Z") to get the time zone name.
11590 This fixes a bug when the time zone name contains characters that
11591 need converting from the system time locale to Emacs internal format.
11592 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11593 that patch fixed format-time-string to do the conversion, but
11594 I forgot to fix current-time-zone.
11595 (format_time_string): New function, containing most of
11596 what Fformat_time_string used to contain.
11597 (Fformat_time_string): Rewrite in terms of format_time_string.
11598 This doesn't change this function's behavior.
11599 (current-time-zone): Rewrite to use format_time_string.
11600 This fixes the bug reported by Michael Schierl in
11601 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11602 Jason Rumney's 2007-06-07 change worked around this bug, but
11603 didn't fix it.
11604 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11605
11606 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11607
11608 * xdisp.c (start_display): If the character at POS is displayed
11609 via a display vector, reset IT->current.dpvec_index to zero.
11610 (try_window_reusing_current_matrix): If a line ends in a display
11611 vector or the next line starts in a display vector, continue
11612 redrawing the window even though the character position of
11613 start_row was reached.
11614 (Bug#9771, part 2)
11615
11616 2011-10-18 Chong Yidong <cyd@gnu.org>
11617
11618 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11619 with nobreak-char-display too.
11620
11621 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11622
11623 Fix part 3 of bug#9771.
11624 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11625 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11626 non-neutral characters if the current character is a paragraph
11627 separator (a.k.a. Newline). This avoids running the same
11628 expensive loop twice, once when we consume the preceding newline
11629 and the other time when the line actually needs to be displayed.
11630 Avoid the loop when we see neutrals on the base embedding level
11631 following a character whose directionality is the same as the
11632 paragraph's. This avoids running the expensive loop when a line
11633 ends in a long sequence of neutrals, like control characters.
11634 Add assertion against STRONG_AL type. Slightly rearrange code
11635 that determines the type of a neutral given the first non-neutral
11636 that follows it.
11637 (bidi_level_of_next_char): Set next_en_pos to zero when
11638 invalidating its info.
11639
11640 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11641
11642 * xdisp.c (push_display_prop): Determine whether to record string
11643 or buffer position by IT->string, not by IT->method. Allow
11644 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11645 (move_it_vertically_backward): Don't look for character position
11646 immediately after the newline when in a continuation line.
11647 (Bug#9771, part 1)
11648
11649 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11650
11651 * window.c (coordinates_in_window): Rewrite and delabelize
11652 vertical border check. (Bug#5357) (Bug#9618)
11653
11654 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11655
11656 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11657 errors in XSetWindowBorder (bug#9310).
11658
11659 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11660
11661 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11662 avoid crash when xmalloc overrun checking is enabled.
11663
11664 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11665
11666 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11667 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11668 cursor motion with <left> and <right> arrow keys.
11669
11670 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11671 some callers set that themselves.
11672
11673 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11674
11675 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11676 display string and the previous row comes from the same string and
11677 is empty. (Bug#9739) (Bug#9738)
11678
11679 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11680
11681 * doc.c (get_doc_string): Encode file name (bug#9735).
11682
11683 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11684
11685 * bidi.c (bidi_level_of_next_char):
11686 * xdisp.c (get_visually_first_element): Remove old incorrect
11687 comments regarding the Unicode Line Separator character.
11688
11689 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11690
11691 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11692
11693 * alloc.c (Fgc_status): Do not access beyond zombies array
11694 boundary if nzombies > MAX_ZOMBIES.
11695 * alloc.c (dump_zombies): Add missing format specifier.
11696
11697 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11698
11699 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11700 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11701
11702 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11703 Some packages use them to denote characters with modifiers.
11704
11705 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11706
11707 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11708 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11709 matching a pp-number. Rename parameter var to var1.
11710
11711 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11712
11713 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11714
11715 2011-10-08 Glenn Morris <rgm@gnu.org>
11716
11717 * callint.c (Fcall_interactively): Give a more explicit error for the
11718 'c' case with a non-character input. (Bug#8479)
11719
11720 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11721
11722 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11723 lines.
11724 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11725 lines that are hscrolled on the left.
11726
11727 * dispnew.c (buffer_posn_from_coords): Account for a possible
11728 presence of header-line. (Bug#4426)
11729
11730 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11731
11732 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11733 Don't advertise functionality which we discourage or doesn't work.
11734
11735 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11736
11737 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11738 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11739 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11740 this makes Emacs dump core during garbage collection on rare
11741 occasions. sizeof is obviously inferior to offsetof here, so
11742 stick with offsetof.
11743 (GC_POINTER_ALIGNMENT): New macro.
11744 (mark_memory): Omit 3rd (offset) arg; caller changed.
11745 Don't assume EMACS_INT alignment is the same as pointer alignment.
11746
11747 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11748
11749 * keyboard.c (read_key_sequence_remapped): New var.
11750 (read_key_sequence): Compute remapping in the right buffer.
11751 (command_loop_1): Use read_key_sequence's remapping directly.
11752
11753 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11754
11755 * dired.c (file_name_completion): Don't expand file name.
11756 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11757 before checking file name handler.
11758
11759 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11760 they've been requested explicitly (bug#9591).
11761
11762 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11763
11764 * keymap.c (Fsingle_key_description): Use make_specified_string
11765 instead of build_string to build string from push_key_description.
11766 (Bug#5193)
11767
11768 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11769
11770 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11771 This fixes a Y2038 bug on 64-bit hosts.
11772 * buffer.c (reset_buffer):
11773 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11774 (Fclear_buffer_auto_save_failure):
11775 Use 0, not -1, to represent an unset failure time, since time_t
11776 might not be signed.
11777
11778 Remove dependency on glibc malloc internals.
11779 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11780 Move back here from lisp.h, but with their new implementations.
11781 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11782 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11783 * charset.c (charset_table_init): New static var.
11784 (syms_of_charset): Use it instead of xmalloc. This removes a
11785 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11786 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11787 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11788 Move back to alloc.c.
11789 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11790 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11791
11792 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11793
11794 * nsterm.m (windowDidResize): Call x_set_window_size only when
11795 ns_in_resize is true. Otherwise set pixelwidth/height and
11796 call change_frame_size (Bug#9628).
11797
11798 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11799
11800 Port --enable-checking=all to Fedora 14 x86-64.
11801 * charset.c (syms_of_charset): Also account for glibc malloc's
11802 internal overhead when calculating the initial malloc maximum.
11803
11804 Port --enable-checking=all to Fedora 14 x86.
11805 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11806 Move to lisp.h.
11807 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11808 (overrun_check_realloc, overrun_check_free):
11809 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11810 That way, xmalloc returns a properly-aligned pointer even if
11811 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11812 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11813 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11814 into account when calculating the initial malloc maximum.
11815 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11816 Move here from alloc.c, so that charset.c can use it too.
11817 Properly align; the old code wasn't right for common 32-bit hosts
11818 when configured with --enable-checking=all.
11819 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11820 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11821
11822 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11823
11824 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11825 use EDOM.
11826
11827 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11828
11829 * xdisp.c (compute_display_string_end): If there's no display
11830 string at CHARPOS, return -1.
11831
11832 * bidi.c (bidi_fetch_char): When compute_display_string_end
11833 returns a negative value, treat the character as a normal
11834 character not covered by a display string. (Bug#9624)
11835
11836 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11837
11838 * lread.c (Fread_from_string): Fix typo in docstring.
11839
11840 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11841
11842 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11843 newline, reseat the iterator instead of bidi-iterating there one
11844 character at a time. (Bug#9610)
11845 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11846 TO_CHARPOS if the bidi iterator is at base embedding level.
11847
11848 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11849
11850 * lread.c (readevalloop): Use correct code for NBSP.
11851 (read1): Likewise. (Bug#9608)
11852
11853 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11854
11855 * dbusbind.c (Fdbus_register_signal): When service is not
11856 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11857
11858 2011-09-25 Glenn Morris <rgm@gnu.org>
11859
11860 * buffer.c (truncate-lines): Doc fix.
11861
11862 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11863
11864 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11865 (Fset_window_next_buffers): Doc fix.
11866
11867 2011-09-24 Glenn Morris <rgm@gnu.org>
11868
11869 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11870
11871 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11872
11873 Fix minor problems found by static checking.
11874 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11875 * indent.c (Fvertical_motion): Fix == vs = typo.
11876
11877 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11878
11879 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11880 Default value is now t. Doc fix.
11881
11882 * indent.c (Fvertical_motion): Compute and apply the overshoot
11883 logic when moving up, not only when moving down. Fix the
11884 confusing name and values of the it_overshoot_expected variable;
11885 logic changes accordingly. (Bug#9254) (Bug#9549)
11886
11887 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11888 CHARPOS is covered by a display string which includes newlines.
11889 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11890 is covered by a display string with embedded newlines.
11891
11892 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11893
11894 * dbusbind.c (Fdbus_register_signal): Add match rule to
11895 Vdbus_registered_objects_table. (Bug#9581)
11896 (Fdbus_register_method, Vdbus_registered_objects_table):
11897 Fix docstring.
11898
11899 2011-09-24 Jim Meyering <meyering@redhat.com>
11900
11901 do not ignore write error for any output size
11902 The previous change was incomplete.
11903 While it makes emacs --batch detect the vast majority of stdout
11904 write failures, errors were still ignored whenever the output size is
11905 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11906 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11907 && echo FAIL: ignored write error
11908 FAIL: ignored write error
11909 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11910 && echo FAIL: ignored write error
11911 FAIL: ignored write error
11912 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11913
11914 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11915
11916 * emacs.c (Fkill_emacs): In noninteractive mode exit
11917 non-successfully if a write error occurred on stdout. (Bug#9574)
11918
11919 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11920
11921 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11922 the xassert test.
11923
11924 * dispextern.h (struct it): Update the comment documenting what
11925 can it->OBJECT be.
11926
11927 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11928
11929 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11930 a display string, extend search for cursor position to end of row.
11931 (find_row_edges): If the row ends in a newline from a display
11932 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11933 Handle the case of a display string with multiple newlines.
11934 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11935 non-empty line. Fixes confusing cursor motion with arrow keys at
11936 the beginning of a line that starts with whitespace.
11937
11938 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11939
11940 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11941 (bug#9493).
11942
11943 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11944
11945 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11946 boolean (Bug#9154).
11947
11948 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11949
11950 * xdisp.c (display_line): Record maximum and minimum buffer
11951 positions even if no glyphs were produced (e.g., by a zero-width
11952 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11953 buffer positions that will be removed from the glyph row because
11954 they don't fit.
11955 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11956 column is beyond frame width: don't subtract 1 "pixel" when
11957 computing width of the stretch.
11958 (reseat_at_next_visible_line_start): Undo the change made on
11959 2011-09-17 that saved paragraph information and restored it after
11960 the call to `reseat'. (Bug#9545)
11961
11962 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11963
11964 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11965 and turn window cursor on if cleared (Bug#9415).
11966
11967 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11968
11969 * search.c (boyer_moore): Take unibyte characters from pattern
11970 literally. (Bug#9458)
11971
11972 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11973
11974 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11975
11976 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 Fix minor problem found by static checking.
11979 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11980 initialized, to pacify gcc -Wuninitialized.
11981
11982 * fileio.c: Report proper errno when syscall falls.
11983 (Finsert_file_contents): Save and restore errno,
11984 so that report_file_error outputs the correct diagnostic.
11985 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11986
11987 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11988
11989 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11990
11991 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11992
11993 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11994 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11995
11996 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11997
11998 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11999 about the current paragraph and restore it after the call to reseat.
12000
12001 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12002 (bidi_find_paragraph_start): Search back for paragraph beginning
12003 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12004 (bidi_move_to_visually_next): Only trigger paragraph-related
12005 computations when the last character is a newline or at EOB, not
12006 just any NEUTRAL_B. (Bug#9470)
12007
12008 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12009 truncated lines if point is covered by a display string. (Bug#9524)
12010
12011 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12014 (cons_to_x_long): New function.
12015 (lisp_data_to_selection_data): Use it. Correct the test for
12016 short-versus-long data; it was negated. Break out of vector
12017 loop, for efficiency, when a long datum is discovered.
12018
12019 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12020
12021 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12022
12023 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12024
12025 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12026 GCC PR/17406) by declaring this function with external scope.
12027
12028 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12029
12030 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12031 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12032
12033 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12034
12035 * editfns.c (Fformat): Correctly handle text properties on "%%".
12036
12037 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12038
12039 * xterm.c (x_draw_composite_glyph_string_foreground):
12040 * w32term.c (x_draw_composite_glyph_string_foreground):
12041 * term.c (encode_terminal_code):
12042 * composite.c (composition_update_it, get_composition_id):
12043 * xdisp.c (get_next_display_element)
12044 (fill_composite_glyph_string): Add comments about special meaning
12045 of TAB characters in a composition.
12046
12047 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12048
12049 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12050 This occurs when processing a multibyte format.
12051 Problem reported by Wolfgang Jenker.
12052
12053 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12054
12055 * xdisp.c (try_cursor_movement): Only check for exact match if
12056 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12057
12058 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12059
12060 Remove unused external symbols.
12061 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12062 * xdisp.c (calc_pixel_width_or_height): Now static.
12063 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12064 * indent.c (check_display_width):
12065 * w32term.c: Fix comment to match code.
12066 * xterm.c, xterm.h (x_catching_errors): Remove.
12067
12068 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12069
12070 * xselect.c: Use signed conversions more consistently (Bug#9498).
12071 (selection_data_to_lisp_data): Assume incoming selection data are
12072 signed integers, not unsigned. This is to be consistent with
12073 outgoing selection data, which was modified to use signed integers
12074 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12075 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12076 expects long, not unsigned long.
12077
12078 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12079
12080 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12081 computation of loop end. Reported by Johan Bockgård
12082 <bojohan@gnu.org>.
12083
12084 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12085
12086 * frame.c (Fother_visible_frames_p): Function deleted.
12087
12088 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12089
12090 * indent.c (compute_motion): Process display vector front to back
12091 rather than the other way around. (Bug#2496)
12092
12093 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12094
12095 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12096
12097 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12098
12099 * minibuf.c (Fread_from_minibuffer): Doc fix.
12100
12101 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12102
12103 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12104 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12105
12106 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12107
12108 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12109 value for non-existent files.
12110
12111 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12112
12113 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12114 set its "size" to -1. This will set the modtime_size field of
12115 the corresponding buffer to -1, which is what
12116 verify-visited-file-modtime expects for files that do not exist.
12117 (Bug#9139)
12118
12119 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12120
12121 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12122 here ...
12123 * lisp.h: ... from here. push_key_description is no longer
12124 defined in keyboard.c, so its declaration should not be in
12125 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12126 logically belongs with push_key_description.
12127
12128 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12129
12130 * buffer.h: Include <sys/types.h> instead of <time.h>.
12131 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12132 Problem reported by Herbert J. Skuhra.
12133
12134 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12135
12136 * xml.c (parse_region): Make the parsing work for
12137 non-comment-starting XML files again (bug#9144).
12138
12139 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12140
12141 * image.c (gif_load): Fix calculation of bottom and right corner.
12142 (Bug#9468)
12143
12144 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12145
12146 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12147 redisplay in small windows.
12148
12149 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12150
12151 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12152
12153 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12154
12155 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12156 Operate on live windows only.
12157
12158 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12159
12160 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12161
12162 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12163
12164 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12165 only under bidi iteration.
12166
12167 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12168
12169 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12170
12171 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12172
12173 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12174 Without this fix, the command to link temacs failed due to an
12175 undefined symbol __builtin_isnan. This is because
12176 /usr/include/iso/math_c99.h #defines isnan(x) to
12177 __builtin_isnan(x), but the bundled gcc, which identifies itself
12178 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12179 a __builtin_isnan.
12180 * floatfns.c (isnan): #undef, and then #define to a clone of
12181 what's in data.c.
12182 (Fisnan): Always define, since it's always available now.
12183 (syms_of_floatfns): Always define isnan at the Lisp level.
12184
12185 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12186
12187 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12188
12189 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12190
12191 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12192 The previous code assumed that file offsets (off_t values) fit in
12193 EMACS_INT variables, which is not true on typical 32-bit hosts.
12194 The code messed up by falsely reporting buffer overflow in cases
12195 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12196 when "big" contains more than 2**29 bytes, even though this
12197 inserts just one byte and does not overflow the buffer.
12198 (Finsert_file_contents): Store file offsets as off_t
12199 values, not as EMACS_INT values. Check for overflow when
12200 converting between EMACS_INT and off_t. When checking for
12201 buffer overflow or for overlap, take the offsets into account.
12202 Don't use EMACS_INT for small values where int suffices.
12203 When checking for overlap, fix a typo: ZV was used where
12204 ZV_BYTE was intended.
12205 (Fwrite_region): Don't assume off_t fits into 'long'.
12206 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12207
12208 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12209
12210 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12211
12212 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12213
12214 sprintf-related integer and memory overflow issues (Bug#9412).
12215
12216 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12217 (esprintf, exprintf, evxprintf): New functions.
12218 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12219 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12220 (modify_event_symbol): Do not assume that the length of
12221 name_alist_or_stem is safe to alloca and fits in int.
12222 (Fexecute_extended_command): Likewise for function name and binding.
12223 (Frecursion_depth): Wrap around reliably on integer overflow.
12224 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12225 since some callers pass EMACS_INT values.
12226 (Fsingle_key_description): Don't crash if symbol name contains more
12227 than MAX_ALLOCA bytes.
12228 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12229 (get_minibuffer): Arg is now EMACS_INT, not int.
12230 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12231 (esprintf, exprintf, evxprintf): New decls.
12232 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12233
12234 * dbusbind.c (signature_cat): New function.
12235 (xd_signature, Fdbus_register_signal):
12236 Do not overrun buffer; instead, report string overflow.
12237
12238 * dispnew.c (add_window_display_history): Don't overrun buffer.
12239 Truncate instead; this is OK since it's just a log.
12240
12241 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12242 even if the time zone offset is outlandishly large.
12243 Don't mishandle offset == INT_MIN.
12244
12245 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12246 when creating daemon; the previous buffer-overflow check was incorrect.
12247
12248 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12249 which has the guts of the old verror function.
12250
12251 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12252 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12253
12254 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12255 (font_unparse_xlfd): Don't blindly alloca long strings.
12256 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12257 fits in int, when using sprintf. Use single snprintf to count
12258 length of string rather than counting it via multiple sprintfs;
12259 that's simpler and more reliable.
12260 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12261 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12262 sprintf, in case result does not fit in int.
12263
12264 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12265 (fontset_from_font): Print it.
12266
12267 * frame.c (tty_frame_count): Now printmax_t, not int.
12268 (make_terminal_frame, set_term_frame_name): Print it.
12269 (x_report_frame_params): In X, window IDs are unsigned long,
12270 not signed long, so print them as unsigned.
12271 (validate_x_resource_name): Check for implausibly long names,
12272 and don't assume name length fits in 'int'.
12273 (x_get_resource_string): Don't blindly alloca invocation name;
12274 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12275 not fit in int.
12276
12277 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12278 (xg_check_special_colors, xg_set_geometry):
12279 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12280
12281 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12282 Use esprintf, not sprintf, in case result does not fit in int.
12283
12284 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12285 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12286 it as a large positive number.
12287 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12288 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12289
12290 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12291 in case result does not fit in int.
12292
12293 * print.c (float_to_string): Detect width overflow more reliably.
12294 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12295 buffer overrun. Don't assume list length fits in 'int'. Treat
12296 print length of 0 as 0, not as infinity; to be consistent with other
12297 uses of print length in this function. Don't overflow print length
12298 index. Don't assume hash table size fits in 'long', or that
12299 vectorlike size fits in 'unsigned long'.
12300
12301 * process.c (make_process): Use printmax_t, not int, to format
12302 process-name gensyms.
12303
12304 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12305
12306 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12307 to avoid potential buffer overrun.
12308
12309 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12310 if X resource line is longer than 512 bytes.
12311
12312 * xfns.c (x_window): Make sprintf buffer a bit bigger
12313 to avoid potential buffer overrun.
12314
12315 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12316
12317 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12318
12319 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12320
12321 Integer overflow fixes for scrolling, etc.
12322 Without these, Emacs silently mishandles large integers sometimes.
12323 For example, "C-u 4294967297 M-x recenter" was treated as if
12324 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12325
12326 * xdisp.c (try_window_id): Check Emacs fixnum range before
12327 converting to 'int'.
12328
12329 * window.c (window_scroll_line_based, Frecenter):
12330 Check that an Emacs fixnum is in range before assigning it to 'int'.
12331 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12332 values converted from Emacs fixnums.
12333 (Frecenter): Don't wrap around a line count if it is out of 'int'
12334 range; instead, treat it as an extreme value.
12335 (Fset_window_configuration, compare_window_configurations):
12336 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12337
12338 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12339 that can exceed INT_MAX. Check that EMACS_INT value is in range
12340 before assigning it to the (possibly-narrower) index.
12341 (match_limit): Don't assume that a fixnum can fit in 'int'.
12342
12343 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12344 exceed INT_MAX.
12345
12346 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12347 (Fvertical_motion): Don't wrap around LINES values that don't fit
12348 in 'int'. Instead, treat them as extreme values. This is good
12349 enough for windows, which can't have more than INT_MAX lines anyway.
12350
12351 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12352
12353 * Require libxml/parser.h to avoid compilation warning.
12354
12355 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12356
12357 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12358 since this reportedly can destroy thread storage.
12359
12360 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12361
12362 * syntax.c (find_defun_start): Update all cache variables if
12363 exiting early (Bug#9401).
12364
12365 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12366
12367 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12368
12369 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12370 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12371 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12372
12373 * term.c (tty_append_glyph): New function.
12374 (produce_stretch_glyph): Static function and its prototype deleted.
12375
12376 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12377 Add prototypes.
12378
12379 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12380
12381 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12382 when checking :margin (Bug#9390).
12383 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12384 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12385 so that the name doesn't mislead. All uses changed.
12386
12387 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12388
12389 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12390 set_tty_hooks.
12391
12392 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12393
12394 * xdisp.c (move_it_to): Don't bail out early when reaching
12395 position beyond to_charpos, if we are scanning backwards.
12396 (move_it_vertically_backward): When DY == 0, make sure we get to
12397 the first character in the line after the newline.
12398
12399 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12400
12401 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12402 (ccl_driver): Do not generate an out-of-range pointer.
12403 (Fccl_execute_on_string): Remove unnecessary check for
12404 integer overflow, noted by Stefan Monnier in
12405 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12406 Remove a FIXME that didn't need fixing.
12407 Simplify the newly-introduced buffer reallocation code.
12408
12409 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12410
12411 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12412
12413 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12414
12415 Integer and memory overflow issues (Bug#9196).
12416
12417 * doc.c (get_doc_string): Rework so that
12418 get_doc_string_buffer_size is the actual buffer size, rather than
12419 being 1 less than the actual buffer size; this makes xpalloc more
12420 convenient.
12421
12422 * image.c (x_allocate_bitmap_record, cache_image):
12423 * xselect.c (Fx_register_dnd_atom):
12424 Simplify previous changes by using xpalloc.
12425
12426 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12427 since either will do and ptrdiff_t is convenient with xpalloc.
12428
12429 * charset.c (charset_table_size)
12430 (struct charset_sort_data.priority): Now ptrdiff_t.
12431 (charset_compare): Don't overflow if priorities differ greatly.
12432 (Fsort_charsets): Don't assume list length fits in int.
12433 Check for size-calculation overflow when allocating sort data.
12434 (syms_of_charset): Allocate an initial charset table that is
12435 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12436
12437 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12438
12439 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12440 The actual value is always <= INT_MAX, and leaving it unsigned made
12441 overflow checking harder.
12442
12443 * dispextern.h (struct glyph_matrix.rows_allocated)
12444 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12445 with xpalloc. The values are still always <= INT_MAX.
12446
12447 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12448
12449 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12450 (SAFE_NALLOCA): New macro.
12451
12452 * region-cache.c (struct boundary.pos, find_cache_boundary)
12453 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12454 (set_cache_region, invalidate_region_cache)
12455 (revalidate_region_cache, know_region_cache, region_cache_forward)
12456 (region_cache_backward, pp_cache):
12457 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12458 so that ptrdiff_t * can be passed to xpalloc.
12459 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12460 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12461 (pp_cache): Don't assume cache_len fits in int.
12462 * region-cache.h: Adjust extern decls to match.
12463
12464 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12465 EMACS_INT, since either will do, for xpalloc.
12466
12467 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12468 (xnmalloc, xnrealloc, xpalloc): New functions.
12469
12470 * bidi.c (bidi_shelve_header_size): New constant.
12471 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12472 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12473
12474 * bidi.c (bidi_cache_shrink):
12475 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12476 (overlay_strings):
12477 Don't update size of array until after memory allocation succeeds,
12478 because xmalloc/xrealloc may not return.
12479 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12480 now that we have proper integer overflow checking.
12481 (record_overlay_string, overlay_strings): Catch overflows when
12482 calculating size of overlay_str_buf.
12483
12484 * callproc.c (Fcall_process): Check for size overflow when
12485 calculating size of args2.
12486 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12487 Normally we prefer signed values, but sticking with ptrdiff_t would
12488 require adding more-complicated checks.
12489
12490 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12491 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12492 Redo buffer-overflow calculations to avoid integer overflow.
12493 Add a FIXME comment where memory seems to be over-allocated.
12494
12495 * character.c (Fstring): Check for size-calculation overflow.
12496
12497 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12498 unnecessary integer overflow. Check for size overflow.
12499 (encode_coding_object): Don't update size until xmalloc succeeds.
12500
12501 * composite.c (get_composition_id): Check for overflow in glyph
12502 length calculations.
12503
12504 Integer and memory overflow fixes for display code.
12505 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12506 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12507 (scrolling_window): Check for overflow in size calculations.
12508 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12509 Don't assume glyph table len fits in int.
12510 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12511 (row_table_size): Now ptrdiff_t, not int.
12512 (scrolling_window): Avoid overflow in size calculations.
12513 Don't update size until allocation succeeds.
12514 * fns.c (concat): Check for overflow in size calculations.
12515 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12516 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12517 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12518
12519 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12520 (get_doc_string): Check for size calculation overflow.
12521 Don't update size until allocation succeeds.
12522 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12523 EMACS_INT, where ptrdiff_t will do.
12524 (Fsubstitute_command_keys): Check for string overflow.
12525
12526 * editfns.c (set_time_zone_rule): Don't assume environment length
12527 fits in int.
12528 (message_length): Now ptrdiff_t, not int.
12529 (Fmessage_box): Don't update size until allocation succeeds.
12530 Don't assume message length fits in int.
12531 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12532
12533 * emacs.c (main): Do not reallocate argv, since there is a null at
12534 the end that can be overwritten, and this way there's no need to
12535 worry about size-calculation overflow.
12536 (sort_args): Check for size-calculation overflow.
12537
12538 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12539 alloc succeeds.
12540 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12541
12542 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12543 (x_set_scroll_bar_width, x_figure_window_size):
12544 Check for integer overflow.
12545 (x_set_alpha): Do not assume XINT fits in int.
12546
12547 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12548 This is for the members text_lines, text_cols, total_lines, total_cols,
12549 where the system imposes an 'int' limit.
12550
12551 * fringe.c (Fdefine_fringe_bitmap):
12552 Don't update size until alloc works.
12553
12554 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12555 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12556
12557 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12558 Check for size-calculation overflow.
12559 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12560 do, as we prefer signed integers.
12561 (id_to_widget.max_size, id_to_widget.used)
12562 (xg_store_widget_in_map, xg_remove_widget_from_map)
12563 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12564 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12565 Use and return ptrdiff_t, not int.
12566 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12567 * gtkutil.h: Change prototypes to match the above.
12568
12569 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12570 are duplicate now that they've been promoted to lisp.h.
12571 (x_allocate_bitmap_record, x_alloc_image_color)
12572 (make_image_cache, cache_image, xpm_load):
12573 Don't update size until alloc is done.
12574 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12575 (x_detect_edges):
12576 Check for size calculation overflow.
12577 (ct_colors_allocated_max): New constant.
12578 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12579 overflow.
12580
12581 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12582 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12583 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12584 Use ptrdiff_t, not int, to count maps.
12585 (read_char_minibuf_menu_prompt): Check for overflow in size
12586 calculations. Don't update size until allocation succeeds.
12587 Redo calculations to avoid overflow.
12588 * keyboard.h: Change prototypes to match the above.
12589
12590 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12591 to count maps.
12592 (current_minor_maps): Check for size calculation overflow.
12593 * keymap.h: Change prototypes to match the above.
12594
12595 * lread.c (read1, init_obarray): Don't update size until alloc done.
12596
12597 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12598 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12599
12600 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12601 Now ptrdiff_t, not int.
12602 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12603 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12604
12605 * process.c (Fnetwork_interface_list): Check for overflow
12606 in size calculation.
12607
12608 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12609
12610 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12611 overflow. Don't bother calling xmalloc when xrealloc will do.
12612
12613 * search.c (Freplace_match): Check for size calculation overflow.
12614 (Fset_match_data): Don't assume list lengths fit in 'int'.
12615
12616 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12617 for command line length. Do not attempt to address one before the
12618 beginning of an array, as that's not portable.
12619
12620 * term.c (max_frame_lines): Remove; unused.
12621 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12622 not int.
12623 (encode_terminal_code, calculate_costs): Check for size
12624 calculation overflow.
12625 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12626 table lengths and related sizes. Don't update size until alloc
12627 done. Redo calculations to avoid overflow.
12628 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12629
12630 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12631 subtracting pointers.
12632 (gobble_line): Check for overflow more carefully. Don't update size
12633 until alloc done.
12634
12635 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12636 Don't update size until alloc done.
12637 Redo size calculations to avoid overflow.
12638 Check for size calculation overflow.
12639 (main) [DEBUG]: Fix typo in invoking tparam1.
12640
12641 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12642 Use ptrdiff_t, not int, for sizes.
12643 (store_mode_line_noprop_char): Don't update size until alloc done.
12644
12645 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12646 Use ptrdiff_t, not int, for sizes.
12647 (Finternal_make_lisp_face, cache_face):
12648 Check for size calculation overflow.
12649 (cache_face): Treat size calculation overflows as if they were
12650 memory exhaustion (the usual treatment), rather than aborting.
12651
12652 * xfns.c (x_encode_text, x_set_name_internal)
12653 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12654 sizes, since they can exceed INT_MAX in size. Check for size
12655 calculation overflow.
12656
12657 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12658 (xg_select): Check for size calculation overflow.
12659 Don't update size until alloc done.
12660
12661 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12662 as sprintf is limited to int lengths.
12663
12664 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12665 (X_LONG_MIN): New macros.
12666 Use them to make the following changes clearer.
12667 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12668 This change doesn't affect the value now, but it may help remind
12669 future maintainers not to raise the value too much later.
12670 (SELECTION_QUANTUM): Remove, replacing with ...
12671 (selection_quantum): ... new function, which avoids overflow.
12672 All uses changed.
12673 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12674 assumption that selection length fits in 'int'.
12675 (x_reply_selection_request, x_handle_selection_request)
12676 (x_get_window_property, receive_incremental_selection)
12677 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12678 (lisp_data_to_selection_data, clean_local_selection_data):
12679 Use ptrdiff_t, not int, to record length of selection.
12680 (x_reply_selection_request, x_get_window_property)
12681 (receive_incremental_selection, x_property_data_to_lisp):
12682 Redo calculations to avoid overflow.
12683 (x_reply_selection_request): When sending hint, ceiling it at
12684 X_LONG_MAX rather than relying on wraparound overflow to send
12685 something.
12686 (x_get_window_property, receive_incremental_selection)
12687 (lisp_data_to_selection_data, x_property_data_to_lisp):
12688 Check for size-calculation overflow.
12689 (x_get_window_property, receive_incremental_selection)
12690 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12691 Don't store size until memory allocation succeeds.
12692 (x_get_window_property): Plug memory leak on memory exhaustion.
12693 Don't double-block input; malloc is safe here. Don't assume 2**34
12694 - 4 fits in unsigned long. Add an xassert to check
12695 XGetWindowProperty overflow. Be more careful about overflow
12696 calculations, and distinguish size from memory overflow better.
12697 (receive_incremental_selection): When tracing, don't assume
12698 unsigned int is less than INT_MAX.
12699 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12700 harmful) conversions of unsigned short to int.
12701 (lisp_data_to_selection_data): Don't assume that integers
12702 in the range -65535 through -1 fit in an X unsigned short.
12703 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12704 result parameters unless successful. Rely on cons_to_unsigned
12705 to report problems with elements; the old code wasn't right anyway.
12706 (x_check_property_data): Check for int overflow; we cannot use
12707 a wider type due to X limits.
12708 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12709
12710 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12711
12712 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12713 (x_term_init): Check for size calculation overflow.
12714 (x_color_cells): Don't store size until memory allocation succeeds.
12715 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12716 Don't assume alloca size is less than MAX_ALLOCA.
12717 (x_term_init): Don't assume length fits in int (sprintf is limited
12718 to int size).
12719
12720 Use ptrdiff_t for composition IDs.
12721 * character.c (lisp_string_width):
12722 * composite.c (composition_table_size, n_compositions)
12723 (get_composition_id, composition_gstring_from_id):
12724 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12725 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12726 * window.c (Frecenter):
12727 Use ptrdiff_t, not int, for composition IDs.
12728 * composite.c (get_composition_id): Check for integer overflow.
12729 * composite.h: Adjust prototypes to match the above changes.
12730
12731 Use ptrdiff_t for hash table indexes.
12732 * category.c (hash_get_category_set):
12733 * ccl.c (ccl_driver):
12734 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12735 * coding.c (coding_system_charset_list, detect_coding_system):
12736 * coding.h (struct coding_system.id):
12737 * composite.c (get_composition_id, gstring_lookup_cache):
12738 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12739 * image.c (xpm_get_color_table_h):
12740 * lisp.h (hash_lookup, hash_put):
12741 * minibuf.c (Ftest_completion):
12742 Use ptrdiff_t for hash table indexes, not int (which is too
12743 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12744 32-bit --with-wide-int hosts).
12745
12746 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12747 Add a FIXME comment about memory leaks.
12748 (syms_of_charset): Don't assume xmalloc returns.
12749
12750 Don't assume that stated character widths fit in int.
12751 * character.c (Fchar_width, c_string_width, lisp_string_width):
12752 * character.h (CHAR_WIDTH):
12753 * indent.c (MULTIBYTE_BYTES_WIDTH):
12754 Use sanitize_char_width to avoid undefined and/or bad behavior
12755 with outlandish widths.
12756 * character.h (sanitize_tab_width): Rename from sanitize_width,
12757 now that we have two such functions. All uses changed.
12758 (sanitize_char_width): New inline function.
12759
12760 Don't assume that tab-width fits in int.
12761 * character.h (sanitize_width): New inline function.
12762 (SANE_TAB_WIDTH): New macro.
12763 (ASCII_CHAR_WIDTH): Use it.
12764 * indent.c (sane_tab_width): Remove. All uses replaced by
12765 SANE_TAB_WIDTH (current_buffer).
12766 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12767
12768 * fileio.c: Integer overflow issues with file modes.
12769 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12770
12771 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12772 Remove unreachable code.
12773 (read_hex, load_charset_map_from_file): Check for integer overflow.
12774
12775 * xterm.c: Don't go over XClientMessageEvent limit.
12776 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12777 (x_send_scroll_bar_event): Likewise. Check that the size does not
12778 exceed limits imposed by XClientMessageEvent, as well as the usual
12779 ptrdiff_t and size_t limits.
12780
12781 * keyboard.c: Overflow, signedness and related fixes.
12782 (make_lispy_movement): Use same integer type in forward decl
12783 that is used in the definition.
12784 (read_key_sequence, keyremap_step):
12785 Change bufsize argument back to int, undoing my 2011-03-30 change.
12786 We prefer signed types, and int is wide enough here.
12787 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12788 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12789 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12790 length, not size_t. Use ptrdiff_t for index, not int.
12791 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12792 possibility of integer overflow.
12793
12794 Overflow, signedness and related fixes for images.
12795
12796 * dispextern.h (struct it.stack[0].u.image.image_id)
12797 (struct_it.image_id, struct image.id, struct image_cache.size)
12798 (struct image_cache.used, struct image_cache.ref_count):
12799 * gtkutil.c (update_frame_tool_bar):
12800 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12801 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12802 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12803 * nsmenu.m (update_frame_tool_bar):
12804 * xdisp.c (calc_pixel_width_or_height):
12805 * xfns.c (image_cache_refcount):
12806 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12807 on typical 64-bit hosts.
12808
12809 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12810 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12811 Omit unnecessary casts to int.
12812 (parse_image_spec): Check that integers fall into 'int' range
12813 when the callers expect that.
12814 (image_ascent): Redo ascent calculation to avoid int overflow.
12815 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12816 (lookup_image): Remove unnecessary tests.
12817 (xbm_image_p): Locals are now of int, not EMACS_INT,
12818 since parse_image_check makes sure they fit into int.
12819 (png_load, gif_load, svg_load_image):
12820 Prefer int to unsigned where either will do.
12821 (tiff_handler): New function, combining the cores of the
12822 old tiff_error_handler and tiff_warning_handler.
12823 This function is rewritten to use vsnprintf and thereby avoid
12824 stack buffer overflows. It uses only the features of vsnprintf
12825 that are common to both POSIX and native Microsoft.
12826 (tiff_error_handler, tiff_warning_handler): Use it.
12827 (tiff_load, gif_load, imagemagick_load_image):
12828 Don't assume :index value fits in 'int'.
12829 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12830 (imagemagick_load_image): Check that crop parameters fit into
12831 the integer types that MagickCropImage accepts. Don't assume
12832 Vimagemagick_render_type has a nonnegative value. Don't assume
12833 size_t fits in 'long'.
12834 (gs_load): Use printmax_t to print the widest integers possible.
12835 Check for integer overflow when computing image height and width.
12836
12837 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12838
12839 * xdisp.c (redisplay_window): Don't force window start if point
12840 will be invisible in the resulting window. (Bug#9324)
12841
12842 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12843
12844 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12845 the display spec is of the form `(space ...)'.
12846 (handle_display_spec): Return the value returned by
12847 handle_single_display_spec, not just 1 or zero.
12848 (handle_single_display_spec): If the display spec is of the form
12849 `(space ...)', and specifies display in the text area, return 2
12850 rather than 1.
12851 (try_cursor_movement): Check for the need to scroll more
12852 accurately, and prefer exact match for point under bidi.
12853 Don't advance `row' beyond the last row of the window.
12854
12855 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12856 into disp_prop; all users changed.
12857
12858 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12859 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12860 for the text covered by the display property.
12861
12862 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12863
12864 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12865 Change return value to nil.
12866 (Frecord_buffer): Delete unused function.
12867
12868 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12869
12870 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12871 buffers, return left-to-right.
12872 (set_cursor_from_row): Consider candidate row a win if its glyph
12873 represents a newline and point is on that newline. Fixes cursor
12874 positioning on the newline at EOL of R2L text within L2R
12875 paragraph, and vice versa.
12876 (try_cursor_movement): Check continued rows, in addition to
12877 continuation rows. Fixes unwarranted scroll when point enters a
12878 continued line of R2L text within an L2R paragraph, or vice versa.
12879 (cursor_row_p): Consider the case of point being equal to
12880 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12881 from the end of a short line to the beginning of a continued line
12882 of R2L text within L2R paragraph.
12883 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12884 composed characters.
12885
12886 * bidi.c (bidi_check_type): Use xassert.
12887 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12888 members.
12889
12890 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12891
12892 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12893 a character.
12894
12895 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12896
12897 * nsfont.m (ns_otf_to_script): Fix typo.
12898
12899 2011-08-22 Kenichi Handa <handa@m17n.org>
12900
12901 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12902 extra slot even if the purpose is char-code-property-table.
12903
12904 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12905
12906 * xdisp.c (redisplay_window): When computing centering_position,
12907 account for the height of the header line. (Bug#8874)
12908
12909 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12910 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12911 candidate is selected by the mouse, and that candidate has a
12912 composed character under the mouse.
12913
12914 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12915 coordinates reported by pos-visible-in-window-p for a composed
12916 character in column zero.
12917
12918 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12919
12920 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12921
12922 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12923
12924 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12925 consider it a hit if to_charpos is anywhere in the range of the
12926 composed buffer positions.
12927
12928 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12929
12930 * image.c (gif_load): Don't assume that each subimage has the same
12931 dimensions as the base image. Handle disposal method that is
12932 "undefined" by the gif spec (Bug#9335).
12933
12934 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12935
12936 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12937 (Fcondition_case): Document `debug' symbol in error handler.
12938
12939 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12940
12941 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12942 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12943 from an Org mode buffer to a Speedbar frame.
12944
12945 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12946 a composition, take its buffer position from IT->cmp_it.charpos.
12947 Fixes cursor positioning at the beginning of a line that begins
12948 with a composed character.
12949
12950 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12951
12952 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12953 character bidirectional type, use STRONG_L instead. Fixes crashes
12954 in a buffer produced by `describe-categories'.
12955
12956 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12957 members before the level stack, so they would be saved and
12958 restored when copying iterator state. Fixes incorrect reordering
12959 around TABs covered by display properties.
12960
12961 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12962
12963 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12964
12965 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12966
12967 * eval.c (internal_condition_case, internal_condition_case_1)
12968 (internal_condition_case_2, internal_condition_case_n):
12969 Remove unnecessary aborts (Bug#9081).
12970
12971 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12972
12973 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12974 has no `load' handler, try opening the file locally. (Bug#9311)
12975
12976 2011-08-16 Ken Brown <kbrown@cornell.edu>
12977
12978 * gmalloc.c: Expand comment.
12979
12980 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12981
12982 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12983 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12984
12985 2011-08-16 Ken Brown <kbrown@cornell.edu>
12986
12987 Fix memory allocation problems in Cygwin build (Bug#9273).
12988
12989 * unexcw.c ( __malloc_initialized): Declare external variable.
12990 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12991
12992 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12993 New variables.
12994 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12995 dumped emacs.
12996 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12997 in the static heap.
12998 [CYGWIN] (special_realloc): New function.
12999 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13000 requests to realloc storage in the static heap.
13001
13002 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13003
13004 * bidi.c (bidi_initialize): Remove unused local.
13005
13006 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13007
13008 * bidimirror.h:
13009 * biditype.h: Remove file.
13010 * makefile.w32-in ($(BLD)/bidi.$(O)):
13011 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13012
13013 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13014
13015 * chartab.c: Improve commentary for the uniprop_table API.
13016
13017 * bidi.c (bidi_paragraph_init): Support zero value of
13018 bidi_ignore_explicit_marks_for_paragraph_level.
13019 (bidi_initialize): Use uniprop_table instead of including
13020 biditype.h and bidimirror.h.
13021
13022 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13023 coordinates of the iterator when restoring from ppos_it.
13024 (Bug#9296)
13025
13026 2011-08-14 Kenichi Handa <handa@m17n.org>
13027
13028 * process.c (create_process): Call setup_process_coding_systems
13029 after the pid of the process is set to -1 (Bug#8162).
13030
13031 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13032
13033 * xdisp.c (move_it_in_display_line_to): Don't invoke
13034 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13035 ppos_it. Fixes vertical cursor motion when line beginning is
13036 covered by an image. (Bug#9296)
13037
13038 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13039
13040 * nsterm.h (ns_run_ascript): Declare.
13041 (NSAPP_DATA2_RUNASSCRIPT): Define.
13042
13043 * nsfns.m (as_script, as_result, as_status): New static variables.
13044 (ns_run_ascript): New function.
13045 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13046 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13047 the event loop. Get status from as_status (Bug#7276).
13048
13049 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13050 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13051 the event loop (Bug#7276).
13052
13053 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13054
13055 * gnutls.c (QCgnutls_bootprop_priority)
13056 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13057 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13058 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13059 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13060 (QCgnutls_bootprop_verify_hostname_error)
13061 (QCgnutls_bootprop_callbacks_verify): Rename from
13062 Qgnutls_bootprop_..., all uses changed.
13063
13064 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13065 uses changed.
13066
13067 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13068
13069 * xfaces.c (Qframe_set_background_mode): Now static.
13070 * dispextern.h (Qframe_set_background_mode): Remove decl.
13071
13072 * process.c (Fnetwork_interface_info): Declare local only if needed.
13073
13074 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13075
13076 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13077 (Fnetwork_interface_list): Allocate in increments of bytes instead
13078 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13079 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13080 sockaddr.
13081 (struct ifflag_def): notrailers is smart on OSX.
13082 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13083 Get hardware address with getifaddrs if available.
13084
13085 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13086
13087 * xdisp.c (iterate_out_of_display_property): xassert that
13088 IT->position is set to within IT->object's boundaries. Break from
13089 the loop as soon as EOB is reached; avoids infloops in redisplay
13090 when IT->position is set up wrongly due to some bug.
13091 Set IT->current to match the bidi iterator unconditionally.
13092 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13093 entry. Force push_it to save on the stack the current
13094 buffer/string position, to be restored by pop_it. Fix flags in
13095 the iterator structure wrt the object coming from a display
13096 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13097 properties. (Bug#9284)
13098
13099 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13100
13101 * fontset.c (fontset_get_font_group): Add proper type checks.
13102 (Bug#9172)
13103
13104 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13105
13106 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13107 and LC_VERSION_MIN_MACOSX.
13108 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13109 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13110
13111 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13112
13113 * xdisp.c (forward_to_next_line_start): Allow to use the
13114 no-display-properties-and-no-overlays under bidi display.
13115 Set disp_pos in the bidi iterator to avoid searches for display
13116 properties and overlays.
13117
13118 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13119
13120 * editfns.c (Fset_time_zone_rule): Document relationship with the
13121 setenv function.
13122
13123 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13124 the font entity extracted from the cache (Bug#8109).
13125
13126 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13127
13128 * composite.c (autocmp_chars): Don't reset point. That is done by
13129 restore_point_unwind (Bug#5984).
13130
13131 2011-08-07 Juri Linkov <juri@jurta.org>
13132
13133 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13134 to show the arg `TIME' instead of `TIMEVAL'.
13135
13136 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13137
13138 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13139 display property strides EOL and includes a newline, as in
13140 longlines-mode. (Bug#9254)
13141 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13142 word-wrap under bidirectional display. (Bug#9224)
13143
13144 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13145 is non-zero, even if the data buffer is NULL. Fixes a crash in
13146 vertical-motion with longlines-mode. (Bug#9254)
13147
13148 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13149
13150 * bidi.c <bidi_cache_total_alloc>: Now static.
13151 (bidi_initialize): Initialize bidi_cache_total_alloc.
13152
13153 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13154 cache. (Bug#9221)
13155
13156 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13157 amount allocated this far in `bidi_cache_total_alloc'.
13158 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13159 non-zero, only free the data buffer without restoring the cache
13160 contents. All callers changed.
13161
13162 * dispextern.h (bidi_unshelve_cache): Update prototype.
13163
13164 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13165 (move_it_in_display_line, move_it_to)
13166 (move_it_vertically_backward, move_it_by_lines): Replace the call
13167 to xfree to an equivalent call to bidi_unshelve_cache.
13168 (move_it_in_display_line_to): Fix logic of returning
13169 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13170
13171 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13172
13173 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13174 came from a string character with a `cursor' property. (Bug#9229)
13175
13176 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13177
13178 * Makefile.in (LIB_PTHREAD): New variable.
13179 (LIBES): Add LIB_PTHREAD (Bug#9216).
13180
13181 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13182 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13183
13184 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13185
13186 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13187
13188 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13189
13190 * xterm.c (x_find_topmost_parent): New function.
13191 (x_set_frame_alpha): Find topmost parent window with
13192 x_find_topmost_parent and set the property there also (bug#9181).
13193 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13194
13195 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13196
13197 * callproc.c (Fcall_process): Avoid vfork clobbering
13198 the local vars buffer, coding_systems, current_dir.
13199
13200 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13201
13202 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13203
13204 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13205
13206 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13207 so that it is not optimized away.
13208
13209 * xdisp.c (compute_display_string_pos): Remove unused local.
13210
13211 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13212
13213 Fix slow cursor motion and scrolling in large buffers with
13214 selective display, like Org Mode buffers. (Bug#9218)
13215
13216 * dispextern.h (struct bidi_it): New member disp_prop_p.
13217
13218 * xdisp.c: Remove one-slot cache of display string positions.
13219 (compute_display_string_pos): Accept an additional argument
13220 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13221 for a display string or property. If found, set DISP_PROP_P
13222 non-zero.
13223
13224 * bidi.c (bidi_fetch_char): Accept an additional argument
13225 DISP_PROP_P, and pass it to compute_display_string_pos.
13226 Only handle text covered by a display string if DISP_PROP_P is returned
13227 non-zero. All callers of bidi_fetch_char changed.
13228
13229 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13230
13231 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13232
13233 2010-12-03 Don March <don@ohspite.net>
13234
13235 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13236 last character M-[char] is translated to ESC [char] (bug#7541).
13237
13238 2011-08-02 Kenichi Handa <handa@m17n.org>
13239
13240 * lisp.h (uniprop_table): Extern it.
13241
13242 * chartab.c (uniprop_table): Make it non-static.
13243
13244 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13245
13246 * xdisp.c (forward_to_next_line_start): Accept additional argument
13247 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13248 on the newline.
13249 (reseat_at_next_visible_line_start): Use the bidi iterator state
13250 returned by forward_to_next_line_start to restore the state of
13251 it->bidi_it after backing up to previous newline. (Bug#9212)
13252
13253 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13254
13255 * regex.c (re_comp): Protoize.
13256 (re_exec): Fix return type.
13257 (regexec): Fix type of `ret'. (Bug#9203)
13258
13259 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13260
13261 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13262 This is needed if max-image-size is a floating-point number.
13263
13264 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13265
13266 * print.c (print_object): Print empty symbol as ##.
13267
13268 * lread.c (read1): Read ## as empty symbol.
13269
13270 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13271
13272 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13273 setting frame foreground color (Bug#9175).
13274 (x_set_background_color): Likewise.
13275
13276 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13277 contents (Bug#9176).
13278 (EmacsTooltip -init): Remove bezels and add shadows to
13279 tooltip windows.
13280
13281 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13282 or scroll bar (Bug#8470).
13283
13284 * nsfont.m (nsfont_open): Remove assignment to voffset and
13285 unnecessary vars hshink, expand, hd, full_height, min_height.
13286 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13287
13288 * nsterm.h (nsfont_info): Remove voffset field.
13289
13290 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13291
13292 Implement strike-through and overline on NextStep (Bug#8863).
13293
13294 * nsfont.m (nsfont_open): Use underline position provided by font,
13295 instead of hard-coded value of 2.
13296 (nsfont_draw): Call ns_draw_text_decoration instead.
13297
13298 * nsterm.h: Add declaration for ns_draw_text_decoration.
13299
13300 * nsterm.m (ns_draw_text_decoration): New function for drawing
13301 underline, overline, and strike-through.
13302 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13303 ns_draw_text_decoration. Change treatment of cursor drawing to
13304 accommodate underlining, etc.
13305
13306 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13307
13308 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13309 default.
13310
13311 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13312
13313 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13314 Without this fix, if a signal arrives just after memory fills up,
13315 'malloc' might be invoked reentrantly.
13316
13317 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13318 In other words, assume that every image size is allowed, on non-X
13319 hosts. This assumption is probably wrong, but it lets Emacs compile.
13320
13321 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13322
13323 * regex.c (re_iswctype): Convert return values to boolean.
13324
13325 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13326
13327 * xdisp.c (compute_display_string_pos): Don't use cached display
13328 string position if the buffer had its restriction changed.
13329 (Bug#9184)
13330
13331 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13332
13333 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13334
13335 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13336
13337 Integer signedness and overflow and related fixes. (Bug#9079)
13338
13339 * bidi.c: Integer size and overflow fixes.
13340 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13341 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13342 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13343 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13344 (bidi_find_other_level_edge):
13345 Use ptrdiff_t instead of EMACS_INT where either will do.
13346 This works better on 32-bit hosts configured --with-wide-int.
13347 (bidi_cache_ensure_space): Check for size-calculation overflow.
13348 Use % rather than repeated addition, for better worst-case speed.
13349 Don't set bidi_cache_size until after xrealloc returns, because it
13350 might not return.
13351 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13352 (bidi_cache_ensure_space): Also check that the bidi cache size
13353 does not exceed that of the largest Lisp string or buffer. See Eli
13354 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13355
13356 * alloc.c (__malloc_size_t): Remove.
13357 All uses replaced by size_t. See Andreas Schwab's note
13358 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13359
13360 * image.c: Improve checking for integer overflow.
13361 (check_image_size): Assume that f is nonnull, since
13362 it is always nonnull in practice. This is one less thing to
13363 worry about when checking for integer overflow later.
13364 (x_check_image_size): New function, which checks for integer
13365 overflow issues inside X.
13366 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13367 This removes the need for a memory_full check.
13368 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13369 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13370 (xbm_read_bitmap_data): Change locals back to 'int', since
13371 their values must fit in 'int'.
13372 (xpm_load_image, png_load, tiff_load):
13373 Invoke x_create_x_image_and_pixmap earlier,
13374 to avoid much needless work if the image is too large.
13375 (tiff_load): Treat overly large images as if
13376 x_create_x_image_and_pixmap failed, not as malloc failures.
13377 (gs_load): Use x_check_image_size.
13378
13379 * gtkutil.c: Omit integer casts.
13380 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13381 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13382
13383 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13384
13385 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13386 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13387 would wrongly return t on a 64-bit host.
13388
13389 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13390 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13391 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13392 and therefore cause GCC to emit a bogus diagnostic in some cases.
13393
13394 * image.c: Integer signedness and overflow and related fixes.
13395 This is not an exhaustive set of fixes, but it's time to
13396 record what I've got.
13397 (lookup_pixel_color, check_image_size): Remove redundant decls.
13398 (check_image_size): Don't assume that arbitrary EMACS_INT values
13399 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13400 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13401 (tiff_load, imagemagick_load_image):
13402 Check for overflow in size calculations.
13403 (x_create_x_image_and_pixmap): Remove unnecessary test for
13404 xmalloc returning NULL; that can't happen.
13405 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13406 (xpm_color_bucket): Use better integer hashing function.
13407 (xpm_cache_color): Don't possibly over-allocate memory.
13408 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13409 (gif_memory_source):
13410 Use ptrdiff_t, not int or size_t, to record sizes.
13411 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13412 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13413 either works, as we prefer signed integers.
13414 (tiff_read_from_memory, tiff_write_from_memory):
13415 Return tsize_t, not size_t, since that's what the TIFF API wants.
13416 (tiff_read_from_memory): Don't fail simply because the read would
13417 go past EOF; instead, return a short read.
13418 (tiff_load): Omit no-longer-needed casts.
13419 (Fimagemagick_types): Don't assume size fits into 'int'.
13420
13421 Improve hashing quality when configured --with-wide-int.
13422 * fns.c (hash_string): New function, taken from sxhash_string.
13423 Do not discard information about ASCII character case; this
13424 discarding is no longer needed.
13425 (sxhash-string): Use it. Change sig to match it. Caller changed.
13426 * lisp.h: Declare it.
13427 * lread.c (hash_string): Remove, since we now use fns.c's version.
13428 The fns.c version returns a wider integer if --with-wide-int is
13429 specified, so this should help the quality of the hashing a bit.
13430
13431 * emacs.c: Integer overflow minor fix.
13432 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13433 Define only if GNU_LINUX.
13434 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13435
13436 * dispnew.c: Integer signedness and overflow fixes.
13437 Remove unnecessary forward decls, that were a maintenance hassle.
13438 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13439 All uses changed.
13440 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13441 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13442 (prepare_desired_row, line_draw_cost):
13443 Use int, not unsigned, where either works.
13444 (save_current_matrix, restore_current_matrix):
13445 Use ptrdiff_t, not size_t, where either works.
13446 (init_display): Check for overflow more accurately, and without
13447 relying on undefined behavior.
13448
13449 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13450 Remove, replacing with the new symbols in lisp.h. All uses changed.
13451 * fileio.c (make_temp_name):
13452 * filelock.c (lock_file_1, lock_file):
13453 * xdisp.c (message_dolog):
13454 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13455 Use pMd etc. instead.
13456 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13457 replacing the pWIDE etc. symbols removed from editfns.c.
13458
13459 * keyboard.h (num_input_events): Now uintmax_t.
13460 This is (very slightly) less likely to mess up due to wraparound.
13461 All uses changed.
13462
13463 * buffer.c: Integer signedness fixes.
13464 (alloc_buffer_text, enlarge_buffer_text):
13465 Use ptrdiff_t rather than size_t when either will do, as we prefer
13466 signed integers.
13467
13468 * alloc.c: Integer signedness and overflow fixes.
13469 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13470 (__malloc_size_t): Default to size_t, not to int.
13471 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13472 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13473 Prefer ptrdiff_t to size_t when either would do, as we prefer
13474 signed integers.
13475 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13476 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13477 Now const. Initialize with values that are in range even if char
13478 is signed.
13479 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13480 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13481 These functions do the right thing with sizes > 2**32.
13482 (check_depth): Now ptrdiff_t, not int.
13483 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13484 Adjust to new way of storing sizes. Check for size overflow bugs
13485 in rest of code.
13486 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13487 slightly wrong anyway, as it missed one instance of
13488 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13489 (refill_memory_reserve): Omit needless cast to size_t.
13490 (mark_object_loop_halt): Mark as externally visible.
13491
13492 * xselect.c: Integer signedness and overflow fixes.
13493 (Fx_register_dnd_atom, x_handle_dnd_message):
13494 Use ptrdiff_t, not size_t, since we prefer signed.
13495 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13496 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13497 x_dnd_atoms_size and x_dnd_atoms_length.
13498
13499 * doprnt.c: Prefer signed to unsigned when either works.
13500 * eval.c (verror):
13501 * doprnt.c (doprnt):
13502 * lisp.h (doprnt):
13503 * xdisp.c (vmessage):
13504 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13505 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13506 prefer signed arithmetic to avoid comparison confusion.
13507 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13508 but is a bit tricky.
13509
13510 Assume freestanding C89 headers, string.h, stdlib.h.
13511 * data.c, doprnt.c, floatfns.c, print.c:
13512 Include float.h unconditionally.
13513 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13514 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13515 * regex.c: Likewise for stddef.h, string.h.
13516 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13517 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13518 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13519 (STDC_HEADERS): Remove obsolete defines.
13520 * sysdep.c: Include limits.h unconditionally.
13521
13522 Assume support for memcmp, memcpy, memmove, memset.
13523 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13524 * regex.c (memcmp, memcpy):
13525 Remove; we assume C89 now.
13526
13527 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13528 (__malloc_safe_bcopy): Remove; no longer needed.
13529
13530 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13531 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13532 well either way, and we prefer signed to unsigned.
13533
13534 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13535
13536 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13537 closes the connection while we're reading (bug#9182).
13538
13539 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13540
13541 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13542 are specified (Bug#9168).
13543
13544 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13545
13546 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13547 Found by GCC static checking and --with-wide-int on a 32-bit host.
13548
13549 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13550
13551 * xdisp.c (compute_display_string_pos): Fix logic of caching
13552 previous display string position. Initialize cached_prev_pos to
13553 -1. Fixes slow-down at the beginning of a buffer.
13554
13555 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13556
13557 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13558 for attrs[LFACE_FONTSET_INDEX].
13559
13560 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13561
13562 * xml.c (parse_region): Remove unused local
13563 that was recently introduced.
13564
13565 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13566
13567 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13568 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13569
13570 * xdisp.c (move_it_in_display_line_to): Record the best matching
13571 position for TO_CHARPOS while scanning the line, and restore it on
13572 exit if none of the characters scanned was an exact match.
13573 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13574 when exact match is impossible due to invisible text, and the
13575 lines are truncated.
13576
13577 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13578
13579 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13580 for OSX >= 10.7.
13581
13582 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13583
13584 Fix a significant slow-down of cursor motion with C-n, C-p,
13585 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13586 auto-repeat under bidi redisplay in fontified buffers.
13587 * xdisp.c (compute_stop_pos_backwards): New function.
13588 (next_element_from_buffer): Call compute_stop_pos_backwards to
13589 find a suitable prev_stop when we find ourselves before
13590 base_level_stop.
13591 (reseat): Don't look for prev_stop, as that could mean a very long
13592 run.
13593 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13594 <cached_disp_overlay_modiff>: Cache for last found display string
13595 position.
13596 (compute_display_string_pos): Return the cached position if asked
13597 about the same buffer in the same area of character positions, and
13598 the buffer wasn't changed since the time the display string
13599 position was cached.
13600
13601 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13602
13603 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13604 is an integer, which is important for empty lines. (Bug#9149)
13605
13606 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13607
13608 * frame.c (Fmodify_frame_parameters): In tty case, update the
13609 default face if necessary (Bug#4238).
13610
13611 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13612
13613 * editfns.c (Fstring_to_char): No need to explain what a character
13614 is in the docstring (Bug#6576).
13615
13616 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13617
13618 * xml.c (parse_region): Make sure we always return a tree.
13619
13620 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13621
13622 * xml.c (parse_region): If a document contains only comments,
13623 return that, too.
13624
13625 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13626
13627 * xml.c (make_dom): Return comments, too.
13628
13629 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13630
13631 Port to OpenBSD.
13632 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13633 and the surrounding thread.
13634 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13635 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13636 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13637 timer goes off.
13638 * s/openbsd.h (BROKEN_SIGIO): Define.
13639 * unexelf.c (unexec) [__OpenBSD__]:
13640 Don't update the .mdebug section of the Alpha COFF symbol table.
13641
13642 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13643
13644 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13645 (bug#8460).
13646
13647 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13648
13649 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13650 This fixes some race conditions on the permissions of any newly
13651 created file.
13652
13653 * alloc.c (valid_pointer_p): Use pipe, not open.
13654 This fixes some permissions issues when debugging.
13655
13656 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13657 If fchown fails to set both uid and gid, try to set just gid,
13658 as that is sometimes allowed. Adjust the file's mode to eliminate
13659 setuid or setgid bits that are inappropriate if fchown fails.
13660
13661 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13662
13663 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13664 to compare Lisp_Objects.
13665 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13666 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13667 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13668
13669 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13670
13671 * lread.c (read_integer): Unread even EOF character.
13672 (read1): Likewise. Properly record start position of symbol.
13673
13674 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13675 symbol character follows.
13676
13677 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13678
13679 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13680 This works around a problem with the previous change to Fcopy_file.
13681 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13682 and without this change, GCC might complain about discarding
13683 fchown's return value.
13684
13685 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13686
13687 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13688
13689 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13690
13691 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13692
13693 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13694
13695 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13696 it's used from the C level.
13697
13698 * process.c: Use the same condition for POLL_FOR_INPUT in both
13699 keyboard.c and process.c (bug#1858).
13700
13701 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13702
13703 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13704 (Fgnutls_boot): Use it.
13705
13706 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13707
13708 * doc.c (Fsubstitute_command_keys): Revert last change.
13709
13710 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13711
13712 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13713 quotes the next character, and doesn't affect other longer
13714 sequences (bug#8935).
13715
13716 * lread.c (syms_of_lread): Clarify that is isn't only
13717 `eval-buffer' and `eval-defun' that's affected by
13718 `lexical-binding' (bug#8460).
13719
13720 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13721
13722 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13723 bidi redisplay when a line includes both an image and is truncated.
13724
13725 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13726
13727 Fix minor problems found by static checking.
13728 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13729 (elsz): Now a signed constant, not a size_t var. We prefer signed
13730 types to unsigned, to avoid integer comparison confusion. Without
13731 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13732 "cannot optimize loop, the loop counter may overflow", a symptom
13733 of the confusion.
13734 * indent.c (Fvertical_motion): Mark locals as initialized.
13735 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13736
13737 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13738
13739 * search.c (Fre_search_backward): Mention `case-fold-search' in
13740 all the re_search_* functions (bug#8138).
13741
13742 * keyboard.c (Fopen_dribble_file): Document when the file is
13743 closed (bug#8056).
13744
13745 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13746
13747 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13748 bidi_cache_idx.
13749
13750 Support bidi reordering of display and overlay strings.
13751 * xdisp.c (compute_display_string_pos)
13752 (compute_display_string_end): Accept additional argument STRING.
13753 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13754 (reseat_to_string): Initialize bidi_it->string.s and
13755 bidi_it->string.schars.
13756 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13757 NULL (avoids a crash in bidi_paragraph_init).
13758 Initialize itb.string.lstring.
13759 (init_iterator): Call bidi_init_it only of a valid
13760 buffer position was specified. Initialize paragraph_embedding to
13761 L2R.
13762 (reseat_to_string): Initialize the bidi iterator.
13763 (display_string): If we need to ignore text properties of
13764 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13765 original value of -1 will not work with bidi.)
13766 (compute_display_string_pos): First arg is now struct
13767 `text_pos *'; all callers changed. Support display properties on
13768 Lisp strings.
13769 (compute_display_string_end): Support display properties on Lisp
13770 strings.
13771 (init_iterator, reseat_1, reseat_to_string): Initialize the
13772 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13773 when iterating on a string not from display properties).
13774 (compute_display_string_pos, compute_display_string_end):
13775 Fix calculation of the object to scan. Fixes an error when using
13776 arrow keys.
13777 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13778 base_level_stop; instead, set base_level_stop to BEGV.
13779 Fixes crashes in vertical-motion.
13780 (next_element_from_buffer): Improve commentary for when
13781 the iterator is before prev_stop.
13782 (init_iterator): Initialize bidi_p from the default value of
13783 bidi-display-reordering, not from buffer-local value. Use the
13784 buffer-local value only if initializing for buffer iteration.
13785 (handle_invisible_prop): Support invisible properties on strings
13786 that are being bidi-reordered.
13787 (set_iterator_to_next): Support bidi reordering of C strings and
13788 Lisp strings.
13789 (next_element_from_string): Support bidi reordering of Lisp
13790 strings.
13791 (handle_stop_backwards): Support Lisp strings as well.
13792 (display_string): Support display of R2L glyph rows.
13793 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13794 (init_iterator): Don't initialize it->bidi_p for strings
13795 here.
13796 (reseat_to_string): Initialize it->bidi_p for strings here.
13797 (next_element_from_string, next_element_from_c_string)
13798 (next_element_from_buffer): Add xassert's for correspondence
13799 between IT's object being iterated and it->bidi_it.string
13800 structure.
13801 (face_before_or_after_it_pos): Support bidi iteration.
13802 (next_element_from_c_string): Handle the case of the first string
13803 character that is not the first one in the visual order.
13804 (get_visually_first_element): New function, refactored from common
13805 parts of next_element_from_buffer, next_element_from_string, and
13806 next_element_from_c_string.
13807 (tool_bar_lines_needed, redisplay_tool_bar)
13808 (display_menu_bar): Force left-to-right direction. Add a FIXME
13809 comment for making that be controlled by a user option.
13810 (push_it, pop_it): Save and restore the state of the
13811 bidi iterator. Save and restore the bidi_p flag.
13812 (pop_it): Iterate out of display property for string iteration as
13813 well.
13814 (iterate_out_of_display_property): Support iteration over strings.
13815 (handle_single_display_spec): Set up it->bidi_it for iteration
13816 over a display string, and call bidi_init_it.
13817 (handle_single_display_spec, next_overlay_string)
13818 (get_overlay_strings_1, push_display_prop): Set up the bidi
13819 iterator for displaying display or overlay strings.
13820 (forward_to_next_line_start): Don't use the shortcut if
13821 bidi-iterating.
13822 (back_to_previous_visible_line_start): If handle_display_prop
13823 pushed the iterator stack, restore the internal state of the bidi
13824 iterator by calling bidi_pop_it same number of times.
13825 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13826 and we are bidi-iterating, don't decrement the iterator position;
13827 instead, set the first_elt flag in the bidi iterator, to produce
13828 the same effect.
13829 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13830 (push_display_prop): xassert that we are iterating a buffer.
13831 (push_it, pop_it): Save and restore paragraph_embedding member.
13832 (handle_single_display_spec, next_overlay_string)
13833 (get_overlay_strings_1, reseat_1, reseat_to_string)
13834 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13835 correctly. Don't assume unibyte strings are not bidi-reordered.
13836 (compute_display_string_pos)
13837 (compute_display_string_end): Fix handling the case of C string.
13838 (push_it, pop_it): Save and restore from_disp_prop_p.
13839 (handle_single_display_spec, push_display_prop): Set the
13840 from_disp_prop_p flag.
13841 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13842 (pop_it): Call iterate_out_of_display_property only if we are
13843 popping after iteration over a string that came from a display
13844 property. Fix a typo in popping stretch info. Add an assertion
13845 for verifying that the iterator position is in sync with the bidi
13846 iterator.
13847 (handle_single_display_spec, get_overlay_strings_1)
13848 (push_display_prop): Fix initialization of paragraph direction for
13849 string when that of the parent object is not yet determined.
13850 (reseat_1): Call bidi_init_it to resync the bidi
13851 iterator with IT's position. (Bug#7616)
13852 (find_row_edges): If ROW->start.pos gives position
13853 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13854 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13855 Reset the from_disp_prop_p flag.
13856 (SAVE_IT, RESTORE_IT): New macros.
13857 (pos_visible_p, face_before_or_after_it_pos)
13858 (back_to_previous_visible_line_start)
13859 (move_it_in_display_line_to, move_it_in_display_line)
13860 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13861 (try_scrolling, redisplay_window, display_line): Use them when
13862 saving a temporary copy of the iterator and restoring it back.
13863 (back_to_previous_visible_line_start, reseat_1)
13864 (init_iterator): Empty the bidi cache "stack".
13865 (move_it_in_display_line_to): If iterator ended up at
13866 EOL, but we never saw any buffer positions smaller than
13867 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13868 motion in bidi-reordered lines.
13869 (move_it_in_display_line_to): Record prev_method and prev_pos
13870 immediately before the call to set_iterator_to_next. Fixes cursor
13871 motion in bidi-reordered lines with stretch glyphs and strings
13872 displayed in margins. (Bug#8133) (Bug#8867)
13873 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13874 TO_CHARPOS.
13875 (pos_visible_p): Support positions in bidi-reordered lines.
13876 Save and restore bidi cache.
13877
13878 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13879 (bidi_paragraph_info): Delete unused struct.
13880 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13881 (bidi_cache_start): New variable.
13882 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13883 to zero.
13884 (bidi_cache_fetch_state, bidi_cache_search)
13885 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13886 (bidi_cache_find, bidi_peek_at_next_level)
13887 (bidi_level_of_next_char, bidi_find_other_level_edge)
13888 (bidi_move_to_visually_next): Compare cache index with
13889 bidi_cache_start rather than with zero.
13890 (bidi_fetch_char): Accept new argument STRING; all callers
13891 changed. Support iteration over a string. Support strings with
13892 display properties. Support unibyte strings. Fix the type of
13893 `len' according to what STRING_CHAR_AND_LENGTH expects.
13894 (bidi_paragraph_init, bidi_resolve_explicit_1)
13895 (bidi_resolve_explicit, bidi_resolve_weak)
13896 (bidi_level_of_next_char, bidi_move_to_visually_next):
13897 Support iteration over a string.
13898 (bidi_set_sor_type, bidi_resolve_explicit_1)
13899 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13900 can now be zero (for strings); special values 0 and -1 were
13901 changed to -1 and -2, respectively.
13902 (bidi_char_at_pos): New function.
13903 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13904 Call it instead of FETCH_MULTIBYTE_CHAR.
13905 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13906 initialized to valid values.
13907 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13908 values.
13909 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13910 the test for valid cached positions. Fix the logic for looking up
13911 the sentinel state in the cache. GCPRO the Lisp string we are
13912 iterating.
13913 (bidi_push_it, bidi_pop_it): New functions.
13914 (bidi_initialize): Initialize the bidi cache start stack pointer.
13915 (bidi_cache_ensure_space): New function, refactored from part of
13916 bidi_cache_iterator_state. Don't assume the required size is just
13917 one BIDI_CACHE_CHUNK away.
13918 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13919 (bidi_count_bytes, bidi_char_at_pos): New functions.
13920 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13921 always valid if bidi_cache_idx is valid.
13922 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13923 is valid if it's going to be used.
13924 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13925 (bidi_cache_fetch_state, bidi_cache_search)
13926 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13927 (bidi_cache_iterator_state, bidi_cache_find)
13928 (bidi_find_other_level_edge, bidi_cache_start_stack):
13929 All variables related to cache indices are now EMACS_INT.
13930
13931 * dispextern.h (struct bidi_string_data): New structure.
13932 (struct bidi_it): New member `string'. Make flag members be 1-bit
13933 fields, and put them last in the struct.
13934 (compute_display_string_pos, compute_display_string_end):
13935 Update prototypes.
13936 (bidi_push_it, bidi_pop_it): Add prototypes.
13937 (struct iterator_stack_entry): New members bidi_p,
13938 paragraph_embedding, and from_disp_prop_p.
13939 (struct it): Member bidi_p is now a bit field 1 bit wide.
13940 (bidi_shelve_cache, bidi_unshelve_cache):
13941 Declare prototypes.
13942
13943 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13944 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13945 and vector-like objects.
13946
13947 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13948 cache around display iteration.
13949
13950 * window.c (Fwindow_end, window_scroll_pixel_based)
13951 (displayed_window_lines, Frecenter): Save and restore the bidi
13952 cache around display iteration.
13953
13954 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13955
13956 * editfns.c (Fdelete_region): Clarify the use of the named
13957 parameters (bug#6788).
13958
13959 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13960
13961 * indent.c (Fvertical_motion): Set and restore w->pointm when
13962 saving and restoring the window's buffer (Bug#9006).
13963
13964 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13965
13966 * editfns.c (Fstring_to_char): Clarify just what is returned
13967 (bug#6576). Text by Eli Zaretskii.
13968
13969 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13970
13971 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13972
13973 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13974
13975 * buffer.c (mmap_find): Fix a typo.
13976
13977 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13978
13979 Fix execution of x selection hooks.
13980 * xselect.c (Qx_lost_selection_functions)
13981 (Qx_sent_selection_functions): New vars.
13982 (syms_of_xselect): DEFSYM them.
13983 (x_handle_selection_request): Pass Qx_sent_selection_functions
13984 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13985 (x_handle_selection_clear,x_clear_frame_selections):
13986 Pass Qx_lost_selection_functions rather than
13987 Vx_lost_selection_functions to Frun_hook_with_args.
13988
13989 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13990
13991 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13992 The old code sometimes used this field without initializing it.
13993
13994 * alloc.c (gc_sweep): Don't read past end of array.
13995 In theory, the old code could also have corrupted Emacs internals,
13996 though it'd be very unlikely.
13997
13998 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13999
14000 * character.c (Fcharacterp): Don't advertise optional ignored
14001 argument. (Bug#4026)
14002
14003 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14004
14005 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14006 key" (bug#4257).
14007
14008 * window.c (Fset_window_start): Doc fix (bug#4199).
14009 (Fset_window_hscroll): Ditto.
14010
14011 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14012
14013 Fix minor new problems caught by GCC 4.6.1.
14014 * term.c (init_tty): Remove unused local.
14015 * xsettings.c (store_monospaced_changed): Define this function only
14016 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14017 not used otherwise.
14018
14019 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14020
14021 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14022
14023 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14024
14025 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14026 are the mini-buffer and the echo area (bug#3320).
14027
14028 * term.c (init_tty): Remove support for supdup, c10 and perq
14029 terminals, which are no longer supported (bug#1482).
14030
14031 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14032
14033 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14034
14035 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14036
14037 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14038 for non-popups (Bug#3642).
14039
14040 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14041
14042 * alloc.c (reset_malloc_hooks): Protoize.
14043 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14044 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14045 * cm.c (losecursor): Likewise.
14046 * data.c (fmod): Likewise.
14047 * dispnew.c (swap_glyphs_in_rows): Likewise.
14048 * emacs.c (memory_warning_signal): Likewise.
14049 * floatfns.c (float_error): Likewise.
14050 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14051 (otf_open, font_otf_capability, generate_otf_features)
14052 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14053 Likewise.
14054 * image.c (pbm_read_file): Likewise.
14055 * indent.c (string_display_width): Likewise.
14056 * intervals.c (check_for_interval, search_for_interval)
14057 (inc_interval_count, count_intervals, root_interval)
14058 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14059 * lread.c (defalias): Likewise.
14060 * ralloc.c (r_alloc_check): Likewise.
14061 * regex.c (set_image_of_range_1, set_image_of_range)
14062 (regex_grow_registers): Likewise.
14063 * sysdep.c (strerror): Likewise.
14064 * termcap.c (valid_filename_p, tprint, main): Likewise.
14065 * tparam.c (main): Likewise.
14066 * unexhp9k800.c (run_time_remap, save_data_space)
14067 (update_file_ptrs, read_header, write_header, calculate_checksum)
14068 (copy_file, copy_rest, display_header): Likewise.
14069 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14070 Likewise.
14071 * xdisp.c (check_it): Likewise.
14072 * xfaces.c (register_color, unregister_color, unregister_colors):
14073 Likewise.
14074 * xfns.c (print_fontset_result): Likewise.
14075 * xrdb.c (member, fatal, main): Likewise.
14076
14077 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14078
14079 Fix minor problems found by static checking (Bug#9031).
14080 * chartab.c (char_table_set_range, map_sub_char_table):
14081 Remove unused locals.
14082 (uniprop_table): Now static.
14083 * composite.c (_work_char): Remove unused static var.
14084
14085 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14086
14087 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14088
14089 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14090
14091 * gtkutil.c (qttip_cb): Remove code without function.
14092
14093 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14094
14095 * w32.c (pthread_sigmask): New stub.
14096
14097 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14098
14099 Use pthread_sigmask, not sigprocmask (Bug#9010).
14100 sigprocmask is portable only for single-threaded applications, and
14101 Emacs can be multi-threaded when it uses GTK.
14102 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14103 (LIBES): Use it.
14104 * callproc.c (Fcall_process):
14105 * process.c (create_process):
14106 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14107 Use pthread_sigmask, not sigprocmask.
14108
14109 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14110
14111 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14112 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14113 wrong (Bug#8591).
14114
14115 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14116
14117 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14118 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14119 (xg_hide_tooltip): Fix comment.
14120
14121 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14122 in registerServicesMenuSendTypes.
14123 (validRequestorForSendType): Don't check ns_return_types.
14124
14125 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14126 ns_return_type.
14127
14128 2011-07-08 Jason Rumney <jasonr@gnu.org>
14129
14130 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14131 SH_SHOW for hidden windows (Bug#5482).
14132
14133 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14134 frame struct members of non-existent frames (Bug#6284).
14135
14136 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14137
14138 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14139 variable firstTime not needed on OSX >= 10.6.
14140 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14141 >= 10.5. Use setKnobProportion, setDoubleValue.
14142
14143 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14144 (MAC_OS_X_VERSION_10_5): Define if not defined.
14145 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14146 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14147 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14148
14149 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14150 cString and lossyCString on OSX >= 10.4.
14151
14152 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14153 sizeToFit on OSX >= 10.2.
14154
14155 * nsimage.m (allocInitFromFile): Don't use deprecated method
14156 bestRepresentationForDevice on OSX >= 10.6.
14157
14158 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14159 to avoid warning.
14160
14161 * emacs.c: Declare unexec_init_emacs_zone.
14162
14163 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14164
14165 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14166
14167 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14168 on svcsMenu (Bug#8842).
14169
14170 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14171 ns_return_types.
14172 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14173
14174 * nsterm.m (QUTF8_STRING): Declare.
14175 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14176 (validRequestorForSendType): Return type is (id).
14177 Change indexOfObjectIdenticalTo to indexOfObject.
14178 Check if we have local selection before returning self (Bug#8842).
14179 (writeSelectionToPasteboard): Put local selection into paste board
14180 if we have a local selection (Bug#8842).
14181 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14182
14183 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14184 (ns_get_local_selection): Declare.
14185
14186 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14187
14188 * keymap.c (describe_map_tree): Don't insert a double newline at
14189 the end of the buffer (bug#1169) and return whether we inserted
14190 something.
14191
14192 * callint.c (Fcall_interactively): Change "reading args" to
14193 "providing args" to try to clarify what it does (bug#1010).
14194
14195 2011-07-07 Kenichi Handa <handa@m17n.org>
14196
14197 * composite.c (composition_compute_stop_pos): Ignore a static
14198 composition starting before CHARPOS (Bug#8915).
14199
14200 * xdisp.c (handle_composition_prop): Likewise.
14201
14202 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14203
14204 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14205 (Bug#9015)
14206
14207 2011-07-07 Kenichi Handa <handa@m17n.org>
14208
14209 * character.h (unicode_category_t): New enum type.
14210
14211 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14212 (Qchar_code_property_table): New variable.
14213 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14214 (UNIPROP_COMPRESSED_FORM_P): New macros.
14215 (char_table_ascii): Uncompress the compressed values.
14216 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14217 Uncompress the compressed values.
14218 (sub_char_table_ref_and_range): Likewise.
14219 (char_table_ref_and_range): Uncompress the compressed values.
14220 (sub_char_table_set): New arg is_uniprop. Callers changed.
14221 Uncompress the compressed values.
14222 (sub_char_table_set_range): Args changed. Callers changed.
14223 (char_table_set_range): Adjuted for the above change.
14224 (map_sub_char_table): Delete args default_val and parent. Add arg
14225 top. Give decoded values to a Lisp function.
14226 (map_char_table): Adjust for the above change. Give decoded
14227 values to a Lisp function. Gcpro more variables.
14228 (uniprop_table_uncompress)
14229 (uniprop_decode_value_run_length): New functions.
14230 (uniprop_decoder, uniprop_decoder_count): New variables.
14231 (uniprop_get_decoder, uniprop_encode_value_character)
14232 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14233 New functions.
14234 (uniprop_encoder, uniprop_encoder_count): New variables.
14235 (uniprop_get_encoder, uniprop_table)
14236 (Funicode_property_table_internal, Fget_unicode_property_internal)
14237 (Fput_unicode_property_internal): New functions.
14238 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14239 Sunicode_property_table_internal, Sget_unicode_property_internal,
14240 and Sput_unicode_property_internal. Defvar_lisp
14241 char-code-property-alist.
14242
14243 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14244 Vunicode_category_table.
14245
14246 * font.c (font_range): Adjust for the change of
14247 Vunicode_category_table.
14248
14249 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14250
14251 * m/iris4d.h: Remove file, move contents ...
14252 * s/irix6-5.h: ... here.
14253
14254 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14255
14256 Remove unportable assumption about struct layout (Bug#8884).
14257 * alloc.c (mark_buffer):
14258 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14259 (clone_per_buffer_values): Don't assume that
14260 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14261 This isn't true in general, and it's particularly not true
14262 if Emacs is configured with --with-wide-int.
14263 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14264 New macros, used in the buffer.c change.
14265
14266 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14267
14268 * xsettings.c: Use both GConf and GSettings if both are available.
14269 (store_config_changed_event): Add comment.
14270 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14271 (store_tool_bar_style_changed): New functions.
14272 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14273 (struct xsettings): Move font inside HAVE_XFT.
14274 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14275 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14276 Move inside HAVE_XFT.
14277 (something_changed_gsettingsCB): Rename from something_changedCB.
14278 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14279 also.
14280 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14281 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14282 (something_changed_gconfCB): Rename from something_changedCB.
14283 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14284 (parse_settings): Move check for font inside HAVE_XFT.
14285 (read_settings, apply_xft_settings): Add comment.
14286 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14287 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14288 call store_font_name_changed.
14289 (xft_settings_event): Add comment.
14290 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14291 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14292 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14293 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14294 (xsettings_initialize): Call init_gsettings last.
14295 (xsettings_get_system_font, xsettings_get_system_normal_font):
14296 Add comment.
14297
14298 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14299
14300 Random fixes. E.g., (random) never returned negative values.
14301 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14302 subseconds part to the entropy, as that's a bit more random.
14303 Prefer signed to unsigned, since the signedness doesn't matter and
14304 in general we prefer signed. When given a limit, use a
14305 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14306 latter isn't right if USE_2_TAGS_FOR_INTS.
14307 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14308 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14309
14310 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14311
14312 * textprop.c (text_property_stickiness):
14313 Obey Vtext_property_default_nonsticky.
14314 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14315 * w32fns.c (syms_of_w32fns):
14316 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14317
14318 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14319
14320 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14321 This is more efficient than Ffile_directory_p and avoids a minor race.
14322
14323 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14324
14325 * buffer.c (Foverlay_put): Say what the return value is
14326 (bug#7835).
14327
14328 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14329 is a directory before asking whether to use the file name
14330 (bug#7564).
14331 (barf_or_query_if_file_exists): Make the "File is a directory"
14332 error be more correct.
14333
14334 * fns.c (Frequire): Remove the mention of the .gz files, since
14335 that's installation-specific, but keep the mention of
14336 `get-load-suffixes'.
14337
14338 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14339
14340 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14341 Report string overflow if the output is too long.
14342
14343 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14344
14345 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14346 (syms_of_gnutls): Remove duplicate DEFSYM for
14347 Qgnutls_bootprop_verify_hostname_error, an error for
14348 Qgnutls_bootprop_verify_error (which is no longer used).
14349
14350 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14351 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14352 Also (re)move comments that are misplaced or no longer relevant.
14353
14354 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14355
14356 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14357
14358 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14359
14360 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14361 and background color parameters if they have been changed.
14362
14363 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14364
14365 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14366
14367 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14368
14369 * xsettings.c (SYSTEM_FONT): Define only when used.
14370 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14371
14372 * keymap.c (access_keymap_1): Now static.
14373
14374 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14375
14376 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14377 leave any prefix arg for the up event (Bug#1586).
14378
14379 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14380
14381 * lread.c (syms_of_lread): Mention single symbols defined by
14382 `defvar' or `defconst' (bug#7154).
14383
14384 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14385 (Frequire): Mention get-load-suffixes.
14386
14387 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14388
14389 * window.h (window): Remove clone_number slot.
14390 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14391 Remove.
14392 (make_parent_window, make_window, saved_window)
14393 (Fset_window_configuration, save_window_save): Don't deal with
14394 clone numbers.
14395 * buffer.c (Qclone_number): Remove declaration.
14396 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14397
14398 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14399
14400 Add multiple inheritance to keymaps.
14401 * keymap.c (Fmake_composed_keymap): New function.
14402 (Fset_keymap_parent): Simplify.
14403 (fix_submap_inheritance): Remove.
14404 (access_keymap_1): New function extracted from access_keymap to handle
14405 embedded parents and handle lists of maps.
14406 (access_keymap): Use it.
14407 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14408 (Fcopy_keymap): Handle embedded parents.
14409 (Fcommand_remapping, define_as_prefix): Simplify.
14410 (Fkey_binding): Simplify.
14411 (syms_of_keymap): Move minibuffer-local-completion-map,
14412 minibuffer-local-filename-completion-map,
14413 minibuffer-local-must-match-map, and
14414 minibuffer-local-filename-must-match-map to Elisp.
14415 (syms_of_keymap): Defsubr make-composed-keymap.
14416 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14417 (parse_menu_item): Trivial simplification.
14418
14419 2011-07-01 Glenn Morris <rgm@gnu.org>
14420
14421 * Makefile.in (SETTINGS_LIBS): Fix typo.
14422
14423 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14424
14425 * coding.c (Fencode_coding_string): Record the last coding system
14426 used, as the function doc string says (bug#8738).
14427
14428 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14429
14430 * xsettings.c (store_monospaced_changed): Take new font as arg and
14431 check for change against current_mono_font.
14432 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14433 (emacs_settings_constructor, emacs_settings_get_property)
14434 (emacs_settings_set_property, emacs_settings_class_init)
14435 (emacs_settings_init, gsettings_obj): Remove.
14436 (something_changedCB): New function for HAVE_GSETTINGS.
14437 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14438 with value as argument.
14439 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14440 g_settings_new (Bug#8967). Do not create gsettings_obj.
14441 Remove calls to g_settings_bind. Connect something_changedCB to
14442 "changed".
14443
14444 * xgselect.c: Add defined (HAVE_GSETTINGS).
14445 (xgselect_initialize): Ditto.
14446
14447 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14448 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14449 xg_select.
14450
14451 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14452
14453 * eval.c (struct backtrace): Simplify and port the data structure.
14454 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14455 signed bit field, as this assumption is not portable and it makes
14456 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14457 "char debug_on_exit : 1" as this is not portable either; instead,
14458 use the portable "unsigned int debug_on_exit : 1". Remove unused
14459 member evalargs. Remove obsolete comments about cc bombing out.
14460
14461 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14462
14463 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14464 Let HAVE_GSETTINGS override HAVE_GCONF.
14465 (store_monospaced_changed): New function.
14466 (EMACS_SETTINGS): A new type derived from GObject to handle
14467 GSettings notifications.
14468 (emacs_settings_constructor, emacs_settings_get_property)
14469 (emacs_settings_set_property, emacs_settings_class_init):
14470 New functions.
14471 (gsettings_client, gsettings_obj): New variables.
14472 (GSETTINGS_SCHEMA): New define.
14473 (something_changedCB): Call store_monospaced_changed.
14474 (init_gsettings): New function.
14475 (xsettings_initialize): Call init_gsettings.
14476 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14477 to NULL.
14478
14479 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14480 GCONF_CFLAGS/LIBS.
14481
14482 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14483
14484 * window.c (resize_root_window, grow_mini_window)
14485 (shrink_mini_window): Rename Qresize_root_window to
14486 Qwindow_resize_root_window and Qresize_root_window_vertically to
14487 Qwindow_resize_root_window_vertically.
14488
14489 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14490
14491 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14492
14493 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14494
14495 * makefile.w32-in: Redesign dependencies so they reflect more
14496 clearly which files are directly included by each source file,
14497 and not through other includes.
14498
14499 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14500
14501 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14502 (sort_overlays, overlay_strings): When an overlay's clone number
14503 matches the window's clone number process the overlay even if
14504 the overlay's window property doesn't match the current window.
14505
14506 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14507 (Fwindow_hchild): Rename to Fwindow_left_child.
14508 (Fwindow_next): Rename to Fwindow_next_sibling.
14509 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14510 (resize_window_check): Rename to window_resize_check.
14511 (resize_window_apply): Rename to window_resize_apply.
14512 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14513 (Fdelete_other_windows_internal, resize_frame_windows)
14514 (Fsplit_window_internal, Fdelete_window_internal)
14515 (grow_mini_window, shrink_mini_window)
14516 (Fresize_mini_window_internal): Fix callers accordingly.
14517
14518 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14519
14520 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14521 (emacs_fixed_set_min_size): Remove.
14522 (emacs_fixed_new): Take frame as argument.
14523
14524 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14525 (_EmacsFixedPrivate): Remove minwidth/height.
14526 Add struct frame *f.
14527 (emacs_fixed_init): Initialize priv->f.
14528 (get_parent_class, emacs_fixed_set_min_size): Remove.
14529 (emacs_fixed_new): Set priv->f to argument.
14530 (emacs_fixed_get_preferred_width)
14531 (emacs_fixed_get_preferred_height): Use min_width/height from
14532 frames size_hint to set minimum and natural (Bug#8919).
14533 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14534 and use min_width/height from frames size_hint to set
14535 min_width/height (Bug#8919).
14536
14537 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14538 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14539 Fix indentation.
14540
14541 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14542
14543 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14544 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14545 called at ZV.
14546
14547 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14548
14549 * process.c (wait_reading_process_output): Bypass select if
14550 waiting for a cell while ignoring keyboard input, and input is
14551 pending. Suggested by Jan Djärv (Bug#8869).
14552
14553 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14554
14555 Use gnulib's dup2 module instead of rolling our own.
14556 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14557
14558 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14559
14560 * dispnew.c (scrolling_window): Before scrolling, turn off a
14561 mouse-highlight in the window being scrolled.
14562
14563 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14564
14565 Move DEFSYM to lisp.h and use everywhere.
14566
14567 * character.h (DEFSYM): Move declaration...
14568 * lisp.h (DEFSYM): ...here.
14569
14570 * gnutls.c:
14571 * minibuf.c:
14572 * w32menu.c:
14573 * w32proc.c:
14574 * w32select.c: Don't include character.h.
14575
14576 * alloc.c (syms_of_alloc):
14577 * buffer.c (syms_of_buffer):
14578 * bytecode.c (syms_of_bytecode):
14579 * callint.c (syms_of_callint):
14580 * casefiddle.c (syms_of_casefiddle):
14581 * casetab.c (init_casetab_once):
14582 * category.c (init_category_once, syms_of_category):
14583 * ccl.c (syms_of_ccl):
14584 * cmds.c (syms_of_cmds):
14585 * composite.c (syms_of_composite):
14586 * dbusbind.c (syms_of_dbusbind):
14587 * dired.c (syms_of_dired):
14588 * dispnew.c (syms_of_display):
14589 * doc.c (syms_of_doc):
14590 * editfns.c (syms_of_editfns):
14591 * emacs.c (syms_of_emacs):
14592 * eval.c (syms_of_eval):
14593 * fileio.c (syms_of_fileio):
14594 * fns.c (syms_of_fns):
14595 * frame.c (syms_of_frame):
14596 * fringe.c (syms_of_fringe):
14597 * insdel.c (syms_of_insdel):
14598 * keymap.c (syms_of_keymap):
14599 * lread.c (init_obarray, syms_of_lread):
14600 * macros.c (syms_of_macros):
14601 * msdos.c (syms_of_msdos):
14602 * print.c (syms_of_print):
14603 * process.c (syms_of_process):
14604 * search.c (syms_of_search):
14605 * sound.c (syms_of_sound):
14606 * syntax.c (init_syntax_once, syms_of_syntax):
14607 * terminal.c (syms_of_terminal):
14608 * textprop.c (syms_of_textprop):
14609 * undo.c (syms_of_undo):
14610 * w32.c (globals_of_w32):
14611 * window.c (syms_of_window):
14612 * xdisp.c (syms_of_xdisp):
14613 * xfaces.c (syms_of_xfaces):
14614 * xfns.c (syms_of_xfns):
14615 * xmenu.c (syms_of_xmenu):
14616 * xsettings.c (syms_of_xsettings):
14617 * xterm.c (syms_of_xterm): Use DEFSYM.
14618
14619 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14620
14621 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14622
14623 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14624
14625 Integer and buffer overflow fixes (Bug#8873).
14626
14627 * print.c (printchar, strout): Check for string overflow.
14628 (PRINTPREPARE, printchar, strout):
14629 Don't set size unless allocation succeeds.
14630
14631 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14632 for sizes. Check for string overflow more accurately.
14633 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14634
14635 * macros.c: Integer and buffer overflow fixes.
14636 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14637 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14638 Use ptrdiff_t, not int, for sizes.
14639 Don't increment bufsize until after realloc succeeds.
14640 Check for size-calculation overflow.
14641 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14642
14643 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14644
14645 * lread.c: Integer overflow fixes.
14646 (read_integer): Radix is now EMACS_INT, not int,
14647 to improve quality of diagnostics for out-of-range radices.
14648 Calculate buffer size correctly for out-of-range radices.
14649 (read1): Check for integer overflow in radices, and in
14650 read-circle numbers.
14651 (read_escape): Avoid int overflow.
14652 (Fload, openp, read_buffer_size, read1)
14653 (substitute_object_recurse, read_vector, read_list, map_obarray):
14654 Use ptrdiff_t, not int, for sizes.
14655 (read1): Use EMACS_INT, not int, for sizes.
14656 Check for size overflow.
14657
14658 * image.c (cache_image): Check for size arithmetic overflow.
14659
14660 * lread.c: Integer overflow issues.
14661 (saved_doc_string_size, saved_doc_string_length)
14662 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14663 Now ptrdiff_t, not int.
14664 (read1): Don't assume doc string length fits in int. Check for
14665 out-of-range doc string lengths.
14666 (read_list): Don't assume file position fits in int.
14667 (read_escape): Check for hex character overflow.
14668
14669 2011-06-22 Leo Liu <sdl.web@gmail.com>
14670
14671 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14672 Move to minibuffer.el.
14673
14674 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14675
14676 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14677 The following patches are for when GLYPH_DEBUG && !XASSERT.
14678 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14679 * dispnew.c (flush_stdout):
14680 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14681 Mark as externally visible.
14682 * dispnew.c (check_window_matrix_pointers): Now static.
14683 * dispnew.c (window_to_frame_vpos):
14684 * xfns.c (unwind_create_frame):
14685 * xterm.c (x_check_font): Remove unused local.
14686 * scroll.c (CHECK_BOUNDS):
14687 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14688 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14689 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14690 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14691 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14692 Now static.
14693 (debug_method_add): Use va_list and vsprintf rather than relying
14694 on undefined behavior with wrong number of arguments.
14695 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14696 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14697 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14698 since we're not interested in debugging glyphs with old libraries.
14699 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14700 GCC 4.6.0's static checking.
14701
14702 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14703
14704 Integer overflow and signedness fixes (Bug#8873).
14705 A few related buffer overrun fixes, too.
14706
14707 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14708
14709 * dispextern.h (struct face.stipple):
14710 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14711 (x_bitmap_mask, x_allocate_bitmap_record)
14712 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14713 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14714 (x_create_bitmap_from_xpm_data):
14715 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14716 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14717 (.bitmaps_last):
14718 * xfaces.c (load_pixmap):
14719 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14720 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14721 (.bitmaps_last, struct x_output.icon_bitmap):
14722 Use ptrdiff_t, not int, for bitmap indexes.
14723 (x_allocate_bitmap_record): Check for size overflow.
14724 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14725
14726 Use ptrdiff_t, not int, for overlay counts.
14727 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14728 * editfns.c (overlays_around, get_pos_property):
14729 * textprop.c (get_char_property_and_overlay):
14730 * xdisp.c (next_overlay_change, note_mouse_highlight):
14731 * xfaces.c (face_at_buffer_position):
14732 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14733 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14734 (Fnext_overlay_change, Fprevious_overlay_change)
14735 (mouse_face_overlay_overlaps, Foverlays_in):
14736 Use ptrdiff_t, not int, for sizes.
14737 (overlays_at, overlays_in): Check for size-calculation overflow.
14738
14739 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14740
14741 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14742 (x_session_initialize): Do not assume string length fits in int.
14743
14744 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14745 This is unlikely, but can occur if DPI is outlandish.
14746
14747 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14748 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14749
14750 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14751 * xrdb.c (magic_file_p, search_magic_path):
14752 Omit last arg SUFFIX; it was always 0. All callers changed.
14753 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14754
14755 * xfont.c (xfont_match): Avoid need for strlen.
14756
14757 * xfns.c: Don't assume strlen fits in int.
14758 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14759
14760 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14761 not unsigned long, as we prefer signed integers. All callers changed.
14762 Detect integer overflow in repeat count.
14763 (message_dolog): Don't assume print length fits in 39 bytes.
14764 (display_mode_element): Don't assume strlen fits in int.
14765
14766 * termcap.c: Don't assume sizes fit in int and never overflow.
14767 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14768 (gobble_line): Check for size-calculation overflow.
14769
14770 * minibuf.c (Fread_buffer):
14771 * lread.c (intern, intern_c_string):
14772 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14773 Don't assume string length fits in int.
14774
14775 * keyboard.c (parse_tool_bar_item):
14776 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14777
14778 * font.c: Don't assume string length fits in int.
14779 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14780 Use ptrdiff_t, not int.
14781 (font_intern_prop): Don't assume string length fits in int.
14782 Don't assume integer property fits in fixnum.
14783 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14784
14785 * filelock.c: Fix some buffer overrun and integer overflow issues.
14786 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14787 Reformulate so as not to need the command string.
14788 Invoke gzip -cd rather than gunzip, as it's more portable.
14789 (lock_info_type, lock_file_1, lock_file):
14790 Don't assume pid_t and time_t fit in unsigned long.
14791 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14792 (current_lock_owner): Prefer signed type for sizes.
14793 Use memcpy, not strncpy, where memcpy is what is really wanted.
14794 Don't assume (via atoi) that time_t and pid_t fit in int.
14795 Check for time_t and/or pid_t out of range, e.g., via a network share.
14796 Don't alloca where an auto var works fine.
14797
14798 * fileio.c: Fix some integer overflow issues.
14799 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14800 Don't assume string length fits in int.
14801 (directory_file_name): Don't assume string length fits in long.
14802 (make_temp_name): Don't assume pid fits in int, or that its print
14803 length is less than 20.
14804
14805 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14806
14807 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14808
14809 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14810
14811 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14812 We prefer signed integers, even for size calculations.
14813
14814 * emacs.c: Don't assume string length fits in 'int'.
14815 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14816 (main): Don't invoke strlen when not needed.
14817
14818 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14819 (XD_DEBUG_MESSAGE): Don't waste a byte.
14820
14821 * callproc.c (getenv_internal_1, getenv_internal)
14822 (Fgetenv_internal):
14823 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14824
14825 * lread.c (invalid_syntax): Omit length argument.
14826 All uses changed. This doesn't fix a bug, but it simplifies the
14827 code away from its former Hollerith-constant appearance, and it's
14828 one less 'int' to worry about when looking at integer-overflow issues.
14829 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14830
14831 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14832 This didn't break anything, but it didn't help either.
14833 It's confusing to put a bogus integer in a place where the actual
14834 value does not matter.
14835 (LIST_END_P): Remove unused macro and its bogus comment.
14836 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14837
14838 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14839 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14840 implementation.
14841 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14842 We prefer signed types, and the value cannot exceed the EMACS_INT
14843 range anyway (because otherwise the length would not be representable).
14844 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14845 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14846 This avoids a GCC warning when WIDE_EMACS_INT.
14847
14848 * indent.c (sane_tab_width): New function.
14849 (current_column, scan_for_column, Findent_to, position_indentation)
14850 (compute_motion): Use it. This is just for clarity.
14851 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14852
14853 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14854
14855 * lisp.h (lint_assume): New macro.
14856 * composite.c (composition_gstring_put_cache):
14857 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14858
14859 * editfns.c, insdel.c:
14860 Omit unnecessary forward decls, to simplify future changes.
14861
14862 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14863
14864 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14865
14866 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14867 Use much-faster test for byte-length change.
14868 Don't assume string byte-length fits in 'int'.
14869 Check that character arg fits in 'int'.
14870 (mapcar1): Declare byte as byte, for clarity.
14871
14872 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14873
14874 * fns.c (concat): Catch string overflow earlier.
14875 Do not rely on integer wraparound.
14876
14877 * dispextern.h (struct it.overlay_strings_charpos)
14878 (struct it.selective): Now EMACS_INT, not int.
14879 * xdisp.c (forward_to_next_line_start)
14880 (back_to_previous_visible_line_start)
14881 (reseat_at_next_visible_line_start, next_element_from_buffer):
14882 Don't arbitrarily truncate the value of 'selective' to int.
14883
14884 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14885
14886 * composite.c: Don't truncate sizes to 'int'.
14887 (composition_gstring_p, composition_reseat_it)
14888 (composition_adjust_point): Use EMACS_INT, not int.
14889 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14890 not EMACS_UINT, for indexes.
14891
14892 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14893
14894 * buffer.c: Include <verify.h>.
14895 (struct sortvec.priority, struct sortstr.priority):
14896 Now EMACS_INT, not int.
14897 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14898 (struct sortstr.size, record_overlay_string)
14899 (struct sortstrlist.size, struct sortlist.used):
14900 Don't truncate size to int.
14901 (record_overlay_string): Check for size-calculation overflow.
14902 (init_buffer_once): Check at compile-time, not run-time.
14903
14904 2011-06-22 Jim Meyering <meyering@redhat.com>
14905
14906 Don't leak an XBM-image-sized buffer
14907 * image.c (xbm_load): Free the image buffer after using it.
14908
14909 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14910
14911 Port to Sun C.
14912 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14913 that Sun C diagnosed.
14914 * fns.c (secure_hash): Fix pointer signedness issue.
14915 * intervals.c (static_offset_intervals): New function.
14916 (offset_intervals): Use it.
14917
14918 2011-06-21 Leo Liu <sdl.web@gmail.com>
14919
14920 * deps.mk (fns.o):
14921 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14922 sha512.h.
14923
14924 * fns.c (secure_hash): Rename from crypto_hash_function and change
14925 the first arg to accept symbols.
14926 (Fsecure_hash): New primitive.
14927 (syms_of_fns): New symbols.
14928
14929 2011-06-20 Deniz Dogan <deniz@dogan.se>
14930
14931 * process.c (Fset_process_buffer): Clarify return value in
14932 docstring.
14933
14934 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14935
14936 * dispnew.c (add_window_display_history): Use BVAR.
14937
14938 * xdisp.c (debug_method_add): Use BVAR.
14939 (check_window_end, dump_glyph_matrix, dump_glyph)
14940 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14941
14942 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14943 Likewise.
14944
14945 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14946 check till after the cache is created in init_frame_faces.
14947
14948 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14949
14950 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14951
14952 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14953
14954 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14955 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14956 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14957
14958 Improve buffer-overflow checking (Bug#8873).
14959 * fileio.c (Finsert_file_contents):
14960 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14961 Remove the old (too-loose) buffer overflow checks.
14962 They weren't needed, since make_gap checks for buffer overflow.
14963 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14964 The old code merely checked for Emacs fixnum overflow, and relied
14965 on undefined (wraparound) behavior. The new code avoids undefined
14966 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14967
14968 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14969 Tune. Don't use wider integers than needed. Don't use alloca.
14970 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14971
14972 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14973
14974 * insdel.c, lisp.h (buffer_overflow): New function.
14975 (insert_from_buffer_1, replace_range, replace_range_2):
14976 * insdel.c (make_gap_larger):
14977 * editfns.c (Finsert_char):
14978 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14979
14980 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14981
14982 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14983
14984 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14985
14986 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14987 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14988
14989 * fileio.c: Don't assume EMACS_INT fits in off_t.
14990 (emacs_lseek): New static function.
14991 (Finsert_file_contents, Fwrite_region): Use it.
14992 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14993
14994 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14995
14996 * fns.c: Don't overflow int when computing a list length.
14997 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14998 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14999 truncation on 64-bit hosts. Check for QUIT every
15000 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15001 faster and is responsive enough.
15002 (Flength): Report an error instead of overflowing an integer.
15003 (Fsafe_length): Return a float if the value is not representable
15004 as a fixnum. This shouldn't happen except in contrived situations.
15005 (Fnthcdr, Fsort): Don't assume list length fits in int.
15006 (Fcopy_sequence): Don't assume vector length fits in int.
15007
15008 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15009 (header_size, word_size): New constants.
15010 (allocate_vectorlike): Don't check size overflow here.
15011 (allocate_vector): Check it here instead, since this is the only
15012 caller of allocate_vectorlike that could cause overflow.
15013 Check that the new vector's length is representable as a fixnum.
15014
15015 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15016 The previous code was bogus. For example, next_almost_prime (32)
15017 returned 39, which is undesirable as it is a multiple of 3; and
15018 next_almost_prime (24) returned 25, which is a multiple of 5 so
15019 why was the code bothering to check for multiples of 7?
15020
15021 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15022
15023 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15024
15025 Variadic C functions now count arguments with ptrdiff_t.
15026 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15027 Back then I didn't know that the Emacs coding style prefers signed int.
15028 Also, in the meantime I found a few more instances where arguments
15029 were being counted with int, which may truncate counts on 64-bit
15030 machines, or EMACS_INT, which may be unnecessarily wide.
15031 * lisp.h (struct Lisp_Subr.function.aMANY)
15032 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15033 Arg counts are now ptrdiff_t, not size_t.
15034 All variadic functions and their callers changed accordingly.
15035 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15036 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15037 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15038 * callint.c (Fcall_interactively): Check arg count for overflow,
15039 to avoid potential buffer overrun. Use signed char, not 'int',
15040 for 'varies' array, so that we needn't bother to check its size
15041 calculation for overflow.
15042 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15043 * eval.c (apply_lambda):
15044 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15045 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15046 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15047
15048 * callint.c (Fcall_interactively): Don't use index var as event count.
15049
15050 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15051 * mem-limits.h (SIZE): Remove; no longer used.
15052
15053 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15054
15055 Remove unnecessary casts.
15056 * xterm.c (x_term_init):
15057 * xfns.c (x_set_border_pixel):
15058 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15059 These aren't needed now that we assume ANSI C.
15060
15061 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15062 It's more likely to cause problems (due to unsigned overflow)
15063 than to cure them.
15064
15065 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15066
15067 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15068
15069 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15070
15071 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15072
15073 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15074
15075 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15076
15077 GLYPH_CODE_FACE returns EMACS_INT, not int.
15078 * dispextern.h (merge_faces):
15079 * xfaces.c (merge_faces):
15080 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15081 Don't assume EMACS_INT fits in int.
15082
15083 * character.h (CHAR_VALID_P): Remove unused parameter.
15084 * fontset.c, lisp.h, xdisp.c: All uses changed.
15085
15086 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15087
15088 * fns.c (concat): Minor tuning based on overflow analysis.
15089 This doesn't fix any bugs. Use int to hold character, instead
15090 of constantly refetching from Emacs object. Use XFASTINT, not
15091 XINT, for value known to be a character. Don't bother comparing
15092 a single byte to 0400, as it's always less.
15093
15094 * floatfns.c (Fexpt):
15095 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15096
15097 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15098 for characters.
15099
15100 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15101
15102 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15103 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15104 incorrectly succeed when S was a string, because 4294967386 was
15105 truncated before it was used.
15106
15107 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15108 Otherwise, an out-of-range integer could cause undefined behavior
15109 on a 64-bit host.
15110
15111 * composite.c: Use int, not EMACS_INT, for characters.
15112 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15113 EMACS_INT, for values that are known to be in character range.
15114 This doesn't fix any bugs but is the usual style inside Emacs and
15115 may generate better code on 32-bit machines.
15116
15117 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15118 This is for reasons similar to the recent CHAR_STRING fix.
15119 * charset.c (Fencode_char): Check that character arg is actually
15120 a character. Pass an int to ENCODE_CHAR.
15121 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15122 wider than 'int', as a compile-time check to prevent future regressions
15123 in this area.
15124
15125 * character.c (char_string): Remove unnecessary casts.
15126
15127 Make sure a 64-bit char is never passed to CHAR_STRING.
15128 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15129 by silently ignoring the top 32 bits, allowing some values
15130 that were far too large to be valid characters.
15131 * character.h: Include <verify.h>.
15132 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15133 arguments are no wider than unsigned, as a compile-time check
15134 to prevent future regressions in this area.
15135 * data.c (Faset):
15136 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15137 (Fsubst_char_in_region):
15138 * fns.c (concat):
15139 * xdisp.c (decode_mode_spec_coding):
15140 Adjust to CHAR_STRING's new requirement.
15141 * editfns.c (Finsert_char, Fsubst_char_in_region):
15142 * fns.c (concat): Check that character args are actually
15143 characters. Without this test, these functions did the wrong
15144 thing with wildly out-of-range values on 64-bit hosts.
15145
15146 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15147 These casts should not be needed on 32-bit hosts, either.
15148 * keyboard.c (read_char):
15149 * lread.c (Fload): Remove casts to unsigned.
15150
15151 * lisp.h (UNSIGNED_CMP): New macro.
15152 This fixes comparison bugs on 64-bit hosts.
15153 (ASCII_CHAR_P): Use it.
15154 * casefiddle.c (casify_object):
15155 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15156 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15157 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15158 * dispextern.h (FACE_FROM_ID):
15159 * keyboard.c (read_char): Use UNSIGNED_CMP.
15160
15161 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15162 not to EMACS_INT, to avoid GCC warning.
15163
15164 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15165
15166 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15167 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15168 isn't needed on 32-bit machines.
15169
15170 * buffer.c (Fgenerate_new_buffer_name):
15171 Use EMACS_INT for count, not int.
15172 (advance_to_char_boundary): Return EMACS_INT, not int.
15173
15174 * data.c (Qcompiled_function): Now static.
15175
15176 * window.c (window_body_lines): Now static.
15177
15178 * image.c (gif_load): Rename local to avoid shadowing.
15179
15180 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15181 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15182 * alloc.c (make_save_value): Integer argument is now of type
15183 ptrdiff_t, not int.
15184 (mark_object): Use ptrdiff_t, not int.
15185 * lisp.h (pD): New macro.
15186 * print.c (print_object): Use it.
15187
15188 * alloc.c: Use EMACS_INT, not int, to count objects.
15189 (total_conses, total_markers, total_symbols, total_vector_size)
15190 (total_free_conses, total_free_markers, total_free_symbols)
15191 (total_free_floats, total_floats, total_free_intervals)
15192 (total_intervals, total_strings, total_free_strings):
15193 Now EMACS_INT, not int. All uses changed.
15194 (Fgarbage_collect): Compute overall total using a double, so that
15195 integer overflow is less likely to be a problem. Check for overflow
15196 when converting back to an integer.
15197 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15198 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15199 These were 'int' variables that could overflow on 64-bit hosts;
15200 they were never used, so remove them instead of repairing them.
15201 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15202 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15203 Previously, this ceilinged at INT_MAX, but that doesn't work on
15204 64-bit machines.
15205 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15206
15207 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15208 (allocate_vectorlike): Check for ptrdiff_t overflow.
15209 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15210 when a (possibly-narrower) signed value would do just as well.
15211 We prefer using signed arithmetic, to avoid comparison confusion.
15212
15213 * alloc.c: Catch some string size overflows that we were missing.
15214 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15215 for convenience in STRING_BYTES_MAX.
15216 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15217 The definition here is exact; the one in lisp.h was approximate.
15218 (allocate_string_data): Check for string overflow. This catches
15219 some instances we weren't catching before. Also, it catches
15220 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15221 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15222 and ptrdiff_t and EMACS_INT are both 64 bits.
15223
15224 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15225 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15226 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15227
15228 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15229
15230 * alloc.c (Fmake_string): Check for out-of-range init.
15231
15232 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15233
15234 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15235
15236 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15237
15238 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15239 xg_get_default_scrollbar_width.
15240
15241 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15242 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15243 (style_changed_cb): Call update_theme_scrollbar_width and call
15244 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15245 all frames (Bug#8505).
15246 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15247 Call gtk_window_set_resizable if HAVE_GTK3.
15248 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15249 and height if HAVE_GTK3 (Bug#8505).
15250 (scroll_bar_width_for_theme): New variable.
15251 (update_theme_scrollbar_width): New function.
15252 (xg_get_default_scrollbar_width): Move code to
15253 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15254 (xg_initialize): Call update_theme_scrollbar_width.
15255
15256 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15257
15258 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15259
15260 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15261
15262 * frame.c (make_frame): Call other_buffer_safely instead of
15263 other_buffer.
15264
15265 * window.c (temp_output_buffer_show): Call display_buffer with
15266 second argument Vtemp_buffer_show_specifiers and reset latter
15267 immediately after the call.
15268 (Vtemp_buffer_show_specifiers): New variable.
15269 (auto_window_vscroll_p, next_screen_context_lines)
15270 (Vscroll_preserve_screen_position): Remove leading asterisks from
15271 doc-strings.
15272
15273 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15274
15275 Fix minor problems found by GCC 4.6.0 static checking.
15276 * buffer.c (Qclone_number): Remove for now, as it's unused.
15277 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15278 (record_buffer): Remove unused local.
15279 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15280 (set_frame_buffer_list): Remove; unused.
15281 * frame.h (other_visible_frames): Remove decl.
15282 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15283 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15284 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15285 if HAVE_GPM.
15286 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15287 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15288 Define only if HAVE_GPM.
15289 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15290 (update_hints_inhibit): Remove; never set. All uses removed.
15291 * widgetprv.h (emacsFrameClassRec): Remove decl.
15292 * window.c (delete_deletable_window): Now returns void, since it
15293 wasn't returning anything.
15294 (compare_window_configurations): Remove unused locals.
15295 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15296 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15297 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15298 the same widths as pointers. This follows up on the 2011-05-06 patch.
15299 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15300 * xterm.h: Likewise.
15301 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15302
15303 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15304
15305 * makefile.w32-in: Update dependencies.
15306 (LISP_H): Add lib/intprops.h.
15307
15308 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15309
15310 * image.c (gif_load): Add animation frame delay to the metadata.
15311 (syms_of_image): Use DEFSYM. New symbol `delay'.
15312
15313 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15314
15315 * window.c (delete_deletable_window): Re-add.
15316 (Fset_window_configuration): Rewrite to handle dead buffers and
15317 consequently deletable windows.
15318 (window_tree, Fwindow_tree): Remove. Supply functionality in
15319 window.el.
15320 (compare_window_configurations): Simplify code.
15321
15322 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15323
15324 * image.c (imagemagick_load_image): Fix type mismatch.
15325 (Fimagemagick_types): Likewise.
15326
15327 * window.h (replace_buffer_in_windows): Declare.
15328
15329 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15330
15331 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15332 Qclone_number. Remove external declaration of Qdelete_window.
15333 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15334 code.
15335 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15336 Run Qbuffer_list_update_hook if allowed.
15337 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15338 buffer list implementation.
15339 (other_buffer_safely): New function.
15340 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15341 calls to replace_buffer_in_windows and
15342 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15343 if allowed.
15344 (record_buffer): Inhibit quitting and rewrite using quittable
15345 functions. Run Qbuffer_list_update_hook if allowed.
15346 (Frecord_buffer, Funrecord_buffer): New functions.
15347 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15348 Move switch-to-buffer to window.el.
15349 (bury-buffer): Move to window.el.
15350 (Vbuffer_list_update_hook): New variable.
15351
15352 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15353 section.
15354
15355 * window.h (resize_frame_windows): Move up in code.
15356 (Fwindow_frame): Remove EXFUN.
15357 (replace_buffer_in_all_windows): Remove prototype.
15358 (replace_buffer_in_windows_safely): Add prototype.
15359
15360 * window.c: Declare Qdelete_window static again. Move down
15361 declaration of select_count.
15362 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15363 (Fother_window): Move to window.el.
15364 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15365 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15366 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15367 window.el.
15368 (replace_buffer_in_windows): Implement by calling
15369 Qreplace_buffer_in_windows.
15370 (replace_buffer_in_all_windows): Remove with some functionality
15371 moved into replace_buffer_in_windows_safely.
15372 (replace_buffer_in_windows_safely): New function.
15373 (select_window_norecord, select_frame_norecord): Move in front
15374 of run_window_configuration_change_hook. Remove now obsolete
15375 declarations.
15376 (Fset_window_buffer): Rewrite doc-string.
15377 Call Qrecord_window_buffer.
15378 (keys_of_window): Move binding for other-window to window.el.
15379
15380 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15381
15382 * dispextern.h (struct image): Replace data member, whose int_val
15383 and ptr_val fields were not used by anything, with a single
15384 lisp_val object.
15385
15386 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15387 (gif_clear_image, gif_load, imagemagick_load_image)
15388 (gs_clear_image, gs_load): Callers changed.
15389
15390 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15391
15392 * buffer.h: Include <time.h>, for time_t.
15393 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15394
15395 Fix minor problems found by static checking.
15396
15397 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15398
15399 Make identifiers static if they are not used in other modules.
15400 * data.c (Qcompiled_function, Qframe, Qvector):
15401 * image.c (QimageMagick, Qsvg):
15402 * minibuf.c (Qmetadata):
15403 * window.c (resize_window_check, resize_root_window): Now static.
15404 * window.h (resize_window_check, resize_root_window): Remove decls.
15405
15406 * window.c (window_deletion_count, delete_deletable_window):
15407 Remove; unused.
15408 (window_body_lines): Now static.
15409 (Fdelete_other_windows_internal): Mark vars as initialized.
15410 Make sure 'resize_failed' is initialized.
15411 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15412 (resize_window_apply): Remove unused local.
15413 * window.h (delete_deletable_window): Remove decl.
15414
15415 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15416 (imagemagick_load_image): Fix pointer signedness problem by changing
15417 last arg from unsigned char * to char *. All uses changed.
15418 Also, fix a local for similar reasons.
15419 Remove unused locals. Remove locals to avoid shadowing.
15420 (fn_rsvg_handle_free): Remove; unused.
15421 (svg_load, svg_load_image): Fix pointer signedness problem.
15422 (imagemagick_load_image): Don't use garbage pointer image_wand.
15423
15424 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15425
15426 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15427
15428 * image.c (gif_load): Fix omitted cast error introduced by
15429 2011-06-06 change.
15430
15431 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15432
15433 * window.h (resize_proportionally, orig_total_lines)
15434 (orig_top_line): Remove from window structure.
15435 (set_window_height, set_window_width, change_window_heights)
15436 (Fdelete_window): Remove prototypes.
15437 (resize_frame_windows): Remove duplicate declaration.
15438
15439 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15440
15441 * window.h (resize_frame_windows, resize_window_check)
15442 (delete_deletable_window, resize_root_window)
15443 (resize_frame_windows): Declare prototypes.
15444
15445 * window.c (resize_window_apply): Make definition be "static" to
15446 match the prototype.
15447
15448 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15449
15450 * window.c: Remove declarations of Qwindow_size_fixed,
15451 window_min_size_1, window_min_size_2, window_min_size,
15452 size_window, window_fixed_size_p, enlarge_window, delete_window.
15453 Remove static from declaration of Qdelete_window, it's
15454 temporarily needed by Fbury_buffer.
15455 (replace_window): Don't assign orig_top_line and
15456 orig_total_lines.
15457 (Fdelete_window, delete_window): Remove. Window deletion is
15458 handled by window.el.
15459 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15460 Replace Fdelete_window calls with calls to Qdelete_window.
15461 (Fdelete_other_windows): Remove. Deleting other windows is
15462 handled by window.el.
15463 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15464 handled in window.el.
15465 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15466 Window minimum sizes are handled in window.el.
15467 (shrink_windows, size_window, set_window_height)
15468 (set_window_width, change_window_heights, window_height)
15469 (window_width, CURBEG, CURSIZE, enlarge_window)
15470 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15471 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15472 handled in window.el.
15473 (make_dummy_parent): Rename to make_parent_window and give it a
15474 second argument horflag.
15475 (make_window): Don't set resize_proportionally any more.
15476 (Fsplit_window): Remove. Windows are split in window.el.
15477 (save_restore_action, save_restore_orig_size)
15478 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15479 Resize mini windows in window.el.
15480 (grow_mini_window, shrink_mini_window): Implement by calling
15481 Qresize_root_window_vertically, resize_window_check and
15482 resize_window_apply.
15483 (saved_window, Fset_window_configuration, save_window_save):
15484 Do not handle orig_top_line, orig_total_lines, and
15485 resize_proportionally.
15486 (window_min_height, window_min_width): Move to window.el.
15487 (keys_of_window): Move bindings for delete-other-windows,
15488 split-window, delete-window and enlarge-window to window.el.
15489
15490 * buffer.c: Temporarily extern Qdelete_window.
15491 (Fbury_buffer): Temporarily call Qdelete_window instead of
15492 Fdelete_window (Fbury_buffer will move to window.el soon).
15493
15494 * frame.c (set_menu_bar_lines_1): Remove code handling
15495 orig_top_line and orig_total_lines.
15496
15497 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15498 set_window_height but set heights directly.
15499 (change_frame_size_1): Use resize_frame_windows.
15500
15501 * xdisp.c (init_xdisp): Don't use set_window_height but set
15502 heights directly.
15503
15504 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15505 Use resize_frame_windows instead of change_window_heights and run
15506 run_window_configuration_change_hook.
15507
15508 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15509 instead of change_window_heights and run
15510 run_window_configuration_change_hook.
15511
15512 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15513
15514 * window.c (replace_window): Rename second argument REPLACEMENT to
15515 NEW. New third argument SETFLAG. Rewrite.
15516 (delete_window, make_dummy_parent): Call replace_window with
15517 third argument 1.
15518 (window_list_1): Move down in code.
15519 (run_window_configuration_change_hook): Move set_buffer part
15520 before select_frame_norecord part in order to unwind correctly.
15521 Rename count1 to count.
15522 (recombine_windows, delete_deletable_window, resize_root_window)
15523 (Fdelete_other_windows_internal)
15524 (Frun_window_configuration_change_hook, make_parent_window)
15525 (resize_window_check, resize_window_apply, Fresize_window_apply)
15526 (resize_frame_windows, Fsplit_window_internal)
15527 (Fdelete_window_internal, Fresize_mini_window_internal):
15528 New functions.
15529 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15530
15531 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15532
15533 * window.h (window): Add some new members to window structure -
15534 normal_lines, normal_cols, new_total, new_normal, clone_number,
15535 splits, nest, prev_buffers, next_buffers.
15536 (WINDOW_TOTAL_SIZE): Move here from window.c.
15537 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15538
15539 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15540 Remove.
15541 (make_dummy_parent): Set new members of windows structure.
15542 (make_window): Move down in code. Handle new members of window
15543 structure.
15544 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15545 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15546 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15547 (Fset_window_prev_buffers, Fwindow_next_buffers)
15548 (Fset_window_next_buffers, Fset_window_clone_number):
15549 New functions.
15550 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15551 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15552 Doc-string fixes.
15553 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15554 Argument WINDOW can be now internal window too.
15555 (Fwindow_use_time): Move up in code.
15556 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15557 Rewrite doc-string.
15558 (Fset_window_configuration, saved_window)
15559 (Fcurrent_window_configuration, save_window_save): Handle new
15560 members of window structure.
15561 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15562 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15563 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15564 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15565 Qget_mru_window, Qresize_root_window,
15566 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15567 Qauto_buffer_name; staticpro them.
15568
15569 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15570
15571 * window.c (Fwindow_total_size, Fwindow_left_column)
15572 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15573 (Fwindow_list_1): New functions.
15574 (window_box_text_cols): Replace with window_body_cols.
15575 (Fwindow_width, Fscroll_left, Fscroll_right):
15576 Use window_body_cols instead of window_box_text_cols.
15577 (delete_window, Fset_window_configuration):
15578 Call delete_all_subwindows with window as argument.
15579 (delete_all_subwindows): Take a window as argument and not a
15580 structure. Rewrite.
15581 (window_loop): Remove handling of GET_LRU_WINDOW and
15582 GET_LARGEST_WINDOW.
15583 (Fget_lru_window, Fget_largest_window): Move to window.el.
15584
15585 * window.h: Extern window_body_cols instead of
15586 window_box_text_cols. delete_all_subwindows now takes a
15587 Lisp_Object as argument.
15588
15589 * indent.c (compute_motion, Fcompute_motion):
15590 Use window_body_cols instead of window_box_text_cols.
15591
15592 * frame.c (delete_frame): Call delete_all_subwindows with root
15593 window as argument.
15594
15595 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15596
15597 * fns.c (Fputhash): Document return value.
15598
15599 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15600
15601 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15602
15603 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15604
15605 Cons<->int and similar integer overflow fixes (Bug#8794).
15606
15607 Check for overflow when converting integer to cons and back.
15608 * charset.c (Fdefine_charset_internal, Fdecode_char):
15609 Use cons_to_unsigned to catch overflow.
15610 (Fencode_char): Use INTEGER_TO_CONS.
15611 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15612 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15613 * data.c (long_to_cons, cons_to_long): Remove.
15614 (cons_to_unsigned, cons_to_signed): New functions.
15615 These signal an error for invalid or out-of-range values.
15616 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15617 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15618 * font.c (Ffont_variation_glyphs):
15619 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15620 * lisp.h: Include <intprops.h>.
15621 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15622 (cons_to_signed, cons_to_unsigned): New decls.
15623 (long_to_cons, cons_to_long): Remove decls.
15624 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15625 (Fprimitive_undo): Use CONS_TO_INTEGER.
15626 * xfns.c (Fx_window_property): Likewise.
15627 * xselect.c: Include <limits.h>.
15628 (x_own_selection, selection_data_to_lisp_data):
15629 Use INTEGER_TO_CONS.
15630 (x_handle_selection_request, x_handle_selection_clear)
15631 (x_get_foreign_selection, Fx_disown_selection_internal)
15632 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15633 (lisp_data_to_selection_data): Use cons_to_unsigned.
15634 (x_fill_property_data): Use cons_to_signed.
15635 Report values out of range.
15636
15637 Check for buffer and string overflow more precisely.
15638 * buffer.h (BUF_BYTES_MAX): New macro.
15639 * lisp.h (STRING_BYTES_MAX): New macro.
15640 * alloc.c (Fmake_string):
15641 * character.c (string_escape_byte8):
15642 * coding.c (coding_alloc_by_realloc):
15643 * doprnt.c (doprnt):
15644 * editfns.c (Fformat):
15645 * eval.c (verror):
15646 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15647 since they may not be the same number.
15648 * editfns.c (Finsert_char):
15649 * fileio.c (Finsert_file_contents):
15650 Likewise for BUF_BYTES_MAX.
15651
15652 * image.c: Use ptrdiff_t, not int, for sizes.
15653 (slurp_file): Switch from int to ptrdiff_t.
15654 All uses changed.
15655 (slurp_file): Check that file size fits in both size_t (for
15656 malloc) and ptrdiff_t (for sanity and safety).
15657
15658 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15659 if b->modtime has its maximal value.
15660
15661 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15662
15663 Don't assume time_t can fit into int.
15664 * buffer.h (struct buffer.modtime): Now time_t, not int.
15665 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15666 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15667
15668 Minor fixes for signed vs unsigned integers.
15669 * character.h (MAYBE_UNIFY_CHAR):
15670 * charset.c (maybe_unify_char):
15671 * keyboard.c (read_char, reorder_modifiers):
15672 XINT -> XFASTINT, since the integer must be nonnegative.
15673 * ftfont.c (ftfont_spec_pattern):
15674 * keymap.c (access_keymap, silly_event_symbol_error):
15675 XUINT -> XFASTINT, since the integer must be nonnegative.
15676 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15677 since it makes no difference and we prefer signed.
15678 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15679 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15680 nonnegative.
15681
15682 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15683
15684 * window.h (Fwindow_frame): Declare.
15685
15686 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15687
15688 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15689 (SPARE_MEMORY): Always define.
15690 (LARGE_REQUEST): Remove.
15691 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15692
15693 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15694
15695 * lisp.h: Move EXFUNS for Fframe_root_window,
15696 Fframe_first_window and Fset_frame_selected_window to window.h.
15697
15698 * window.h: Move EXFUNS for Fframe_root_window,
15699 Fframe_first_window and Fset_frame_selected_window here from
15700 lisp.h.
15701
15702 * frame.c (Fwindow_frame, Fframe_first_window)
15703 (Fframe_root_window, Fframe_selected_window)
15704 (Fset_frame_selected_window): Move to window.c.
15705 (Factive_minibuffer_window): Move to minibuf.c.
15706 (Fother_visible_frames_p): New function.
15707
15708 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15709
15710 * window.c (decode_window, decode_any_window): Move up in code.
15711 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15712 (inhibit_frame_unsplittable): Remove unused variable.
15713 (Fwindow_buffer): Move up and rewrite doc-string.
15714 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15715 (Fwindow_prev): New functions.
15716 (Fwindow_frame): Move here from frame.c. Accept any window as
15717 argument.
15718 (Fframe_root_window, Fframe_first_window)
15719 (Fframe_selected_window): Move here from frame.c. Accept frame
15720 or arbitrary window as argument. Update doc-strings.
15721 (Fminibuffer_window): Move up in code.
15722 (Fwindow_minibuffer_p): Move up in code and simplify.
15723 (Fset_frame_selected_window): Move here from frame.c.
15724 Marginal rewrite.
15725 (Fselected_window, select_window, Fselect_window): Move up in
15726 code. Minor doc-string fixes.
15727
15728 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15729
15730 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15731 Do not assume that spare memory exists; that assumption is valid
15732 only if SYSTEM_MALLOC.
15733 (LARGE_REQUEST): New macro, so that the issue of large requests
15734 is separated from the issue of spare memory.
15735
15736 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15737
15738 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15739 format. (Bug#8806)
15740
15741 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15742
15743 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15744 before statements.
15745
15746 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15747
15748 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15749
15750 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15751
15752 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15753 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15754
15755 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15756
15757 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15758
15759 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15760
15761 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15762 (x_clipboard_manager_save): Add return value.
15763 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15764 New error handlers.
15765 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15766 Obey Vx_select_enable_clipboard_manager. Catch errors in
15767 x_clipboard_manager_save (Bug#8779).
15768 (Vx_select_enable_clipboard_manager): New variable.
15769 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15770
15771 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15772
15773 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15774
15775 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15776
15777 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15778 in the current matrix if keep_current_p is non-zero.
15779
15780 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15781
15782 * bidi.c (bidi_level_of_next_char): Fix last change.
15783
15784 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15785
15786 Support bidi reordering of text covered by display properties.
15787
15788 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15789 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15790 (bidi_cache_search, bidi_cache_iterator_state)
15791 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15792 (bidi_level_of_next_char, bidi_move_to_visually_next):
15793 Support character positions inside a run of characters covered by a
15794 display string.
15795 (bidi_paragraph_init, bidi_resolve_explicit_1)
15796 (bidi_level_of_next_char): Call bidi_fetch_char and
15797 bidi_fetch_char_advance instead of FETCH_CHAR and
15798 FETCH_CHAR_ADVANCE.
15799 (bidi_init_it): Initialize new members.
15800 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15801 definitions.
15802 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15803 instead of using explicit *_CHAR codes.
15804 (bidi_resolve_explicit, bidi_resolve_weak):
15805 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15806 bidirectional text is supported only in multibyte buffers.
15807 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15808 it to initialize the frame_window_p member of struct bidi_it.
15809 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15810 (bidi_resolve_explicit, bidi_resolve_weak)
15811 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15812 bidi_it->nchars is non-positive.
15813 (bidi_level_of_next_char): Don't try to lookup the cache for the
15814 next/previous character if nothing is cached there yet, or if we
15815 were just reseat()'ed to a new position.
15816
15817 * xdisp.c (set_cursor_from_row): Set start and stop points
15818 according to the row's direction when priming the loop that looks
15819 for the glyph on which to display cursor.
15820 (single_display_spec_intangible_p): Function deleted.
15821 (display_prop_intangible_p): Reimplement to call
15822 handle_display_spec instead of single_display_spec_intangible_p.
15823 Accept 3 additional arguments needed by handle_display_spec.
15824 This fixes incorrect cursor motion across display property with complex
15825 values: lists, `(when COND...)' forms, etc.
15826 (single_display_spec_string_p): Support property values that are
15827 lists with the argument STRING its top-level element.
15828 (display_prop_string_p): Fix the condition for processing a
15829 property that is a list to be consistent with handle_display_spec.
15830 (handle_display_spec): New function, refactored from the
15831 last portion of handle_display_prop.
15832 (compute_display_string_pos): Accept additional argument
15833 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15834 value of a `display' property is a "replacing spec".
15835 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15836 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15837 the display property, but just return a value indicating whether
15838 the display property will replace the characters it covers.
15839 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15840 frame_window_p members of struct bidi_it.
15841 (compute_display_string_pos, compute_display_string_end):
15842 New functions.
15843 (push_it): Accept second argument POSITION, where pop_it should
15844 jump to continue iteration.
15845 (reseat_1): Initialize bidi_it.disp_pos.
15846
15847 * keyboard.c (adjust_point_for_property): Adjust the call to
15848 display_prop_intangible_p to its new signature.
15849
15850 * dispextern.h (struct bidi_it): New member frame_window_p.
15851 (bidi_init_it): Update prototypes.
15852 (display_prop_intangible_p): Update prototype.
15853 (compute_display_string_pos, compute_display_string_end):
15854 Declare prototypes.
15855 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15856 EMACS_INT.
15857
15858 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15859
15860 Malloc failure behavior now depends on size of allocation.
15861 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15862 * lisp.h: Change signatures accordingly.
15863 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15864 All callers changed. (Bug#8762)
15865
15866 * gnutls.c: Use Emacs's memory allocators.
15867 Without this change, the gnutls library would invoke malloc etc.
15868 directly, which causes problems on non-SYNC_INPUT hosts, and which
15869 runs afoul of improving memory_full behavior. (Bug#8761)
15870 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15871 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15872 xfree instead of the default malloc, realloc, free.
15873 (Fgnutls_boot): No need to check for memory allocation failure,
15874 since xmalloc does that for us.
15875
15876 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15877 * category.c (hash_get_category_set):
15878 * ccl.c (ccl_driver):
15879 * charset.c (Fdefine_charset_internal):
15880 * charset.h (struct charset.hash_index):
15881 * composite.c (get_composition_id, gstring_lookup_cache)
15882 (composition_gstring_put_cache):
15883 * composite.h (struct composition.hash_index):
15884 * dispextern.h (struct image.hash):
15885 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15886 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15887 (hashfn_equal, hashfn_user_defined, make_hash_table)
15888 (maybe_resize_hash_table, hash_lookup, hash_put)
15889 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15890 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15891 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15892 * image.c (make_image, search_image_cache, lookup_image)
15893 (xpm_put_color_table_h):
15894 * lisp.h (struct Lisp_Hash_Table):
15895 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15896 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15897 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15898 * alloc.c (allocate_vectorlike):
15899 Check for overflow in vector size calculations.
15900 * ccl.c (ccl_driver):
15901 Check for overflow when converting EMACS_INT to int.
15902 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15903 need to be updated by these changes.
15904 * fns.c (make_hash_table, maybe_resize_hash_table):
15905 Check for integer overflow with large hash tables.
15906 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15907 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15908 (SXHASH_REDUCE): New macro.
15909 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15910 Use it instead of discarding useful hash info with large hash values.
15911 (sxhash_float): New function.
15912 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15913 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15914 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15915 Rewrite to use FIXNUM_BITS, as this simplifies things.
15916 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15917 Adjust signatures to match updated version of code.
15918 (consing_since_gc): Now EMACS_INT, since a single hash table can
15919 use more than INT_MAX bytes.
15920
15921 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15922
15923 Make it possible to build with GCC-4.6+ -O2 -flto.
15924
15925 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15926
15927 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15928
15929 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15930 Call minibuffer-inactive-mode.
15931
15932 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15933
15934 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15935 Update dependencies.
15936
15937 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15938
15939 * data.c (init_data): Remove code for UTS, this system is not
15940 supported anymore.
15941
15942 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15943
15944 Don't force ./temacs to start in terminal mode.
15945
15946 * frame.c (make_initial_frame): Initialize faces in all cases, not
15947 only when CANNOT_DUMP is defined.
15948 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15949
15950 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15951
15952 * dispnew.c (add_window_display_history): Use const for the string
15953 pointer. Remove declaration, not needed.
15954
15955 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15956
15957 Use 'inline', not 'INLINE'.
15958 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15959 * alloc.c, fontset.c (INLINE): Remove.
15960 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15961 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15962 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15963 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15964 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15965
15966 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15967
15968 Make it possible to run ./temacs.
15969
15970 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15971 syms_of_callproc does the same thing. Remove test for
15972 "initialized", do it in the caller.
15973 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15974
15975 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15976
15977 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15978 (read_minibuf): Use get_minibuffer.
15979 (syms_of_minibuf): Use DEFSYM.
15980 (Qmetadata): New var.
15981 * data.c (Qbuffer): Don't make it static.
15982 (syms_of_data): Use DEFSYM.
15983
15984 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15985
15986 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15987 (CCL_CODE_MIN): New macro.
15988
15989 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15990
15991 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15992
15993 * eval.c (Qdebug): Now static.
15994 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15995 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15996 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15997
15998 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15999
16000 * image.c: Various fixes to ImageMagick code comments.
16001 (Fimagemagick_types): Doc fix.
16002
16003 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16004
16005 Minor fixes prompted by GCC 4.6.0 warnings.
16006
16007 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16008
16009 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16010 (x_clipboard_manager_save_all): Move extern decl to ...
16011 * xterm.h: ... here, so that it can be checked for consistency.
16012
16013 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16014
16015 * xselect.c (x_clipboard_manager_save_frame)
16016 (x_clipboard_manager_save_all): New functions.
16017 (Fx_clipboard_manager_save): Lisp function deleted.
16018
16019 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16020 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16021
16022 * xterm.h: Update prototype.
16023
16024 2011-05-28 William Xu <william.xwl@gmail.com>
16025
16026 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16027 exiting (Bug#8239).
16028
16029 2011-05-28 Jim Meyering <meyering@redhat.com>
16030
16031 Avoid a sign-extension bug in crypto_hash_function.
16032 * fns.c (to_uchar): Define.
16033 (crypto_hash_function): Use it to convert some newly-signed
16034 variables to unsigned, to avoid sign-extension bugs. For example,
16035 without this change, (md5 "truc") would evaluate to
16036 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16037 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16038 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16039
16040 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16041
16042 Integer overflow fixes.
16043
16044 * dbusbind.c: Serial number integer overflow fixes.
16045 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16046 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16047 to hold a serial number that is too large for a fixnum.
16048 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16049 Check for serial numbers out of range. Decode any serial number
16050 that was so large that it became a float. (Bug#8722)
16051
16052 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16053 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16054 Use XFASTINT rather than XUINT when numbers are nonnegative.
16055 (xd_append_arg, Fdbus_method_return_internal):
16056 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16057 arguments, check that Lisp number is nonnegative, rather than
16058 silently wrapping negative numbers around. (Bug#8722)
16059 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16060 (Bug#8722)
16061
16062 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16063
16064 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16065
16066 ccl: Add integer overflow checks.
16067 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16068 (IN_INT_RANGE): New macros.
16069 (ccl_driver): Use them to check for integer overflow when
16070 decoding a CCL program. Many of the new checks are whether XINT (x)
16071 fits in int; it doesn't always, on 64-bit hosts. The new version
16072 doesn't catch all possible integer overflows, but it's an
16073 improvement. (Bug#8719)
16074
16075 * alloc.c (make_event_array): Use XINT, not XUINT.
16076 There's no need for unsigned here.
16077
16078 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16079 This follows up to the 2011-05-06 change that substituted uintptr_t
16080 for EMACS_INT. This case wasn't caught back then.
16081
16082 Rework Fformat to avoid integer overflow issues.
16083 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16084 now (part of C89). Include <verify.h>.
16085 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16086 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16087 (Fformat): Avoid the prepass trying to compute sizes; it was only
16088 approximate and thus did not catch overflow reliably. Instead, walk
16089 through the format just once, formatting and computing sizes as we go,
16090 checking for integer overflow at every step, and allocating a larger
16091 buffer as needed. Keep track separately whether the format is
16092 multibyte. Keep only the most-recently calculated precision, rather
16093 than them all. Record whether each argument has been converted to
16094 string. Use EMACS_INT, not int, for byte and char and arg counts.
16095 Support field widths and precisions larger than INT_MAX. Avoid
16096 sprintf's undefined behavior with conversion specifications such as %#d
16097 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16098 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16099 formatting out-of-range floating point numbers with int
16100 formats. (Bug#8668)
16101
16102 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16103
16104 * data.c: Avoid integer truncation in expressions involving floats.
16105 * data.c: Include <intprops.h>.
16106 (arith_driver): When there's an integer overflow in an expression
16107 involving floating point, convert the integers to floating point
16108 so that the resulting value does not suffer from catastrophic
16109 integer truncation. For example, on a 64-bit host (* 4
16110 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16111 Do not rely on undefined behavior after integer overflow.
16112
16113 merge count_size_as_multibyte, parse_str_to_multibyte
16114 * character.c, character.h (count_size_as_multibyte):
16115 Rename from parse_str_to_multibyte; all uses changed.
16116 Check for integer overflow.
16117 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16118 since it's now a duplicate of the other. This is more of
16119 a character than a buffer op, so better that it's in character.c.
16120 * fns.c, print.c: Adjust to above changes.
16121
16122 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16123
16124 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16125
16126 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16127
16128 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16129 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16130 (x_clipboard_manager_save): Now static.
16131 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16132
16133 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16134 (crypto_hash_function): Now static.
16135 Fix pointer signedness problems. Avoid unnecessary initializations.
16136
16137 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16138
16139 * termhooks.h (Vselection_alist): Make it terminal-local.
16140
16141 * terminal.c (create_terminal): Initialize it.
16142
16143 * xselect.c: Support for clipboard managers.
16144 (Vselection_alist): Move to termhooks.h as terminal-local var.
16145 (LOCAL_SELECTION): New macro.
16146 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16147 (symbol_to_x_atom): Remove gratuitous arg.
16148 (x_handle_selection_request, lisp_data_to_selection_data)
16149 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16150 (x_own_selection, x_get_local_selection, x_convert_selection):
16151 New arg, specifying work frame. Use terminal-local Vselection_alist.
16152 (some_frame_on_display): Delete unused function.
16153 (Fx_own_selection_internal, Fx_get_selection_internal)
16154 (Fx_disown_selection_internal, Fx_selection_owner_p)
16155 (Fx_selection_exists_p): New optional frame arg.
16156 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16157 (x_handle_selection_clear): Don't treat other terminals with the
16158 same keyboard specially. Use the terminal-local Vselection_alist.
16159 (x_clear_frame_selections): Use Frun_hook_with_args.
16160
16161 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16162
16163 * xterm.h: Add support for those atoms.
16164
16165 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16166
16167 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16168 (converted_selections, conversion_fail_tag): New global variables.
16169 (x_selection_request_lisp_error): Free the above.
16170 (x_get_local_selection): Remove unnecessary code.
16171 (x_reply_selection_request): Args changed; handle arbitrary array
16172 of converted selections stored in converted_selections.
16173 Separate the XChangeProperty and SelectionNotify steps.
16174 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16175 (x_convert_selection): New function.
16176 (x_handle_selection_event): Simplify.
16177 (x_get_foreign_selection): Don't ignore incoming requests while
16178 waiting for an answer; this will fail when we implement
16179 SAVE_TARGETS, and seems unnecessary anyway.
16180 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16181 (Vx_sent_selection_functions): Doc fix.
16182
16183 2011-05-26 Leo Liu <sdl.web@gmail.com>
16184
16185 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16186
16187 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16188
16189 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16190
16191 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16192 for fringe update if it has periodic bitmap.
16193 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16194 and fringe_bitmap_periodic_p.
16195
16196 * fringe.c (get_fringe_bitmap_data): New function.
16197 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16198 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16199 row. Mark glyph row for fringe update if periodicity changed.
16200
16201 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16202 for fringe update unless it has periodic bitmap.
16203
16204 2011-05-25 Kenichi Handa <handa@m17n.org>
16205
16206 * xdisp.c (get_next_display_element): Set correct it->face_id for
16207 a static composition.
16208
16209 2011-05-24 Leo Liu <sdl.web@gmail.com>
16210
16211 * deps.mk (fns.o):
16212 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16213
16214 * fns.c (crypto_hash_function, Fsha1): New function.
16215 (Fmd5): Use crypto_hash_function.
16216 (syms_of_fns): Add Ssha1.
16217
16218 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16219
16220 * gnutls.c: Remove unused macros.
16221 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16222 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16223 Remove macros that are defined and never used.
16224 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16225
16226 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16227
16228 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16229 (Fx_get_selection_internal): Minor cleanup.
16230 (Fx_own_selection_internal): Rename arguments for consistency with
16231 select.el.
16232
16233 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16234
16235 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16236
16237 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16238
16239 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16240
16241 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16242
16243 * dispnew.c (scrolling_window): Don't exclude the case that the
16244 last enabled row in the desired matrix touches the bottom boundary.
16245
16246 2011-05-21 Glenn Morris <rgm@gnu.org>
16247
16248 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16249 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16250 and add some more files.
16251
16252 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16253
16254 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16255 report_file_error introduced by the change from 2011-05-07.
16256
16257 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16258
16259 * systime.h (Time): Define only if emacs is defined.
16260 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16261 where the include path doesn't have X11/X.h by default. See
16262 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16263
16264 2011-05-20 Kenichi Handa <handa@m17n.org>
16265
16266 * composite.c (find_automatic_composition): Fix previous change.
16267
16268 2011-05-20 Glenn Morris <rgm@gnu.org>
16269
16270 * lisp.mk: New file, split from Makefile.in.
16271 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16272 (shortlisp): Remove.
16273 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16274
16275 2011-05-19 Glenn Morris <rgm@gnu.org>
16276
16277 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16278 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16279 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16280 (lisp): Set the order to that of loadup.el.
16281 (shortlisp): Make it a copy of $lisp.
16282 (SOME_MACHINE_LISP): Remove.
16283 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16284 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16285
16286 2011-05-18 Kenichi Handa <handa@m17n.org>
16287
16288 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16289 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16290 (find_automatic_composition): Mostly rewrite for efficiency.
16291
16292 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16293
16294 * makefile.w32-in: Update dependencies.
16295
16296 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16297
16298 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16299 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16300
16301 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16302
16303 Fix some integer overflow issues, such as string length overflow.
16304
16305 * insdel.c (count_size_as_multibyte): Check for string overflow.
16306
16307 * character.c (lisp_string_width): Check for string overflow.
16308 Use EMACS_INT, not int, for string indexes and lengths; in
16309 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16310 the resulting string length overflows an EMACS_INT; instead,
16311 report a string overflow if no precision given. When checking for
16312 precision exhaustion, use a check that cannot possibly have
16313 integer overflow. (Bug#8675)
16314 * character.h (lisp_string_width): Adjust to new signature.
16315
16316 * alloc.c (string_overflow): New function.
16317 (Fmake_string): Use it. This doesn't change behavior, but saves
16318 a few bytes and will simplify future changes.
16319 * character.c (string_escape_byte8): Likewise.
16320 * lisp.h (string_overflow): New decl.
16321
16322 Fixups, following up to the user-interface timestamp change.
16323 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16324 for UI timestamps, instead of unsigned long.
16325 * msdos.c (mouse_get_pos): Likewise.
16326 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16327 * w32gui.h (Time): Define by including "systime.h" rather than by
16328 declaring it ourselves. (Bug#8664)
16329
16330 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16331 * image.c (clear_image_cache): Likewise.
16332
16333 * term.c (term_mouse_position): Don't assume time_t wraparound.
16334
16335 Be more systematic about user-interface timestamps.
16336 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16337 and sometimes 'EMACS_UINT', to represent these timestamps.
16338 This change causes it to use 'Time' uniformly, as that's what X uses.
16339 This makes the code easier to follow, and makes it easier to catch
16340 integer overflow bugs such as Bug#8664.
16341 * frame.c (Fmouse_position, Fmouse_pixel_position):
16342 Use Time, not unsigned long, for user-interface timestamps.
16343 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16344 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16345 * keyboard.h (last_event_timestamp): Likewise.
16346 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16347 * menu.h (xmenu_show): Likewise.
16348 * term.c (term_mouse_position): Likewise.
16349 * termhooks.h (struct input_event.timestamp): Likewise.
16350 (struct terminal.mouse_position_hook): Likewise.
16351 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16352 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16353 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16354 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16355 what it was before.
16356 * menu.h, termhooks.h: Include "systime.h", for Time.
16357
16358 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16359 Don't assume that the difference between two unsigned long values
16360 can fit into an integer. At this point, we know button_down_time
16361 <= event->timestamp, so the difference must be nonnegative, so
16362 there's no need to cast the result if double-click-time is
16363 nonnegative, as it should be; check that it's nonnegative, just in
16364 case. This bug is triggered when events are more than 2**31 ms
16365 apart (about 25 days). (Bug#8664)
16366
16367 * xselect.c (last_event_timestamp): Remove duplicate decl.
16368 (x_own_selection): Remove needless cast to unsigned long.
16369
16370 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16371 that always fit in int. Use a sentinel instead of a counter, to
16372 avoid a temp and to allay GCC's concerns about possible int overflow.
16373 * frame.h (struct frame): Use int for menu_bar_items_used
16374 instead of EMACS_INT, since it always fits in int.
16375
16376 * menu.c (grow_menu_items): Check for int overflow.
16377
16378 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16379
16380 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16381 Before, the code was not consistent. These values cannot exceed
16382 2**31 - 1 so there's no need to make them unsigned.
16383 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16384 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16385 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16386 as modifiers.
16387 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16388
16389 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16390 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16391 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16392 presumably because the widths might not match.
16393
16394 * window.c (size_window): Avoid needless test at loop start.
16395
16396 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16397
16398 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16399
16400 2011-05-12 Drew Adams <drew.adams@oracle.com>
16401
16402 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16403
16404 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16405
16406 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16407 `width' to `bar_area_x' and `bar_area_width', respectively.
16408 (x_scroll_run): Take account of fringe background extension.
16409
16410 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16411 Rename local vars `left' and `width' to `bar_area_x' and
16412 `bar_area_width', respectively.
16413 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16414 background extension.
16415
16416 2011-05-10 Jim Meyering <meyering@redhat.com>
16417
16418 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16419
16420 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16421
16422 * image.c (Finit_image_library): Return t for built-in image types,
16423 like pbm and xbm. (Bug#8640)
16424
16425 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16426
16427 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16428
16429 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16430
16431 * w32console.c (Fset_screen_color): Doc fix.
16432 (Fget_screen_color): New function.
16433 (syms_of_ntterm): Defsubr it.
16434
16435 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16436 unlink the temporary file if Fcall_process didn't create it in the
16437 first place.
16438 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16439 child process will be redirected to a file specified with `:file'.
16440 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16441 cue to call_process_cleanup not to close that handle.
16442
16443 2011-05-07 Ben Key <bkey76@gmail.com>
16444
16445 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16446 one of two shell specific rules, either bootstrap-temacs-CMD or
16447 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16448 to the previous implementation of the bootstrap-temacs rule.
16449 The bootstrap-temacs-CMD rule is similar to the previous
16450 implementation of the bootstrap-temacs rule except that it
16451 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16452 variable.
16453
16454 These changes, along with some changes to nt/configure.bat,
16455 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16456 earlier fix to add support for --cflags and --ldflags options
16457 that include quotes so that it works whether make uses cmd or
16458 sh as the shell.
16459
16460 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16461
16462 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16463 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16464 is a constant.
16465 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16466 a string. Handle both cases.
16467 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16468 (Fdbus_register_method): Use Qinvalid_function.
16469
16470 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16471
16472 * makefile.w32-in: Update dependencies.
16473 (LISP_H): Add inttypes.h and stdin.h.
16474 (PROCESS_H): Add unistd.h.
16475
16476 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16477
16478 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16479 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16480
16481 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16482
16483 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16484
16485 * term.c (vfatal): Remove stray call to va_end.
16486 It's not needed and the C Standard doesn't allow it here anyway.
16487
16488 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16489 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16490
16491 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16492 bytes.
16493
16494 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16495
16496 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16497
16498 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16499
16500 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16501
16502 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16503
16504 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16505 * charset.c (Fdefine_charset_internal): Don't initialize
16506 charset.code_space[15]. The value was garbage, on hosts with
16507 32-bit int (Bug#8600).
16508
16509 * lread.c (read_integer): Be more consistent with string-to-number.
16510 Use string_to_number to do the actual conversion; this avoids
16511 rounding errors and fixes some other screwups. Without this fix,
16512 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16513 (digit_to_number): Move earlier, for benefit of read_integer.
16514 Return -1 if the digit is out of range for the base, -2 if it is
16515 not a digit in any supported base. (Bug#8602)
16516
16517 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16518
16519 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16520 to match comment at start of function. This also removes a
16521 GCC warning about overflow in a 32+64-bit port.
16522
16523 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16524
16525 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16526 Reported by Stefan Monnier in
16527 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16528 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16529 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16530
16531 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16532 (EMACS_UINTPTR): Likewise, with uintptr_t.
16533
16534 * lisp.h: Prefer 64-bit EMACS_INT if available.
16535 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16536 on 32-bit hosts that have 64-bit int, so that they can access
16537 large files.
16538 However, temporarily disable this change unless the temporary
16539 symbol WIDE_EMACS_INT is defined.
16540
16541 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16542
16543 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16544 This removes an assumption that EMACS_INT and long are the same
16545 width as pointers. The assumption is true for Emacs porting targets
16546 now, but we want to make other targets possible.
16547 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16548 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16549 In the rest of the code, change types of integers that hold casted
16550 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16551 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16552 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16553 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16554 No need to cast type when ORing.
16555 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16556 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16557 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16558 assume EMACS_INT is the same width as char *.
16559 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16560 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16561 Remove no-longer-needed casts.
16562 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16563 (xg_tool_bar_help_callback, xg_make_tool_item):
16564 Use EMACS_INTPTR to hold an integer
16565 that will be cast to void *; this can avoid a GCC warning
16566 if EMACS_INT is not the same width as void *.
16567 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16568 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16569 (current_message_1, set_message_1):
16570 Use a local to convert to proper width without a cast.
16571 * xmenu.c (dialog_selection_callback): Likewise.
16572
16573 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16574 Also, don't assume VALBITS / RAND_BITS is less than 5,
16575 and don't rely on undefined behavior when shifting a 1 left into
16576 the sign bit.
16577 * lisp.h (get_random): Change signature to match.
16578
16579 * lread.c (hash_string): Use size_t, not int, for hash computation.
16580 Normally we prefer signed values; but hashing is special, because
16581 it's better to use unsigned division on hash table sizes so that
16582 the remainder is nonnegative. Also, size_t is the natural width
16583 for hashing into memory. The previous code used 'int', which doesn't
16584 retain enough info to hash well into very large tables.
16585 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16586
16587 * dbusbind.c: Don't possibly lose pointer info when converting.
16588 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16589 Use XPNTR rather than XHASH, so that the high-order bits of
16590 the pointer aren't lost when converting through void *.
16591
16592 * eval.c (Fautoload): Don't double-shift a pointer.
16593
16594 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16595
16596 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16597
16598 * gnutls.c (DEF_GNUTLS_FN):
16599 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16600
16601 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16602
16603 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16604 marker. (Bug#8610)
16605
16606 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16607
16608 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16609 New version that can reserve upto 2GB of heap space.
16610
16611 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16612
16613 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16614
16615 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16616
16617 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16618 `gnutls_certificate_set_x509_key_file'.
16619
16620 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16621
16622 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16623 Update dependencies.
16624
16625 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16626
16627 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16628 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16629 Remove unused parameter `fildes'.
16630 * process.c (read_process_output, send_process): Don't pass it.
16631
16632 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16633
16634 Fix previous change: the library cache is defined in w32.c.
16635 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16636 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16637
16638 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16639
16640 Implement dynamic loading of GnuTLS on Windows.
16641
16642 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16643 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16644 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16645 Declare.
16646
16647 * gnutls.c (Qgnutls_dll): Define.
16648 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16649 (gnutls_*): Declare function pointers.
16650 (init_gnutls_functions): New function to initialize function pointers.
16651 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16652 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16653 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16654 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16655 (emacs_gnutls_write, emacs_gnutls_read)
16656 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16657 (Fgnutls_available_p): New function.
16658 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16659 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16660 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16661
16662 * image.c: Include w32.h.
16663 (Vimage_type_cache): Delete.
16664 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16665 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16666 (w32_delayed_load): Move to w32.c.
16667
16668 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16669
16670 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16671 (w32_delayed_load): Move from image.c. When loading a library, record
16672 its filename in the :loaded-from property of the library id.
16673 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16674 Initialize and staticpro them.
16675 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16676
16677 * process.c: Include lisp.h before w32.h, not after.
16678 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16679 instead of gnutls_record_check_pending.
16680
16681 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16682
16683 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16684
16685 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16686 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16687 as passed in.
16688
16689 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16690
16691 * xterm.c (x_set_frame_alpha): Do not set property on anything
16692 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16693
16694 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16695
16696 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16697
16698 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16699
16700 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16701 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16702 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16703 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16704 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16705 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16706 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16707 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16708 (Qgnutls_bootprop_callbacks_verify): Make static.
16709
16710 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16711
16712 * callproc.c: Indentation fixup.
16713
16714 * sysdep.c (wait_for_termination_1): Make static.
16715 (wait_for_termination, interruptible_wait_for_termination):
16716 Move after wait_for_termination_1.
16717
16718 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16719
16720 * sysdep.c (interruptible_wait_for_termination): New function
16721 which is like wait_for_termination, but allows keyboard
16722 interruptions.
16723
16724 * callproc.c (Fcall_process): Add (:file "file") as an option for
16725 the STDOUT buffer.
16726 (Fcall_process_region): Ditto.
16727
16728 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16729
16730 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16731 rather than `XVECTOR (FOO)->size'.
16732
16733 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16734 inttypes.h, as a gnulib replacement is used if it not available in
16735 system headers.
16736
16737 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16738
16739 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16740 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16741 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16742
16743 * coding.c (coding_alloc_by_realloc): Error out if destination
16744 will grow beyond MOST_POSITIVE_FIXNUM.
16745 (decode_coding_emacs_mule): Abort if there isn't enough place in
16746 charbuf for the composition carryover bytes. Reserve an extra
16747 space for up to 2 characters produced in a loop.
16748 (decode_coding_iso_2022): Abort if there isn't enough place in
16749 charbuf for the composition carryover bytes.
16750
16751 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16752
16753 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16754 aborting when %lld or %lll format is passed.
16755 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16756 %llo or %llx format is passed. (Bug#8545)
16757
16758 * window.c (window_scroll_line_based): Use a marker instead of
16759 simple variables to record original value of point. (Bug#7952)
16760
16761 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16762 produced by %s or %c overflows available buffer space. (Bug#8545)
16763
16764 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16765
16766 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16767 (SIZE_MAX): Move defn after all includes, as they might #define it.
16768
16769 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16770
16771 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16772
16773 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16774
16775 * keyboard.c (Qdelayed_warnings_hook): Define.
16776 (command_loop_1): Run `delayed-warnings-hook'
16777 if Vdelayed_warnings_list is non-nil.
16778 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16779 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16780
16781 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16782
16783 * doprnt.c (doprnt): Don't return value smaller than the buffer
16784 size if the message was truncated. (Bug#8545).
16785
16786 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16787
16788 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16789 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16790
16791 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16792
16793 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16794
16795 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16796
16797 * makefile.w32-in: Update dependencies.
16798
16799 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16800
16801 Improve `doprnt' and its usage. (Bug#8545)
16802 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16803 `format_end'. Remove support for %l as a conversion specifier.
16804 Don't use xrealloc. Improve diagnostics when the %l size modifier
16805 is used. Update the commentary.
16806
16807 * eval.c (verror): Simplify calculation of size_t.
16808
16809 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16810 messages.
16811
16812 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16813
16814 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16815 change.
16816
16817 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16818
16819 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16820 This makes this file independent of the recent pseudovector change.
16821
16822 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16823
16824 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16825
16826 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16827 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16828 Remove unused local.
16829 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16830
16831 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16832 GCC 4.6.0 optimizes based on type-based alias analysis.
16833 For example, if b is of type struct buffer * and v of type struct
16834 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16835 != &v->size, and therefore "v->size = 1; b->size = 2; return
16836 v->size;" must therefore return 1. This assumption is incorrect
16837 for Emacs, since it type-puns struct Lisp_Vector * with many other
16838 types. To fix this problem, this patch adds a new type struct
16839 vectorlike_header that documents the constraints on layout of vectors
16840 and pseudovectors, and helps optimizing compilers not get fooled
16841 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16842 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16843 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16844 the size member.
16845 (XSETPVECTYPE): Rewrite in terms of new macro.
16846 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16847 This is a bit clearer, and further avoids the possibility of
16848 undesirable aliasing.
16849 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16850 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16851 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16852 since Lisp_Subr is a special case (no "next" field).
16853 (ASIZE): Now uses header.size rather than size.
16854 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16855 to avoid the hassle of writing XVECTOR (foo)->header.size.
16856 (struct vectorlike_header): New type.
16857 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16858 object, to help avoid aliasing.
16859 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16860 (SUBRP): Likewise, since Lisp_Subr is a special case.
16861 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16862 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16863 (struct Lisp_Hash_Table): Combine first two members into a single
16864 struct vectorlike_header member. All uses of "size" and "next" members
16865 changed to be "header.size" and "header.next".
16866 * buffer.h (struct buffer): Likewise.
16867 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16868 * frame.h (struct frame): Likewise.
16869 * process.h (struct Lisp_Process): Likewise.
16870 * termhooks.h (struct terminal): Likewise.
16871 * window.c (struct save_window_data, struct saved_window): Likewise.
16872 * window.h (struct window): Likewise.
16873 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16874 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16875 * buffer.c (init_buffer_once): Likewise.
16876 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16877 special case.
16878 * process.c (Fformat_network_address): Use local var for size,
16879 for brevity.
16880
16881 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16882
16883 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16884 * data.c (atof): Remove decl; no longer used or needed.
16885 (digit_to_number): Move to lread.c.
16886 (Fstring_to_number): Use new string_to_number function, to be
16887 consistent with how the Lisp reader treats infinities and NaNs.
16888 Do not assume that floating-point numbers represent EMACS_INT
16889 without losing information; this is not true on most 64-bit hosts.
16890 Avoid double-rounding errors, by insisting on integers when
16891 parsing non-base-10 numbers, as the documentation specifies.
16892 * lisp.h (string_to_number): New decl, replacing ...
16893 (isfloat_string): Remove.
16894 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16895 (read1): Do not accept +. and -. as integers; this
16896 appears to have been a coding error. Similarly, do not accept
16897 strings like +-1e0 as floating point numbers. Do not report
16898 overflow for integer overflows unless the base is not 10 which
16899 means we have no simple and reliable way to continue.
16900 Break out the floating-point parsing into a new
16901 function string_to_number, so that Fstring_to_number parses
16902 floating point numbers consistently with the Lisp reader.
16903 (digit_to_number): Move here from data.c. Make it static inline.
16904 (E_CHAR, EXP_INT): Remove, replacing with ...
16905 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16906 (string_to_number): New function, replacing isfloat_string.
16907 This function checks for valid syntax and produces the resulting
16908 Lisp float number too. Rework it so that string-to-number
16909 no longer mishandles examples like "1.0e+". Use strtoumax,
16910 so that overflow for non-base-10 numbers is reported only when
16911 there's no portable and simple way to convert to floating point.
16912
16913 * textprop.c (set_text_properties_1): Rewrite for clarity,
16914 and to avoid GCC warning about integer overflow.
16915
16916 * intervals.h (struct interval): Use EMACS_INT for members
16917 where EMACS_UINT might cause problems. See
16918 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16919 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16920 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16921 All uses changed.
16922 (offset_intervals): Tell GCC not to worry about length overflow
16923 when negating a negative length.
16924
16925 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16926 (overrun_check_free): Likewise.
16927
16928 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16929 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16930 word size.
16931
16932 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16933 (gnutls_make_error): Rename local to avoid shadowing.
16934 (gnutls_emacs_global_deinit): ifdef out; not used.
16935 (Fgnutls_boot): Use const for pointer to readonly storage.
16936 Comment out unused local. Fix pointer signedness problems.
16937
16938 * lread.c (openp): Don't stuff size_t into an 'int'.
16939 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16940 about possible signed overflow.
16941
16942 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16943 (GDK_KEY_g): Don't define if already defined.
16944 (xg_prepare_tooltip): Avoid pointer signedness problem.
16945 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16946
16947 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16948 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16949
16950 * xfns.c (Fx_window_property): Simplify a bit,
16951 to make a bit faster and to avoid GCC 4.6.0 warning.
16952 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16953
16954 * fns.c (internal_equal): Don't assume size_t fits in int.
16955
16956 * alloc.c (compact_small_strings): Tighten assertion a little.
16957
16958 Replace pEd with more-general pI, and fix some printf arg casts.
16959 * lisp.h (pI): New macro, generalizing old pEd macro to other
16960 conversion specifiers. For example, use "...%"pI"d..." rather
16961 than "...%"pEd"...".
16962 (pEd): Remove. All uses replaced with similar uses of pI.
16963 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16964 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16965 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16966 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16967 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16968 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16969 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16970 64-bit hosts.
16971 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16972 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16973 * print.c (safe_debug_print, print_object): Likewise.
16974 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16975 to int.
16976 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16977 avoiding the 0 flag, which is not portable.
16978 * process.c (Fmake_network_process): Use pI to avoid cast.
16979 * region-cache.c (pp_cache): Likewise.
16980 * xdisp.c (decode_mode_spec): Likewise.
16981 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16982 behavior on 64-bit hosts with printf arg.
16983 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16984 (x_stop_queuing_selection_requests): Likewise.
16985 (x_get_window_property): Don't truncate byte count to an 'int'
16986 when tracing.
16987
16988 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16989 here, since it parses constructs like leading '-' and spaces,
16990 which are not wanted; and it overflows with large numbers.
16991 Instead, simply match F[0-9]+, which is what is wanted anyway.
16992
16993 * alloc.c: Remove unportable assumptions about struct layout.
16994 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16995 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16996 (allocate_vectorlike, make_pure_vector): Use the new macros,
16997 plus offsetof, to remove unportable assumptions about struct layout.
16998 These assumptions hold on all porting targets that I know of, but
16999 they are not guaranteed, they're easy to remove, and removing them
17000 makes further changes easier.
17001
17002 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17003 This doesn't fix a bug but makes the code clearer.
17004 (string_overrun_cookie): Now const. Use initializers that
17005 don't formally overflow signed char, to avoid warnings.
17006 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17007 can cause Emacs to crash when string overrun checking is enabled.
17008 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17009 multiple of sizeof (EMACS_INT); it need not be, if
17010 alignof(EMACS_INT) < sizeof (EMACS_INT).
17011 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17012
17013 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17014
17015 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17016
17017 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17018
17019 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17020 supposed to be handshaking. (Bug#8556)
17021 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17022
17023 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17024
17025 * lisp.h (Qdebug): List symbol.
17026 * eval.c (Qdebug): Restore global linkage.
17027 * keyboard.c (debug-on-event): New variable.
17028 (handle_user_signal): Break into debugger when debug-on-event
17029 matches the current signal symbol.
17030
17031 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17032
17033 * alloc.c (check_sblock, check_string_bytes)
17034 (check_string_free_list): Convert to standard C.
17035
17036 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17037
17038 * w32.c (emacs_gnutls_push): Fix typo.
17039
17040 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17041
17042 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17043 "cast to pointer from integer of different size".
17044
17045 Improve doprnt and its use in verror. (Bug#8545)
17046 * doprnt.c (doprnt): Document the set of format control sequences
17047 supported by the function. Use SAFE_ALLOCA instead of always
17048 using `alloca'.
17049
17050 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17051 is one byte too soon. Don't use xrealloc; instead xfree and
17052 xmalloc anew.
17053
17054 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17055
17056 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17057 callbacks stage.
17058
17059 * gnutls.c: Renamed global_initialized to
17060 gnutls_global_initialized. Added internals for the
17061 :verify-hostname-error, :verify-error, and :verify-flags
17062 parameters of `gnutls-boot' and documented those parameters in the
17063 docstring. Start callback support.
17064 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17065 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17066 on error. Return error code.
17067 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17068 (emacs_gnutls_read): Likewise.
17069 (Fgnutls_boot): Return handshake error code.
17070 (emacs_gnutls_handle_error): New function.
17071 (wsaerror_to_errno): Likewise.
17072
17073 * w32.h (emacs_gnutls_pull): Add prototype.
17074 (emacs_gnutls_push): Likewise.
17075
17076 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17077 (emacs_gnutls_push): Likewise.
17078
17079 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17080
17081 * process.c (wait_reading_process_output): Check if GnuTLS
17082 buffered some data internally if no FDs are set for TLS
17083 connections.
17084
17085 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17086 (LIBS): Link to USER_LIBS.
17087 ($(BLD)/gnutls.$(0)): New target.
17088
17089 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17090
17091 * xdisp.c (handle_single_display_spec): Rename the
17092 display_replaced_before_p argument into display_replaced_p, to
17093 make it consistent with the commentary. Fix typos in the
17094 commentary.
17095
17096 * textprop.c (syms_of_textprop): Remove dead code.
17097 (copy_text_properties): Delete obsolete commentary about an
17098 interface that was deleted long ago. Fix typos in the description
17099 of arguments.
17100
17101 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17102 to changes in oldXMenu/XMenu.h from 2011-04-16.
17103 <menu_help_message, prev_menu_help_message>: Constify.
17104 (IT_menu_make_room): menu->help_text is now `const char **';
17105 adjust.
17106
17107 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17108 to changes in oldXMenu/XMenu.h from 2011-04-16.
17109 (struct XMenu): Declare `help_text' `const char **'.
17110
17111 * xfaces.c <Qunspecified>: Make extern again.
17112
17113 * syntax.c: Include sys/types.h before including regex.h, as
17114 required by POSIX.
17115
17116 * doc.c (get_doc_string): Improve the format passed to `error'.
17117
17118 * doprnt.c (doprnt): Improve commentary.
17119
17120 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17121
17122 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17123 them with etags.
17124
17125 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17126 changes in globals.h immediately force recompilation.
17127 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17128 $(CURDIR)/s/ms-w32.h.
17129 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17130
17131 * character.c (Fchar_direction): Function deleted.
17132 (syms_of_character): Don't defsubr it.
17133 <char-direction-table>: Deleted.
17134
17135 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17136
17137 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17138 * doprnt.c: Include limits.h.
17139 (SIZE_MAX): New macro.
17140 (doprnt): Return a size_t value. 2nd arg is now size_t.
17141 Many local variables are now size_t instead of int or unsigned.
17142 Improve overflow protection. Support `l' modifier for integer
17143 conversions. Support %l conversion. Don't assume an EMACS_INT
17144 argument for integer conversions and for %c.
17145
17146 * lisp.h (doprnt): Restore prototype.
17147
17148 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17149 $(SRC)/character.h.
17150
17151 * Makefile.in (base_obj): Add back doprnt.o.
17152
17153 * deps.mk (doprnt.o): Add back prerequisites.
17154 (callint.o): Depend on character.h.
17155
17156 * eval.c (internal_lisp_condition_case): Include the handler
17157 representation in the error message.
17158 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17159 when breaking from the loop.
17160
17161 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17162
17163 * callint.c (Fcall_interactively): When displaying error message
17164 about invalid control letter, pass the character's codepoint, not
17165 a pointer to its multibyte form. Improve display of the character
17166 in octal and display also its hex code.
17167
17168 * character.c (char_string): Use %x to display the (unsigned)
17169 codepoint of an invalid character, to avoid displaying a bogus
17170 negative value.
17171
17172 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17173 `error', not SYMBOL_NAME itself.
17174
17175 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17176 character arguments to `error'.
17177
17178 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17179 to `error' in error message about FINAL_CHAR argument. Make sure
17180 FINAL_CHAR is a character, and use %c when it is passed as
17181 argument to `error'.
17182
17183 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17184
17185 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17186
17187 * w32.c: Include <time.h>.
17188 (sys_localtime): New function.
17189
17190 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17191
17192 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17193
17194 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17195
17196 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17197
17198 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17199 zombies (Bug#8467).
17200
17201 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17202
17203 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17204 gl_state.e_property when gl_state.object is Qt.
17205
17206 * insdel.c (make_gap_larger): Remove limitation of buffer size
17207 to <= INT_MAX.
17208
17209 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17210
17211 * xdisp.c (lookup_glyphless_char_display)
17212 (produce_glyphless_glyph): Handle cons cell entry in
17213 glyphless-char-display.
17214 (Vglyphless_char_display): Document it.
17215
17216 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17217 glyphless-char-display.
17218
17219 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17220
17221 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17222
17223 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17224
17225 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17226 definition for no-X builds.
17227
17228 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17229
17230 Static checks with GCC 4.6.0 and non-default toolkits.
17231
17232 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17233
17234 * process.c (keyboard_bit_set): Define only if SIGIO.
17235 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17236 (send_process): Repair possible setjmp clobbering.
17237
17238 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17239
17240 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17241
17242 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17243
17244 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17245 Define only if needed.
17246
17247 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17248 by pacifying GCC about it. Maybe it's time to retire it?
17249 * xfaces.c (USG, __TIMEVAL__): Likewise.
17250
17251 * dispextern.h (struct redisplay_interface): Rename param
17252 to avoid shadowing.
17253 * termhooks.h (struct terminal): Likewise.
17254 * xterm.c (xembed_send_message): Likewise.
17255
17256 * insdel.c (make_gap_smaller): Define only if
17257 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17258
17259 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17260 it.
17261
17262 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17263 so that we aren't warned about unused symbols.
17264
17265 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17266
17267 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17268
17269 * xfns.c (x_real_positions): Mark locals as initialized.
17270
17271 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17272
17273 * xterm.c: Fix problems found by static analysis with other toolkits.
17274 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17275 (x_dispatch_event): Declare static if USE_GTK, and
17276 define if USE_GTK || USE_X_TOOLKIT.
17277 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17278 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17279 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17280 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17281
17282 * xmenu.c (menu_help_callback): Pointer type fixes.
17283 Use const pointers when pointing at readonly data. Avoid pointer
17284 signedness clashes.
17285 (FALSE): Remove unused macro.
17286 (update_frame_menubar): Remove unused decl.
17287
17288 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17289
17290 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17291 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17292 (single_menu_item): Rename local to avoid shadowing.
17293
17294 * keyboard.c (make_lispy_event): Remove unused local var.
17295
17296 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17297 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17298
17299 * bitmaps: Change bitmaps from unsigned char back to the X11
17300 compatible char. Avoid the old compiler warnings about
17301 out-of-range initializers by using, for example, '\xab' rather
17302 than 0xab.
17303
17304 * xgselect.c (xgselect_initialize): Check vs interface
17305 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17306
17307 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17308
17309 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17310 to read-only memory.
17311
17312 * fns.c (vector): Remove; this old hack is no longer needed.
17313
17314 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17315 Remove unused var.
17316 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17317
17318 * xrdb.c (x_load_resources): Omit unused local.
17319
17320 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17321 (x_window): Rename locals to avoid shadowing.
17322 (USG): Use the kludged USG macro, to pacify gcc.
17323
17324 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17325 (x_term_init): Remove local to avoid shadowing.
17326
17327 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17328
17329 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17330 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17331
17332 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17333
17334 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17335
17336 Fix regex.c, syntax.c and friends for buffers > 2GB.
17337 * syntax.h (struct gl_state_s): Declare character position members
17338 EMACS_INT.
17339
17340 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17341
17342 * textprop.c (verify_interval_modification, interval_of):
17343 Declare arguments EMACS_INT.
17344
17345 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17346 EMACS_INT.
17347
17348 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17349
17350 * indent.c (Fvertical_motion): Local variable it_start is now
17351 EMACS_INT.
17352
17353 * regex.c (re_match, re_match_2, re_match_2_internal)
17354 (bcmp_translate, regcomp, regexec, print_double_string)
17355 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17356 (re_compile_pattern, re_exec): Declare arguments and local
17357 variables `size_t' and `ssize_t' and return values `regoff_t', as
17358 appropriate.
17359 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17360 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17361 <compile_stack_type>: `size' and `avail' are now `size_t'.
17362
17363 * regex.h <regoff_t>: Use ssize_t, not int.
17364 (re_search, re_search_2, re_match, re_match_2): Arguments that
17365 specify buffer/string position and length are now ssize_t and
17366 size_t. Return type is regoff_t.
17367
17368 2011-04-16 Ben Key <bkey76@gmail.com>
17369
17370 * nsfont.m: Fixed bugs in ns_get_family and
17371 ns_descriptor_to_entity that were caused by using free to
17372 deallocate memory blocks that were allocated by xmalloc (via
17373 xstrdup). This caused Emacs to crash when compiled with
17374 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17375 --enable-checking=xmallocoverrun). xfree is now used to
17376 deallocate these memory blocks.
17377
17378 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17379
17380 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17381
17382 emacs_write: Accept and return EMACS_INT for sizes.
17383 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17384 et seq.
17385 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17386 Accept and return EMACS_INT.
17387 (emacs_gnutls_write): Return the number of bytes written on
17388 partial writes.
17389 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17390 (emacs_read, emacs_write): Remove check for negative size, as the
17391 Emacs source code has been audited now.
17392 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17393 (emacs_read, emacs_write): Use it.
17394 * process.c (send_process): Adjust to the new signatures of
17395 emacs_write and emacs_gnutls_write. Do not attempt to store
17396 a byte offset into an 'int'; it might overflow.
17397 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17398
17399 * sound.c: Don't assume sizes fit in 'int'.
17400 (struct sound_device.period_size, alsa_period_size):
17401 Return EMACS_INT, not int.
17402 (struct sound_device.write, vox_write, alsa_write):
17403 Accept EMACS_INT, not int.
17404 (wav_play, au_play): Use EMACS_INT to store sizes and to
17405 record read return values.
17406
17407 2011-04-15 Ben Key <bkey76@gmail.com>
17408
17409 * keyboard.c (Qundefined): Don't declare static since it is used
17410 in nsfns.m.
17411 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17412 static since they are used in nsfont.m.
17413
17414 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17415
17416 * process.c (Qprocessp): Don't declare static.
17417 * lisp.h (Qprocessp): Declare again.
17418
17419 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17420
17421 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17422
17423 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17424
17425 Improve C-level modularity by making more things 'static'.
17426
17427 Don't publish debugger-only interfaces to other modules.
17428 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17429 (verify_bytepos, count_markers): Move decls to the only modules
17430 that need them.
17431 * region-cache.h (pp_cache): Likewise.
17432 * window.h (check_all_windows): Likewise.
17433 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17434
17435 * sysdep.c (croak): Now static, if
17436 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17437 * syssignal.h (croak): Declare only if not static.
17438
17439 * alloc.c (refill_memory_reserve): Now static if
17440 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17441 * lisp.h (refill_memory_reserve): Declare only if not static.
17442
17443 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17444 Define only if USE_LUCID.
17445
17446 * xrdb.c (x_customization_string, x_rm_string): Now static.
17447
17448 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17449 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17450
17451 * xdisp.c (draw_row_with_mouse_face): Now static.
17452 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17453
17454 * window.h (check_all_windows): Mark externally visible.
17455
17456 * window.c (window_deletion_count): Now static.
17457
17458 * undo.c: Make symbols static if they're not exported.
17459 (last_undo_buffer, last_boundary_position, pending_boundary):
17460 Now static.
17461
17462 * textprop.c (interval_insert_behind_hooks): Now static.
17463 (interval_insert_in_front_hooks): Likewise.
17464
17465 * term.c: Make symbols static if they're not exported.
17466 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17467 (max_frame_lines, tty_set_terminal_modes):
17468 (tty_reset_terminal_modes, tty_turn_off_highlight):
17469 (get_tty_terminal): Now static.
17470 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17471 * termhooks.h (term_mouse_moveto): Do not declare if
17472 HAVE_WINDOW_SYSTEM.
17473 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17474 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17475
17476 * sysdep.c: Make symbols static if they're not exported.
17477 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17478 Now static.
17479 (sigprocmask_set, full_mask): Remove; unused.
17480 (wait_debugging): Mark as visible.
17481 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17482 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17483
17484 * syntax.c (syntax_temp): Define only if !__GNUC__.
17485
17486 * sound.c (current_sound_device, current_sound): Now static.
17487
17488 * search.c (searchbufs, searchbuf_head): Now static.
17489
17490 * scroll.c (scroll_cost): Remove; unused.
17491 * dispextern.h (scroll_cost): Remove decl.
17492
17493 * region-cache.h (pp_cache): Mark as externally visible.
17494
17495 * process.c: Make symbols static if they're not exported.
17496 (process_tick, update_tick, create_process, chan_process):
17497 (Vprocess_alist, proc_buffered_char, datagram_access):
17498 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17499 (deactivate_process): Mark defn as static, as well as decl.
17500 * lisp.h (create_process): Remove decl.
17501 * process.h (chan_process, Vprocess_alist): Remove decls.
17502
17503 * print.c: Make symbols static if they're not exported.
17504 (print_depth, new_backquote_output, being_printed, print_buffer):
17505 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17506 (print_interval, print_number_index, initial_stderr_stream):
17507 Now static.
17508 * lisp.h (Fprinc): Remove decl.
17509 (debug_output_compilation_hack): Mark as externally visible.
17510
17511 * sysdep.c (croak): Move decl from here to syssignal.h.
17512 * syssignal.h (croak): Put it here, so the API can be checked when
17513 'croak' is called from dissociate_if_controlling_tty.
17514
17515 * minibuf.c: Make symbols static if they're not exported.
17516 (minibuf_save_list, choose_minibuf_frame): Now static.
17517 * lisp.h (choose_minibuf_frame): Remove decl.
17518
17519 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17520
17521 * lread.c: Make symbols static if they're not exported.
17522 (read_objects, initial_obarray, oblookup_last_bucket_number):
17523 Now static.
17524 (make_symbol): Remove; unused.
17525 * lisp.h (initial_obarray, make_symbol): Remove decls.
17526
17527 * keyboard.c: Make symbols static if they're not exported.
17528 (single_kboard, recent_keys_index, total_keys, recent_keys):
17529 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17530 (this_single_command_key_start, echoing, last_auto_save):
17531 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17532 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17533 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17534 (Vlispy_mouse_stem, double_click_count):
17535 Now static.
17536 (force_auto_save_soon): Define only if SIGDANGER.
17537 (ignore_mouse_drag_p): Now static if
17538 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17539 (print_help): Remove; unused.
17540 (stop_character, last_timer_event): Mark as externally visible.
17541 * keyboard.h (ignore_mouse_drag_p): Declare only if
17542 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17543 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17544 * lisp.h (echoing): Remove decl.
17545 (force_auto_save_soon): Declare only if SIGDANGER.
17546 * xdisp.c (redisplay_window): Simplify code, to make it more
17547 obvious that ignore_mouse_drag_p is not accessed if !defined
17548 USE_GTK && !defined HAVE_NS.
17549
17550 * intervals.c: Make symbols static if they're not exported.
17551 (merge_properties_sticky, merge_interval_right, delete_interval):
17552 Now static.
17553 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17554
17555 * insdel.c: Make symbols static if they're not exported.
17556 However, leave prepare_to_modify_buffer alone. It's never
17557 called from outside this function, but that appears to be a bug.
17558 (combine_after_change_list, combine_after_change_buffer):
17559 (adjust_after_replace, signal_before_change): Now static.
17560 (adjust_after_replace_noundo): Remove; unused.
17561 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17562 (signal_before_change): Remove decls.
17563
17564 * indent.c (val_compute_motion, val_vmotion): Now static.
17565
17566 * image.c: Make symbols static if they're not exported.
17567 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17568 if USE_GTK.
17569 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17570 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17571
17572 * fringe.c (standard_bitmaps): Now static.
17573 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17574
17575 * frame.c: Make symbols static if they're not exported.
17576 (x_report_frame_params, make_terminal_frame): Now static.
17577 (get_frame_param): Now static, unless HAVE_NS.
17578 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17579 (x_get_resource_string): Remove; not used.
17580 * frame.h (make_terminal_frame, x_report_frame_params):
17581 (x_get_resource_string); Remove decls.
17582 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17583 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17584
17585 * font.c, fontset.c: Make symbols static if they're not exported.
17586 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17587 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17588 * font.c (font_close_object): Now static.
17589 * font.h (font_close_object): Remove.
17590 * fontset.c (FONTSET_OBJLIST): Remove.
17591 (free_realized_fontset) #if-0 the body, which does nothing.
17592 (face_suitable_for_char_p): #if-0, as it's never called.
17593 * fontset.h (face_suitable_for_char_p): Remove decl.
17594 * xfaces.c (face_at_string_position):
17595 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17596 since 0 is always ASCII.
17597
17598 * fns.c (weak_hash_tables): Now static.
17599
17600 * fileio.c: Make symbols static if they're not exported.
17601 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17602 (Vwrite_region_annotation_buffers): Now static.
17603
17604 * eval.c: Make symbols static if they're not exported.
17605 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17606 * lisp.h (backtrace_list): Remove decl.
17607
17608 * emacs.c: Make symbols static if they're not exported.
17609 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17610 (fatal_error_code, fatal_error_signal_hook, standard_args):
17611 Now static.
17612 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17613 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17614 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17615 * lisp.h (fatal_error_signal_hook): Remove decl.
17616 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17617
17618 * editfns.c: Move a (normally-unused) function to its only use.
17619 * editfns.c, lisp.h (get_operating_system_release): Remove.
17620 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17621 worth the hassle of breaking this out.
17622
17623 * xterm.c: Make symbols static if they're not exported.
17624 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17625 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17626 (x_destroy_window, x_delete_display):
17627 Now static.
17628 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17629 (x_mouse_leave): Remove; unused.
17630 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17631 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17632 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17633 Remove decls.
17634 (x_mouse_leave): Declare only if WINDOWSNT.
17635 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17636 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17637 USE_X_TOOLKIT.
17638
17639 * ftxfont.c: Make symbols static if they're not exported.
17640 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17641 HAVE_FREETYPE.
17642 * font.h (ftxfont_driver): Likewise.
17643
17644 * xfns.c: Make symbols static if they're not exported.
17645 (x_last_font_name, x_display_info_for_name):
17646 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17647 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17648 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17649 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17650 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17651 (last_show_tip_args): Now static.
17652 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17653 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17654 (x_screen_planes): Remove; unused.
17655 * dispextern.h (x_screen_planes): Remove decl.
17656
17657 * dispnew.c: Make symbols static if they're not exported.
17658 * dispextern.h (redraw_garbaged_frames, scrolling):
17659 (increment_row_positions): Remove.
17660 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17661 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17662 Now static.
17663 (redraw_garbaged_frames): Remove; unused.
17664
17665 * xfaces.c: Make symbols static if they're not exported.
17666 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17667 Remove decls.
17668 * xterm.h (defined_color): Remove decls.
17669 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17670 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17671 (menu_face_changed_default, defined_color, free_realized_face):
17672 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17673 (ascii_face_of_lisp_face): Remove; unused.
17674
17675 * xdisp.c: Make symbols static if they're not exported.
17676 * dispextern.h (scratch_glyph_row, window_box_edges):
17677 (glyph_to_pixel_coords, set_cursor_from_row):
17678 (get_next_display_element, set_iterator_to_next):
17679 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17680 (show_mouse_face): Remove decls
17681 * frame.h (message_buf_print): Likewise.
17682 * lisp.h (pop_message, set_message, check_point_in_composition):
17683 Likewise.
17684 * xterm.h (set_vertical_scroll_bar): Likewise.
17685 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17686 (message_buf_print, scratch_glyph_row, displayed_buffer):
17687 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17688 (get_next_display_element, show_mouse_face, window_box_edges):
17689 (frame_to_window_pixel_xy, check_point_in_composition):
17690 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17691 (glyph_to_pixel_coords): Remove; unused.
17692
17693 * dired.c (file_name_completion): Now static.
17694
17695 * dbusbind.c (xd_in_read_queued_messages): Now static.
17696
17697 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17698 * data.c (circular_list_error): Remove.
17699
17700 * commands.h (last_point_position, last_point_position_buffer):
17701 (last_point_position_window): Remove decls.
17702 * keyboard.c: Make these variables static.
17703
17704 * coding.h (coding, code_convert_region, encode_coding_gap):
17705 Remove decls.
17706 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17707 (iso_code_class, detect_coding, code_convert_region): Now static.
17708 (encode_coding_gap): Remove; unused.
17709
17710 * chartab.c (chartab_chars, chartab_bits): Now static.
17711
17712 * charset.h (charset_iso_8859_1): Remove decl.
17713 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17714 Now static.
17715
17716 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17717 * ccl.c (Vccl_program_table): Now static.
17718 (check_ccl_update): Remove; unused.
17719
17720 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17721 * category.h: ... from here.
17722 * category.c (check_category_table, set_category_set): Now static.
17723
17724 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17725 * lisp.h: Remove these decls.
17726
17727 * buffer.c (buffer_count): Remove unused var.
17728
17729 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17730 so that it's not optimized away.
17731 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17732 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17733 exported only to the debugger.
17734
17735 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17736 * atimer.h (run_all_atimers): Remove; not exported.
17737
17738 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17739 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17740 was inaccessible from Lisp.
17741 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17742 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17743
17744 alloc.c: Import and export fewer symbols, and remove unused items.
17745 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17746 is defined.
17747 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17748 it's not optimized away by whole-program optimization.
17749 (message_enable_multibyte, free_misc): Remove.
17750 (catchlist, handlerlist, mark_backtrace):
17751 Declare only if BYTE_MARK_STACK.
17752 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17753 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17754 (message_enable_multibyte): Remove decl.
17755 (free_misc, interval_free_list, float_block, float_block_index):
17756 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17757 (cons_free_list, last_marked_index):
17758 Now static.
17759 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17760 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17761 (mark_backtrace): Define only if BYTE_MARK_STACK.
17762 * xdisp.c (message_enable_multibyte): Now static.
17763
17764 Declare Lisp_Object Q* variables to be 'static' if not exported.
17765 This makes it easier for human readers (and static analyzers)
17766 to see whether these variables are used from other modules.
17767 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17768 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17769 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17770 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17771 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17772 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17773 * xmenu.c, xselect.c:
17774 Declare Q* vars static if they are not used in other modules.
17775 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17776 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17777 Remove decls of unexported vars.
17778 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17779
17780 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17781
17782 Make Emacs functions such as Fatom 'static' by default.
17783 This makes it easier for human readers (and static analyzers)
17784 to see whether these functions can be called from other modules.
17785 DEFUN now defines a static function. To make the function external
17786 so that it can be used in other C modules, use the new macro DEFUE.
17787 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17788 (Finit_image_library):
17789 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17790 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17791 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17792 Remove decls, since these functions are now static.
17793 (Funintern, Fget_internal_run_time): New decls, since these functions
17794 were already external.
17795
17796 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17797 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17798 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17799 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17800 * keyboard.c, keymap.c, lread.c:
17801 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17802 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17803 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17804 Mark functions with DEFUE instead of DEFUN,
17805 if they are used in other modules.
17806 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17807 decls for now-static functions.
17808 * buffer.h (Fdelete_overlay): Remove decl.
17809 * callproc.c (Fgetenv_internal): Mark as internal.
17810 * composite.c (Fremove_list_of_text_properties): Remove decl.
17811 (Fcomposition_get_gstring): New forward static decl.
17812 * composite.h (Fcomposite_get_gstring): Remove decl.
17813 * dired.c (Ffile_attributes): New forward static decl.
17814 * doc.c (Fdocumntation_property): New forward static decl.
17815 * eval.c (Ffetch_bytecode): New forward static decl.
17816 (Funintern): Remove extern decl; now in .h file where it belongs.
17817 * fileio.c (Fmake_symbolic_link): New forward static decl.
17818 * image.c (Finit_image_library): New forward static decl.
17819 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17820 * intervals.h (Fprevious_property_change):
17821 (Fremove_list_of_text_properties): Remove decls.
17822 * keyboard.c (Fthis_command_keys): Remove decl.
17823 (Fcommand_execute): New forward static decl.
17824 * keymap.c (Flookup_key): New forward static decl.
17825 (Fcopy_keymap): Now static.
17826 * keymap.h (Flookup_key): Remove decl.
17827 * process.c (Fget_process): New forward static decl.
17828 (Fprocess_datagram_address): Mark as internal.
17829 * syntax.c (Fsyntax_table_p): New forward static decl.
17830 (skip_chars): Remove duplicate decl.
17831 * textprop.c (Fprevious_property_change): New forward static decl.
17832 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17833 Now internal.
17834 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17835 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17836
17837 * editfns.c (Fformat): Remove unreachable code.
17838
17839 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17840
17841 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17842 change. (Bug#8496)
17843
17844 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17845
17846 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17847 when at ZV. (Bug#8487)
17848
17849 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17850
17851 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17852 (Bug#8437)
17853 * keyboard.c (parse_tool_bar_item): Likewise.
17854 * sound.c (sound_cleanup, alsa_close): Likewise.
17855 * termcap.c (tgetent): Likewise.
17856 * xfns.c (x_default_font_parameter): Likewise.
17857 * xsettings.c (read_and_apply_settings): Likewise.
17858
17859 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17860 (overrun_check_free): Protoize.
17861
17862 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17863
17864 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17865 since callers should never pass a negative size.
17866 Change the signature to match that of plain 'read' and 'write'; see
17867 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17868 * lisp.h: Update prototypes of emacs_write and emacs_read.
17869
17870 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17871
17872 * xdisp.c (redisplay_window): Don't try to determine the character
17873 position of the scroll margin if the window start point w->startp
17874 is outside the buffer's accessible region. (Bug#8468)
17875
17876 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17877
17878 Fix write-region and its subroutines for buffers > 2GB.
17879 * fileio.c (a_write, e_write): Modify declaration of arguments and
17880 local variables to support buffers larger than 2GB.
17881 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17882
17883 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17884 argument, local variables, and return value.
17885
17886 * lisp.h: Update prototypes of emacs_write and emacs_read.
17887
17888 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17889
17890 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17891
17892 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17893
17894 Fix more problems found by GCC 4.6.0's static checks.
17895
17896 * xdisp.c (vmessage): Use a better test for character truncation.
17897
17898 * charset.c (load_charset_map): <, not <=, for optimization,
17899 and to avoid potential problems with integer overflow.
17900 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17901 * casetab.c (set_identity, shuffle): Likewise.
17902 * editfns.c (Fformat): Likewise.
17903 * syntax.c (skip_chars): Likewise.
17904
17905 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17906 This also lets GCC 4.6.0 generate slightly better loop code.
17907
17908 * callint.c (Fcall_interactively): <, not <=, for optimization.
17909 (Fcall_interactively): Count the number of arguments produced,
17910 not the number of arguments given. This is simpler and lets GCC
17911 4.6.0 generate slightly better code.
17912
17913 * ftfont.c: Distingish more carefully between FcChar8 and char.
17914 The previous code passed unsigned char * to a functions like
17915 strlen and xstrcasecmp that expect char *, which does not
17916 conform to the C standard.
17917 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17918 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17919 char * when the C standard requires it.
17920
17921 * keyboard.c (read_char): Remove unused var.
17922
17923 * eval.c: Port to Windows vsnprintf (Bug#8435).
17924 Include <limits.h>.
17925 (SIZE_MAX): Define if the headers do not.
17926 (verror): Do not give up if vsnprintf returns a negative count.
17927 Instead, grow the buffer. This ports to Windows vsnprintf, which
17928 does not conform to C99. Problem reported by Eli Zaretskii.
17929 Also, simplify the allocation scheme, by avoiding the need for
17930 calling realloc, and removing the ALLOCATED variable.
17931
17932 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17933
17934 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17935 But keep the doprint source code for now, as we might revamp it
17936 and use it again (Bug#8435).
17937 * lisp.h (doprnt): Remove.
17938 * Makefile.in (base_obj): Remove doprnt.o.
17939 * deps.mk (doprnt.o): Remove.
17940
17941 error: Print 32- and 64-bit integers portably (Bug#8435).
17942 Without this change, on typical 64-bit hosts error ("...%d...", N)
17943 was used to print both 32- and 64-bit integers N, which relied on
17944 undefined behavior.
17945 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17946 * lisp.h (error, verror): Mark as printf-like functions.
17947 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17948 Report overflow in size calculations when allocating printf buffer.
17949 Do not truncate output string at its first null byte.
17950 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17951 Truncate the output at a character boundary, since vsnprintf does not
17952 do that.
17953 * charset.c (check_iso_charset_parameter): Convert internal
17954 character to string before calling 'error', since %c now has the
17955 printf meaning.
17956 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17957 overflow when computing char to be passed to 'error'. Do not
17958 pass Lisp_Object to 'error'; pass the integer instead.
17959 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17960 formatted with plain %d.
17961
17962 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17963
17964 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17965
17966 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17967
17968 * xterm.c (x_catch_errors): Remove duplicate declaration.
17969
17970 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17971
17972 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17973
17974 2011-04-10 Jim Meyering <meyering@redhat.com>
17975
17976 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17977 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17978 return ssize_t not "int", and use size_t as the buffer length.
17979 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17980 * gnutls.h: Update declarations.
17981 * process.c (read_process_output): Use ssize_t, to match.
17982 (send_process): Likewise.
17983
17984 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17985
17986 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17987
17988 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17989
17990 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17991 Use unsigned char, to match FcChar8 type definition.
17992
17993 * xterm.c (handle_one_xevent):
17994 * xmenu.c (create_and_show_popup_menu):
17995 * xselect.c (x_decline_selection_request)
17996 (x_reply_selection_request): Avoid type-punned deref of X events.
17997
17998 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17999
18000 Fix some uses of `int' instead of EMACS_INT.
18001 * search.c (string_match_1, fast_string_match)
18002 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18003 (scan_buffer, find_next_newline_no_quit)
18004 (find_before_next_newline, search_command, Freplace_match)
18005 (Fmatch_data): Make some `int' variables be EMACS_INT.
18006
18007 * xdisp.c (display_count_lines): 3rd argument and return value now
18008 EMACS_INT. All callers changed.
18009 (pint2hrstr): Last argument is now EMACS_INT.
18010
18011 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18012 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18013 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18014 (decode_coding_utf_16, decode_coding_emacs_mule)
18015 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18016 (decode_coding_ccl, decode_coding_charset)
18017 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18018 (decode_coding_iso_2022, decode_coding_emacs_mule)
18019 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18020 <char_offset, last_offset>: Declare EMACS_INT.
18021 (encode_coding_utf_8, encode_coding_utf_16)
18022 (encode_coding_emacs_mule, encode_invocation_designation)
18023 (encode_designation_at_bol, encode_coding_iso_2022)
18024 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18025 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18026 Declare EMACS_INT.
18027 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18028 (encode_invocation_designation): Last argument P_NCHARS is now
18029 EMACS_INT.
18030 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18031 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18032
18033 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18034 All users changed.
18035
18036 * ccl.c (Fccl_execute_on_string): Declare some variables
18037 EMACS_INT.
18038
18039 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18040
18041 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18042
18043 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18044
18045 * process.c (Fformat_network_address): Doc fix.
18046
18047 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18048
18049 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18050
18051 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18052
18053 * keyboard.c (read_char): Call Lisp function help-form-show,
18054 instead of using internal_with_output_to_temp_buffer.
18055 (Qhelp_form_show): New var.
18056 (syms_of_keyboard): Use DEFSYM macro.
18057
18058 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18059
18060 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18061
18062 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18063
18064 * process.c (Flist_processes): Remove to Lisp.
18065 (list_processes_1): Delete.
18066
18067 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18068
18069 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18070
18071 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18072
18073 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18074
18075 Fix more problems found by GCC 4.6.0's static checks.
18076
18077 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18078
18079 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18080
18081 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18082
18083 * xdisp.c (vmessage): Mark as a printf-like function.
18084
18085 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18086
18087 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18088
18089 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18090 printf-like functions.
18091 (tiff_load): Add casts to remove these marks before passing them
18092 to system-supplied API.
18093
18094 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18095
18096 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18097 This avoids several warnings with gcc -Wstrict-overflow.
18098 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18099 directly, rather than having caller test rule sign. This avoids
18100 some unnecessary tests.
18101 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18102 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18103 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18104
18105 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18106 (xfont_open): Avoid unnecessary tests.
18107
18108 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18109
18110 * composite.h, composite.c (composition_gstring_put_cache):
18111 Use EMACS_INT, not int, for length.
18112
18113 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18114 breaking out part of COMPOSITION_DECODE_RULE.
18115 (COMPOSITION_DECODE_RULE): Use it.
18116 * composite.c (get_composition_id): Remove unused local vars,
18117 by using the new macro.
18118
18119 * textprop.c (set_text_properties_1): Change while to do-while,
18120 since the condition is always true at first.
18121
18122 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18123 (interval_deletion_adjustment): Return unsigned value.
18124 All uses changed.
18125
18126 * process.c (list_processes_1, create_pty, read_process_output):
18127 (exec_sentinel): Remove vars that were set but not used.
18128 (create_pty): Remove unnecessary "volatile"s.
18129 (Fnetwork_interface_info): Avoid possibility of int overflow.
18130 (read_process_output): Do adaptive read buffering even if carryover.
18131 (read_process_output): Simplify nbytes computation if buffered.
18132
18133 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18134
18135 * syntax.c (scan_words): Remove var that was set but not used.
18136 (update_syntax_table): Use unsigned instead of int.
18137
18138 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18139 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18140 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18141
18142 * print.c (print_error_message): Avoid int overflow.
18143
18144 * font.c (font_list_entities): Redo for clarity,
18145 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18146
18147 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18148 (font_score): Avoid potential overflow in diff calculation.
18149
18150 * fns.c (substring_both): Remove var that is set but not used.
18151 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18152
18153 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18154
18155 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18156 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18157 can always succeed if overflow has undefined behavior.
18158
18159 * search.c (boyer_moore, wordify): Remove vars set but not used.
18160 (wordify): Omit three unnecessary tests.
18161
18162 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18163 All callers changed. This avoids the need for an unused var.
18164
18165 * casefiddle.c (casify_region): Remove var that is set but not used.
18166
18167 * dired.c (file_name_completion): Remove var that is set but not used.
18168
18169 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18170
18171 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18172 (Finsert_file_contents): Remove unnecessary code checking fd.
18173
18174 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18175 Check for integer overflow on size calculations.
18176
18177 * buffer.c (Fprevious_overlay_change): Remove var that is set
18178 but not used.
18179
18180 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18181 Remove vars that are set but not used.
18182 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18183 (timer_check_2): Mark vars as initialized.
18184
18185 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18186
18187 * image.c (lookup_image): Remove var that is set but not used.
18188 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18189
18190 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18191 that are set but not used.
18192
18193 * xfns.c (make_invisible_cursor): Don't return garbage
18194 if XCreateBitmapFromData fails (Bug#8410).
18195
18196 * xselect.c (x_get_local_selection, x_handle_property_notify):
18197 Remove vars that are set but not used.
18198
18199 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18200 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18201
18202 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18203 Remove var that is set but not used.
18204 (scroll_bar_windows_size): Now size_t, not int.
18205 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18206 Check for overflow.
18207
18208 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18209 (map_tty_color) [!defined MSDOS]: Likewise.
18210
18211 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18212
18213 * coding.c: Remove vars that are set but not used.
18214 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18215 All callers changed.
18216 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18217 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18218 (decode_coding_charset): Remove vars that are set but not used.
18219
18220 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18221 that is set but not used.
18222
18223 * print.c (print_object): Remove var that is set but not used.
18224
18225 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18226 The gnulib version avoids calling malloc in the usual case,
18227 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18228 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18229 * filelock.c (current_lock_owner): Likewise.
18230 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18231 * sysdep.c: Include allocator.h, careadlinkat.h.
18232 (emacs_no_realloc_allocator): New static constant.
18233 (emacs_readlink): New function.
18234 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18235 ../lib/careadlinkat.h.
18236
18237 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18238
18239 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18240 first non-nil return value).
18241
18242 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18243
18244 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18245 if not defined (Bug#8403).
18246
18247 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18248
18249 * xdisp.c (display_count_lines): Remove parameter `start',
18250 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18251 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18252 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18253 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18254 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18255 and thereabouts. All callers changed.
18256 (get_per_char_metric): Remove parameter `f', unused since
18257 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18258
18259 2011-04-02 Jim Meyering <meyering@redhat.com>
18260
18261 do not dereference NULL upon failed strdup
18262 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18263 (ns_get_family): Likewise.
18264
18265 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18266
18267 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18268
18269 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18270
18271 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18272 later (Bug#8403).
18273
18274 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18275
18276 Add lexical binding.
18277
18278 * window.c (Ftemp_output_buffer_show): New fun.
18279 (Fsave_window_excursion):
18280 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18281
18282 * lread.c (lisp_file_lexically_bound_p): New function.
18283 (Fload): Bind Qlexical_binding.
18284 (readevalloop): Remove `evalfun' arg.
18285 Bind Qinternal_interpreter_environment.
18286 (Feval_buffer): Bind Qlexical_binding.
18287 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18288 Mark as dynamic.
18289 (syms_of_lread): Declare `lexical-binding'.
18290
18291 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18292
18293 * keyboard.c (eval_dyn): New fun.
18294 (menu_item_eval_property): Use it.
18295
18296 * image.c (parse_image_spec): Use Ffunctionp.
18297
18298 * fns.c (concat, mapcar1): Accept byte-code-functions.
18299
18300 * eval.c (Fsetq): Handle lexical vars.
18301 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18302 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18303 (FletX, Flet): Obey lexical binding.
18304 (Fcommandp): Handle closures.
18305 (Feval): New `lexical' arg.
18306 (eval_sub): New function extracted from Feval. Use it almost
18307 everywhere where Feval was used. Look up vars in lexical env.
18308 Handle closures.
18309 (Ffunctionp): Move from subr.el.
18310 (Ffuncall): Handle closures.
18311 (apply_lambda): Remove `eval_flags'.
18312 (funcall_lambda): Handle closures and new byte-code-functions.
18313 (Fspecial_variable_p): New function.
18314 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18315 but without exporting it to Lisp.
18316
18317 * doc.c (Fdocumentation, store_function_docstring):
18318 * data.c (Finteractive_form): Handle closures.
18319
18320 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18321 interactive spec.
18322
18323 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18324 New byte-codes.
18325 (exec_byte_code): New function extracted from Fbyte_code to handle new
18326 calling convention for byte-code-functions. Add new byte-codes.
18327
18328 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18329
18330 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18331
18332 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18333
18334 * xdisp.c (redisplay_internal): Fix prototype.
18335
18336 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18337
18338 * xdisp.c (SCROLL_LIMIT): New macro.
18339 (try_scrolling): Use it when setting scroll_limit.
18340 Limit scrolling to 100 screen lines.
18341 (redisplay_window): Even when falling back on "recentering",
18342 position point in the window according to scroll-conservatively,
18343 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18344
18345 (try_scrolling): When point is above the window, allow searching
18346 as far as scroll_max, or one screenful, to compute vertical
18347 distance from PT to the scroll margin position. This prevents
18348 try_scrolling from unnecessarily failing when
18349 scroll-conservatively is set to a value slightly larger than the
18350 window height. Clean up the case of PT below the margin at bottom
18351 of window: scroll_max can no longer be INT_MAX. When aggressive
18352 scrolling is in use, don't let point enter the opposite scroll
18353 margin as result of the scroll.
18354 (syms_of_xdisp) <scroll-conservatively>: Document the
18355 threshold of 100 lines for never-recentering scrolling.
18356
18357 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18358
18359 * dispextern.h (move_it_by_lines):
18360 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18361 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18362 (message_log_check_duplicate): Remove parameters `prev_bol' and
18363 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18364 (redisplay_internal): Remove parameter `preserve_echo_area',
18365 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18366
18367 * indent.c (Fvertical_motion):
18368 * window.c (window_scroll_pixel_based, Frecenter):
18369 Don't pass `need_y_p' to `move_it_by_lines'.
18370
18371 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18372
18373 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18374 steal a few bits to be more compact.
18375 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18376 Remove unneeded casts.
18377
18378 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18379
18380 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18381
18382 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18383 binding" message (bug#7967).
18384
18385 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18386
18387 Fix more problems found by GCC 4.6.0's static checks.
18388
18389 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18390 Remove unused local var.
18391
18392 * editfns.c (Fmessage_box): Remove unused local var.
18393
18394 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18395 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18396 Omit unused local vars.
18397 * window.c (shrink_windows): Omit unused local var.
18398 * menu.c (digest_single_submenu): Omit unused local var.
18399 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18400 Omit unused local var.
18401
18402 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18403 Don't assume string length fits in int.
18404 (keyremap_step, read_key_sequence): Use size_t for sizes.
18405 (read_key_sequence): Don't check last_real_key_start redundantly.
18406
18407 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18408 instead of alloca (Bug#8344).
18409
18410 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18411 (Fbacktrace_frame): Don't assume nframes fits in int.
18412
18413 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18414
18415 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18416 concerns.
18417
18418 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18419
18420 * cm.c (calccost): Turn while-do into do-while, for clarity.
18421
18422 * keyboard.c (syms_of_keyboard): Use the same style as later
18423 in this function when indexing through an array. This also
18424 works around GCC bug 48267.
18425
18426 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18427
18428 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18429
18430 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18431 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18432
18433 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18434 This avoids undefined behavior on integer overflow, and is a bit
18435 more convenient anyway since it is compared to a size_t variable.
18436
18437 Variadic C functions now count arguments with size_t, not int.
18438 This avoids an unnecessary limitation on 64-bit machines, which
18439 caused (substring ...) to crash on large vectors (Bug#8344).
18440 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18441 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18442 All variadic functions and their callers changed accordingly.
18443 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18444 * data.c (arith_driver, float_arith_driver): Likewise.
18445 * editfns.c (general_insert_function): Likewise.
18446 * eval.c (struct backtrace.nargs, interactive_p)
18447 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18448 (funcall_lambda, mark_backtrace): Likewise.
18449 * fns.c (concat): Likewise.
18450 * frame.c (x_set_frame_parameters): Likewise.
18451 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18452 0 if not found, not -1. All callers changed.
18453
18454 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18455 (stack_copy_size): Now size_t, not int.
18456 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18457
18458 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18459
18460 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18461 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18462 All callers changed.
18463
18464 * lisp.h (multibyte_char_to_unibyte):
18465 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18466 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18467 * character.h (CHAR_TO_BYTE8):
18468 * cmds.c (internal_self_insert):
18469 * editfns.c (general_insert_function):
18470 * keymap.c (push_key_description):
18471 * search.c (Freplace_match):
18472 * xdisp.c (message_dolog, set_message_1): All callers changed.
18473
18474 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18475
18476 * keyboard.c (safe_run_hook_funcall): New function.
18477 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18478 don't set the hook to nil, but remove the offending function instead.
18479 (Qcommand_hook_internal): Remove, unused.
18480 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18481 Vcommand_hook_internal.
18482
18483 * eval.c (enum run_hooks_condition): Remove.
18484 (funcall_nil, funcall_not): New functions.
18485 (run_hook_with_args): Call each function through a `funcall' argument.
18486 Remove `cond' argument, now redundant.
18487 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18488 (Frun_hook_with_args_until_failure): Adjust accordingly.
18489 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18490
18491 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18492
18493 * dispextern.h (string_buffer_position): Remove declaration.
18494
18495 * print.c (strout): Remove parameter `multibyte', unused since
18496 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18497
18498 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18499 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18500 All callers changed.
18501
18502 * w32.c (_wsa_errlist): Use braces for struct initializers.
18503
18504 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18505 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18506 All callers changed.
18507 (string_buffer_position): Likewise. Also, make static (it's never
18508 used outside xdisp.c).
18509 (cursor_row_p): Remove parameter `w', unused since
18510 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18511 (decode_mode_spec): Remove parameter `precision', introduced during
18512 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18513 All callers changed.
18514
18515 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18516
18517 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18518
18519 2011-03-27 Anders Lindgren <andlind@gmail.com>
18520
18521 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18522 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18523 (ns_update_auto_hide_menu_bar): New functions.
18524 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18525 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18526 ns_constrain_all_frames.
18527 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18528 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18529
18530 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18531
18532 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18533
18534 2011-03-27 Glenn Morris <rgm@gnu.org>
18535
18536 * syssignal.h: Replace RETSIGTYPE with void.
18537 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18538 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18539 Replace SIGTYPE with void everywhere.
18540 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18541 * s/template.h (SIGTYPE): Remove commented out definition.
18542
18543 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18544
18545 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18546 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18547
18548 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18549
18550 * w32.c (read_unc_volume): Use parameter `henum', instead of
18551 global variable `wget_enum_handle'.
18552
18553 * keymap.c (describe_vector): Remove parameters `indices' and
18554 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18555 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18556
18557 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18558
18559 * keyboard.c (timer_check): Remove parameter `do_it_now',
18560 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18561 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18562 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18563
18564 * keyboard.c (read_char):
18565 * w32menu.c (w32_menu_display_help):
18566 * xmenu.c (show_help_event, menu_help_callback):
18567 Adjust calls to `show_help_echo'.
18568
18569 * gtkutil.c (xg_maybe_add_timer):
18570 * keyboard.c (readable_events):
18571 * process.c (wait_reading_process_output):
18572 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18573
18574 * insdel.c (adjust_markers_gap_motion):
18575 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18576 (gap_left, gap_right): Don't call it.
18577
18578 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18579
18580 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18581 incurred during fontification.
18582
18583 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18584
18585 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18586 (DEFVAR_PER_BUFFER): Don't pass it.
18587
18588 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18589 (scrolling_window): Don't pass it.
18590
18591 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18592
18593 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18594
18595 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18596 and `suffix'.
18597 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18598 of variables specific to SELinux and computation of `encoded_absname'.
18599
18600 * image.c (XPutPixel): Remove unused variable `height'.
18601
18602 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18603
18604 * unexw32.c (get_section_info): Remove unused variable `section'.
18605
18606 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18607 (system_process_attributes): Remove unused variable `sess'.
18608 (sys_read): Remove unused variable `err'.
18609
18610 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18611 (w32_wnd_proc): Remove unused variable `isdead'.
18612 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18613 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18614 (x_create_tip_frame): Remove unused variable `tem'.
18615
18616 * w32inevt.c (w32_console_read_socket):
18617 Remove unused variable `no_events'.
18618
18619 * w32term.c (x_draw_composite_glyph_string_foreground):
18620 Remove unused variable `width'.
18621
18622 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18623
18624 * w32term.c (x_set_glyph_string_clipping):
18625 Don't pass uninitialized region to CombineRgn.
18626
18627 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18628
18629 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18630 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18631 (Fx_close_connection): Remove unused variable `i'.
18632
18633 * w32font.c (w32font_draw): Return number of glyphs.
18634 (w32font_open_internal): Remove unused variable `i'.
18635 (w32font_driver): Add missing initializer.
18636
18637 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18638 (fill_in_menu): Remove unused variable `items_added'.
18639
18640 * w32term.c (last_mouse_press_frame): Remove static global variable.
18641 (w32_clip_to_row): Remove unused variable `f'.
18642 (x_delete_terminal): Remove unused variable `i'.
18643
18644 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18645 (NOTHING): Remove unused static global variable.
18646 (uniscribe_check_otf): Remove unused variable `table'.
18647 (uniscribe_font_driver): Add missing initializers.
18648
18649 2011-03-23 Julien Danjou <julien@danjou.info>
18650
18651 * term.c (Fsuspend_tty, Fresume_tty):
18652 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18653 * window.c (temp_output_buffer_show):
18654 * insdel.c (signal_before_change):
18655 * frame.c (Fhandle_switch_frame):
18656 * fileio.c (Fdo_auto_save):
18657 * emacs.c (Fkill_emacs):
18658 * editfns.c (save_excursion_restore):
18659 * cmds.c (internal_self_insert):
18660 * callint.c (Fcall_interactively):
18661 * buffer.c (Fkill_all_local_variables):
18662 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18663 Use Frun_hooks.
18664 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18665 unconditionally since it does the check itself.
18666
18667 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18668
18669 Fix more problems found by GCC 4.5.2's static checks.
18670
18671 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18672 the first time through the loop, since we know p0 < p1 then.
18673 This also avoids a gcc -Wstrict-overflow warning.
18674
18675 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18676 leading to a memory leak, possible in functions like
18677 load_charset_map_from_file that can allocate an unbounded number
18678 of objects (Bug#8318).
18679
18680 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18681 that could (at least in theory) be that large.
18682
18683 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18684 This is less likely to overflow, and avoids undefined behavior if
18685 overflow does occur. All callers changed. Use strtoul to scan
18686 for the unsigned long integer.
18687 (pint2hrstr): Simplify and tune code slightly.
18688 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18689
18690 * scroll.c (do_scrolling): Work around GCC bug 48228.
18691 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18692
18693 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18694 This also avoids a warning with gcc -Wstrict-overflow.
18695 (validate_x_resource_name): Simplify count usage.
18696 This also avoids a warning with gcc -Wstrict-overflow.
18697
18698 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18699 fail (Bug#8306).
18700
18701 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18702
18703 * process.c (Fmake_network_process): Use socklen_t, not int,
18704 where POSIX says socklen_t is required in portable programs.
18705 This fixes a porting bug on hosts like 64-bit HP-UX, where
18706 socklen_t is wider than int (Bug#8277).
18707 (Fmake_network_process, server_accept_connection):
18708 (wait_reading_process_output, read_process_output):
18709 Likewise.
18710
18711 * process.c: Rename or move locals to avoid shadowing.
18712 (list_processes_1, Fmake_network_process):
18713 (read_process_output_error_handler, exec_sentinel_error_handler):
18714 Rename or move locals.
18715 (Fmake_network_process): Define label "retry_connect" only if needed.
18716 (Fnetwork_interface_info): Fix pointer signedness.
18717 (process_send_signal): Add cast to avoid pointer signedness problem.
18718 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18719 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18720
18721 Make tparam.h and terminfo.c consistent.
18722 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18723 Include tparam.h instead, since it declares them.
18724 * cm.h (PC): Remove extern decl; tparam.h now does this.
18725 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18726 * terminfo.c: Include tparam.h, to check interfaces.
18727 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18728 (tparam): Adjust signature to match interface in tparam.h;
18729 this removes some undefined behavior. Check that outstring and len
18730 are zero, which they always are with Emacs.
18731 * tparam.h (PC, BC, UP): New extern decls.
18732
18733 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18734 (xftfont_open): Rename locals to avoid shadowing.
18735
18736 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18737 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18738 (OTF_TAG_SYM): Omit macro if not needed.
18739 (ftfont_list): Remove unused local.
18740 (get_adstyle_property, ftfont_pattern_entity):
18741 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18742 Rename locals to avoid shadowing.
18743
18744 * xfont.c (xfont_list_family): Mark var as initialized.
18745
18746 * xml.c (make_dom): Now static.
18747
18748 * composite.c (composition_compute_stop_pos): Rename local to
18749 avoid shadowing.
18750 (composition_reseat_it): Remove unused locals.
18751 (find_automatic_composition, composition_adjust_point): Likewise.
18752 (composition_update_it): Mark var as initialized.
18753 (find_automatic_composition): Mark vars as initialized,
18754 with a FIXME (Bug#8290).
18755
18756 character.h: Rename locals to avoid shadowing.
18757 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18758 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18759 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18760 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18761 to avoid shadowing.
18762
18763 * textprop.c (property_change_between_p): Remove; unused.
18764
18765 * intervals.c (interval_start_pos): Now static.
18766
18767 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18768
18769 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18770 Rename locals to avoid shadowing.
18771
18772 * sound.c (wav_play, au_play, Fplay_sound_internal):
18773 Fix pointer signedness.
18774 (alsa_choose_format): Remove unused local var.
18775 (wav_play): Initialize a variable to 0, to prevent undefined
18776 behavior (Bug#8278).
18777
18778 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18779
18780 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18781
18782 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18783 clobbering (Bug#8298).
18784 * sysdep.c (sys_subshell): Likewise.
18785 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18786
18787 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18788 This should get cleaned up, so that child_setup has the
18789 same signature on all platforms.
18790
18791 * callproc.c (call_process_cleanup): Now static.
18792 (relocate_fd): Rename locals to avoid shadowing.
18793
18794 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18795
18796 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18797 not to be necessary, and produces flickering.
18798
18799 2011-03-20 Glenn Morris <rgm@gnu.org>
18800
18801 * config.in: Remove file.
18802
18803 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18804
18805 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18806 are now in src/globals.h.
18807 (syms_of_minibuf): Remove spurious & from previous change.
18808
18809 2011-03-20 Leo Liu <sdl.web@gmail.com>
18810
18811 * minibuf.c (completing-read-function): New variable.
18812 (completing-read-default): Rename from completing-read.
18813 (completing-read): Call completing-read-function.
18814
18815 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18816
18817 * xfaces.c (Fx_load_color_file):
18818 Read color file from absolute filename (bug#8250).
18819
18820 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18821
18822 * makefile.w32-in: Update dependencies.
18823
18824 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18825
18826 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18827
18828 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18829
18830 Fix more problems found by GCC 4.5.2's static checks.
18831
18832 * process.c (make_serial_process_unwind, send_process_trap):
18833 (sigchld_handler): Now static.
18834
18835 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18836 That way, the code declares only the vars that it needs.
18837 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18838 * s/cygwin.h (PTY_ITERATION): Likewise.
18839 * s/darwin.h (PTY_ITERATION): Likewise.
18840 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18841
18842 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18843 * process.c (allocate_pty): Don't declare stb unless it's needed.
18844
18845 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18846 (CONSTANTLIM): Remove; unused.
18847 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18848 Define only if needed.
18849
18850 * unexelf.c (unexec): Name an expression,
18851 to avoid gcc -Wbad-function-cast warning.
18852 Use a different way to cause a compilation error if anyone uses
18853 n rather than nn, a way that does not involve shadowing.
18854 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18855
18856 * deps.mk (unexalpha.o): Remove; unused.
18857
18858 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18859 * unexec.h: New file.
18860 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18861 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18862 Depend on unexec.h.
18863 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18864 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18865 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18866 Change as necessary to match prototype in unexec.h.
18867
18868 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18869 shadowing.
18870 (back_comment, skip_chars): Mark vars as initialized.
18871
18872 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18873 Rename locals to avoid shadowing.
18874
18875 * lread.c (read1): Rewrite so as not to use empty "else".
18876 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18877
18878 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18879
18880 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18881 warning when compiling print.c.
18882
18883 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18884 instead of using an uninitialized var.
18885 (font_sort_entities): Mark var as initialized.
18886
18887 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18888
18889 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18890 pointers to constants.
18891 (font_parse_fcname): Remove unused vars.
18892 (font_delete_unmatched): Now static.
18893 (font_get_spec): Remove; unused.
18894 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18895 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18896 Rename or move locals to avoid shadowing.
18897
18898 * fns.c (require_nesting_list, require_unwind): Now static.
18899 (Ffillarray): Rename locals to avoid shadowing.
18900
18901 * floatfns.c (domain_error2): Define only if needed.
18902 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18903
18904 * alloc.c (mark_backtrace): Move decl from here ...
18905 * lisp.h: ... to here, so that it can be checked.
18906
18907 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18908 (Fdefvar): Rewrite so as not to use empty "else".
18909 (lisp_indirect_variable): Name an expression,
18910 to avoid gcc -Wbad-function-cast warning.
18911 (Fdefvar): Rename locals to avoid shadowing.
18912
18913 * callint.c (quotify_arg, quotify_args): Now static.
18914 (Fcall_interactively): Rename locals to avoid shadowing.
18915 Use const pointer when appropriate.
18916
18917 * lisp.h (get_system_name, get_operating_system_release):
18918 Move decls here, to check interfaces.
18919 * process.c (get_operating_system_release): Move decl to lisp.h.
18920 * xrdb.c (get_system_name): Likewise.
18921 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18922 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18923 some of which prompt warnings from gcc -Wbad-function-cast.
18924 (Fformat_time_string, Fencode_time, Finsert_char):
18925 (Ftranslate_region_internal, Fformat):
18926 Rename or remove local vars to avoid shadowing.
18927 (Ftranslate_region_internal): Mark var as initialized.
18928
18929 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18930 avoid shadowing.
18931
18932 * lisp.h (eassert): Check that the argument compiles, even if
18933 ENABLE_CHECKING is not defined.
18934
18935 * data.c (Findirect_variable): Name an expression, to avoid
18936 gcc -Wbad-function-cast warning.
18937 (default_value, arithcompare, arith_driver, arith_error): Now static.
18938 (store_symval_forwarding): Rename local to avoid shadowing.
18939 (Fmake_variable_buffer_local, Fmake_local_variable):
18940 Mark variables as initialized.
18941 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18942
18943 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18944 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18945 Rename locals to avoid shadowing.
18946 (mark_stack): Move local variables into the #ifdef region where
18947 they're used.
18948 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18949 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18950 needed otherwise.
18951 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18952 (GC_STRING_CHARS): Remove; not used.
18953 (Fmemory_limit): Cast sbrk's returned value to char *.
18954
18955 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18956 avoids undefined behavior in theory.
18957
18958 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18959
18960 Use functions, not macros, for up- and down-casing (Bug#8254).
18961 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18962 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18963 to use the following functions instead of these macros.
18964 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18965 EMACS_INT, since callers assume the returned value fits in int.
18966 (upcase1): Likewise, for UPCASE_TABLE.
18967 (uppercasep, lowercasep, upcase): New static inline functions.
18968 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18969 the race-condition problem in the old DOWNCASE.
18970
18971 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18972 Rename locals to avoid shadowing.
18973 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18974 (regex_compile, re_search_2, re_match_2_internal):
18975 Remove unused local vars.
18976 (FREE_VAR): Rewrite so as not to use empty "else",
18977 which gcc can warn about.
18978 (regex_compile, re_match_2_internal): Mark locals as initialized.
18979 (RETALLOC_IF): Define only if needed.
18980 (WORDCHAR_P): Likewise. This one is never needed, but is used
18981 only in a comment talking about a compiler bug, so put inside
18982 the #if 0 of that comment.
18983 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18984 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18985 Remove; unused.
18986
18987 * search.c (boyer_moore): Rename locals to avoid shadowing.
18988 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18989 (PREV_CHAR_BOUNDARY): Likewise.
18990
18991 * search.c (simple_search): Remove unused var.
18992
18993 * dired.c (compile_pattern): Move decl from here ...
18994 * lisp.h: ... to here, so that it can be checked.
18995 (struct re_registers): New forward decl.
18996
18997 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18998
18999 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19000 All uses changed.
19001 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19002 Rename locals to avoid shadowing.
19003 (Fvertical_motion): Mark locals as initialized.
19004
19005 * casefiddle.c (casify_object, casify_region): Now static.
19006 (casify_region): Mark local as initialized.
19007
19008 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19009
19010 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19011 New macros, so that the caller can use some names other than
19012 gcpro1, gcpro2, etc.
19013 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19014 of the new macros.
19015 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19016 argument, for consistency with GCPRO2_VAR, etc: it is now the
19017 prefix of the variable, not the variable itself. All uses
19018 changed.
19019 * dired.c (directory_files_internal, file_name_completion):
19020 Rename locals to avoid shadowing.
19021
19022 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19023 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19024 dired.c's scmp function, had undefined behavior.
19025 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19026 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19027 * buffer.h: ... to here, because these macros use current_buffer,
19028 and the new implementation with inline functions needs to have
19029 current_buffer in scope now, rather than later when the macros
19030 are used.
19031 (downcase, upcase1): New static inline functions.
19032 (DOWNCASE, UPCASE1): Reimplement using these functions.
19033 This avoids undefined behavior in expressions like
19034 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19035 from race conditions in accessing the global variables
19036 case_temp1 and case_temp2.
19037 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19038 * lisp.h (case_temp1, case_temp2): Remove their decls.
19039 * character.h (ASCII_CHAR_P): Move from here ...
19040 * lisp.h: ... to here, so that the inline functions mentioned
19041 above can use them.
19042
19043 * dired.c (directory_files_internal_unwind): Now static.
19044
19045 * fileio.c (file_name_as_directory, directory_file_name):
19046 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19047 Now static.
19048 (file_name_as_directory): Use const pointers when appropriate.
19049 (Fexpand_file_name): Likewise. In particular, newdir might
19050 point at constant storage, so make it a const pointer.
19051 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19052 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19053 signedness issues.
19054 (Fset_file_times, Finsert_file_contents, auto_save_error):
19055 Rename locals to avoid shadowing.
19056
19057 * minibuf.c (choose_minibuf_frame_1): Now static.
19058 (Ftry_completion, Fall_completions): Rename or remove locals
19059 to avoid shadowing.
19060
19061 * marker.c (bytepos_to_charpos): Remove; unused.
19062
19063 * lisp.h (verify_bytepos, count_markers): New decls,
19064 so that gcc does not warn that these functions aren't declared.
19065
19066 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19067 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19068 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19069 (copy_text): Remove unused local var.
19070
19071 * filelock.c (within_one_second): Now static.
19072 (lock_file_1): Rename local to avoid shadowing.
19073
19074 * buffer.c (fix_overlays_before): Mark locals as initialized.
19075 (fix_start_end_in_overlays): Likewise. This function should be
19076 simplified by using pointers-to-pointers, but that's a different
19077 matter.
19078 (switch_to_buffer_1): Now static.
19079 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19080 (report_overlay_modification): Rename locals to avoid shadowing.
19081
19082 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19083 Fix pointer signedness issue.
19084 (sys_subshell): Mark local as volatile if checking for lint,
19085 to suppress a gcc -Wclobbered warning that does not seem to be right.
19086 (MAXPATHLEN): Define only if needed.
19087
19088 * process.c (serial_open, serial_configure): Move decls from here ...
19089 * systty.h: ... to here, so that they can be checked.
19090
19091 * fns.c (get_random, seed_random): Move extern decls from here ...
19092 * lisp.h: ... to here, so that they can be checked.
19093
19094 * sysdep.c (reset_io): Now static.
19095 (wait_for_termination_signal): Remove; unused.
19096
19097 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19098 (copy_keymap_item, append_key, push_text_char_description):
19099 Now static.
19100 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19101 (DENSE_TABLE_SIZE): Remove; unused.
19102 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19103 (describe_map_tree):
19104 Rename locals to avoid shadowing.
19105
19106 * keyboard.c: Declare functions static if they are not used elsewhere.
19107 (echo_char, echo_dash, cmd_error, top_level_2):
19108 (poll_for_input, handle_async_input): Now static.
19109 (read_char, kbd_buffer_get_event, make_lispy_position):
19110 (make_lispy_event, make_lispy_movement, apply_modifiers):
19111 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19112 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19113 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19114 (read_key_sequence, read_char): Mark locals as initialized.
19115 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19116
19117 * keyboard.h (make_ctrl_char): New decl.
19118 (mark_kboards): Move decl here ...
19119 * alloc.c (mark_kboards): ... from here.
19120
19121 * lisp.h (force_auto_save_soon): New decl.
19122
19123 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19124 (DEFINE_DUMMY_FUNCTION): New macro.
19125 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19126 Use it.
19127 (main): Add casts to avoid warnings
19128 if GCC considers string literals to be constants.
19129
19130 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19131
19132 * dbusbind.c: Pointer signedness fixes.
19133 (xd_signature, xd_append_arg, xd_initialize):
19134 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19135 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19136 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19137 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19138
19139 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19140 if GCC considers string literals to be constants.
19141 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19142
19143 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19144
19145 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19146 (print_preprocess, print_object): New macro to fix last change.
19147
19148 * print.c (print_preprocess): Don't forget font objects.
19149
19150 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19151
19152 * emacs.c (USAGE3): Doc fixes.
19153
19154 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19155
19156 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19157 structure.
19158
19159 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19160
19161 * lisp.h (VWindow_system, Qfile_name_history):
19162 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19163 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19164 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19165
19166 * w32select.c: Don't #include "keyboard.h".
19167 (run_protected): Add extern declaration for waiting_for_input.
19168
19169 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19170 * w32console.c (detect_input_pending, read_input_pending)
19171 (encode_terminal_code):
19172 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19173 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19174 (w32_system_caret_y, Qfile_name_history):
19175 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19176 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19177 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19178 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19179 * w32proc.c (Qlocal, report_file_error):
19180 * w32term.c (Vwindow_system, updating_frame):
19181 * w32uniscribe.c (initialized, uniscribe_font_driver):
19182 Remove unneeded extern declarations.
19183
19184 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19185
19186 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19187
19188 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19189
19190 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19191 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19192 These macros can no longer be used for assignment.
19193
19194 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19195 Assign struct members directly, instead of using BUF_BEGV etc.
19196 (record_buffer_markers, fetch_buffer_markers): New functions for
19197 recording and fetching special buffer markers.
19198 (set_buffer_internal_1, set_buffer_temp): Use them.
19199
19200 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19201
19202 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19203
19204 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19205 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19206
19207 * xdisp.c (hscroll_window_tree):
19208 (reconsider_clip_changes): Use PT instead of BUF_PT.
19209
19210 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19211
19212 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19213 $(EMACS_ROOT)/lib/intprops.h.
19214
19215 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19216
19217 Fix more problems found by GCC 4.5.2's static checks.
19218
19219 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19220 to unsigned char * to avoid compiler diagnostic.
19221 (xg_free_frame_widgets): Make it clear that a local variable is
19222 needed only if USE_GTK_TOOLTIP.
19223 (gdk_window_get_screen): Make it clear that this macro is needed
19224 only if USE_GTK_TOOLTIP.
19225 (int_gtk_range_get_value): New function, which avoids a diagnostic
19226 from gcc -Wbad-function-cast.
19227 (xg_set_toolkit_scroll_bar_thumb): Use it.
19228 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19229 diagnostic from gcc -Wbad-function-cast.
19230 (get_utf8_string, xg_get_file_with_chooser):
19231 Rename locals to avoid shadowing.
19232 (create_dialog): Move locals to avoid shadowing.
19233
19234 * xgselect.c (xg_select): Remove unused var.
19235
19236 * image.c (four_corners_best): Mark locals as initialized.
19237 (gif_load): Initialize transparent_p to zero (Bug#8238).
19238 Mark another local as initialized.
19239 (my_png_error, my_error_exit): Mark with NO_RETURN.
19240
19241 * image.c (clear_image_cache): Now static.
19242 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19243 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19244 (x_edge_detection): Remove unnecessary cast that
19245 gcc -Wbad-function-cast diagnoses.
19246 (gif_load): Fix pointer signedness.
19247 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19248 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19249
19250 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19251
19252 Improve quality of tests for time stamp overflow.
19253 For example, without this patch (encode-time 0 0 0 1 1
19254 1152921504606846976) returns the obviously-bogus value (-948597
19255 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19256 reports time overflow. See
19257 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19258 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19259 * editfns.c: Include limits.h and intprops.h.
19260 (TIME_T_MIN, TIME_T_MAX): New macros.
19261 (time_overflow): Move earlier, to before first use.
19262 (hi_time, lo_time): New functions, for an accurate test for
19263 out-of-range times.
19264 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19265 (Fget_internal_run_time): Don't assume time_t fits in int.
19266 (make_time): Use list2 instead of Fcons twice.
19267 (Fdecode_time): More accurate test for out-of-range times.
19268 (check_tm_member): New function.
19269 (Fencode_time): Use it, to test for out-of-range times.
19270 (lisp_time_argument): Don't rely on undefined left-shift and
19271 right-shift behavior when checking for time stamp overflow.
19272
19273 * editfns.c (time_overflow): New function, refactoring common code.
19274 (Fformat_time_string, Fdecode_time, Fencode_time):
19275 (Fcurrent_time_string): Use it.
19276
19277 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19278 * dired.c (make_time): Move to ...
19279 * editfns.c (make_time): ... here.
19280 * systime.h: Note the move.
19281
19282 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19283
19284 * fringe.c (update_window_fringes): Remove unused variables.
19285
19286 * unexmacosx.c (copy_data_segment): Also copy __got section.
19287 (Bug#8223)
19288
19289 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19290
19291 * termcap.c [MSDOS]: Include "msdos.h".
19292 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19293 Constify `char *' arguments and their references according to
19294 prototypes in tparam.h.
19295
19296 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19297
19298 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19299 Adapt all references accordingly.
19300
19301 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19302
19303 2011-03-11 Tom Tromey <tromey@redhat.com>
19304
19305 * buffer.c (syms_of_buffer): Remove obsolete comment.
19306
19307 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19308
19309 * termhooks.h (encode_terminal_code): Declare prototype.
19310
19311 * msdos.c (encode_terminal_code): Don't declare prototype.
19312
19313 * term.c (encode_terminal_code): Now external again, used by
19314 w32console.c and msdos.c.
19315
19316 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19317 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19318
19319 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19320
19321 Fix some minor problems found by GCC 4.5.2's static checks.
19322
19323 * fringe.c (update_window_fringes): Mark locals as initialized
19324 (Bug#8227).
19325 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19326
19327 * alloc.c (mark_fringe_data): Move decl from here ...
19328 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19329 to check its interface.
19330 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19331
19332 * fontset.c (free_realized_fontset): Now static.
19333 (Fset_fontset_font): Rename local to avoid shadowing.
19334 (fontset_font): Mark local as initialized.
19335 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19336
19337 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19338
19339 * xselect.c (x_disown_buffer_selections): Remove; not used.
19340 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19341 (x_own_selection, Fx_disown_selection_internal): Rename locals
19342 to avoid shadowing.
19343 (x_handle_dnd_message): Remove local to avoid shadowing.
19344
19345 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19346 so that the caller can use some name other than gcpro1.
19347 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19348 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19349 (Fx_backspace_delete_keys_p):
19350 Use them to avoid shadowing, and rename vars to avoid shadowing.
19351 (x_decode_color, x_set_name, x_window): Now static.
19352 (Fx_create_frame): Add braces to silence GCC warning.
19353 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19354 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19355 Remove unused locals.
19356 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19357 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19358 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19359 macros.
19360
19361 * xterm.h (x_mouse_leave): New decl.
19362
19363 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19364 Remove unused functions.
19365 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19366 (x_calc_absolute_position): Now static.
19367 (XTread_socket): Don't define label "out" unless it's used.
19368 Don't declare local "event" unless it's used.
19369 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19370 unless they are used.
19371 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19372 (x_fatal_error_signal): Remove; not used.
19373 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19374 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19375 (x_error_catcher, x_connection_closed, x_error_handler):
19376 (x_error_quitter, xembed_send_message, x_iconify_frame):
19377 (my_log_handler): Rename locals to avoid shadowing.
19378 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19379 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19380
19381 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19382 Rename or move locals to avoid shadowing.
19383 (tty_defined_color, merge_face_heights): Now static.
19384 (free_realized_faces_for_fontset): Remove; not used.
19385 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19386 does not deduce is never used uninitialized.
19387 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19388 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19389
19390 * terminal.c (store_terminal_param): Now static.
19391
19392 * xmenu.c (menu_highlight_callback): Now static.
19393 (set_frame_menubar): Remove unused local.
19394 (xmenu_show): Rename parameter to avoid shadowing.
19395 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19396 since they might point to immutable storage.
19397 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19398 since it's unused otherwise.
19399
19400 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19401 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19402 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19403 avoids a gcc -Wuninitialized diagnostic.
19404 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19405 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19406 does not deduce are never used uninitialized.
19407
19408 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19409
19410 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19411 * window.c (window_loop, size_window):
19412 (run_window_configuration_change_hook, enlarge_window): Likewise.
19413
19414 * window.c (display_buffer): Now static.
19415 (size_window): Mark variables that gcc -Wuninitialized
19416 does not deduce are never used uninitialized.
19417 * window.h (check_all_windows): New decl, to forestall
19418 gcc -Wmissing-prototypes diagnostic.
19419 * dispextern.h (bidi_dump_cached_states): Likewise.
19420
19421 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19422 shadowing.
19423 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19424 Include <limits.h>.
19425 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19426 and to avoid gcc -Wuninitialized warning.
19427 (load_charset_map): Mark variables that gcc -Wuninitialized
19428 does not deduce are never used uninitialized.
19429 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19430
19431 * coding.c (coding_set_source, coding_set_destination):
19432 Use "else { /* comment */ }" rather than "else /* comment */;"
19433 for clarity, and to avoid gcc -Wempty-body warning.
19434 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19435 a block, when the outer 'i' will do.
19436 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19437 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19438 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19439 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19440 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19441 Rename locals to avoid shadowing.
19442 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19443 * coding.c (emacs_mule_char, encode_invocation_designation):
19444 Now static, since they're not used elsewhere.
19445 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19446 (decode_coding_object, encode_coding_object, detect_coding_system):
19447 (decode_coding_emacs_mule): Mark variables that gcc
19448 -Wuninitialized does not deduce are never used uninitialized.
19449 (detect_coding_iso_2022): Initialize a local variable that might
19450 be used uninitialized. Leave a FIXME because it's not clear that
19451 this initialization is needed. (Bug#8211)
19452 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19453 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19454 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19455 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19456 Remove unused macros.
19457
19458 * category.c (hash_get_category_set): Remove unused local var.
19459 (copy_category_table): Now static, since it's not used elsewhere.
19460 * character.c (string_count_byte8): Likewise.
19461
19462 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19463 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19464
19465 * chartab.c (copy_sub_char_table): Now static, since it's not used
19466 elsewhere.
19467 (sub_char_table_ref_and_range, char_table_ref_and_range):
19468 Rename locals to avoid shadowing.
19469 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19470
19471 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19472 (BIDI_BOB): Remove unused macro.
19473
19474 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19475 deduce are never used uninitialized.
19476 * term.c (encode_terminal_code): Likewise.
19477
19478 * term.c (encode_terminal_code): Now static. Remove unused local.
19479
19480 * tparam.h: New file.
19481 * term.c, tparam.h: Include it.
19482 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19483 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19484 Move these decls to tparam.h, and make them agree with what
19485 is actually in tparam.c. The previous trick of using incompatible
19486 decls in different modules does not conform to the C standard.
19487 All callers of tparam changed to use tparam's actual API.
19488 * tparam.c (tparam1, tparam, tgoto):
19489 Use const pointers where appropriate.
19490
19491 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19492 * cm.h (struct cm): Likewise.
19493 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19494 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19495 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19496 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19497 (turn_on_face, init_tty): Likewise.
19498 * termchar.h (struct tty_display_info): Likewise.
19499
19500 * term.c (term_mouse_position): Rename local to avoid shadowing.
19501
19502 * alloc.c (mark_ttys): Move decl from here ...
19503 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19504
19505 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19506
19507 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19508
19509 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19510
19511 * search.c (compile_pattern_1): Remove argument regp, unused since
19512 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19513 (compile_pattern): Don't pass it.
19514
19515 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19516
19517 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19518 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19519 for ! HAVE_GTK3.
19520 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19521
19522 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19523
19524 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19525 gdk_window_get_screen, gdk_window_get_geometry,
19526 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19527 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19528 (xg_get_pixbuf_from_pixmap): New function.
19529 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19530 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19531 Call xg_get_pixbuf_from_pixmap instead of
19532 gdk_pixbuf_get_from_drawable.
19533 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19534 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19535 (xg_check_special_colors): Use GtkStyleContext and its functions
19536 for HAVE_GTK3.
19537 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19538 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19539 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19540 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19541 Call gtk_widget_get_preferred_size.
19542 (xg_frame_resized): gdk_window_get_geometry only takes 5
19543 parameters.
19544 (xg_win_to_widget, xg_event_is_for_menubar):
19545 Call gdk_x11_window_lookup_for_display.
19546 (xg_set_widget_bg): New function.
19547 (delete_cb): New function.
19548 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19549 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19550 (xg_set_background_color): Call xg_set_widget_bg.
19551 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19552 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19553 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19554 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19555 if ! HAVE_GTK3.
19556 (update_frame_tool_bar): Call gtk_widget_hide.
19557 (xg_initialize): Use GDK_KEY_g.
19558
19559 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19560 if ! HAVE_GTK3
19561 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19562
19563 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19564 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19565 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19566
19567 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19568
19569 * w32xfns.c (select_palette): Check success of RealizePalette against
19570 GDI_ERROR, not zero.
19571
19572 See ChangeLog.11 for earlier changes.
19573
19574 ;; Local Variables:
19575 ;; coding: utf-8
19576 ;; End:
19577
19578 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19579
19580 This file is part of GNU Emacs.
19581
19582 GNU Emacs is free software: you can redistribute it and/or modify
19583 it under the terms of the GNU General Public License as published by
19584 the Free Software Foundation, either version 3 of the License, or
19585 (at your option) any later version.
19586
19587 GNU Emacs is distributed in the hope that it will be useful,
19588 but WITHOUT ANY WARRANTY; without even the implied warranty of
19589 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19590 GNU General Public License for more details.
19591
19592 You should have received a copy of the GNU General Public License
19593 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.