]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix another instance of bug #12933 with non-ASCII file names on Windows.
[gnu-emacs] / src / ChangeLog
1 2012-12-04 Eli Zaretskii <eliz@gnu.org>
2
3 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4 Encode the file name before passing it to dostounix_filename, in
5 case it will downcase it (under w32-downcase-file-names).
6 (Bug#12933)
7
8 2012-12-01 Chong Yidong <cyd@gnu.org>
9
10 * fileio.c (Vauto_save_list_file_name): Doc fix.
11
12 2012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
13
14 * w32fns.c: Remove prototype of atof.
15 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
16 builds.
17 (file_dialog_callback): Declared UINT_PTR.
18
19 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
20 with 64-bit builds.
21
22 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
23 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
24 defined.
25
26 2012-11-27 Glenn Morris <rgm@gnu.org>
27
28 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
29
30 2012-11-26 Eli Zaretskii <eliz@gnu.org>
31
32 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
33 (Bug#11964)
34
35 2012-11-24 Paul Eggert <eggert@cs.ucla.edu>
36
37 Revert recent change for Bug#8855.
38 As reported by Harald Hanche-Olsen in
39 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
40 the change introduces a further bug, of creating lots of zombie
41 processes in some cases. Further work is needed to come up with a
42 better fix for Bug#8855.
43
44 2012-11-24 Eli Zaretskii <eliz@gnu.org>
45
46 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
47 highlighting on the frame was cleared. Prevents assertion
48 violations when repeatedly clicking on the "Top" link of the
49 "bread-crumbs" in Info buffers.
50
51 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
52 Eli Zaretskii <eliz@gnu.org>
53
54 Fix a race condition with glib (Bug#8855).
55 The symptom is a diagnostic "GLib-WARNING **: In call to
56 g_spawn_sync(), exit status of a child process was requested but
57 SIGCHLD action was set to SIG_IGN and ECHILD was received by
58 waitpid(), so exit status can't be returned." The diagnostic
59 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
60 The real bug is a race condition between Emacs and glib: Emacs
61 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
62 so that glib can't find it. Work around the bug by invoking
63 waitpid only on subprocesses that Emacs itself creates.
64
65 This is a backport from the trunk, consisting of:
66
67 * w32proc.c (create_child): Don't clip the PID of the child
68 process to fit into an Emacs integer, as this is no longer a
69 restriction.
70 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
71 reaping only the process specified by PID argument, if that is
72 positive. Use PID instead of dead_child to know which process to
73 reap. Wait for the child to die only if WNOHANG is not in
74 OPTIONS.
75 (sys_select): Don't set dead_child.
76
77 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
78 as it is no longer needed.
79
80 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
81 no longer needed.
82 (create_process, record_child_status_change): Don't use special
83 value -1 in pid field, as the caller now must know the pid rather
84 than having the callee infer it. The inference was sometimes
85 incorrect anyway, due to another race.
86 (create_process): Set new 'alive' member if child is created.
87 (process_status_retrieved): New function.
88 (record_child_status_change): Use it.
89 Accept negative 1st argument, which means to wait for the
90 processes that Emacs already knows about. Move special-case code
91 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
92 processes that have already been waited for, by testing and
93 clearing new 'alive' member. Remove the setting of
94 record_at_most_one_child for the !WNOHANG case.
95 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
96 now does this internally.
97 (handle_child_signal): Let record_child_status_change do all
98 the work, since we do not want to reap all exited child processes,
99 only the child processes that Emacs itself created.
100 * process.h (Lisp_Process): New boolean member 'alive'.
101
102 2012-11-23 Eli Zaretskii <eliz@gnu.org>
103
104 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
105 between bpos_covered and bpos_max. This fixes cursor display when
106 several display strings follow each other.
107
108 * .gdbinit (pgx): If the glyph's object is a string, display the
109 pointer to string data, rather than the value of the string object
110 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
111
112 2012-11-21 Eli Zaretskii <eliz@gnu.org>
113
114 * indent.c (Fvertical_motion): If the starting position is covered
115 by a display string, return to one position before that, to avoid
116 overshooting it inside move_it_to. (Bug#12930)
117
118 2012-11-20 Daniel Colascione <dancol@dancol.org>
119
120 * w32fns.c (Fx_file_dialog):
121 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
122 cygwin_convert_file_name*.
123
124 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
125 Rename cygwin_convert_path* to cygwin_convert_file_name*.
126
127 2012-11-20 Ken Brown <kbrown@cornell.edu>
128
129 * emacs.c (main): Set the G_SLICE environment variable for all
130 Cygwin builds, not just GTK builds. See
131 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
132
133 2012-11-19 Eli Zaretskii <eliz@gnu.org>
134
135 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
136 w32_note_current_window with code. (Backport from trunk.)
137
138 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
139 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
140 Define for the MSVC compiler.
141
142 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
143 semi-colon.
144
145 2012-11-18 Eli Zaretskii <eliz@gnu.org>
146
147 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
148 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
149 dostounix_filename. Prevents crashes down the road, because
150 dostounix_filename assumes it gets a unibyte string. Reported by
151 Michel de Ruiter <michel@sentient.nl>, see
152 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
153
154 2012-11-17 Eli Zaretskii <eliz@gnu.org>
155
156 * w32select.c: Include w32common.h before w32term.h, so that
157 windows.h gets included before w32term.h uses some of its
158 features, see below.
159
160 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
161 typedefs.
162 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
163 prototypes.
164 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
165
166 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
167
168 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
169 (ns_select): Return at once if events are held (Bug#12834).
170
171 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
172
173 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
174 Needed following 2012-10-20 change. (Bug#12902)
175
176 2012-11-16 Glenn Morris <rgm@gnu.org>
177
178 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
179
180 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
181
182 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
183
184 2012-11-14 Eli Zaretskii <eliz@gnu.org>
185
186 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
187 use the same value of thread handle.
188 (start_timer_thread): If the timer thread exited (due to error),
189 clean up by closing the two handles it used. Duplicate the caller
190 thread's handle here, so it gets duplicated only once, when
191 launching the timer thread. Set priority of the timer thread, not
192 the caller thread.
193 (getitimer): Don't duplicate the caller thread's handle here.
194 (Bug#12832)
195
196 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
197
198 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
199 called (Bug#12834).
200
201 2012-11-12 Eli Zaretskii <eliz@gnu.org>
202
203 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
204 passed to pint2str and pint2hrstr to be at most the size of the
205 frame's decode_mode_spec_buffer. This avoids crashes with very
206 large values of FIELD_WIDTH argument to decode_mode_spec.
207 (Bug#12867)
208
209 2012-11-07 Martin Rudalics <rudalics@gmx.at>
210
211 * window.c (Fsplit_window_internal): Set combination limit of
212 new parent window to t iff Vwindow_combination_limit is t;
213 fixing a regression introduced with the change from 2012-09-22.
214 (Fwindow_combination_limit, Fset_window_combination_limit):
215 Fix doc-strings.
216
217 2012-11-06 Eli Zaretskii <eliz@gnu.org>
218
219 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
220 amount when the scroll margins are too large. When scrolling
221 backwards in the buffer, give up if cannot reach point or the
222 scroll margin within a reasonable number of screen lines.
223 Fixes point position in window under scroll-up/down-aggressively when
224 point is positioned many lines beyond the window top/bottom.
225 (Bug#12811)
226
227 2012-11-05 Eli Zaretskii <eliz@gnu.org>
228
229 * ralloc.c (relinquish): If real_morecore fails to return memory
230 to the system, don't crash; instead, leave the last heap
231 unchanged and return. (Bug#12774)
232
233 2012-11-03 Eli Zaretskii <eliz@gnu.org>
234
235 * lisp.mk: Adjust comments to the fact that term/internal is now
236 loaded from loadup.el.
237
238 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
239 (msdos_fatal_signal): New function.
240 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
241 its argument list.
242
243 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
244 for GCC versions before 4.
245 (emacs_raise): Define to call msdos_fatal_signal.
246
247 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
248 iterator when starting in the middle of a display or overlay
249 string. (Bug#12745)
250
251 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
252
253 * widget.c (resize_cb): New function.
254 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
255 (EmacsFrameResize): Check if all is up to date before changing frame
256 size.
257
258 2012-11-01 Eli Zaretskii <eliz@gnu.org>
259
260 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
261
262 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
263
264 Fix crash when using Emacs as commit editor for git (Bug#12697).
265 * callproc.c (setpgrp): Remove macro, as we now use setpgid
266 and it is configured in conf_post.h.
267 (Fcall_process): Don't invoke both setsid and setpgid; the former
268 is enough, if it exists.
269 * callproc.c (Fcall_process, child_setup):
270 * process.c (create_process): Use setpgid.
271 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
272 for the real thing.
273 * dispnew.c (init_display): Initialize the foreground group
274 if we are running a tty display.
275 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
276 * lisp.h (init_foreground_group): New decl.
277 * sysdep.c (inherited_pgroup): New static var.
278 (init_foreground_group, tcsetpgrp_without_stopping)
279 (narrow_foreground_group, widen_foreground_group): New functions.
280 (init_sys_modes): Narrow foreground group.
281 (reset_sys_modes): Widen foreground group.
282
283 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
284
285 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
286
287 2012-10-31 Martin Rudalics <rudalics@gmx.at>
288
289 * minibuf.c (read_minibuf): Restore current buffer since
290 choose_minibuf_frame calling Fset_frame_selected_window may
291 change it (Bug#12766).
292
293 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
294
295 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
296
297 2012-10-30 Kenichi Handa <handa@gnu.org>
298
299 * font.c (Ffont_at): If WINDOW is specified and it is not
300 displaying the current buffer, signal an error.
301
302 2012-10-29 Daniel Colascione <dancol@dancol.org>
303
304 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
305 In preparation for fixing bug#12739, move these functions from
306 here...
307
308 * coding.h, coding.c: ... to here, and compile them only when
309 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
310 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
311
312 2012-10-28 Eli Zaretskii <eliz@gnu.org>
313
314 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
315 (timer_loop, getitimer, setitimer): Use it instead of
316 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
317 'clock'.
318 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
319 literal 10000.
320
321 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
322
323 * nsterm.m (NO_APPDEFINED_DATA): New define.
324 (last_appdefined_event_data): New variable
325 (last_appdefined_event): Remove.
326 (ns_select): Initialize t from last_appdefined_event_data instead
327 of [last_appdefined_event data1].
328 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
329 remove last_appdefined_event (Bug#12698).
330
331 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
332
333 * frame.c (x_set_font): Catch internal error.
334
335 2012-10-27 Eli Zaretskii <eliz@gnu.org>
336
337 Avoid overflow in w32 implementation of interval timers.
338 When possible, for ITIMER_PROF count only times the main thread
339 actually executes.
340 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
341 'volatile ULONGLONG' types. All the other data which was
342 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
343 (GetThreadTimes_Proc): New typedef.
344 (w32_get_timer_time): New function, returns a suitable time value
345 for the timer.
346 (timer_loop): Enter critical section when accessing ULONGLONG
347 values of the itimer_data struct, as these accesses are no longer
348 atomic. Call 'w32_get_timer_time' instead of 'clock'.
349 Remove unused variable.
350 (init_timers): Initialize s_pfn_Get_Thread_Times.
351 (start_timer_thread): Don't assign itimer->caller_thread here.
352 (getitimer): Assign itimer->caller_thread here.
353 (setitimer): Always call getitimer to get the value of ticks_now.
354 (sys_spawnve): Avoid compiler warning about format mismatch.
355
356 2012-10-26 Eli Zaretskii <eliz@gnu.org>
357
358 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
359 mouse movement events if the menu bar is active. This avoids
360 producing a busy "hour-glass" cursor by Windows if the mouse
361 pointer is positioned over a tooltip shown for some menu item.
362
363 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
364
365 Don't assume process IDs fit in int.
366 * emacs.c (shut_down_emacs) [!DOS_NT]:
367 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
368 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
369 Use pid_t, not int, to store process IDs, as 'int'
370 is not wide enough on a few platforms (e.g., AIX and IRIX).
371
372 2012-10-23 Kenichi Handa <handa@gnu.org>
373
374 The following change is to make face-font-rescale-alist work
375 correctly for non-ASCII fonts.
376
377 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
378 (font_open_for_lface): Handle Vface_font_rescale_alist.
379
380 2012-10-23 Chong Yidong <cyd@gnu.org>
381
382 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
383
384 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
385
386 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
387 for screen font.
388 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
389
390 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
391 event (Bug#12681).
392
393 2012-10-21 Glenn Morris <rgm@gnu.org>
394
395 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
396
397 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
398
399 Port to OpenBSD 5.1.
400 * frame.c (Fmouse_position, Fmouse_pixel_position):
401 * xdisp.c (produce_stretch_glyph):
402 Declare local vars only when they're needed.
403 This is clearer and avoids a warning on OpenBSD about unused vars.
404 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
405 This is safer, and avoids OpenBSD warnings about unused vars.
406 * keyboard.c (record_menu_key): Remove unnecessary decl.
407 (poll_timer): Define only if POLL_FOR_INPUT is defined.
408 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
409 as our definition clashes with OpenBSD's.
410 * xfaces.c (load_face_colors, check_lface_attrs)
411 (get_lface_attributes_no_remap, get_lface_attributes)
412 (lface_fully_specified_p, x_supports_face_attributes_p)
413 (tty_supports_face_attributes_p, face_fontset, realize_face)
414 (realize_x_face, realize_tty_face):
415 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
416 merely Lisp_Object *. This is more informative and avoids
417 a warning on OpenBSD about accessing beyond an object's size.
418
419 2012-10-20 Chong Yidong <cyd@gnu.org>
420
421 * lread.c (Fload): Doc fix (Bug#12592).
422
423 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
424
425 * font.c (Ffont_at): Fix previous change.
426
427 2012-10-19 Eli Zaretskii <eliz@gnu.org>
428
429 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
430 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
431 for the reasons.
432
433 * alloc.c (NSTATICS): Decrease to 0x800.
434
435 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
436
437 * fns.c (Fnreverse): Include the problem element when signalling an
438 error (bug#12677).
439
440 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
441
442 * nsterm.m (ns_select): Check writefds before call to
443 FD_ISSET (Bug#12668).
444
445 2012-10-18 Daniel Colascione <dancol@dancol.org>
446
447 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
448 (staticpro): If we run out of staticpro slots, die with an
449 informative error instead of just calling emacs_abort.
450
451 2012-10-18 Martin Rudalics <rudalics@gmx.at>
452
453 Fix two flaws reported by Dmitry Antipov.
454 * window.c (Ftemp_output_buffer_show): Remove.
455 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
456 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
457
458 2012-10-17 Eli Zaretskii <eliz@gnu.org>
459
460 * makefile.w32-in ($(BLD)/w32.$(O)):
461 ($(BLD)/vm-limit.$(O)):
462 ($(BLD)/term.$(O)):
463 ($(BLD)/unexw32.$(O)):
464 ($(BLD)/fileio.$(O)):
465 ($(BLD)/dispnew.$(O)): Update dependencies.
466
467 * w32term.h (w32_initialize_display_info, initialize_w32_display):
468 Add prototypes.
469
470 * w32proc.c: Include ctype.h.
471
472 * w32.h (init_environment, check_windows_init_file)
473 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
474 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
475 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
476 (sys_link): Add prototypes.
477
478 * w32.c: Include w32select.h.
479 (sys_access, e_malloc, sys_select): Add prototypes.
480 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
481
482 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
483
484 * unexw32.c: Include lisp.h and w32.h.
485
486 * term.c [WINDOWSNT]: Include w32term.h.
487
488 * process.c [WINDOWSNT]: Add prototype of sys_select.
489
490 * fileio.c [WINDOWSNT]: Include w32.h.
491
492 * dispnew.c [WINDOWSNT]: Include w32.h.
493
494 * cygw32.c (Fcygwin_convert_path_to_windows)
495 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
496 Lisp_Object values. (Bug#12661)
497
498 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
499 to Lisp_Object. (Bug#12661)
500
501 2012-10-17 Kenichi Handa <handa@gnu.org>
502
503 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
504 invalidate.
505
506 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
507
508 * buffer.c (Fkill_buffer): When unchaining the marker,
509 reset its buffer pointer to NULL (Bug#12652).
510
511 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
512
513 Do not verify indirection counters of killed buffers (Bug#12579).
514 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
515 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
516
517 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
518
519 * alloc.c (Fmake_byte_code): Fix typo in comment.
520 * print.c (print_interval): Define as static to match prototype.
521 * indent.c (disptab_matches_widthtab, recompute_width_table):
522 Convert to eassert.
523
524 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
525
526 * editfns.c (get_system_name): Remove.
527 * lisp.h (get_system_name): Remove prototype.
528 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
529 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
530
531 2012-10-15 Daniel Colascione <dancol@dancol.org>
532
533 * dbusbind.c: Add comment explaining reason for previous change.
534
535 2012-10-15 Martin Rudalics <rudalics@gmx.at>
536
537 * window.c (Fwindow_end): Rewrite check whether cached position
538 can be used (Bug#12600).
539 (resize_frame_windows, grow_mini_window, shrink_mini_window):
540 Set windows_or_buffers_changed.
541
542 2012-10-15 Daniel Colascione <dancol@dancol.org>
543
544 * dbusbind.c: Fix cygw32 build break when compiling with dbus
545 enabled by undefining the symbol "interface", which the platform
546 headers define to something incompatible.
547
548 2012-10-14 Daniel Colascione <dancol@dancol.org>
549
550 * image.c (init_tiff_functions, init_imagemagick_functions)
551 (init_svg_functions): Fix cygw32 build break by using these
552 functions only when WINDOWSNT _and_ HAVE_NTGUI.
553
554 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
555
556 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
557
558 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
559
560 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
561
562 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
563
564 * coding.c (detect_coding): Set coding->id before calling
565 this->detector.
566
567 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
568
569 * fileio.c: Formatting fixes.
570
571 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
572
573 Fix some stat-related races.
574 * fileio.c (Fwrite_region): Avoid race condition if a file is
575 removed or renamed by some other process immediately after Emacs
576 writes it but before Emacs stats it. Do not assume that stat (or
577 fstat) succeeds.
578 * image.c (slurp_file): Resolve the file name with fopen + fstat
579 rather than stat + fopen.
580 (pbm_read_file) [0]: Remove unused code with stat race.
581 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
582 Remove ineffective code with stat race.
583
584 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
585
586 * doc.c (get_doc_string): Don't signal an error if the file is missing.
587
588 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
589
590 * nsterm.m (hold_event_q): New static variable.
591 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
592 ! q_event_ptr.
593 (hold_event): New function.
594 (ns_read_socket): If hold_event_q have events, store them and
595 return (Bug#12384).
596 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
597 is zero (Bug#12384).
598
599 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
600
601 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
602
603 2012-10-12 Eli Zaretskii <eliz@gnu.org>
604
605 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
606
607 * fileio.c (check_existing): New function.
608 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
609 instead of calling 'stat', when what's needed is to check whether
610 a file exists. This avoids expensive system calls on MS-Windows.
611 (Bug#12587)
612
613 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
614
615 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
616 determine whether a file exists and is not a directory.
617
618 * lisp.h (check_existing): Add prototype.
619
620 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
621
622 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
623
624 2012-10-12 Glenn Morris <rgm@gnu.org>
625
626 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
627
628 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
629
630 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
631
632 * eval.c (Fautoload): Remember previous autoload status in load-history.
633
634 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
635
636 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
637 * lread.c (load_each_byte, new_backquote_flag, readchar)
638 (read_filtered_event, lisp_file_lexically_bound_p)
639 (safe_to_load_version, Fload, complete_filename_p, openp)
640 (build_load_history, readevalloop, read_escape, read1)
641 (string_to_number, read_vector, read_list):
642 * macros.c (Fstart_kbd_macro):
643 * marker.c (CONSIDER):
644 * menu.c (parse_single_submenu, digest_single_submenu)
645 (find_and_return_menu_selection, Fx_popup_menu):
646 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
647 (Ftry_completion):
648 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
649 (ns_menu_show):
650 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
651 (xmenu_show, xdialog_show):
652 Use bool for booleans.
653 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
654 as it's not a predicate. All uses changed. Omit unnecessary
655 buffer termination.
656
657 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
658
659 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
660 (save_excursion_restore): Do not restore mark if it was not saved.
661
662 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
663
664 * marker.c (cached_modiff): EMACS_INT, not int.
665
666 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
667 instead of having a wrong decl.
668 * nsmenu.m (waiting_for_input): Remove wrong decl.
669
670 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
671
672 keyboard.c, keymap.c: Use bool for booleans.
673 * dispnew.c (sit_for): Distinguish between 3-way display_option
674 and boolean do_display.
675 * keyboard.c (single_kboard, this_command_key_count_reset)
676 (waiting_for_input, echoing, immediate_quit, input_pending)
677 (interrupt_input, interrupts_deferred, pop_kboard)
678 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
679 (command_loop_1, adjust_point_for_property)
680 (safe_run_hooks_error, input_polling_used, read_char):
681 (help_char_p, readable_events, kbd_buffer_events_waiting)
682 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
683 (lucid_event_type_list_p, get_input_pending):
684 (gobble_input, menu_separator_name_p, menu_bar_item)
685 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
686 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
687 (keyremap_step, test_undefined, read_key_sequence)
688 (detect_input_pending, detect_input_pending_ignore_squeezables)
689 (detect_input_pending_run_timers, requeued_events_pending_p)
690 (quit_throw_to_read_char, Fset_input_interrupt_mode):
691 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
692 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
693 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
694 (accessible_keymaps_1, Fkey_description, push_key_description):
695 (shadow_lookup, struct where_is_internal_data)
696 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
697 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
698 (describe_map, describe_vector):
699 * menu.c (single_menu_item):
700 * nsmenu.m (ns_update_menubar):
701 * process.c (wait_reading_process_output):
702 * search.c (scan_buffer, scan_newline):
703 Use bool for boolean.
704 * keyboard.c (timers_run, swallow_events)
705 (detect_input_pending_run_timers):
706 * process.c (wait_reading_process_output):
707 Use unsigned for counter where wraparound-on-overflow is desired,
708 since unsigned is guaranteed to have that behavior and signed is not.
709 (read_char): Use ptrdiff_t for string length.
710 (get_input_pending): Remove first argument, since it was always
711 the same pointer-to-int (now pointer-to-boolean) &input_pending,
712 and behave as if it had that value. Return new value of
713 input_pending. All callers changed.
714 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
715 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
716 a string length.
717 * keymap.c (push_key_description): Omit last arg, which was always 1.
718 All callers changed.
719
720 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
721
722 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
723
724 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
725 ($(BLD)/term.$(O)): Update dependencies.
726
727 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
728
729 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
730 * lisp.h (enum pvec_type): Adjust comments and omit explicit
731 initializer for PVEC_NORMAL_VECTOR.
732
733 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
734
735 Clean out old termopts cruft.
736 * termopts.h (flow_control, meta_key): Remove unused decls.
737 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
738 Don't include termopts.h.
739
740 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
741
742 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
743
744 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
745
746 * commands.h (immediate_quit): Remove duplicate decl.
747
748 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
749
750 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
751 caching.
752 (nsfont_open): Remove setting of Vfonts_in_cache.
753 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
754
755 2012-10-09 Eli Zaretskii <eliz@gnu.org>
756
757 * w32fns.c (w32_last_error): Change the return value to DWORD, to
758 match what GetLastError returns. Explain why the function is
759 needed.
760
761 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
762 'is_tooltip_frame', to avoid confusion with its global namesake.
763
764 2012-10-08 Daniel Colascione <dancol@dancol.org>
765
766 * xdisp.c (start_hourglass): Call w32_note_current_window when
767 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
768 build that caused Emacs to display the hourglass cursor forever.
769
770 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
771 which is broken under remote desktop, calculate the number of
772 colors available for a display based on the display's number of
773 planes and number of bits per pixel per plane. (bug#10397).
774
775 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
776
777 * nsfont.m (Vfonts_in_cache): New variable.
778 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
779 are used. Add cached fonts to Vfonts_in_cache.
780 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
781
782 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
783
784 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
785 in nt/config.nt.
786 (FONT_H): Define after FRAME_H.
787 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
788 Update dependencies.
789
790 * w32term.c: Remove leftover declaration of keyboard_codepage.
791
792 2012-10-08 Eli Zaretskii <eliz@gnu.org>
793
794 * makefile.w32-in (FONT_H): Add $(FRAME_H).
795 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
796 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
797 (GLOBAL_SOURCES): Add cygw32.c.
798 ($(BLD)/unexw32.$(O)):
799 ($(BLD)/w32.$(O)):
800 ($(BLD)/w32console.$(O)):
801 ($(BLD)/w32fns.$(O)):
802 ($(BLD)/w32heap.$(O)):
803 ($(BLD)/w32menu.$(O)):
804 ($(BLD)/w32proc.$(O)): Add w32common.h.
805
806 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
807 'const char *'.
808 (x_to_w32_color): Don't modify the argument, modify a copy instead.
809
810 2012-10-08 Daniel Colascione <dancol@dancol.org>
811
812 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
813 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
814 accidental message numbering hole. Change other messages to
815 match.
816
817 * w32select.h (HAVE_W32SELECT): Remove.
818
819 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
820 w32common.h instead of w32heap.h.
821
822 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
823 (get_allocation_unit, get_processor_type, get_w32_major_version)
824 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
825 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
826 (OS_NT, os_subtype, cache_system_info): Move declarations to
827 w32common.
828
829 * w32heap.c: Include w32common.h.
830 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
831 (w32_minor_version, w32_build_number, w32_subtype):
832 Remove duplicate definitions.
833
834 * w32fns.c: Include w32common.h; include w32heap.h only in
835 WINDOWSNT.
836
837 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
838 Use `report_file_error' instead of `error' in order to better
839 inform users of what went wrong. Increase NTGUI_UNICODE file
840 dialog box file name length to 32k, the maximum allowed by the NT
841 kernel.
842
843 * w32common.h: New file.
844 (ROUND_UP, ROUND_DOWN, get_page_size)
845 (get_allocation_unit, get_processor_type, get_w32_major_version)
846 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
847 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
848 (OS_NT, os_subtype, cache_system_info): Move here.
849
850 * unexw32.c, unexcw.c: Include w32common.h.
851
852 * emacs.c (main): Use (defined (WINDOWSNT) || defined
853 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
854 to call syms_of_w32select.
855
856 * cygw32.h: Remove obsolete EXFUN declarations.
857
858 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
859
860 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
861 of w32inevt.o from SOME_MACHINE_OBJECTS.
862
863 2012-10-08 Daniel Colascione <dancol@dancol.org>
864
865 * image.c: Permanent fix for JPEG compilation issue --- limit
866 jpeglib `boolean' redefinition to Cygwin builds.
867
868 2012-10-08 Eli Zaretskii <eliz@gnu.org>
869
870 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
871
872 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
873 Cygwin.
874
875 2012-10-08 Daniel Colascione <dancol@dancol.org>
876
877 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
878 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
879 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
880 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
881 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
882 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
883 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
884 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
885 now a supported configuration.
886
887 * Makefile.in: consolidate image variables into LIBIMAGE; add
888 W32_OBJ and W32_LIBS. Compile new files.
889
890 * conf_post.h:
891 (_DebPrint) declare tracing facility for W32 debugging. We need
892 to unify tracing later.
893
894 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
895 unconditional use of W32 Unicode functions. Cygwin runs only on
896 100% Unicode operating systems.
897
898 * cygw32.c: New file. Define Cygwin-specific facilities.
899 (Fcygwin_convert_path_to_windows)
900 (Fcygwin_convert_path_from_windows): New user functions for
901 accessing Cygwin path-munging routines.
902
903 * cygw32.h: New file.
904 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
905 UTF-16LE strings temporarily inside non-Lisp-visible string
906 objects.
907
908 (w32_strerror): Just what it says on the tin.
909
910 * emacs.c: Make the NS fork-then-exec code for daemon-launching
911 also run for Cygwin; both systems have the same problem with using
912 GUI facilities in a forked child. Also call syms_of_cygw32,
913 syms_of_w32select in correct places.
914
915 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
916 needs fork-then-exec for daemon launching.
917
918 * font.h: Include frame.h.
919
920 * image.c: Use the image library cache machinery only when we're
921 compiling for native WINDOWSNT; Cygwin can use shared libraries
922 like any other Unixlike system.
923
924 * keyboard.c: Clarify a comment regarding the input loop.
925
926 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
927 functions directly instead of trying to detect at runtime that our
928 host operating system supports them. We make this change for two
929 reasons: Cygwin lacks support for the multibyte character
930 conversion functions used by the legacy menu code, and Cygwin
931 never needs to rely on non-Unicode APIs.
932
933 * unexw32.c (hinst): Declare extern.
934
935 * w32.c: Change header order;
936 (w32_strerror): Move to w32fns.c because we need it for
937 non-WINDOWSNT builds.
938
939 * w32.h: Add #error macro to make sure we don't include w32.h for
940 Cygwin builds. Remove w32select declarations.
941
942 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
943 w32fns.c. w32console.c is WINDOWSNT-only.
944
945 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
946 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
947 POSIXy alternative.
948 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
949 (w32_major_version, w32_minor_version, w32_build_number)
950 (os_subtype, sound_type): Define here
951 (w32_defined_color): Make color parameter const for consistency
952 with other _defined_color functions.
953 (w32_createwindow): Unconditionally call w32_init_class instead of
954 doing so only when hprevinst is non-NULL. Plumbing hprevinst
955 through the code is complex and unnecessary because class
956 registration is practically free.
957 (w32_name_of_message): New EMACSDEBUG-only function.
958 (Fset_message_beep): Move here
959 (Fx_open_connection): Require that the display name for Windows be
960 "w32" for consistency, emacsclient disambiguation, and maybe, one
961 day, multi-window-system support.
962 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
963 Cygwin files for W32 GUI facilities, since these clearly don't
964 expect Cygwin names.
965 (_DebPrint): Define.
966 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
967 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
968 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
969 (w32_last_error): Remove.
970
971 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
972
973 * w32heap.c (syspage_mask): Declare here.
974 (cache_system_info): Remove.
975
976 * w32inevt.c (faked_key): Define globally, not statically.
977 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
978 (w32_console_toggle_lock_key): Move to w32fns.c.
979
980 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
981
982 * w32proc.c (_DebPrint): Move to w32fns.c.
983 * w32select.c: Include string.h, stdio.h for Cygwin.
984 * w32select.h: New File.
985
986 * w32term.c: Include io.h for non-CYGWIN builds; needed for
987 get_osfhandle.
988 (w32_message_fd): New variable. Under Cygwin, holds the file
989 descriptor the system used to tell us about pending thread
990 messages.
991
992 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
993 that prevented compilation under non-WINDOWSNT systems.
994
995 (w32_initialize): Open /dev/windows and assign it to
996 w32_message_fd. Provide w32 feature.
997
998 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
999 (WM_EMACS_INPUT_READY): add.
1000 (prepend_msg, w32_message_fd): Declare globally.
1001
1002 * w32xfns.c:
1003 (keyboard_handle): Use only when WINDOWSNT.
1004 (notify_msg_ready): New function. Posts a message to the main
1005 thread's message queue under CYGWIN, which wakes up the main
1006 thread from select(2) by making the /dev/windows file descriptor
1007 ready. Under WINDOWSNT, it sets an event the same way the old
1008 code did.
1009
1010 (post, prepend_msg): Actually call notify_msg_ready instead of
1011 setting the input event directly.
1012
1013 2012-10-07 Eli Zaretskii <eliz@gnu.org>
1014
1015 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1016 but it still has blocs in it, don't return it to the system,
1017 instead of aborting. (Bug#12402)
1018
1019 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1020
1021 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
1022
1023 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1024 MAC_OS_X_VERSION_10_6.
1025 (syms_of_nsterm): Remove comment about Panther and above for
1026 ns-antialias-text.
1027 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1028 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1029 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1030
1031 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1032 MAC_OS_X_VERSION_10_4.
1033
1034 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1035 MAC_OS_X_VERSION_10_2.
1036
1037 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1038
1039 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1040 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1041
1042 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1043 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1044 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1045 Remove ns_in_resize check.
1046 (ns_clear_frame_area): Remove resize handle code.
1047
1048 * nsfns.m (ns_in_resize): Remove.
1049 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1050 Remove ns_in_resize check.
1051
1052 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 Improve sys_siglist detection.
1055 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1056 defined as a macro, as is done in Solaris.
1057 (sys_siglist_entries): New macro.
1058 (save_strsignal): Use it.
1059 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1060 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1061
1062 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1063
1064 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1065 fullscreen/Fullscreen.
1066
1067 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1068 tobar_height is new.
1069
1070 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1071 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1072 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1073 (windowDidResize:): Check for correct window if old style fullscreen.
1074 Capitalize word in comment. Remove incorrect comment.
1075 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1076 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1077 error in drawing background.
1078 (toggleFullScreen:): Remove comment. Rearrange calls.
1079 Set toolbar values to zero, save old height in tobar_height.
1080 Restore tool bar height when leaving fullscreen.
1081 (canBecomeMainWindow): New function.
1082
1083 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1084
1085 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1086
1087 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1088
1089 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1090
1091 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1092 that time stamps of directories could also be changed.
1093 Don't request the too broad GENERIC_WRITE, only the more restrictive
1094 FILE_WRITE_ATTRIBUTES access rights.
1095
1096 * fileio.c (Fset_file_times): Special-case ignoring errors for
1097 directories only on MSDOS, not on MS-Windows.
1098
1099 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1100
1101 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1102
1103 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1104
1105 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1106 see whether CreateFile failed.
1107
1108 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1109
1110 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1111 to avoid similar races.
1112 * keyboard.c (pending_signals): Now bool, not int.
1113
1114 Port timers to OpenBSD, plus check for timer failures.
1115 OpenBSD problem reported by Han Boetes.
1116 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1117 and/or setitimer.
1118 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1119 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1120 like OpenBSD, which has timer_settime but does not declare it.
1121 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1122 whether to use itimerspec-related primitives. All uses of
1123 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1124
1125 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1126
1127 * profiler.c (handle_profiler_signal): Fix a malloc race
1128 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1129
1130 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1131
1132 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1133
1134 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1135
1136 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1137 consistent with the change in return value of 'safe_strsignal'.
1138
1139 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 Prefer plain 'static' to 'static inline' (Bug#12541).
1142 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1143 (bidi_set_sor_type, bidi_push_embedding_level)
1144 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1145 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1146 (bidi_cache_search, bidi_cache_ensure_space)
1147 (bidi_cache_iterator_state, bidi_cache_find)
1148 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1149 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1150 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1151 Now 'static', not 'static inline'.
1152
1153 Count overruns when profiling; change units to ns.
1154 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1155 Give extra weight to samples after overruns, to attempt to count
1156 the time more accurately.
1157 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1158 the underlying primitives nominally do ns.
1159 (Fprofiler_cpu_start): Document the change. Mention that
1160 the sampling intervals are only approximate.
1161
1162 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1163
1164 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1165
1166 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1167 case for the special 0 coding-system.
1168
1169 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1170 (Fmake_overlay): Remove redundant tests.
1171 (fix_start_end_in_overlays): Remove redundant recentering.
1172
1173 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1174
1175 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1176 Update dependencies.
1177
1178 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1179
1180 Fix a malloc race condition involving strsignal.
1181 A signal can arrive in the middle of a malloc, and Emacs's signal
1182 handler can invoke strsignal, which can invoke malloc, which is
1183 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1184 Fix it by altering the signal handler so that it does not invoke
1185 strsignal.
1186 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1187 * process.c (status_message): Use const pointer, in case strsignal
1188 is #defined to safe_strsignal.
1189 * sysdep.c (sys_siglist, init_signals): Always define and
1190 initialize a substitute sys_siglist if the system does not define
1191 one, even if HAVE_STRSIGNAL.
1192 (safe_strsignal): Rename from strsignal. Always define,
1193 using sys_siglist. Return a const pointer.
1194 * syssignal.h (safe_strsignal): New decl.
1195 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1196
1197 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1198
1199 * w32proc.c (timer_loop): Fix code that waits for timer
1200 expiration, to avoid high CPU usage.
1201
1202 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1203
1204 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1205 (sweep_weak_table): Remove redundant prototypes.
1206
1207 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1208
1209 * emacs.c: Move the inclusion of TERM_HEADER after including
1210 windows.h on WINDOWSNT. This avoids compilation problems with
1211 MSVC.
1212
1213 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1214
1215 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1216 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1217 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1218 as the previous version used 'void *'.
1219
1220 * ralloc.c (ROUNDUP): Fix last change.
1221 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1222 'size_t'.
1223
1224 * w32proc.c <disable_itimers>: New static flag.
1225 (init_timers): Initialize it to zero, after creating the critical
1226 sections used by the timer threads.
1227 (term_timers): Set to 1 before deleting the critical sections.
1228 (getitimer, setitimer): If disable_itimers is non-zero, return an
1229 error indication without doing anything. Reported by Fabrice
1230 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1231 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1232 return results.
1233 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1234 support timers.
1235
1236 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1237 term_ntproc after all the other bookkeeping, to get timers working
1238 as long as possible.
1239
1240 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1241
1242 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1243 Suggested by Juri Linkov in
1244 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1245
1246 Prefer plain 'static' to 'static inline' (Bug#12541).
1247 With static functions, modern compilers inline pretty well by
1248 themselves; advice from programmers often hurts as much as it helps.
1249 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1250 this change shrinks the text size of the Emacs executable by 1.1%
1251 without affecting CPU significantly in my benchmark.
1252 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1253 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1254 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1255 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1256 (bset_auto_fill_function, bset_auto_save_file_format)
1257 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1258 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1259 (bset_cache_long_line_scans, bset_case_fold_search)
1260 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1261 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1262 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1263 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1264 (bset_header_line_format, bset_indicate_buffer_boundaries)
1265 (bset_indicate_empty_lines, bset_invisibility_spec)
1266 (bset_left_fringe_width, bset_major_mode, bset_mark)
1267 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1268 (bset_name, bset_overwrite_mode, bset_pt_marker)
1269 (bset_right_fringe_width, bset_save_length)
1270 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1271 (bset_scroll_up_aggressively, bset_selective_display)
1272 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1273 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1274 (set_buffer_overlays_after):
1275 * category.c (bset_category_table):
1276 * charset.c (read_hex):
1277 * coding.c (produce_composition, produce_charset)
1278 (handle_composition_annotation, handle_charset_annotation)
1279 (char_encodable_p):
1280 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1281 (assign_row, set_frame_matrix_frame, make_current)
1282 (add_row_entry):
1283 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1284 * fns.c (maybe_resize_hash_table):
1285 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1286 * gmalloc.c (register_heapinfo):
1287 * image.c (lookup_image_type):
1288 * intervals.c (set_interval_object, set_interval_left)
1289 (set_interval_right, copy_interval_parent, rotate_right)
1290 (rotate_left, balance_possible_root_interval):
1291 * keyboard.c (kset_echo_string, kset_kbd_queue)
1292 (kset_keyboard_translate_table, kset_last_prefix_arg)
1293 (kset_last_repeatable_command, kset_local_function_key_map)
1294 (kset_overriding_terminal_local_map, kset_real_last_command)
1295 (kset_system_key_syms, clear_event, set_prop):
1296 * lread.c (digit_to_number):
1297 * marker.c (attach_marker, live_buffer, set_marker_internal):
1298 * nsterm.m (ns_compute_glyph_string_overhangs):
1299 * process.c (pset_buffer, pset_command)
1300 (pset_decode_coding_system, pset_decoding_buf)
1301 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1302 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1303 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1304 * syntax.c (bset_syntax_table, dec_bytepos):
1305 * terminal.c (tset_param_alist):
1306 * textprop.c (interval_has_some_properties)
1307 (interval_has_some_properties_list):
1308 * window.c (wset_combination_limit, wset_dedicated)
1309 (wset_display_table, wset_hchild, wset_left_fringe_width)
1310 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1311 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1312 (wset_right_fringe_width, wset_right_margin_cols)
1313 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1314 (wset_vertical_scroll_bar_type, wset_window_parameters):
1315 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1316 (wset_column_number_displayed, wset_region_showing)
1317 (window_box_edges, run_window_scroll_functions)
1318 (append_glyph_string_lists, prepend_glyph_string_lists)
1319 (append_glyph_string, set_glyph_string_background_width)
1320 (append_glyph, append_composite_glyph)
1321 (take_vertical_position_into_account):
1322 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1323 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1324 (lface_hash, lface_same_font_attributes_p, lookup_face):
1325 * xml.c (libxml2_loaded_p):
1326 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1327 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1328 Now 'static', not 'static inline'.
1329
1330 * bidi.c: Tune.
1331 (bidi_copy_it): Do the whole copy with a single memcpy.
1332 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1333
1334 Revert the FOLLOW-SYMLINKS change for file-attributes.
1335 Doing it right would require several changes to Tramp, and there's
1336 not enough time to get that tested before the freeze today.
1337 * dired.c (directory_files_internal, Ffile_attributes):
1338 Undo last change.
1339
1340 * frame.c (x_report_frame_params): Port better to wider ints.
1341 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1342 or that pointers can be printed in 15 decimal digits.
1343 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1344
1345 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1346
1347 Support x64 build on MS-Windows.
1348 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1349 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1350 compatibility with x64.
1351 (x_get_focus_frame): Add prototype.
1352
1353 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1354 defining an XRectangle structure.
1355
1356 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1357 arithmetics for compatibility with x64.
1358
1359 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1360 compatibility with x64.
1361
1362 * w32heap.h: Adjust prototypes and declarations.
1363
1364 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1365 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1366 DWORD, long, and unsigned long, for compatibility with x64.
1367 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1368 (sbrk): Argument is now of type ptrdiff_t.
1369
1370 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1371 less than 0x0500.
1372 (w32_msg_pump): Use WPARAM type for 'result'.
1373
1374 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1375 architecture.
1376 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1377 compatibility with x64.
1378
1379 * vm-limit.c (lim_data): Now size_t.
1380 (check_memory_limits): Adjust prototypes of real_morecore and
1381 __morecore to receive argument of type ptrdiff_t. Use size_t for
1382 five_percent and data_size.
1383
1384 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1385 variables, for compatibility with x64.
1386 (rva_to_section, offset_to_section, relocate_offset)
1387 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1388 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1389 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1390 for compatibility with x64.
1391
1392 * sysdep.c (STDERR_FILENO): Define if not already defined.
1393
1394 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1395 (__morecore): Argument type is now ptrdiff_t.
1396 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1397 (relinquish): Use ptrdiff_t type for 'excess'.
1398 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1399
1400 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1401 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1402 instead of a literal number.
1403
1404 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1405 (min): Define only if not already defined.
1406
1407 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1408 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1409 hosts.
1410
1411 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1412 'bitmaps' is a pointer.
1413
1414 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1415
1416 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1417
1418 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1419
1420 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1421 * dired.c (directory_files_internal, Ffile_attributes):
1422 New arg follow_symlinks. All uses changed.
1423
1424 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1425
1426 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1427
1428 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1429
1430 Support atimers and CPU profiler via profile.c on MS-Windows.
1431 * w32proc.c (sig_mask, crit_sig): New static variables.
1432 (sys_signal): Support SIGALRM and SIGPROF.
1433 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1434 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1435 sigfillset, and sigprocmask are no longer no-ops.
1436 (sigismember): New function.
1437 (struct itimer_data): New definition.
1438 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1439 (crit_prof): New static variables.
1440 (MAX_SINGLE_SLEEP): New definition.
1441 (timer_loop, stop_timer_thread, term_timers, init_timers)
1442 (start_timer_thread, getitimer, setitimer): New functions.
1443 (alarm): No longer a no-op, calls setitimer.
1444
1445 * w32.c (term_ntproc): Call term_timers.
1446 (init_ntproc): Make sure all signals are unblocked at startup, to
1447 erase any traces of dumping. Call init_timers.
1448
1449 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1450 Windows-specific code to display the hourglass mouse pointer is no
1451 longer used.
1452 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1453 to hourglass timer expiration.
1454 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1455 Remove, no longer used.
1456 (w32_note_current_window, show_hourglass, hide_hourglass):
1457 New functions, in support of hourglass cursor display similar to other
1458 window systems.
1459 (syms_of_w32fns): Don't initialize hourglass_timer.
1460
1461 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1462 WINDOWSNT as well.
1463 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1464
1465 * w32.h (init_timers, term_timers): Add prototypes.
1466
1467 2012-09-30 Kenichi Handa <handa@gnu.org>
1468
1469 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1470 to the buffer relocation which may be caused by ccl_driver.
1471
1472 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1473
1474 * xfns.c (Fx_file_dialog): Update comment.
1475
1476 * w32fns.c (Fx_file_dialog): Update comment.
1477
1478 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1479 Initialize panel name field if OSX >= 10.6.
1480
1481 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1482
1483 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1484
1485 * nsterm.m (NEW_STYLE_FS): New define.
1486 (ns_fullscreen_hook, windowWillEnterFullScreen)
1487 (windowDidEnterFullScreen, windowWillExitFullScreen)
1488 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1489 (setFSValue): New functions.
1490 (EmacsFSWindow): New implementation.
1491 (canBecomeKeyWindow): New function for EmacsFSWindow.
1492 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1493 (dealloc): Release nonfs_window if in fullscreen.
1494 (updateFrameSize:): Call windowDidMove to update top/left.
1495 (windowWillResize:toSize:): Check if frame is still maximized.
1496 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1497 next_maximized, maximized_width, maximized_height and nonfs_window.
1498 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1499 tbar_height.
1500 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1501 fullscreen. Set maximized_width/height. Act on next_maximized.
1502
1503 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1504 (EmacsView): Add variables for fullscreen.
1505 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1506 (EmacsFSWindow): New interface for fullscreen.
1507
1508 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1509
1510 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1511
1512 2012-09-30 Chong Yidong <cyd@gnu.org>
1513
1514 * fns.c (Frandom): Doc fix.
1515
1516 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1517
1518 * window.c (Vwindow_combination_limit): New default value.
1519 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1520
1521 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1524 Suggested by Eli Zaretskii in
1525 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1526
1527 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1528
1529 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1530 HAVE_TIMER_SETTIME is defined.
1531
1532 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1533
1534 Profiler improvements: more-accurate timers, overflow checks.
1535 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1536 signal.h, setjmp.h. Include systime.h instead.
1537 (saturated_add): New function.
1538 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1539 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1540 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1541 New static vars.
1542 (enum profiler_cpu_running): New enum.
1543 (profiler_cpu_running): Now of that enum type, not bool.
1544 All uses changed to store the new value.
1545 (handle_profiler_signal): Rename from sigprof_handler_1,
1546 for consistency with other handlers. Do not check whether
1547 cpu_log is a hash-table if garbage collecting, since it
1548 doesn't matter in that case.
1549 (deliver_profiler_signal): Rename from sigprof_handler,
1550 for consistency with other handlers.
1551 (setup_cpu_timer): New function, with much of what used to be in
1552 Fprofiler_cpu_start. Check for out-of-range argument.
1553 Prefer timer_settime if available, and prefer
1554 thread cputime clocks, then process cputime clocks, then
1555 monotonic clocks, to the old realtime clock. Use make_timeval
1556 to round more-correctly when falling back to setitimer.
1557 (Fprofiler_cpu_start): Use it.
1558 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1559 Don't assume that passing NULL as the 2nd argument of setitimer
1560 is the same as passing a pointer to all-zero storage.
1561 Ignore SIGPROF afterwards.
1562 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1563 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1564 non-fatal signal handlers. Ignore SIGPROF on startup.
1565 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1566 in profiler.c, since sysdep.c now uses it.
1567
1568 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1569 Suggested by Eli Zaretskii in
1570 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1571
1572 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1573
1574 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1575
1576 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1577
1578 * lisp.h (struct backtrace): Remove indirection for `function' field.
1579 * xdisp.c (redisplay_internal):
1580 * profiler.c (record_backtrace, sigprof_handler_1):
1581 * alloc.c (Fgarbage_collect):
1582 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1583 (Fbacktrace_frame): Adjust accordingly.
1584
1585 2012-09-28 Glenn Morris <rgm@gnu.org>
1586
1587 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1588 (Frun_hook_with_args_until_failure): Doc fixes.
1589
1590 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1591
1592 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1593 Qautomatic_redisplay and change the symbol name. All users changed.
1594
1595 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1596
1597 * profiler.c (sigprof_handler): Fix race condition.
1598
1599 2012-09-28 Glenn Morris <rgm@gnu.org>
1600
1601 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1602
1603 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1604
1605 Check more robustly for timer_settime.
1606 * Makefile.in (LIB_TIMER_TIME): New macro.
1607 (LIBES): Add it.
1608 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1609 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1610 call timer_settime.
1611
1612 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1613
1614 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1615
1616 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1617
1618 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1619
1620 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1621
1622 * character.h (MAYBE_UNIFY_CHAR): Remove.
1623 * charset.c, charset.h (maybe_unify_char): Now static.
1624 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1625 Since this stuff is now private to charset.c, there's no need for
1626 a public macro and no need to inline by hand.
1627
1628 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1629 Stefan Monnier <monnier@iro.umontreal.ca>
1630 Juanma Barranquero <lekktu@gmail.com>
1631
1632 * profiler.c: New file.
1633 * Makefile.in (base_obj): Add profiler.o.
1634 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1635 ($(BLD)/profiler.$(O)): New target.
1636 * emacs.c (main): Call syms_of_profiler.
1637 * alloc.c (Qautomatic_gc): New constant.
1638 (MALLOC_PROBE): New macro.
1639 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1640 (total_bytes_of_live_objects): New function.
1641 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1642 Call malloc_probe for the memory profiler.
1643 (syms_of_alloc): Define Qautomatic_gc.
1644 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1645 race condition.
1646 (struct backtrace): Move definition...
1647 * lisp.h (struct backtrace): ..here.
1648 (Qautomatic_gc, profiler_memory_running): Declare vars.
1649 (malloc_probe, syms_of_profiler): Declare functions.
1650 * xdisp.c (Qautomatic_redisplay): New constant.
1651 (redisplay_internal): Record itself in backtrace_list.
1652 (syms_of_xdisp): Define Qautomatic_redisplay.
1653
1654 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1655 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1656
1657 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1658
1659 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1660
1661 Prefer POSIX timers if available.
1662 They avoid a race if the timer is too close to the current time.
1663 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1664 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1665 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1666
1667 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1668
1669 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1670 CHAR_STRING_ADVANCE.
1671 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1672 STRING_CHAR_ADVANCE.
1673
1674 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1675
1676 Move Vlibrary_cache to emacs.c and reset before dumping.
1677
1678 * lisp.h (reset_image_types): Declare.
1679 [WINDOWSNT] (Vlibrary_cache): Declare.
1680
1681 * image.c (reset_image_types): New function.
1682
1683 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1684 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1685 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1686
1687 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1688 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1689
1690 * w32.h (Vlibrary_cache): Do not declare.
1691
1692 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1693
1694 * w32proc.c (sys_signal): Handle all signals defined by the
1695 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1696 handlers for signals supported by Windows. Don't override
1697 term_ntproc as the handler for SIGABRT.
1698 (sigaction): Rewrite to call sys_signal instead of duplicating its
1699 code.
1700 (sys_kill): Improve commentary.
1701
1702 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1703 consistency with a signature of a signal handler. All callers
1704 changed.
1705 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1706 install term_ntproc as a signal handler for SIGABRT, as that
1707 should be done by the dumped Emacs.
1708
1709 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1710
1711 * w32select.c (term_w32select): Protect against repeated
1712 invocation by setting clipboard_owner to NULL after calling
1713 DestroyWindow.
1714
1715 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1716 and term_ntproc to their modified signatures.
1717
1718 * character.c (char_string, string_char): Remove calls to
1719 MAYBE_UNIFY_CHAR. See the discussion starting at
1720 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1721 for the details.
1722
1723 2012-09-25 Chong Yidong <cyd@gnu.org>
1724
1725 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1726
1727 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1728
1729 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1730 when encountering an unknown bytecode.
1731
1732 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 image.c, indent.c: Use bool for booleans.
1735 * dispextern.h (struct image_type): Members valid_p, load, init
1736 now return bool, not int. All uses changed.
1737 * image.c: Omit unnecessary static decls.
1738 (x_create_bitmap_mask, x_build_heuristic_mask):
1739 Return void, not int, since callers don't care about the return value.
1740 (x_create_bitmap_mask, define_image_type, valid_image_p)
1741 (struct image_keyword, parse_image_spec, image_spec_value)
1742 (check_image_size, image_background)
1743 (image_background_transparent, x_clear_image_1)
1744 (postprocess_image, lookup_image, x_check_image_size)
1745 (x_create_x_image_and_pixmap, xbm_image_p)
1746 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1747 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1748 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1749 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1750 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1751 (png_image_p, init_png_functions, png_load_body, png_load)
1752 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1753 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1754 (init_gif_functions, gif_load, imagemagick_image_p)
1755 (imagemagick_load_image, imagemagick_load, svg_image_p)
1756 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1757 (gs_load):
1758 * nsimage.m (ns_load_image):
1759 * nsterm.m (ns_defined_color):
1760 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1761 * xfns.c (x_defined_color):
1762 * xterm.c (x_alloc_lighter_color_for_widget)
1763 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1764 (x_alloc_lighter_color):
1765 * indent.c (disptab_matches_widthtab, current_column)
1766 (scan_for_column, string_display_width, indented_beyond_p)
1767 (compute_motion, vmotion, Fvertical_motion):
1768 Use bool for booleans.
1769
1770 2012-09-24 Chong Yidong <cyd@gnu.org>
1771
1772 * chartab.c (Fset_char_table_default): Obsolete function removed.
1773
1774 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 Move pid_t related decls out of lisp.h.
1777 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1778 (interruptible_wait_for_termination):
1779 Move these decls from lisp.h to syswait.h, since they use pid_t.
1780 Needed on FreeBSD; see Herbert J. Skuhra in
1781 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1782 * callproc.c: Include syswait.h.
1783
1784 gnutls.c, gtkutil.c: Use bool for boolean.
1785 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1786 (emacs_gnutls_handle_error):
1787 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1788 (xg_hide_tooltip, xg_create_frame_widgets)
1789 (create_dialog, xg_uses_old_file_dialog)
1790 (xg_get_file_with_chooser, xg_get_file_with_selection)
1791 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1792 (xg_item_label_same_p, xg_update_menubar)
1793 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1794 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1795 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1796 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1797 (update_frame_tool_bar, free_frame_tool_bar):
1798 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1799 * nsmenu.m (ns_update_menubar):
1800 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1801 * xfns.c (Fx_show_tip) [USE_GTK]:
1802 Use bool for boolean.
1803 * gtkutil.c (xg_update_frame_menubar):
1804 * xmenu.c (update_frame_menubar):
1805 Return void, not int, since caller ignores return value.
1806 * gtkutil.c (xg_change_toolbar_position):
1807 Return void, not 1.
1808
1809 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1810
1811 * makefile.w32-in (BLOCKINPUT_H): Remove.
1812 (SYSSIGNAL_H): New macro.
1813 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1814 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1815 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1816 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1817 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1818 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1819 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1820 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1821 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1822 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1823 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1824 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1825 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1826 ($(BLD)/w32xfns.$(O)): Update dependencies.
1827
1828 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1829
1830 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1831 fatal_error_backtrace.
1832
1833 * w32proc.c (sys_kill): Undo last change: don't do anything when
1834 invoked to deliver SIGABRT to our own process. This is now
1835 handled by emacs_raise.
1836
1837 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1838
1839 * w32term.c (w32_read_socket): Remove leftover reference to
1840 interrupt_input_pending.
1841
1842 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1843
1844 Do not use SA_NODEFER.
1845 Problem reported by Dani Moncayo in
1846 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1847 * alloc.c (die):
1848 * sysdep.c (emacs_abort): Do not reset signal handler.
1849 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1850 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1851 wanted even on POSIXish hosts, and it doesn't work on Windows.
1852
1853 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1854
1855 * xterm.c (x_term_init): Call fixup_locale before and after calling
1856 gtk_init (Bug#12392).
1857
1858 2012-09-23 Chong Yidong <cyd@gnu.org>
1859
1860 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1861 Vdynamic_library_alist.
1862
1863 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1864 (Fgnutls_available_p): Caller changed.
1865
1866 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1867 (Flibxml_parse_xml_region): Likewise.
1868
1869 * dispextern.h (struct image_type): Remove arg from init function.
1870
1871 * image.c (Finit_image_library, lookup_image_type)
1872 (define_image_type): Remove now-unneeded second arg.
1873 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1874 (init_tiff_functions, init_gif_functions, init_svg_functions):
1875 Arglist and w32_delayed_load calling convention changed.
1876 (gs_type): Remove init_gs_functions; there is no such function.
1877 (valid_image_p, make_image): Fix caller to lookup_image_type.
1878
1879 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1880
1881 Simplify and avoid signal-handling races (Bug#12471).
1882 * alloc.c (die):
1883 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1884 Avoid recursive loop if there's a fatal error in the function itself.
1885 * atimer.c (pending_atimers):
1886 * blockinput.h: Don't include "atimer.h"; no longer needed.
1887 (interrupt_input_pending): Remove. All uses removed.
1888 pending_signals now counts both atimers and ordinary interrupts.
1889 This is less racy than having three separate pending-signal flags.
1890 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1891 (input_blocked_p):
1892 Rename from their upper-case counterparts BLOCK_INPUT,
1893 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1894 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1895 This makes it easier to access volatile variables more accurately.
1896 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1897 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1898 that's more reliable if the code is buggy and sets
1899 interrupt_input_blocked to a negative value. All uses changed.
1900 * atimer.c (deliver_alarm_signal):
1901 Remove. No need to deliver this to the parent; any thread can
1902 handle this signal now. All uses replaced by underlying handler.
1903 * atimer.c (turn_on_atimers):
1904 * dispnew.c (handle_window_change_signal):
1905 * emacs.c (handle_danger_signal):
1906 * keyboard.c (kbd_buffer_get_event):
1907 Don't reestablish signal handler; not needed with sigaction.
1908 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1909 (UNBLOCK_INPUT_TO):
1910 Rework to avoid unnecessary accesses to volatile variables.
1911 (UNBLOCK_INPUT_TO): Now a function.
1912 (totally_unblock_input, unblock_input): New decls.
1913 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1914 (init_data): Remove. Necessary stuff now done in init_signal.
1915 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1916 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1917 (fatal_error_code): Remove; no longer needed.
1918 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1919 it doesn't always backtrace. All uses changed. No need to reset
1920 signal to default, since sigaction and/or die does that for us now.
1921 Use emacs_raise (FOO), not kill (getpid (), FOO).
1922 (main): Check more-accurately whether we're dumping.
1923 Move fatal-error setup to sysdep.c
1924 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1925 * gtkutil.c (xg_get_file_name, xg_get_font):
1926 Remove no-longer-needed signal-mask manipulation.
1927 * keyboard.c, process.c (POLL_FOR_INPUT):
1928 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1929 * keyboard.c (read_avail_input): Remove.
1930 All uses replaced by gobble_input.
1931 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1932 (kbd_buffer_store_event_hold, gobble_input):
1933 (record_asynch_buffer_change) [USABLE_SIGIO]:
1934 (store_user_signal_events):
1935 No need to mess with signal mask.
1936 (gobble_input): If blocking input and there are terminals, simply
1937 set pending_signals to 1 and return. All hooks changed to not
1938 worry about whether input is blocked.
1939 (process_pending_signals): Clear pending_signals before processing
1940 them, in case a signal comes in while we're processing.
1941 By convention callers now test pending_signals before calling us.
1942 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1943 New functions, to support changes to blockinput.h.
1944 (handle_input_available_signal): Now extern.
1945 (reinvoke_input_signal): Remove. All uses replaced by
1946 handle_async_input.
1947 (quit_count): Now volatile, since a signal handler uses it.
1948 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1949 All callers changed. Block SIGINT only if not already blocked.
1950 Clear sigmask reliably, even if Fsignal returns, which it can.
1951 Omit unnecessary accesses to volatile var.
1952 (quit_throw_to_read_char): No need to restore sigmask.
1953 * keyboard.c (gobble_input, handle_user_signal):
1954 * process.c (wait_reading_process_output):
1955 Call signal-handling code rather than killing ourselves.
1956 * lisp.h: Include <float.h>, for...
1957 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1958 (pending_signals): Now volatile.
1959 (syms_of_data): Now const if IEEE floating point.
1960 (handle_input_available_signal) [USABLE_SIGIO]:
1961 (terminate_due_to_signal, record_child_status_change): New decls.
1962 * process.c (create_process): Avoid disaster if memory is exhausted
1963 while we're processing a vfork, by tightening the critical section
1964 around the vfork.
1965 (send_process_frame, process_sent_to, handle_pipe_signal)
1966 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1967 ignores SIGPIPE.
1968 (send_process): No need for setjmp/longjmp any more, since the
1969 SIGPIPE stuff is now gone. Instead, report an error if errno
1970 is EPIPE.
1971 (record_child_status_change): Now extern. PID and W are now args.
1972 Return void, not bool. All callers changed.
1973 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1974 Remove. All uses removed. This bug should be fixed now in a
1975 different way.
1976 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1977 and record the child status change directly. This avoids the
1978 need to futz with the signal mask.
1979 (process_fatal_action): Move here from emacs.c.
1980 (emacs_sigaction_flags): New function, containing
1981 much of what used to be in emacs_sigaction_init.
1982 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1983 caught by emacs, to make races less likely.
1984 (deliver_process_signal): Rename from handle_on_main_thread.
1985 All uses changed.
1986 (BACKTRACE_LIMIT_MAX): Now at top level.
1987 (thread_backtrace_buffer, threadback_backtrace_pointers):
1988 New static vars.
1989 (deliver_thread_signal, deliver_fatal_thread_signal):
1990 New functions, for more-accurate delivery of thread-specific signals.
1991 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1992 (deliver_arith_signal): Handle in this thread, not
1993 in the main thread, since it's triggered by this thread.
1994 (maybe_fatal_sig): New function.
1995 (init_signals): New arg DUMPING so that we can be more accurate
1996 about whether we're dumping. Caller changed.
1997 Treat thread-specific signals differently from process-general signals.
1998 Block all signals while handling fatal error; that's safer.
1999 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2000 on IEEE hosts.
2001 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2002 Ignore SIGPIPE unless batch.
2003 (emacs_backtrace): Output backtrace for the appropriate thread,
2004 which is not necessarily the main thread.
2005 * syssignal.h: Include <stdbool.h>.
2006 (emacs_raise): New macro.
2007 * xterm.c (x_connection_signal): Remove; no longer needed
2008 now that we use sigaction.
2009 (x_connection_closed): No need to mess with sigmask now.
2010 (x_initialize): No need to reset SIGPIPE handler here, since
2011 init_signals does this for us now.
2012
2013 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2014
2015 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
2016 background rect may be larger (Bug#12245).
2017
2018 2012-09-23 Chong Yidong <cyd@gnu.org>
2019
2020 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2021
2022 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2023
2024 * .gdbinit: Just stop at fatal_error_backtrace.
2025 See Stefan Monnier's request in
2026 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2027 Remove no-longer-used query of system type.
2028
2029 2012-09-22 Chong Yidong <cyd@gnu.org>
2030
2031 * search.c (Freplace_match): Doc fix (Bug#12325).
2032
2033 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2034
2035 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2036 (Fline_end_position): Doc fix.
2037
2038 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2039
2040 2012-09-22 Chong Yidong <cyd@gnu.org>
2041
2042 * dispextern.h (struct image_type): Add new slot, storing a type
2043 initialization function.
2044
2045 * image.c (define_image_type): Call the image initializer function
2046 if it is defined. Arguments and return value changed.
2047 (valid_image_p, make_image): Callers changed.
2048 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2049 (gif_type, imagemagick_type, svg_type, gs_type):
2050 Add initialization functions.
2051 (Finit_image_library): Call lookup_image_type.
2052 (CHECK_LIB_AVAILABLE): Macro deleted.
2053 (lookup_image_type): Call define_image_type here, rather than via
2054 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2055 (syms_of_image): Move define_image_type calls for xbm_type and
2056 pbm_type to lookup_image_type.
2057
2058 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2059
2060 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2061 'idle_timers' from here ...
2062 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2063 lists, to avoid infloops when the timer does something stupid,
2064 like reinvoke itself with the same or smaller time-out.
2065 (Bug#12447)
2066
2067 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2068
2069 * window.c (Fsplit_window_internal): Handle only Qt value of
2070 Vwindow_combination_limit separately.
2071 (Qtemp_buffer_resize): New symbol.
2072 (Vwindow_combination_limit): New default value.
2073 Rewrite doc-string.
2074
2075 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2076
2077 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2078 the new overlay string. (Bug#10159)
2079
2080 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2081
2082 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2083 or that fprintf is async-signal-safe. POSIX doesn't require
2084 either assumption.
2085
2086 2012-09-22 Chong Yidong <cyd@gnu.org>
2087
2088 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2089 (Bug#8207).
2090
2091 2012-09-22 Kenichi Handa <handa@gnu.org>
2092
2093 * composite.c (composition_reseat_it): Handle the case that a
2094 grapheme cluster is not covered by a single font (Bug#12352).
2095
2096 2012-09-21 Chong Yidong <cyd@gnu.org>
2097
2098 * image.c (define_image_type): Avoid adding duplicate types to
2099 image_types (Bug#12463). Suggested by Jörg Walter.
2100
2101 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2102
2103 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2104 (print_load_command_name): Add case LC_DATA_IN_CODE.
2105 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2106
2107 2012-09-21 Glenn Morris <rgm@gnu.org>
2108
2109 * eval.c (Frun_hook_with_args_until_success)
2110 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2111
2112 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2113
2114 * fileio.c (Ffile_selinux_context): Only call freecon when
2115 lgetfilecon succeeded.
2116 (Fset_file_selinux_context): Likewise. (Bug#12444)
2117
2118 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2119
2120 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2121 reordering, locate the cursor by calling set_cursor_from_row; if
2122 that fails, clear the desired glyph matrix before returning a
2123 failure indication to the caller. Fixes leaving garbled display
2124 when fast scrolling with a down-key. (Bug#12403)
2125 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2126 scrolling through multibyte text.
2127
2128 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2129
2130 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2131 calling mark_vectorlike since that's the one that marks the window.
2132 (mark_discard_killed_buffers): Mark the final cdr.
2133 * window.h (struct window): Move prev/next_buffers to the
2134 non-standard fields.
2135 * window.c (make_window): Initialize prev/next_buffers manually.
2136
2137 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2138
2139 Omit unused arg EXPECTED from socket hooks.
2140 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2141 * nsterm.m (ns_term_init):
2142 * termhooks.h (struct terminal.read_socket_hook):
2143 * w32inevt.c (w32_console_read_socket):
2144 * w32term.c (w32_read_socket):
2145 * xterm.c (XTread_socket):
2146 Omit unused arg EXPECTED. All callers changed.
2147 (store_user_signal_events): Return void, not int, since callers no
2148 longer care about the return value. All uses changed.
2149
2150 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2151
2152 * w32gui.h (XParseGeometry): Do not declare.
2153
2154 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2155
2156 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2157 Ignore 'expected'. See Eli Zaretskii in
2158 <http://bugs.gnu.org/12471#8> (last line).
2159
2160 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2161 (XParseGeometry): Now static. Substitute extremal values for
2162 values that are out of range.
2163
2164 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2165
2166 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2167
2168 * nsfns.m (XParseGeometry): Remove.
2169 (Fx_create_frame): Call x_set_offset to correctly interpret
2170 top_pos in geometry.
2171
2172 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2173 (Fx_parse_geometry): If there is a space in string, call
2174 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2175
2176 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2177
2178 * search.c (scan_buffer): Use character positions in calls to
2179 region_cache_forward and region_cache_backward, not byte
2180 positions. (Bug#12196)
2181
2182 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2183 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2184
2185 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2186 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2187 emacs_blocked_malloc, now deleted.
2188
2189 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2190
2191 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2192 The workaround was for improving performance on Solaris 2.4, but
2193 is getting in the way now. Emacs will still work if someone is
2194 still running Solaris 2.4 in a museum somewhere; Sun dropped
2195 support for Solaris 2.4 in 2003.
2196 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2197 * process.c (create_process) [HAVE_WORKING_VFORK]:
2198 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2199 since Emacs no longer uses vfork on that platform.
2200
2201 2012-09-17 Glenn Morris <rgm@gnu.org>
2202
2203 * emacs.c: Use COPYRIGHT.
2204
2205 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 Remove configure's --without-sync-input option (Bug#12450).
2208 When auditing signal-handling in preparation for cleaning it up,
2209 I found that SYNC_INPUT has race conditions and would be a real
2210 pain to fix. Since it's an undocumented and deprecated
2211 configure-time option, now seems like a good time to remove it.
2212 Also see <http://bugs.gnu.org/11080#16>.
2213 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2214 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2215 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2216 (malloc_hysteresis):
2217 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2218 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2219 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2220 (dont_register_blocks, bytes_used_when_reconsidered)
2221 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2222 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2223 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2224 Remove. All uses removed.
2225 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2226 implementation, one that depends on whether the new macro
2227 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2228 is defined.
2229 * atimer.c (run_timers, handle_alarm_signal):
2230 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2231 (handle_async_input, process_pending_signals)
2232 (handle_input_available_signal, init_keyboard):
2233 * nsterm.m (ns_read_socket):
2234 * process.c (wait_reading_process_output):
2235 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2236 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2237 (emacs_write):
2238 * xterm.c (XTread_socket):
2239 Assume SYNC_INPUT.
2240 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2241 * eval.c (handling_signal): Remove. All uses removed.
2242 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2243 All uses replaced with the SYNC_INPUT version.
2244 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2245 Remove decls.
2246 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2247 Now static.
2248
2249 * font.c (Ffont_shape_gstring): Remove unused local.
2250
2251 2012-09-16 Glenn Morris <rgm@gnu.org>
2252
2253 * Makefile.in (clean): No longer run nextstep's clean.
2254
2255 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2256 (ns_frag): Remove.
2257 (ns-app): Move here from ns.mk, and simplify.
2258 (clean): Simplify nextstep entry.
2259 * ns.mk: Remove file.
2260
2261 2012-09-17 Kenichi Handa <handa@gnu.org>
2262
2263 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2264 not covert the last few charactes.
2265
2266 2012-09-16 Kenichi Handa <handa@gnu.org>
2267
2268 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2269 here, but just check the validity of glyphs in the glyph-string.
2270
2271 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2272
2273 * window.c (Fwindow_parameter, Fset_window_parameter):
2274 Accept any window as argument (Bug#12452).
2275
2276 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2277
2278 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2279 to ns_term_init to avoid memory leak.
2280
2281 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2282 explicit retain/release.
2283 (ns_term_init): Only allow one display. Initialize outerpool and
2284 ns_*_types.
2285
2286 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2289 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2290 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2291 the Microsoft problem in a different way, by altering ../nt/config.nt.
2292
2293 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2294
2295 * w32xfns.c:
2296 * w32uniscribe.c:
2297 * w32term.c:
2298 * w32select.c:
2299 * w32reg.c:
2300 * w32proc.c:
2301 * w32menu.c:
2302 * w32inevt.c:
2303 * w32heap.c:
2304 * w32font.c:
2305 * w32fns.c:
2306 * w32console.c:
2307 * w32.c:
2308 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2309 by lisp.h. This completes removal of setjmp.h inclusion
2310 erroneously announced in the previous commit. (Bug#12446)
2311
2312 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2313 more accurate.
2314
2315 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2316 not defined as a macro. The latter happens on MS-Windows.
2317 (Bug#12446)
2318
2319 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2320
2321 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2322 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2323 Some instances of '#include <setjmp.h>' removed, if the
2324 only reason for the instance was because "lisp.h" was included.
2325 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2326 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2327 and _longjmp with the new symbols. Emacs already uses _setjmp if
2328 available, so this change affects only POSIXish hosts that have
2329 sigsetjmp but not _setjmp, such as some versions of Solaris and
2330 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2331 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2332 (png_load_body) [HAVE_PNG]:
2333 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2334 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2335 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2336 since PNG requires jmp_buf. This is the only exception to the
2337 general rule that we now use sys_setjmp and sys_longjmp.
2338 This exception is OK since this code does not change the signal
2339 mask or longjmp out of a signal handler.
2340
2341 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2344 Include "syssignal.h", for 'main_thread'.
2345
2346 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2347
2348 Avoid out-of-range marker position (Bug#12426).
2349 * insdel.c (replace_range, replace_range_2):
2350 Adjust markers before overlays, as suggested by comments.
2351 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2352 Remove redundant check before calling offset_intervals.
2353
2354 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2355
2356 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2357 current buffer (Bug#12387).
2358
2359 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2360
2361 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2362
2363 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 Use a more backwards-compatible timer format (Bug#12430).
2366 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2367 vector element, not from the 4th, since PSECS is now at the end.
2368 (Fcurrent_idle_time): Doc fix.
2369
2370 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2371
2372 Function to mark objects and remove killed buffers at once.
2373 * alloc.c (discard_killed_buffers): Rename to ...
2374 (mark_discard_killed buffers) ... new name. Add marking
2375 of remaining objects. Fix comment. Adjust users.
2376 (mark_object): Do not touch frame buffer lists here.
2377 * frame.c (delete_frame): Reset frame buffer lists here.
2378
2379 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2380
2381 Better workaround for GNOME bug when --enable-gcc-warnings.
2382 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2383 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2384 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2385
2386 Simplify SIGIO usage (Bug#12408).
2387 The code that dealt with SIGIO was crufty and confusing, e.g., it
2388 played tricks like "#undef SIGIO" but these tricks were not used
2389 consistently. Simplify mostly by not #undeffing standard symbols,
2390 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2391 or not as we please) rather than "defined SIGIO" (standard symbol
2392 that we probably shouldn't #undef).
2393 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2394 Modules that need it can include it.
2395 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2396 * dispextern.h (ignore_sigio): New decl.
2397 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2398 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2399 * emacs.c (shut_down_emacs):
2400 * keyboard.c (kbd_buffer_store_event_hold):
2401 Use ignore_sigio rather than invoking 'signal' directly.
2402 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2403 for FIONREAD.
2404 (FIONREAD, SIGIO): Do not #undef.
2405 (tty_read_avail_input): Use #error rather than a syntax error.
2406 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2407 for I_PIPE, used by SETUP_SLAVE_PTY.
2408 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2409 * sysdep.c (croak): Remove; no longer needed. This bit of
2410 temporary code, with Fred N. Fish's comment that it's temporary,
2411 has been in Emacs since at least 1992!
2412 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2413 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2414 * syssignal.h (croak): Remove decl.
2415 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2416 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2417 now that we're termios-only.
2418 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2419 * term.c (dissociate_if_controlling_tty): Use #error rather than
2420 a run-time error.
2421
2422 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2423 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2424 to work around GNOME bug 683906.
2425 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2426 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2427 This works around GCC bug 54561.
2428
2429 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2430
2431 More fixes for 'volatile' and setjmp/longjmp.
2432 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2433 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2434 (png_load_body) [HAVE_PNG]:
2435 (jpeg_load_body) [HAVE_JPEG]:
2436 New function, with most of the old parent function's body.
2437 (png_load) [HAVE_PNG]:
2438 (jpeg_load) [HAVE_JPEG]:
2439 Invoke the new function, to avoid longjmp munging our locals.
2440 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2441 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2442 longjmp is passed 2, as the C standard doesn't guarantee this.
2443 Instead, store the failure code into mgr->failure_code.
2444
2445 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2446
2447 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2448 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2449 (syms_of_keyboard): Remove support for unread-command-char.
2450
2451 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2452
2453 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2454 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2455 violation. (Bug#12426)
2456
2457 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2458
2459 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2460
2461 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2462
2463 * eval.c: Add `inhibit-debugger'.
2464 (Qinhibit_debugger): New symbol.
2465 (call_debugger): Bind it instead of Qdebug_on_error.
2466 (maybe_call_debugger): Test Vinhibit_debugger.
2467 (syms_of_eval): Define inhibit-debugger.
2468 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2469 (syms_of_xdisp): Remove inhibit-debug-on-message.
2470
2471 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2472
2473 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2474 If a nonvolatile local variable is written before a _longjmp to
2475 the frame containing the variable, and is read after the _longjmp,
2476 the value read is indeterminate. Some local variables of type
2477 'struct handler' and 'struct catchtag' are used in this way, so
2478 mark each of their slots as volatile if the slot can be set before
2479 _longjmp and read afterwards.
2480 * lisp.h (struct handler): var and chosen_clause are now volatile.
2481 (struct catchtag): val, next, and pdlcount are now volatile.
2482
2483 * bidi.c (bidi_push_it, bidi_pop_it):
2484 * fns.c (copy_hash_table):
2485 * image.c (define_image_type):
2486 * keyboard.c (kbd_buffer_store_event_hold):
2487 * process.c (Fprocess_send_eof):
2488 * xfaces.c (x_create_gc) [HAVE_NS]:
2489 * xgselect.c (xg_select):
2490 Prefer assignment to memcpy when either will do.
2491
2492 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2493 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2494 time an item is removed. No need to mark this function 'inline';
2495 the compiler knows better than we do.
2496
2497 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2498
2499 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2500 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2501 to change_frame_size (Bug#12388).
2502 (windowDidResize:): Pass YES to updateFrameSize.
2503
2504 * nsterm.h: Add delay parameter to updateFrameSize.
2505
2506 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2507
2508 Discard killed buffers from deleted window and frame objects.
2509 This reduces an amount of references to killed buffers and
2510 helps GC to reclaim them faster.
2511 * alloc.c (discard_killed_buffers): New function.
2512 (mark_object): Use it for deleted windows and frames.
2513 (mark_object): If symbol's value is set up for a killed buffer
2514 or deleted frame, restore its global binding.
2515 * data.c (swap_in_global_binding): Add GC notice.
2516 (swap_in_symval_forwarding): Use convenient set_blv_where.
2517 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2518 * window.h: ... to here.
2519
2520 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2521
2522 Convenient macro to check whether the buffer is live.
2523 * buffer.h (BUFFER_LIVE_P): New macro.
2524 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2525 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2526
2527 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2528
2529 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2530 composition cases (Bug#12364).
2531
2532 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2533 overhang of succeeding glyphs overlapping box cursor.
2534
2535 * w32term.c (x_draw_glyph_string): Likewise.
2536
2537 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 Simplify, document, and port floating-point (Bug#12381).
2540 The porting part of this patch fixes bugs on non-IEEE platforms
2541 with frexp, ldexp, logb.
2542 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2543 Now static.
2544 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2545 support, by removing commented-out code and briefly listing the
2546 C89 functions excluded. The commented-out stuff was confusing
2547 maintenance, e.g., we thought we needed cbrt but it was commented out.
2548 (logb): Remove decl; no longer needed.
2549 (isfinite): New macro, if not already supplied.
2550 (isnan): Don't replace any existing macro.
2551 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2552 are present on all C89 platforms.
2553 (Ffrexp): Do not special-case zero, as frexp does the right thing
2554 for that case.
2555 (Flogb): Do not use logb, as it doesn't have the desired meaning
2556 on hosts that use non-base-2 floating point. Instead, stick with
2557 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2558 frexp, to avoid getting an unspecified result.
2559
2560 * xdisp.c (Qinhibit_debug_on_message): Now static.
2561
2562 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2563
2564 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2565 NSBezierPath (Bug#12131).
2566
2567 2012-09-10 Chong Yidong <cyd@gnu.org>
2568
2569 * fns.c (Fdelq, Fdelete): Doc fix.
2570
2571 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2574 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2575
2576 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2577
2578 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2579 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2580 Use it.
2581
2582 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2583
2584 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2585 left fringe if the window has a left margin. This avoids leaving
2586 traces of the cursor because its leftmost pixel is not drawn over.
2587
2588 * dispnew.c (update_window_line): When the left margin area of a
2589 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2590 that screen line. (Bug#12277)
2591
2592 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2593
2594 Assume C89 or later for math functions (Bug#12381).
2595 This simplifies the code, and makes it a bit smaller and faster,
2596 and (most important) makes it easier to clean up signal handling
2597 since we can stop worring about floating-point exceptions in
2598 library code. That was a problem before C89, but the problem
2599 went away many years ago on all practical Emacs targets.
2600 * data.c, image.c, lread.c, print.c:
2601 Don't include <math.h>; no longer needed.
2602 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2603 might be autoconfigured, as that never happens.
2604 * data.c (fmod):
2605 * doprnt.c (DBL_MAX_10_EXP):
2606 * print.c (DBL_DIG):
2607 Remove. C89 or later always defines these.
2608 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2609 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2610 (arith_error, domain_error, domain_error2):
2611 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2612 no longer needed -- we simply return what C returns. All uses removed.
2613 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2614 the wrapped code.
2615 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2616 Remove. All uses expanded, as these macros are no longer used
2617 more than once and are now more trouble than they're worth.
2618 (Ftan): Use tan, not sin / cos.
2619 (Flogb): Assume C89 frexp.
2620 (fmod_float): Assume C89 fmod.
2621 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2622 (init_floatfns): Remove. All uses removed.
2623
2624 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2625
2626 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2627 compositeToPoint for OSX < 10.6 (Bug#12390).
2628
2629 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2630
2631 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2632 This produces more-accurate results.
2633
2634 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2635
2636 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2637 changes (Bug#12088).
2638
2639 2012-09-08 Chong Yidong <cyd@gnu.org>
2640
2641 * syntax.c (Fstring_to_syntax): Doc fix.
2642
2643 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2644
2645 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2646 in the internal border.
2647 (x_set_window_size): Remove static variables and their usage.
2648 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2649 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2650 Remove fringe/internal border adjustment (Bug#11052).
2651 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2652 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2653 (ns_fix_rect_ibw): Remove.
2654 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2655 (ns_dumpglyphs_box_or_relief): Ditto.
2656 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2657 adjustment.
2658 (ns_dumpglyphs_image): Ditto.
2659 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2660 border adjustment.
2661 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2662 their usage. Add fringe_extended_p and its use as in other terms.
2663 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2664 scroll bar was removed.
2665 (updateFrameSize): New function.
2666 (windowDidResize): Move code to updateFrameSize and call it.
2667
2668 * nsterm.h (EmacsView): Add updateFrameSize.
2669
2670 2012-09-07 Chong Yidong <cyd@gnu.org>
2671
2672 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2673
2674 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2675
2676 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 More signal-handler cleanup (Bug#12327).
2679 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2680 Problem introduced when merging patches. Noted by Eli Zaretskii in
2681 <http://bugs.gnu.org/12327#67>.
2682 * floatfns.c: Comment fix.
2683 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2684 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2685 and anyway the declaration is harmless even if SIGDANGER is not defined.
2686 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2687 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2688 source files not surprisingly expected syssignal.h to define, or
2689 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2690 Include <sys/ioctl.h>, for FIONREAD.
2691 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2692 This eliminates a problem whereby other files mysteriously had
2693 to include "syssignal.h" before including "systty.h" if they
2694 wanted to use "#ifdef SIGIO".
2695
2696 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2697
2698 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2699
2700 * w32.c (sigemptyset): Empty the set.
2701 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2702
2703 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2704
2705 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2706
2707 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2708 (mark_object): Likewise for frame objects.
2709
2710 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 * syssignal.h (handle_on_main_thread): Always declare,
2713 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2714 This ports to platforms without HAVE_PTHREAD.
2715
2716 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2717
2718 Signal-handler cleanup (Bug#12327).
2719 Emacs's signal handlers were written in the old 4.2BSD style with
2720 sigblock and sigmask and so forth, and this led to some
2721 inefficiencies and confusion. Rewrite these to use
2722 pthread_sigmask etc. without copying signal sets around. Also,
2723 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2724 'signal', and instead use functions that do not attempt to take
2725 over the system name space. This patch causes Emacs's text
2726 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2727 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2728 Do not include <signal.h> or "syssignal.h", as these
2729 modules do not use signals.
2730 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2731 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2732 Do not include <signal.h>, as "syssignal.h" does that for us now.
2733 * atimer.c (sigmask_atimers): New function.
2734 (block_atimers, unblock_atimers): New functions,
2735 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2736 All uses replaced.
2737 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2738 no longer needed here.
2739 * emacs.c (main): Inspect existing signal handler with sigaction,
2740 so that there's no need to block and unblock SIGHUP.
2741 * sysdep.c (struct save_signal): New member 'action', replacing
2742 old member 'handler'.
2743 (save_signal_handlers, restore_signal_handlers):
2744 Use sigaction instead of 'signal' to save and restore.
2745 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2746 New function. All users of 'signal' modified to use set_sighandler
2747 if they're writeonly, and to use sys_signal if they're read+write.
2748 (emacs_sigaction_init, forwarded_signal): New functions.
2749 (sys_signal): Remove. All uses replaced by calls to sigaction
2750 and emacs_sigaction_init, or by direct calls to 'signal'.
2751 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2752 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2753 all uses replaced by pthread_sigmask etc. calls.
2754 * syssignal.h: Include <signal.h>.
2755 (emacs_sigaction_init, forwarded_signal): New decls.
2756 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2757 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2758 (sigmask, sys_sigmask): Remove; no longer needed.
2759 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2760 (sigblock, sigunblock, sigfree):
2761 (sigsetmask) [!defined sigsetmask]:
2762 Remove. All uses replaced by pthread_sigmask.
2763 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2764 no longer need to be replaced, and its typical old uses
2765 are now done via emacs_sigaction_init and sigaction.
2766 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2767 (sys_sigdel): Remove; unused.
2768 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2769
2770 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2771
2772 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2773 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2774
2775 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2776
2777 Explicitly mark buffer_defaults and buffer_local_symbols.
2778 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2779 mark_local_symbols here.
2780 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2781 since special buffers aren't marked here any more.
2782 (allocate_buffer): Chain new buffer with all_buffers here...
2783 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2784 not here.
2785 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2786 (syms_of_buffer): Remove staticpro of the above.
2787 (init_buffer_once): Set names for buffer_defaults and
2788 buffer_local_symbols.
2789
2790 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2791
2792 Use bool for booleans in font-related modules.
2793 * font.c (font_intern_prop, font_style_to_value)
2794 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2795 (generate_otf_features, font_check_otf_features, font_check_otf)
2796 (font_match_p, font_list_entities, font_at):
2797 * fontset.c (fontset_id_valid_p, reorder_font_vector
2798 (fontset_find_font, Fset_fontset_font)
2799 (face_suitable_for_char_p) [0]:
2800 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2801 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2802 (m17n_flt_initialized, ftfont_shape_by_flt):
2803 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2804 * nsfont.m (nsfont_draw):
2805 * w32font.c (w32font_draw):
2806 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2807 Use bool for booleans.
2808 * font.h: Adjust to above API changes.
2809 (struct font, struct font_driver, struct font_driver_list):
2810 Use bool for booleans.
2811 (struct font): Remove useless member encoding_type.
2812 All users removed.
2813 * fontset.c, xftfont.c: Omit unnecessary static decls.
2814
2815 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2816
2817 * alloc.c (mark_object): Revert window marking code
2818 since it's unsafe for the Fset_window_configuration.
2819
2820 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 Fix race conditions with signal handlers and errno (Bug#12327).
2823 Be more systematic about preserving errno whenever a signal
2824 handler returns, even if it's not in the main thread. Do this by
2825 renaming signal handlers to distinguish between signal delivery
2826 and signal handling. All uses changed.
2827 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2828 * data.c (deliver_arith_signal): Rename from arith_error.
2829 * dispnew.c (deliver_window_change_signal): Rename from
2830 window_change_signal.
2831 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2832 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2833 * keyboard.c (deliver_input_available_signal): Rename from
2834 input_available_signal.
2835 (deliver_user_signal): Rename from handle_user_signal.
2836 (deliver_interrupt_signal): Rename from interrupt_signal.
2837 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2838 (deliver_child_signal): Rename from sigchld_handler.
2839 * atimer.c (handle_alarm_signal):
2840 * data.c (handle_arith_signal):
2841 * dispnew.c (handle_window_change_signal):
2842 * emacs.c (handle_fatal_signal, handle_danger_signal):
2843 * keyboard.c (handle_input_available_signal):
2844 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2845 * process.c (handle_pipe_signal, handle_child_signal):
2846 New functions, with the actual signal-handling code taken from the
2847 original respective signal handlers, sans the sporadic attempts to
2848 preserve errno, since that's now done by handle_on_main_thread.
2849 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2850 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2851 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2852 Move to sysdep.c.
2853 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2854 Move initialization of main_thread to sysdep.c's init_signals.
2855 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2856 our usage, and simplifies the mainline code.
2857 (record_child_status_change): New static function, as a helper
2858 for handle_child_signal, and with most of the old child handler's
2859 contents.
2860 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2861 (handle_child_signal): Use the above.
2862 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2863 Moved here from emacs.c.
2864 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2865 code moved here from emacs.c's main function.
2866 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2867 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2868 This lets callers save and restore errno properly.
2869
2870 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2871
2872 Remove redundant or unused things here and there.
2873 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2874 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2875 * editfns.c (Fcompare_buffer_substrings): Likewise.
2876 * frame.h (struct terminal, struct font_driver_list):
2877 Remove redundant declarations.
2878 * window.h (Qleft, Qright): Likewise.
2879
2880 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2881
2882 Do not mark objects from deleted buffers, windows and frames.
2883 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2884 (mark_object): Likewise for windows and frames.
2885
2886 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2887
2888 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2889 buffer_defaults and buffer_local_symbols as valid objects.
2890 Return special value to denote them.
2891
2892 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2895 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2896 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2897 (file_name_absolute_p, Fsubstitute_in_file_name):
2898 (check_executable, check_writable, Ffile_accessible_directory_p)
2899 (Fset_file_selinux_context, Fdefault_file_modes)
2900 (Finsert_file_contents, choose_write_coding_system)
2901 (Fwrite_region, build_annotations, a_write, e_write)
2902 (Fdo_auto_save):
2903 * filelock.c (boot_time_initialized, get_boot_time)
2904 (get_boot_time_1, lock_file_1, within_one_second):
2905 * floatfns.c (in_float):
2906 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2907 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2908 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2909 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2910 * window.c (compare_window_configurations):
2911 Use bool for booleans.
2912 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2913 (Fdefault_file_modes): Now mode_t, not int, for modes.
2914 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2915 (internal_delete_file): Now returns void, not a (boolean) int,
2916 since nobody was looking at the return value.
2917 * lisp.h, window.h: Adjust to above API changes.
2918
2919 * xdisp.c (set_message): Simplify and reindent last change.
2920
2921 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2922
2923 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2924
2925 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2926
2927 * eval.c (call_debugger): Make the function non-static so that we
2928 can call it from set_message.
2929
2930 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2931 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2932
2933 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2934
2935 Give more-useful info on a fatal error (Bug#12328).
2936 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2937 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2938 of doing the work ourselves.
2939 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2940 do most of the work.
2941 (fatal_error_backtrace): New function, taken from the guts
2942 of the old fatal_error_signal, but with a new option to output
2943 a backtrace.
2944 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2945 info about the signal than just its number.
2946 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2947 * sysdep.c: Include <execinfo.h>
2948 (emacs_backtrace): New function, taken partly from the previous
2949 code of the 'die' function.
2950 (emacs_abort): Call fatal_error_backtrace rather than abort.
2951
2952 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2953
2954 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2955 eager (load-time) macro-expansion.
2956 * lisp.mk (lisp): Add macroexp.
2957
2958 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 Simplify redefinition of 'abort' (Bug#12316).
2961 Do not try to redefine the 'abort' function. Instead, redo
2962 the code so that it calls 'emacs_abort' rather than 'abort'.
2963 This removes the need for the NO_ABORT configure-time macro
2964 and makes it easier to change the abort code to do a backtrace.
2965 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2966 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2967 Remove; sysdep.c's emacs_abort now takes its place.
2968 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2969 'abort' changed to use 'emacs_abort'.
2970 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2971 (abort) [!defined abort]: Rename to ...
2972 (emacs_abort): ... new name.
2973 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2974 the place of the old 'abort' in emacs.c.
2975 * w32.c, w32fns.c (abort): Do not #undef.
2976 * w32.c (emacs_abort): Rename from w32_abort.
2977
2978 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2979
2980 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2981 offsets[j].dv, since the y axis of the screen coordinates points
2982 down, while the y axis of the font definition coordinates points
2983 up. This fixes display of Arabic diacritics such as KASRA and
2984 KASRATAN. (Bug#11860)
2985
2986 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2987
2988 Be more systematic about _setjmp vs setjmp.
2989 * alloc.c (test_setjmp, mark_stack):
2990 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2991 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2992 (png_load, my_error_exit, jpeg_load):
2993 * process.c (send_process_trap, send_process):
2994 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2995 The underscored versions are up to 30x faster on some hosts.
2996 Formerly, the code used setjmp+longjmp sometimes and
2997 _setjmp+_longjmp at other times, with no particular reason to
2998 prefer setjmp+longjmp.
2999
3000 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3001
3002 Fix minor problem found by static checking.
3003 * buffer.c (Fdelete_all_overlays): Return nil.
3004
3005 2012-09-03 Martin Rudalics <rudalics@gmx.at>
3006
3007 * buffer.c (Fdelete_all_overlays): New function.
3008
3009 2012-09-03 Chong Yidong <cyd@gnu.org>
3010
3011 * gtkutil.c: Add extern decl for Qxft.
3012
3013 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3014
3015 * emacs.c, eval.c: Use bool for boolean.
3016 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3017 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3018 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3019 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3020 (main, decode_env_path, Fdaemon_initialized):
3021 * eval.c (call_debugger, Finteractive_p, interactive_p):
3022 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3023 (maybe_call_debugger, Fbacktrace):
3024 * process.c (read_process_output, exec_sentinel):
3025 Use bool for booleans.
3026 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3027 All callers changed.
3028 * eval.c (interactive_p): Omit always-true boolean argument
3029 EXCLUDE_SUBRS_P. All callers changed.
3030 * dispextern.h, lisp.h: Reflect above API changes.
3031 * firstfile.c (dummy): Use the address of 'main', whose signature
3032 won't change, instead of the address of 'initialize', whose
3033 signature just changed from int to bool.
3034 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3035 * msdos.c (fatal_error_in_progress): ... from here.
3036 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3037 of incrementing it.
3038 (redisplay_internal, unwind_redisplay): Simply clear
3039 REDISPLAYING_P when unwinding, instead of saving its previous,
3040 always-false value and then restoring it.
3041
3042 Clean up some extern decls.
3043 Mostly, this hoists extern decls out of .c files and into .h files.
3044 That way, we're more likely to catch errors if the interfaces change.
3045 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3046 declare xg_mark_data.
3047 * dispextern.h (x_frame_parm_handlers):
3048 * font.h (Qxft):
3049 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3050 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3051 (Qultra_bold, Qoblique, Qitalic):
3052 Move extern decl here from .c file.
3053 * alloc.c (xg_mark_data) [USE_GTK]:
3054 * doc.c (Qclosure):
3055 * eval.c (Qlexical_binding):
3056 * fns.c (time) [!HAVE_UNISTD_H]:
3057 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3058 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3059 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3060 * lread.c (Qinternal_interpreter_environment):
3061 * minibuf.c (Qbuffer):
3062 * process.c (QCfamily, QCfilter):
3063 * widget.c (free_frame_faces):
3064 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3065 * xfont.c (x_clear_errors):
3066 * xterm.c (x_frame_parm_handlers):
3067 Remove now-redundant extern decls.
3068 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3069 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3070 Now static.
3071 * xfaces.c: Remove unnecessary static decls.
3072 * xterm.c (updating_frame): Remove decl of nonexistent object.
3073
3074 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3075 when building globals.h, as the objects that are not built on
3076 this host are not needed to compile C files on this host.
3077
3078 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3079
3080 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3081
3082 * frame.h: Add missing prototype for x_wm_set_size_hint.
3083
3084 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3087 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3088 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3089 (Fsubstitute_command_keys):
3090 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3091 (save_excursion_save, save_excursion_restore)
3092 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3093 (format_time_string, general_insert_function)
3094 (make_buffer_string, make_buffer_string_both)
3095 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3096 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3097 (copy_text, insert_1, insert_1_both, insert_from_string)
3098 (insert_from_string_before_markers, insert_from_string_1)
3099 (insert_from_buffer, insert_from_buffer_1, replace_range)
3100 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3101 (del_range_2, modify_region):
3102 * intervals.c (intervals_equal, balance_possible_root_interval)
3103 (adjust_intervals_for_insertion, merge_properties_sticky)
3104 (graft_intervals_into_buffer, lookup_char_property)
3105 (adjust_for_invis_intang, set_point_both)
3106 (get_property_and_range, compare_string_intervals)
3107 (set_intervals_multibyte_1, set_intervals_multibyte):
3108 * keyboard.c (decode_timer):
3109 Use bool for boolean.
3110 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3111 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3112
3113 2012-09-02 Chong Yidong <cyd@gnu.org>
3114
3115 * keymap.c (push_key_description): Print M-TAB as C-M-i
3116 (Bug#11758).
3117
3118 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3119
3120 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3121 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3122 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3123 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3124 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3125 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3126 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3127
3128 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3129
3130 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3131 more than one grapheme cluster passed to the shaper: compute the
3132 offset adjustment values separately for each cluster. (Bug#11860)
3133
3134 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3135 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3136 about implicit conversions from integer to pointer.
3137
3138 2012-09-01 Daniel Colascione <dancol@dancol.org>
3139
3140 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3141 system used too early.
3142
3143 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3144
3145 Better seed support for (random).
3146 * emacs.c (main): Call init_random.
3147 * fns.c (Frandom): Set the seed from a string argument, if given.
3148 Remove long-obsolete Gentzel cruft.
3149 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3150 (init_random): New function.
3151
3152 2012-09-01 Daniel Colascione <dancol@dancol.org>
3153
3154 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3155 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3156 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3157 x_wm_set_size_hint, x_query_colors, x_real_positions,
3158 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3159 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3160 all of which have been moved to common code.
3161
3162 * xfaces.c: Include TERM_HEADER instead of listing all possible
3163 window-system headers.
3164
3165 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3166 to match header.
3167
3168 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3169 directly accessing frame internals.
3170
3171 * w32font.h: Include font.h. Define syms_of_w32font and
3172 globals_of_w32font.
3173
3174 * process.c: Include TERM_HEADER instead of listing all possible
3175 window-system headers.
3176
3177 * nsterm.h: Remove declarations now in frame.h.
3178 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3179
3180 * menu.c: Include TERM_HEADER instead of listing all possible
3181 window-system headers.
3182
3183 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3184 window system.
3185
3186 * keyboard.c: Include TERM_HEADER instead of listing all possible
3187 window-system headers.
3188
3189 * image.c: Include TERM_HEADER instead of listing all possible
3190 window-system headers. Declare Vlibrary_cache when compiling for
3191 Windows.
3192
3193 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3194 window system declarations.
3195
3196 * frame.h: Move common functions here: set_frame_menubar,
3197 x_set_window_size, x_sync, x_get_focus_frame,
3198 x_set_mouse_position, x_set_mouse_pixel_position,
3199 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3200 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3201 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3202 x_activate_menubar, x_real_positions, x_bitmap_icon,
3203 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3204 and x_query_colors.
3205
3206 * frame.c: Include TERM_HEADER instead of listing all possible
3207 window-system headers.
3208
3209 * font.c: Include TERM_HEADER instead of listing all possible
3210 window-system headers.
3211
3212 * emacs.c: Include TERM_HEADER.
3213
3214 * dispnew.c: Include TERM_HEADER instead of listing all possible
3215 window-system headers.
3216
3217 * ccl.h: Include character.h.
3218
3219 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3220 the current window system; include in list of objects to link into
3221 Emacs.
3222
3223 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3224
3225 Remove mark_ttys function and fix tty_display_info initialization.
3226 * lisp.h (mark_ttys): Remove prototype.
3227 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3228 to mark_ttys because all possible values of 'top_frame' slot are
3229 the frames which are reachable from Vframe_list.
3230 * term.c (mark_ttys): Remove.
3231 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3232
3233 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3234
3235 Change struct frame bitfields from unsigned char to unsigned.
3236 * frame.h (struct frame): Change type of 'display_preempted',
3237 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3238 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3239 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3240 bitfields from unsigned char to unsigned.
3241
3242 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3243
3244 Remove unused member of struct x_output and struct w32_output.
3245 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3246 * w32term.h (struct w32_output): Likewise.
3247
3248 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3249
3250 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3251 does not become zero (Bug#12234).
3252
3253 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3256 for GCC 4.7.1 x86-64.
3257
3258 2012-08-30 Glenn Morris <rgm@gnu.org>
3259
3260 * lread.c (init_lread): For out-of-tree builds, only add the
3261 source directory's site-lisp dir to the load-path if it exists,
3262 consistent with in-tree builds. (Bug#12302)
3263
3264 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3265
3266 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3267 button_values to NULL. Call setStykeMask so dialogs get a close button.
3268 (windowShouldClose:): Set window_closed.
3269 (dealloc): New member, free button_values.
3270 (process_dialog:): Make member function. Remove window argument,
3271 replace window with self. Count buttons and allocate and store values
3272 in button_values.
3273 (addButton:value:row:): value is int with the name tag. Call setTag
3274 with tag. Remove return self, declare return value as void.
3275 (addString:row:): Remove return self, declare return value as void.
3276 (addSplit): Remove return self, declare return value as void.
3277 (clicked:): Remove return self, declare return value as void.
3278 Set dialog_return to button_values[seltag]. Code formatting change.
3279 (initFromContents:isQuestion:): Adjust call to process_dialog.
3280 Code formatting change.
3281 (timeout_handler:): Set timer_fired to YES.
3282 (runDialogAt:): Set timer_fired to NO.
3283 Handle click on close button as quit.
3284
3285 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3286 Add window_closed and button_values. Add void as return value for
3287 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3288 Add process_dialog as new member.
3289
3290 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3291
3292 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3293 is not one of the heaps we manage. (Bug#12242)
3294
3295 2012-08-28 Glenn Morris <rgm@gnu.org>
3296
3297 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3298
3299 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3300
3301 * window.c (Fset_window_configuration): Remove handling of
3302 auto-buffer-name window parameter. Install revision of reverted
3303 fix.
3304
3305 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Do not allow to set major mode for a dead buffer.
3308 * buffer.c (Fset_buffer_major_mode): Signal an error
3309 if the buffer is dead.
3310 (Fother_buffer, other_buffer_safely): Remove redundant
3311 nested declaration.
3312
3313 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3314
3315 Always use set_buffer_if_live to restore original buffer at unwind.
3316 * buffer.h (record_unwind_current_buffer): New function.
3317 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3318 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3319 * undo.c, window.c: Adjust users.
3320 * buffer.c (set_buffer_if_live): Fix comment.
3321
3322 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3323
3324 Fix usage of set_buffer_internal.
3325 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3326 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3327 * coding.c (decode_coding): Omit redundant test.
3328 * fileio.c (decide_coding_unwind): Likewise.
3329 * fns.c (secure_hash): Likewise.
3330 * insdel.c (modify_region): Likewise.
3331 * keyboard.c (command_loop_1): Likewise.
3332 * print.c (PRINTFINISH): Likewise.
3333 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3334
3335 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 * dispnew.c: Use bool for boolean.
3338 (frame_garbaged, display_completed, delayed_size_change)
3339 (fonts_changed_p, add_window_display_history)
3340 (add_frame_display_history, verify_row_hash)
3341 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3342 (row_equal_p, realloc_glyph_pool)
3343 (allocate_matrices_for_frame_redisplay)
3344 (showing_window_margins_p)
3345 (adjust_frame_glyphs_for_frame_redisplay)
3346 (build_frame_matrix_from_leaf_window, make_current)
3347 (mirrored_line_dance, mirror_line_dance, update_frame)
3348 (update_window_tree, update_single_window)
3349 (check_current_matrix_flags, update_window, update_text_area)
3350 (update_window_line, set_window_update_flags, scrolling_window)
3351 (update_frame_1, scrolling, buffer_posn_from_coords)
3352 (do_pending_window_change, change_frame_size)
3353 (change_frame_size_1, sit_for):
3354 Use bool for boolean.
3355 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3356 and remove last int (actually boolean) argument, which was always 0.
3357 All callers changed.
3358 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3359 * dispextern.h (struct composition_it): Use bool for boolean.
3360 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3361 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3362 * dired.c (file_name_completion):
3363 Use bool for boolean. (This was missed in an earlier change.)
3364
3365 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3366
3367 * window.c (Fset_window_configuration): Revert first part of
3368 last change.
3369
3370 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3371
3372 * nsterm.h (NSPanel): New class variable dialog_return.
3373
3374 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3375 Initialize dialog_return.
3376 (windowShouldClose:): Use stop instead of stopModalWithCode.
3377 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3378 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3379 event.
3380 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3381 modal loop returns.
3382
3383 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3386 * composite.c (find_composition, composition_gstring_p)
3387 (composition_reseat_it, find_automatic_composition):
3388 * data.c (let_shadows_buffer_binding_p)
3389 (let_shadows_global_binding_p, set_internal, make_blv)
3390 (Fmake_variable_buffer_local, Fmake_local_variable)
3391 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3392 (cons_to_signed, arith_driver):
3393 * dbusbind.c (xd_in_read_queued_messages):
3394 * dired.c (directory_files_internal, file_name_completion):
3395 Use bool for booleans.
3396 * dired.c (file_name_completion):
3397 * process.h (fd_callback):
3398 Omit int (actually boolean) argument. It wasn't being used.
3399 All uses changed.
3400 * composite.h, lisp.h: Reflect above API changes.
3401
3402 * cmds.c, coding.c: Use bool for booleans.
3403 * cmds.c (move_point, Fself_insert_command):
3404 * coding.h (struct composition status, struct coding_system):
3405 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3406 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3407 (emacs_mule_char, decode_coding_emacs_mule)
3408 (encode_coding_emacs_mule, detect_coding_iso_2022)
3409 (decode_coding_iso_2022, encode_invocation_designation)
3410 (encode_designation_at_bol, encode_coding_iso_2022)
3411 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3412 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3413 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3414 (encode_coding_raw_text, detect_coding_charset)
3415 (decode_coding_charset, encode_coding_charset, detect_eol)
3416 (detect_coding, get_translation_table, produce_chars)
3417 (consume_chars, reused_workbuf_in_use)
3418 (make_conversion_work_buffer, code_conversion_save)
3419 (decode_coding_object, encode_coding_object)
3420 (detect_coding_system, char_encodable_p)
3421 (Funencodable_char_position, code_convert_region)
3422 (code_convert_string, code_convert_string_norecord)
3423 (Fset_coding_system_priority):
3424 * fileio.c (Finsert_file_contents):
3425 Use bool for booleans.
3426 * coding.h, lisp.h: Reflect above API changes.
3427 * coding.c: Remove unnecessary static function decls.
3428 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3429 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3430 not a boolean 'int', since callers never look at the return value.
3431 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3432 * coding.h (decoding_buffer_size, encoding_buffer_size)
3433 (emacs_mule_string_char): Remove unused extern decls.
3434 (struct iso_2022_spec, struct coding_system):
3435 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3436 (struct emacs_mule_spec): Remove unused field 'full_support'.
3437 All initializations removed.
3438 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3439
3440 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 Fix spare memory change (Bug#12286).
3443 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3444 (valid_lisp_object_p): Likewise.
3445
3446 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3447
3448 * window.c (Fset_window_configuration): Record any window's old
3449 buffer if it's replaced (see Bug#8789). If the new current
3450 buffer doesn't appear in the selected window, go to its old
3451 point (Bug#12208).
3452
3453 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3454
3455 Special MEM_TYPE_SPARE to denote reserved memory.
3456 * alloc.c (enum mem_type): New memory type.
3457 (refill_memory_reserve): Use new type for spare memory.
3458 This prevents live_cons_p and live_string_p from incorrect
3459 detection of uninitialized objects from spare memory as live.
3460
3461 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3462
3463 Spelling fixes.
3464 * Makefile.in (.PHONY): versioclean -> versionclean.
3465
3466 Remove unused external symbols.
3467 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3468 * window.c (Qwindow_valid_p, decode_valid_window):
3469 Now static, not extern.
3470 * data.c (Qinterval): Remove; unused.
3471 (syms_of_data): Do not define 'interval'.
3472 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3473 * window.h (decode_valid_window):
3474 Remove decls.
3475
3476 * character.c, charset.c, chartab.c: Use bool for booleans.
3477 * character.c (lisp_string_width, string_count_byte8)
3478 (string_escape_byte8):
3479 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3480 (load_charset_map_from_file, map_charset_chars)
3481 (Fdefine_charset_internal, define_charset_internal)
3482 (Fdeclare_equiv_charset, find_charsets_in_text)
3483 (Ffind_charset_region, char_charset, Fiso_charset):
3484 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3485 (sub_char_table_set, sub_char_table_set_range)
3486 (char_table_set_range, optimize_sub_char_table)
3487 (map_sub_char_table):
3488 Use bool for boolean.
3489 * character.c (str_to_unibyte): Omit last boolean argument; it was
3490 always 0. All callers changed.
3491 * character.h, charset.h: Adjust to match previous changes.
3492 * character.h (char_printable_p): Remove decl of nonexistent function.
3493 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3494 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3495 are all boolean, so make them single-bit bitfields.
3496
3497 * lisp.h (ASET): Remove attempt to detect side effects.
3498 It was meant to be temporary and it often doesn't work,
3499 because when IDX has side effects the behavior of IDX==IDX
3500 is undefined. See Stefan Monnier in
3501 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3502
3503 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3504
3505 * lisp.h (functionp): New function (extracted from Ffunctionp).
3506 (FUNCTIONP): Use it.
3507 * eval.c (Ffunctionp): Use it.
3508
3509 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3512 as that's faster and simpler than static storage. Don't bother
3513 with the g_main_context_query overhead if g_main_context_pending
3514 says no events are pending.
3515 (gfds, gfds_size): Remove these static vars.
3516 (xgselect_initialize): Remove; no longer needed.
3517 All uses and decls removed.
3518
3519 * emacs.c (fatal_error_signal_hook): Remove.
3520 All uses removed. This leftover from old code was always 0.
3521
3522 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3523 * casefiddle.c (casify_object, casify_region):
3524 * casetab.c (set_case_table):
3525 * category.c, category.h (word_boundary_p):
3526 * category.h (CHAR_HAS_CATEGORY):
3527 Use bool for booleans, instead of int.
3528
3529 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3530
3531 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3532
3533 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3534
3535 On assertion failure, print backtrace if available.
3536 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3537 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3538 * Makefile.in (LIB_EXECINFO): New macro.
3539 (LIBES): Use it.
3540
3541 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3542 * bytecode.c (exec_byte_code):
3543 * callint.c (check_mark, Fcall_interactively):
3544 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3545 (getenv_internal, sync_process_alive, call_process_exited):
3546 * lisp.h (USE_SAFE_ALLOCA):
3547 Use bool for booleans, instead of int.
3548 * lisp.h, process.h: Adjust prototypes to match above changes.
3549 * callint.c (Fcall_interactively): Don't assume the mark's
3550 offset fits in 'int'.
3551
3552 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3553
3554 * buffer.c, buffer.h: Use bool for boolean.
3555 * buffer.c (reset_buffer_local_variables)
3556 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3557 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3558 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3559 (overlay_touches_p, overlay_strings, Foverlay_put)
3560 (report_overlay_modification, call_overlay_mod_hooks):
3561 (mmap_enlarge, mmap_set_vars):
3562 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3563 Use bool for booleans, instead of int.
3564 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3565 since the 1-or-0 return value is always ignored anyway.
3566 (mmap_initialized_p):
3567 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3568 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3569
3570 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 * bidi.c: Use bool for boolean.
3573 This is a bit more readable, and makes the text segment of bidi.o
3574 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3575 Presumably it's faster too.
3576 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3577 Now bool.
3578 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3579 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3580 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3581 (bidi_explicit_dir_char, bidi_level_of_next_char)
3582 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3583 Use bool for booleans, instead of int.
3584 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3585 (bidi_unshelve_cache): Adjust decls to match code.
3586
3587 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3588
3589 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3590 argument.
3591
3592 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3593
3594 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3595 * atimer.h: Include <stdbool.h>.
3596
3597 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3598
3599 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3600 compile time tests instead of run time tests on systems that do
3601 not use them.
3602 (FRAME_MAC_P): Remove leftover from deleted code.
3603 * frame.c (syms_of_frame): Remove leftover from deleted code.
3604
3605 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3606
3607 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3608
3609 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3612 Otherwise, the compiler complains about (A?B:C) where B is void
3613 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3614 (fontset_add): Return void, for FONTSET_ADD.
3615
3616 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3617
3618 * alloc.c: Use bool for booleans.
3619 (gc_in_progress, abort_on_gc)
3620 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3621 (dont_register_blocks) [GC_MALLOC_CHECK]:
3622 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3623 (check_string_bytes, make_specified_string, memory_full)
3624 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3625 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3626 (mark_stack, valid_pointer_p, make_pure_string)
3627 (Fgarbage_collect, survives_gc_p, gc_sweep):
3628 Use bool for booleans, instead of int.
3629 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3630 Remove unused local.
3631 * alloc.c (PURE_POINTER_P):
3632 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3633 * editfns.c (Fformat):
3634 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3635 (Fdo_auto_save):
3636 * fns.c (sweep_weak_table):
3637 * lisp.h (suppress_checking, push_message, survives_gc_p)
3638 (make_pure_string, gc_in_progress, abort_on_gc):
3639 * lread.c (readchar, read1):
3640 * print.c (Fprin1_to_string):
3641 * xdisp.c (push_message):
3642 Use bool for booleans affected directly or indirectly by
3643 alloc.c's changes.
3644
3645 Make recently-introduced setters macros.
3646 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3647 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3648 (set_fontset_default, set_fontset_fallback): Rename from their
3649 upper-case counterparts, and make them functions rather than macros.
3650 This is more consistent with the other recently-introduced setters.
3651 These don't need to be inline, since they're local.
3652
3653 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3654
3655 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3656 the loop (Bug#12247).
3657
3658 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 * lisp.h (vcopy): Use memcpy rather than our own loop.
3661 This fixes a performance regression introduced by the recent
3662 addition of vcopy. This means 'vcopy' will need to be modified
3663 for a copying collector, but that's OK. Also, tighten the
3664 checking in the assertion.
3665
3666 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3667
3668 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3669 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3670 non-base glyph for the width of the base character, according to
3671 what x_draw_composite_glyph_string_foreground expects.
3672 Generate WADJUST value according to composition_gstring_width's
3673 expectations, to produce correct width of the composed character.
3674 Reverse the sign of the DU offset produced by ScriptPlace.
3675
3676 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3677
3678 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3679
3680 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3681
3682 Avoid direct writes to contents member of struct Lisp_Vector.
3683 * lisp.h (vcopy): New function to copy data into vector.
3684 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3685 * fns.c (Ffillarray): Use ASET.
3686 * keyboard.c (timer_check_2): Use AREF and ASET.
3687 (append_tool_bar_item, Frecent_keys): Use vcopy.
3688 * lread.c (read_vector): Use ASET.
3689 * msdos.c (Frecent_doskeys): Use vcopy.
3690 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3691 (Finternal_merge_in_global_face): Use ASET and vcopy.
3692 * xfont.c (xfont_list_pattern): Likewise.
3693
3694 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3695
3696 * window.c (Fwindow_point): For the selected window always return
3697 the position of its buffer's point.
3698 (Fset_window_point): For the selected window always go in its
3699 buffer to the specified position.
3700
3701 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3702
3703 Setter macros for fontsets.
3704 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3705 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3706 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3707 Adjust users.
3708
3709 2012-08-20 Glenn Morris <rgm@gnu.org>
3710
3711 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3712 Don't assume that `ln -f' works.
3713
3714 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3715
3716 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3717 and later about non-assignments with no effect. See discussion at
3718 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3719 details.
3720
3721 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Inline setter functions for Lisp_Objects slots of struct specbinding.
3724 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3725 Adjust users.
3726
3727 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3728
3729 * window.c (select_window): Always make selected window's buffer
3730 current.
3731
3732 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3733
3734 Use AREF and ASET for docstrings of category tables.
3735 * category.h (CATEGORY_DOCSTRING): Use AREF.
3736 (SET_CATEGORY_DOCSTRING): Use ASET.
3737 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3738
3739 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3740
3741 Inline setter functions for hash table members.
3742 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3743 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3744 (set_hash_key_and_value, set_hash_index, set_hash_next)
3745 (set_hash_hash): New functions.
3746 * charset.c, fns.c: Adjust users.
3747
3748 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3749
3750 Inline getter and setter functions for per-buffer values.
3751 * buffer.h (per_buffer_default, set_per_buffer_default)
3752 (per_buffer_value, set_per_buffer_value): New functions.
3753 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3754 * buffer.c, data.c: Adjust users.
3755
3756 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3757
3758 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3759
3760 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3761
3762 Rely on <config.h> + <unistd.h> to declare 'environ',
3763 as gnulib does this if the system doesn't.
3764 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3765 Remove declaration. MS-Windows declares it on stdlib.h which is
3766 included by conf_post.h.
3767 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3768 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3769 * vm-limit.c: Include <unistd.h>, for 'environ'.
3770
3771 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3772 (start_of_data): Remove decl; mem-limits.h provides it.
3773
3774 * xdisp.c (handle_invisible_prop): Make it a bit faster
3775 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3776
3777 2012-08-19 Chong Yidong <cyd@gnu.org>
3778
3779 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3780 ends (Bug#3874).
3781
3782 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3783
3784 * .gdbinit: Use call instead of set when calling a function in the
3785 inferior.
3786
3787 * data.c (set_internal): Don't use set_blv_found.
3788 (Fkill_local_variable): Likewise.
3789
3790 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3791
3792 * nsfont.m (ns_ascii_average_width): Ensure the string
3793 ascii_printable is initialized with a null-terminated character
3794 array. Otherwise, it can contain undesired extra characters.
3795
3796 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3797
3798 port new setting code to Sun C 5.8 2005/10/13
3799 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3800 Return void, not Lisp_Object. Otherwise, the compiler
3801 complains about (A?B:C) where B is void and C is Lisp_Object
3802 when compiling CHAR_TABLE_SET, due to the recent change to
3803 the API of sub_char_table_set_contents.
3804
3805 2012-08-18 Chong Yidong <cyd@gnu.org>
3806
3807 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3808 for the string case (Bug#3874).
3809
3810 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3811
3812 * buffer.h (BSET): Remove (Bug#12215).
3813 Replace all uses with calls to new setter functions.
3814 (bset_bidi_paragraph_direction, bset_case_canon_table)
3815 (bset_case_eqv_table, bset_directory, bset_display_count)
3816 (bset_display_time, bset_downcase_table)
3817 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3818 (bset_last_selected_window, bset_local_var_alist)
3819 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3820 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3821 (bset_width_table):
3822 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3823 (bset_auto_fill_function, bset_auto_save_file_format)
3824 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3825 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3826 (bset_cache_long_line_scans, bset_case_fold_search)
3827 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3828 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3829 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3830 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3831 (bset_header_line_format, bset_indicate_buffer_boundaries)
3832 (bset_indicate_empty_lines, bset_invisibility_spec)
3833 (bset_left_fringe_width, bset_major_mode, bset_mark)
3834 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3835 (bset_name, bset_overwrite_mode, bset_pt_marker)
3836 (bset_right_fringe_width, bset_save_length)
3837 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3838 (bset_scroll_up_aggressively, bset_selective_display)
3839 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3840 (bset_word_wrap, bset_zv_marker):
3841 * category.c (bset_category_table):
3842 * syntax.c (bset_syntax_table):
3843 New setter functions.
3844
3845 * process.h (PSET): Remove (Bug#12215).
3846 Replace all uses with calls to new setter functions.
3847 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3848 (PROCESS_INLINE): New macro.
3849 (pset_childp): New setter function.
3850 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3851 * process.c (PROCESS_INLINE):
3852 Define to EXTERN_INLINE, so that the corresponding functions
3853 are compiled into code.
3854 (pset_buffer, pset_command, pset_decode_coding_system)
3855 (pset_decoding_buf, pset_encode_coding_system)
3856 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3857 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3858 (pset_type, pset_write_queue): New setter functions.
3859
3860 * window.h (WSET): Remove (Bug#12215).
3861 Replace all uses with calls to new setter functions.
3862 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3863 (WINDOW_INLINE): New macro.
3864 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3865 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3866 (wset_total_lines, wset_vertical_scroll_bar)
3867 (wset_window_end_pos, wset_window_end_valid)
3868 (wset_window_end_vpos): New setter functions.
3869 * window.c (WINDOW_INLINE):
3870 Define to EXTERN_INLINE, so that the corresponding functions
3871 are compiled into code.
3872 (wset_combination_limit, wset_dedicated, wset_display_table)
3873 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3874 (wset_new_normal, wset_new_total, wset_next_buffers)
3875 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3876 (wset_prev_buffers, wset_right_fringe_width)
3877 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3878 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3879 (wset_window_parameters):
3880 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3881 (wset_column_number_displayed, wset_region_showing):
3882 New setter functions.
3883
3884 * termhooks.h (TSET): Remove (Bug#12215).
3885 Replace all uses with calls to new setter functions.
3886 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3887 (TERMHOOKS_INLINE): New macro.
3888 (tset_charset_list, tset_selection_alist): New setter functions.
3889 * terminal.c (TERMHOOKS_INLINE):
3890 Define to EXTERN_INLINE, so that the corresponding functions
3891 are compiled into code.
3892 (tset_param_alist): New setter function.
3893
3894 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3895
3896 * keyboard.h (KSET): Remove (Bug#12215).
3897 Replace all uses with calls to new setter functions.
3898 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3899 (KEYBOARD_INLINE): New macro.
3900 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3901 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3902 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3903 New setter functions.
3904 * keyboard.c (KEYBOARD_INLINE):
3905 Define to EXTERN_INLINE, so that the corresponding functions
3906 are compiled into code.
3907 (kset_echo_string, kset_kbd_queue)
3908 (kset_keyboard_translate_table, kset_last_prefix_arg)
3909 (kset_last_repeatable_command, kset_local_function_key_map)
3910 (kset_overriding_terminal_local_map, kset_real_last_command)
3911 (kset_system_key_syms): New setter functions.
3912
3913 * frame.h (FSET): Remove (Bug#12215).
3914 Replace all uses with calls to new setter functions.
3915 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3916 (FRAME_INLINE): New macro.
3917 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3918 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3919 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3920 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3921 (fset_param_alist, fset_root_window, fset_scroll_bars)
3922 (fset_selected_window, fset_title, fset_tool_bar_items)
3923 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3924 * frame.c (FRAME_INLINE):
3925 Define to EXTERN_INLINE, so that the corresponding functions
3926 are compiled into code.
3927 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3928
3929 A few more naming-convention fixes for getters and setters.
3930 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3931 and rename from buffer_overlays_set_before.
3932 (set_buffer_overlays_after): Move here from buffer.h, and rename
3933 from buffer_overlays_set_after.
3934 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3935 All uses changed.
3936 (set_buffer_intervals): Rename from buffer_set_intervals.
3937 * intervals.c (set_interval_object): Move here from intervals.h,
3938 and rename from interval_set_object.
3939 (set_interval_left): Move here from intervals.h, and rename from
3940 interval_set_left.
3941 (set_interval_right): Move here from intervals.h, and rename from
3942 interval_set_right.
3943 (copy_interval_parent): Move here from intervals.h, and rename from
3944 interval_copy_parent.
3945 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3946 (set_interval_plist): Rename from interval_set_plist.
3947 Return void, not Lisp_Object, since no caller uses the result.
3948 * lisp.h (string_intervals): Rename from string_get_intervals.
3949 (set_string_intervals): Rename from string_set_intervals.
3950
3951 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3952 (set_char_table_contents): Rename from char_table_set_contents.
3953 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3954 All uses changed. See the end of
3955 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3956
3957 * lisp.h (CSET): Remove (Bug#12215).
3958 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3959 (set_char_table_purpose): New functions,
3960 replacing CSET. All uses changed. For example, replace
3961 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3962 "set_char_table_parent (char_table, parent);".
3963 The old version was confusing because it used the same name
3964 'parent' for two different things.
3965
3966 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3967
3968 Functions to get and set Lisp_Object fields of buffer-local variables.
3969 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3970 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3971 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3972 * data.c, eval.c, frame.c: Adjust users.
3973
3974 2012-08-17 Chong Yidong <cyd@gnu.org>
3975
3976 * xfaces.c (merge_face_vectors): If the target font specfies a
3977 font spec, make the font's attributes take precedence over
3978 directly-specified attributes.
3979 (merge_face_ref): Recognize :font.
3980
3981 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3982
3983 Do not use memcpy for copying intervals.
3984 * intervals.c (reproduce_interval): New function.
3985 (reproduce_tree, reproduce_tree_obj): Use it.
3986 (reproduce_tree_obj): Remove prototype.
3987
3988 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3989
3990 * lisp.h (duration_to_sec_usec): Remove unused decl.
3991
3992 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3993
3994 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3995 to an allocated instance of NSString, not to the class itself.
3996
3997 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3998
3999 * makefile.w32-in (C_CTYPE_H): New macro.
4000 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4001 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4002 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4003
4004 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4005
4006 Use ASCII tests for character types.
4007 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4008 * xfns.c, xterm.c:
4009 Don't include <ctype.h>; was not needed.
4010 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4011 * sysdep.c, xfaces.c:
4012 Include <c-ctype.h> instead of <ctype.h>.
4013 * nsterm.m: Include <c-ctype.h>.
4014 * charset.c (read_hex):
4015 * doc.c (Fsnarf_documentation):
4016 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4017 (DRIVE_LETTER) [DOS_NT]:
4018 (Ffile_name_directory, Fexpand_file_name)
4019 (Fsubstitute_in_file_name):
4020 * font.c (font_parse_xlfd, font_parse_fcname):
4021 * frame.c (x_set_font_backend):
4022 * gtkutil.c (xg_get_font):
4023 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4024 * nsimage.m (hexchar):
4025 * nsterm.m (ns_xlfd_to_fontname):
4026 * sysdep.c (system_process_attributes):
4027 * xfaces.c (hash_string_case_insensitive):
4028 Use C-locale tests instead of locale-specific tests for character
4029 types, since we want the ASCII interpretation here, not the
4030 interpretation suitable for whatever happens to be the current locale.
4031
4032 2012-08-16 Martin Rudalics <rudalics@gmx.at>
4033
4034 Consistently check windows for validity/liveness
4035 (Bug#11984, Bug#12025, Bug#12026).
4036 * lisp.h (CHECK_VALID_WINDOW): New macro.
4037 * window.c (decode_window): Rename to decode_live_window.
4038 (decode_valid_window, Fwindow_valid_p): New functions.
4039 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4040 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4041 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4042 (Fwindow_prev_sibling, Fwindow_combination_limit)
4043 (Fset_window_combination_limit, Fwindow_use_time)
4044 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4045 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4046 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4047 (Fwindow_hscroll, Fset_window_hscroll)
4048 (Fwindow_redisplay_end_trigger)
4049 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4050 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4051 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4052 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4053 (Fwindow_end, Fset_window_point, Fset_window_start)
4054 (Fpos_visible_in_window_p, Fwindow_line_height)
4055 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4056 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4057 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4058 (Fset_window_parameter, Fwindow_display_table)
4059 (Fset_window_display_table, Fdelete_other_windows_internal)
4060 (Fset_window_buffer, Fset_window_new_total)
4061 (Fset_window_new_normal, Fdelete_window_internal)
4062 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4063 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4064 (Fwindow_scroll_bars): Check whether argument window is a valid or
4065 live window. Update doc-strings.
4066 (syms_of_window): New symbol Qwindow_valid_p.
4067 * keyboard.c (Fposn_at_x_y): Check whether argument
4068 frame_or_window denotes a valid window.
4069
4070 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 Fix previous char table change.
4073 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4074 * chartab.c (optimize_sub_char_table): Likewise.
4075
4076 2012-08-16 Chong Yidong <cyd@gnu.org>
4077
4078 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4079
4080 * xfont.c (xfont_open):
4081 * xftfont.c (xftfont_open): Set the font's max_width field.
4082
4083 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4084 min_width to space_width and average_width to the average over
4085 printable ASCII characters.
4086 (ns_char_width): Code cleanup.
4087 (ns_ascii_average_width): New utility function.
4088
4089 * font.h (struct font): Update comments.
4090
4091 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4092
4093 Simple interface to set Lisp_Object fields of character tables.
4094 * lisp.h (CSET): New macro.
4095 (char_table_set_extras, char_table_set_contents)
4096 (sub_char_table_set_contents): New function.
4097 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4098 * syntax.c: Adjust users.
4099
4100 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4101
4102 * eval.c (eval_sub): Bind lexical-binding.
4103 * lread.c (Qlexical_binding): Make non-static.
4104
4105 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4106
4107 * nsmenu.m (popupSession): Remove.
4108 (pop_down_menu): Remove endModalSession.
4109 (timeout_handler:): New method.
4110 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4111 Call runModalForWindow. Check timer_fired when it returns.
4112 If not set, cancel timer and break out of loop.
4113 Otherwise loop again, with a new timeout.
4114
4115 * nsterm.m: Include fcntl.h if present.
4116 (fd_entry, t_readfds, inNsSelect): Remove.
4117 (select_writefds, select_valid, select_timeout, selfds)
4118 (select_mutex, apploopnr): Add.
4119 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4120 Otherwise call kbd_buffer_store_event.
4121 (ns_send_appdefined): Remove release of fd_entry.
4122 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4123 Increment and decrement apploopnr.
4124 (ns_select): If no file descriptors, just do a NSTimer.
4125 Otherwise copy read/write masks and start select thread (fd_handler).
4126 Start main loop and wait for application defined event.
4127 Inform select thread to stop selecting after main loop is exited.
4128 (ns_term_init): Create selfds pipe and set non-blocking.
4129 Initialize select_mutex. Start the select thread (fd_handler).
4130 (fd_handler:): Loop forever, wait for info from the main thread
4131 to either start or stop selecting. When select returns, send
4132 and appdefined event.
4133 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4134 If not call kbd_buffer_store_event.
4135
4136 * nsterm.h (EmacsApp): fd_handler takes id argument.
4137 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4138
4139 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4140
4141 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4142
4143 * region-cache.c (move_cache_gap): Update gap_len using the actual
4144 growth of the boundaries array. Do not change cache_len.
4145 (Bug#12196)
4146
4147 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4148
4149 Generalize and cleanup font subsystem checks.
4150 * font.h (FONT_DEBUG, font_assert): Remove.
4151 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4152 Change font_assert to eassert. Use eassert where appropriate.
4153
4154 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4155
4156 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4157
4158 2012-08-15 Chong Yidong <cyd@gnu.org>
4159
4160 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4161 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4162 extract the font descriptor instead of just the font name.
4163 In that case, return a font spec instead of a string.
4164 (x_last_font_name): Move to this file from xfns.c.
4165
4166 * xfns.c (Fx_select_font): The return value can also be a font
4167 spec. Move x_last_font_name management to gtkutil.c.
4168
4169 * xfaces.c: Make font weight and style symbols non-static.
4170
4171 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4172
4173 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4174 (bug#12117).
4175
4176 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4177
4178 * alloc.c (Fgarbage_collect): Use plural form consistently.
4179
4180 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4181
4182 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4183 iteration through the command loop. Fixes a problem whereby mouse
4184 movements are ignored until the first mouse click.
4185
4186 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4187
4188 Use bool, not int, for Lisp booleans.
4189 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4190 makes Emacs a bit smaller and presumably a bit faster.
4191 * lisp.h: Include <stdbool.h>.
4192 (struct Lisp_Boolfwd, defvar_bool):
4193 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4194 * regex.c [!emacs]: Include <stdbool.h>.
4195 (false, true): Remove; <stdbool.h> does this for us now.
4196
4197 2012-08-14 Chong Yidong <cyd@gnu.org>
4198
4199 * character.c (Fcharacterp): Doc fix (Bug#12076).
4200
4201 * data.c (Findirect_variable): Doc fix (Bug#11040).
4202
4203 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4204
4205 * editfns.c (Fformat): Doc fix (Bug#12059).
4206 (Fsave_current_buffer): Doc fix (Bug#11542).
4207
4208 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4209
4210 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4211 (bug#12022).
4212
4213 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4214
4215 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4216 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4217 * minibuf.c (choose_minibuf_frame, read_minibuf):
4218 * w32fns.c (x_create_tip_frame):
4219 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4220 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4221
4222 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 * intervals.c (offset_intervals): Remove obsolete comment.
4225
4226 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4227
4228 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4229
4230 2012-08-14 Gergely Risko <gergely@risko.hu>
4231
4232 * coding.c (decode_coding): Record buffer modification before
4233 disabling undo_list (Bug#11773).
4234
4235 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Revert and cleanup some recent overlay changes.
4238 * buffer.h (enum overlay_type): Remove.
4239 (buffer_get_overlays, buffer_set_overlays): Likewise.
4240 (buffer_set_overlays_before, buffer_set_overlays_after):
4241 New function. Adjust users.
4242 (unchain_both): Add eassert.
4243
4244 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4245
4246 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4247
4248 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4249
4250 * gtkutil.c (xg_mark_data): Don't assume C99.
4251
4252 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4253
4254 * gtkutil.c (xg_frame_tb_info): New struct.
4255 (TB_INFO_KEY): New define.
4256 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4257 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4258 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4259 if not present.
4260 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4261 is up to date. Otherwise store new data.
4262 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4263
4264 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4265
4266 Use KSET for write access to Lisp_Object members of struct kboard.
4267 * keyboard.h (KSET): New macro.
4268 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4269 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4270 * xterm.c: Adjust users.
4271
4272 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4273
4274 Use BSET for write access to Lisp_Object members of struct buffer.
4275 * buffer.h (BSET): New macro.
4276 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4277 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4278 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4279 * window.c, xdisp.c, xfns.c: Adjust users.
4280
4281 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4282
4283 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4284
4285 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4286
4287 * nsterm.m (not_in_argv): New function.
4288 (application:openFile, application:openTempFile:):
4289 (application:openFileWithoutUI:, application:openFiles:): Open file
4290 if not_in_argv returns non-zero (bug#12171).
4291
4292 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4293 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4294 Define for Gtk+ versions less than 3.2.
4295 (xg_get_font_name): Use those functions/macros here.
4296 Reported by Frans Oilinki <moilinki@gmail.com>.
4297
4298 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4299
4300 * unexmacosx.c (copy_data_segment): Copy initialized data in
4301 statically linked libraries from input file rather than memory.
4302
4303 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4304 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4305 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4306
4307 2012-08-10 Glenn Morris <rgm@gnu.org>
4308
4309 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4310 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4311
4312 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4313
4314 Fix last change to allow compilation with low optimization levels.
4315 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4316 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4317
4318 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Use common inline syntax in intervals.h.
4321 * intervals.h (INTERVALS_INLINE): New macro.
4322 Change all users from LISP_INLINE.
4323
4324 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4325
4326 Define Qnone once for all platforms.
4327 * frame.c (Qnone): Define here.
4328 (syms_of_frame): DEFSYM it.
4329 * lisp.h (Qnone): New declaration.
4330 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4331 * xfns.c: Remove duplication. Adjust users.
4332
4333 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4334
4335 Remove unused macros from intervals.h.
4336 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4337 * intervals.c: Adjust comment.
4338
4339 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4340
4341 * w32fns.c <w32_unicode_gui>: New static variable.
4342 (globals_of_w32fns): Initialize it according to os_subtype.
4343 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4344 testing os_subtype.
4345
4346 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4347 Eli Zaretskii <eliz@gnu.org>
4348
4349 Fix bug #10299 with Unicode characters sent by customized
4350 keyboards created by MSKLC.
4351 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4352 (w32_init_class): Use it to initialize the Emacs class with either
4353 ANSI or Unicode API calls.
4354 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4355 later.
4356 (w32_wnd_proc): If the character code sent by WM_CHAR or
4357 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4358 original message. Call DefWindowProcW on NT and later.
4359
4360 2012-08-10 Glenn Morris <rgm@gnu.org>
4361
4362 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4363
4364 * lisp.h (DIRECTORY_SEP): Let configure set it.
4365
4366 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4367
4368 Use TSET for write access to Lisp_Object slots of struct terminal.
4369 * termhooks.h (TSET): New macro.
4370 * coding.c, terminal.c, xselect.c: Adjust users.
4371
4372 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4373
4374 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4375 the failing expression, include them in the error message.
4376 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4377 * lisp.h (internal_condition_case_n): Update declaration.
4378
4379 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4380
4381 Inline functions to examine and change buffer overlays.
4382 * buffer.c (unchain_both): New function.
4383 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4384 (buffer_has_overlays): New function.
4385 (enum overlay_type): New enum.
4386 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4387 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4388
4389 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4390
4391 Inline functions to examine and change buffer intervals.
4392 * alloc.c (mark_interval_tree): Remove.
4393 (MARK_INTERVAL_TREE): Simplify.
4394 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4395 * intervals.c (buffer_balance_intervals): New function.
4396 (graft_intervals_into_buffer): Adjust indentation.
4397 (set_intervals_multibyte): Simplify.
4398 * buffer.h (BUF_INTERVALS): Remove.
4399 (buffer_get_intervals, buffer_set_intervals): New function.
4400 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4401 * intervals.c, textprop.c: Adjust users.
4402
4403 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4404
4405 Inline functions to examine and change string intervals.
4406 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4407 (string_get_intervals, string_set_intervals): New function.
4408 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4409 * lread.c, print.c, textprop.c: Adjust users.
4410
4411 2012-08-08 Glenn Morris <rgm@gnu.org>
4412
4413 * lisp.mk (lisp): Remove language/persian.elc.
4414
4415 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4416
4417 Cleanup intervals.
4418 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4419 (NULL_INTERVAL_P): Likewise. Adjust users.
4420 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4421 Adjust comment. Move under #if 0.
4422 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4423 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4424
4425 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4426
4427 Check total length of intervals with eassert.
4428 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4429 * intervals.c: Change all users to eassert.
4430
4431 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4432
4433 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4434 Rename fields to match removal of FGET and WGET and disuse of
4435 INTERNAL_FIELD in Lisp_Cons.
4436
4437 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4440 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4441 name since all xname users are fixed long time ago. Do not
4442 use INTERNAL_FIELD.
4443 (set_symbol_name, set_symbol_function, set_symbol_plist):
4444 (set_symbol_next, set_overlay_plist): New function.
4445 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4446 (struct Lisp_Overlay): Likewise.
4447 (CVAR, MVAR, SVAR): Remove.
4448 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4449 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4450 * xterm.c: Adjust users.
4451 * .gdbinit: Change to use name field of struct Lisp_Symbol
4452 where appropriate.
4453
4454 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4455
4456 Basic functions to set Lisp_Object and pointer slots of intervals.
4457 * intervals.h (interval_set_parent, interval_set_object):
4458 (interval_set_left, interval_set_right, interval_set_plist):
4459 (interval_copy_parent): New function.
4460 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4461 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4462 Adjust indentation.
4463 (INTERVAL_SIZE): Remove. Adjust users.
4464 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4465
4466 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4467
4468 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4469 * process.h (PGET): Remove.
4470 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4471 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4472
4473 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4474
4475 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4476 * window.h (WGET): Remove.
4477 (struct window): Do not use INTERNAL_FIELD.
4478 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4479 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4480 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4481 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4482 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4483 Adjust users.
4484
4485 2012-08-07 Chong Yidong <cyd@gnu.org>
4486
4487 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4488 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4489 (Fdelete_window_internal): Signal an error if the window is not on
4490 a live frame (Bug#12025).
4491
4492 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4495 * frame.h (FGET): Remove.
4496 (struct frame): Do not use INTERNAL_FIELD.
4497 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4498 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4499 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4500 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4501
4502 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4503
4504 * w32.c: Silence compiler warnings.
4505 (map_w32_filename): Remove unused variable `is_fat'.
4506 (chase_symlinks): Add parentheses around expression.
4507
4508 2012-08-06 Glenn Morris <rgm@gnu.org>
4509
4510 * sysdep.c: Respect BROKEN_GETWD.
4511
4512 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4513 Let configure handle it.
4514 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4515
4516 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4517
4518 Use GCALIGNMENT where appropriate.
4519 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4520 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4521 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4522
4523 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4524
4525 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4526 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4527
4528 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4529
4530 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4531 that should be sufficient for everyone.
4532
4533 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4534
4535 * keyboard.c (timer_check_2): Add break so timer_check returns next
4536 timeout.
4537
4538 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 Fix Windows build errors introduced after converting to WGET and WSET.
4541 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4542 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4543
4544 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4545
4546 * nsterm.m (ns_frame_rehighlight): Use FSET.
4547
4548 * nsmenu.m (ns_update_menubar): Use FSET.
4549
4550 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4551
4552 Separate read and write access to Lisp_Object slots of Lisp_Process.
4553 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4554 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4555
4556 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Separate read and write access to Lisp_Object slots of struct window.
4559 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4560 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4561 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4562 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4563 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4564 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4565 Adjust users.
4566
4567 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4568
4569 Fix Windows build errors introduced after converting to FGET and FSET.
4570 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4571 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4572 (w32_judge_scroll_bars): Change to use FSET.
4573 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4574
4575 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4576
4577 Fix replacement typo.
4578 * window.c (replace_window): Set root_window instead of
4579 selected_window. This fixes a total window subsystem
4580 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4581
4582 2012-08-06 Glenn Morris <rgm@gnu.org>
4583
4584 * lisp.mk (lisp): Add language/persian.elc.
4585
4586 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4587
4588 Separate read and write access to Lisp_Object slots of struct frame.
4589 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4590 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4591 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4592 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4593 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4594
4595 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4596
4597 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4598
4599 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4600
4601 Generalize common compile-time constants.
4602 * lisp.h (header_size, bool_header_size, word_size): Now here.
4603 (struct Lisp_Vector): Add comment.
4604 (struct Lisp_Bool_Vector): Move up to define handy constants.
4605 (VECSIZE, PSEUDOVECSIZE): Simplify.
4606 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4607 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4608 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4609 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4610 * xfont.c, xmenu.c: Use word_size where appropriate.
4611
4612 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4613
4614 * search.c (Freplace_match): Treat \? in the replacement text
4615 literally (Bug#8161).
4616
4617 2012-08-05 Chong Yidong <cyd@gnu.org>
4618
4619 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4620 * frame.c (Vdelete_frame_functions):
4621 * emacs.c (Vkill_emacs_hook): Doc fix.
4622
4623 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4624
4625 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4626 --with-x-toolkit=no builds.
4627 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4628
4629 2012-08-04 Chong Yidong <cyd@gnu.org>
4630
4631 * syntax.c (Fmodify_syntax_entry): Doc fix.
4632
4633 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4634
4635 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4636 * w32.c (init_environment): Change the default values of many
4637 environment variables in dflt_envvars[] to NULL, to avoid pushing
4638 them into environment when they were not already defined.
4639 Remove the code that deletes site-lisp subdirectories from the default
4640 value of EMACSLOADPATH, as it is no longer needed.
4641 (check_windows_init_file): Now external, not static.
4642 Use Vload_path as is, without adding anything, as this function is now
4643 called when Vload_path is already set up.
4644
4645 * w32.h (check_windows_init_file): Add prototype.
4646
4647 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4648 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4649 compatibility with Posix platforms.
4650 (main): Move the call to check_windows_init_file to here from
4651 w32.c.
4652 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4653 any, in the DEFALT argument into the root of the Emacs build or
4654 installation tree, as appropriate.
4655
4656 * callproc.c (init_callproc_1): Call decode_env_path instead of
4657 doing its equivalent by hand.
4658 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4659 the code that sets Vexec_path run on MS-Windows.
4660
4661 * lread.c (init_lread): Add comments to #ifdef's.
4662
4663 * msdos.c (dos_set_window_size, IT_update_begin)
4664 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4665 instead of direct references.
4666
4667 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 Export DEFAULT_REHASH_* to GDB.
4670 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4671 Now constants, not macros.
4672
4673 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 Remove unnecessary casts involving pointers.
4676 These casts are no longer needed now that we assume C89 or later,
4677 since they involve casting to or from void *.
4678 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4679 (make_pure_float, make_pure_vector):
4680 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4681 * macros.c (Fstart_kbd_macro):
4682 * menu.c (find_and_return_menu_selection):
4683 * minibuf.c (read_minibuf_noninteractive):
4684 * sysdep.c (closedir):
4685 * xdisp.c (x_produce_glyphs):
4686 * xfaces.c (compare_fonts_by_sort_order):
4687 * xfns.c (x_real_positions, select_visual):
4688 * xselect.c (x_stop_queuing_selection_requests)
4689 (x_get_window_property, x_get_window_property_as_lisp_data):
4690 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4691 Remove unnecessary pointer casts.
4692 * alloc.c (record_xmalloc): New function.
4693 * lisp.h (record_xmalloc): New decl.
4694 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4695 more like a function. This is because the pointer cast is not
4696 needed. All uses changed.
4697 * print.c (print_string, print_error_message): Avoid length recalc.
4698
4699 Improve fix for macroexp crash with debugging (Bug#12118).
4700 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4701 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4702 not supposed to be invoked from the garbage collector.
4703 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4704 (gc_aset): New function, which is like ASET but can be
4705 used in the garbage collector.
4706 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4707 (set_hash_index): Use it instead of ASET.
4708
4709 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4710
4711 Support symlinks on latest versions of MS-Windows.
4712 * w32.c: Include winioctl.h and aclapi.h.
4713 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4714 (revert_to_self): Forward declarations of static functions.
4715 <static BOOL g_b_init_get_security_info>:
4716 <g_b_init_create_symbolic_link>: New static flags.
4717 (globals_of_w32): Initialize them to zero.
4718 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4719 (map_w32_filename): Improve commentary. Simplify switch.
4720 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4721 headers (most versions of MinGW w32api don't).
4722 (get_security_info, create_symbolic_link)
4723 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4724 New functions.
4725 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4726 in the argument file name.
4727 (sys_access): Call unc_volume_file_attributes only if
4728 GetFileAttributes fails with network-related error codes.
4729 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4730 have the required privileges.
4731 (get_file_security_desc_by_name): Rename from
4732 get_file_security_desc.
4733 (stat_worker): New function, with most of the guts of 'stat', and
4734 with addition of handling of symlinks and support for 'lstat'.
4735 If possible, get file's attributes and security information by
4736 handle, not by name. Produce S_IFLNK bit for symlinks, when
4737 called from 'lstat'.
4738 (stat, lstat): New functions, call 'stat_worker'.
4739 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4740 symlinks when the underlying filesystem supports them.
4741
4742 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 Fix macroexp crash on Windows with debugging (Bug#12118).
4745 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4746 checking subscripts; problem introduced with the recent
4747 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4748 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4749 since it's used in non-static inline functions now.
4750
4751 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4752 Don't assume buffer size fits in 'int'. Remove unused local.
4753
4754 Use C99-style 'extern inline' if available.
4755 * buffer.h (BUFFER_INLINE):
4756 * category.h (CATEGORY_INLINE):
4757 * character.h (CHARACTER_INLINE):
4758 * charset.h (CHARSET_INLINE):
4759 * composite.h (COMPOSITE_INLINE):
4760 * dispextern.h (DISPEXTERN_INLINE):
4761 * lisp.h (LISP_INLINE):
4762 * systime.h (SYSTIME_INLINE):
4763 New macro, replacing 'static inline' in this header.
4764 * buffer.h, category.h, character.h, charset.h, composite.h:
4765 * dispextern.h, lisp.h, systime.h:
4766 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4767 * alloc.c (LISP_INLINE):
4768 * buffer.c (BUFFER_INLINE):
4769 * category.c (CATEGORY_INLINE):
4770 * character.c (CHARACTER_INLINE):
4771 * charset.c (CHARSET_INLINE):
4772 * composite.c (COMPOSITE_INLINE):
4773 * dispnew.c (DISPEXTERN_INLINE):
4774 * sysdep.c (SYSTIME_INLINE):
4775 Define to EXTERN_INLINE, so that the corresponding functions
4776 are compiled into code.
4777 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4778 (INLINE_HEADER_END): New macros.
4779 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4780 since it's used in non-static inline functions now.
4781 (VALMASK) [!USE_LSB_TAG]: Likewise.
4782
4783 2012-08-02 Glenn Morris <rgm@gnu.org>
4784
4785 * s/: Remove empty directory.
4786
4787 * s/ms-w32.h: Move to ../nt/inc.
4788 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4789 Update for new ms-w32.h location.
4790
4791 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4792
4793 Port to Solaris 8.
4794 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4795
4796 2012-08-02 Glenn Morris <rgm@gnu.org>
4797
4798 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4799 hard-coding the path separator.
4800
4801 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4804 This how ASET and AREF are supposed to work, and makes
4805 it easier to think about future improvements. See
4806 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4807 * charset.h (set_charset_attr): New function.
4808 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4809 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4810 (aref_addr): New function. All uses of &AREF(...) changed.
4811 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4812 (set_hash_index): New functions. All lvalue-style uses of
4813 HASH_KEY etc. changed.
4814 * keyboard.c (set_prop): New function. All lvalue-style uses
4815 of PROP changed.
4816
4817 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4818
4819 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4820 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4821 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4822 * nsfns.m (ns_set_name_as_filename): Likewise.
4823 * nsmenu.m (ns_update_menubar): Likewise.
4824 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4825
4826 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4827
4828 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4829 Adapt to latest changes in field names of the corresponding Lisp
4830 objects.
4831
4832 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4833
4834 2012-08-01 Glenn Morris <rgm@gnu.org>
4835
4836 * s/msdos.h: Remove file.
4837 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4838 * Makefile.in (S_FILE): Remove.
4839 (config_h): Remove S_FILE.
4840
4841 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4842
4843 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4844 Remove; moved to nt/config.nt.
4845
4846 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4847
4848 Use INTERNAL_FIELD for conses and overlays.
4849 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4850 Remove obsolete comment.
4851 (MVAR): New macro.
4852 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4853 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4854
4855 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 Use INTERNAL_FIELD for symbols.
4858 * lisp.h (SVAR): New macro. Adjust users.
4859 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4860 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4861
4862 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4863
4864 Use INTERNAL_FIELD for processes.
4865 * process.h (PVAR): New macro. Adjust style.
4866 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4867 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4868
4869 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4870
4871 Use INTERNAL_FIELD for windows.
4872 * window.h (WVAR): New macro.
4873 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4874 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4875 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4876 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4877 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4878 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4879
4880 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4883
4884 2012-08-01 Glenn Morris <rgm@gnu.org>
4885
4886 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4887 Move to configure.ac.
4888
4889 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4890
4891 * makefile.w32-in (CONFIG_H): Update dependencies.
4892 (CONF_POST_H): New macro.
4893
4894 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4895
4896 2012-07-31 Glenn Morris <rgm@gnu.org>
4897
4898 * Makefile.in (S_FILE): No longer set by configure.
4899
4900 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4901 is available.
4902 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4903
4904 * process.h (NULL_DEVICE):
4905 * emacs.c (SEPCHAR):
4906 * editfns.c (USER_FULL_NAME): Let configure set them.
4907
4908 * s/README, s/template.h: Remove files.
4909
4910 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4911
4912 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4913 Move to configure.ac.
4914
4915 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4916
4917 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4918 resulting renaming of 'struct frame' members.
4919
4920 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4921
4922 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4923 after introduction of FVAR.
4924
4925 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4926
4927 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4928
4929 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4930 instead of compositeToPoint.
4931 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4932
4933 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4934
4935 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4936
4937 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4938 * lisp.h (INTERNAL_FIELD): New macro.
4939 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4940 (BVAR): Change to use INTERNAL_FIELD.
4941 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4942 (KVAR): Change to use INTERNAL_FIELD.
4943 * frame.h (FVAR): New macro.
4944 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4945 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4946 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4947 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4948 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4949
4950 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4951
4952 Miscellaneous fixes for non-default X toolkits.
4953 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4954 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4955 Move under #ifdef USE_LUCID.
4956 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4957 definition and usage to avoid warnings.
4958
4959 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4960
4961 * nsterm.m (openFiles): Fix previous checkin.
4962
4963 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * indent.c (compute_motion): Remove unused local.
4966
4967 2012-07-31 Glenn Morris <rgm@gnu.org>
4968
4969 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4970
4971 * conf_post.h [USG5_4]:
4972 Move remaining contents of s/usg5-4-common.h here.
4973 * s/usg5-4-common.h: Remove file.
4974
4975 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4976 * s/irix6-5.h: Remove file.
4977
4978 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4979 * s/darwin.h: Remove file.
4980
4981 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4982 * s/hpux10-20.h: Remove file, which is now empty.
4983
4984 2012-07-30 Glenn Morris <rgm@gnu.org>
4985
4986 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4987 * Makefile.in (config_h): Add conf_post.h.
4988 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4989
4990 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4991
4992 * nsterm.m (ns_do_open_file): New variable.
4993 (ns_term_init): Set ns_do_open_file to YES after run returns.
4994 (openFile, openTempFile, openFileWithoutUI, openFiles):
4995 Open files only if ns_do_open_file.
4996
4997 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4998
4999 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5000 This no-op macro hasn't been needed for many years.
5001 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5002
5003 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5004 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5005 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5006 gdb_make_enums_visible.
5007 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5008 (DIRECTORY_SEP): Now a constant, not a macro.
5009
5010 2012-07-30 Eli Zaretskii <eliz@gnu.org>
5011
5012 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5013 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5014
5015 * w32term.c <w32_keyboard_codepage>: Renamed from
5016 keyboard_codepage and now external. All users changed.
5017
5018 * w32term.h: Add declaration of w32_keyboard_codepage.
5019
5020 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5021 the codepage to translate keys to Unicode. If this argument is
5022 -1, use the value returned by GetConsoleCP. All callers changed.
5023
5024 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 Update .PHONY listings in makefiles.
5027 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5028 bootstrap-clean, distclean, maintainer-clean, versioclean,
5029 extraclean, frc.
5030
5031 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5032 This is a bit clearer. Fix some commentary typos.
5033
5034 2012-07-30 Glenn Morris <rgm@gnu.org>
5035
5036 * s/netbsd.h: Let configure include signal.h if needed.
5037 Remove file, which is now empty.
5038
5039 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5040 Let configure set them.
5041 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5042 No more need to undefine.
5043
5044 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5045
5046 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5047 non-single-byte char when adding meta modifier. (Bug#12090)
5048
5049 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5050
5051 Convert safe_call to use variable number of arguments.
5052 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5053 (safe_call2): Fix comment.
5054 * lisp.h (safe_call): Adjust prototype.
5055 * coding.c (encode_coding_object): Change to use safe_call2.
5056 * xfaces.c (merge_face_heights): Change to use safe_call1.
5057
5058 2012-07-30 Glenn Morris <rgm@gnu.org>
5059
5060 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5061 does that unconditionally. Remove file, which is now empty.
5062
5063 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5064 Remove empty files.
5065
5066 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5067
5068 Export to GDB most of lisp.h's remaining object-like macros.
5069 * lisp.h (min, max): Move earlier, because they're used earlier now.
5070 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5071 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5072 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5073 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5074 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5075 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5076 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5077 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5078 Now constants, for GDB. They need not be macros.
5079 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5080 Now constants, for GDB, as well as macros, for static initializers.
5081 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5082 Move to after the definition of struct Lisp_Char_Table,
5083 since the former now needs that type defined.
5084 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5085 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5086 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5087 New enums, for gdb_make_enums_visible.
5088 (GLYPH_MODE_LINE_FACE): Remove; unused.
5089 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5090 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5091 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5092 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5093 enum maxargs, enum MAX_ALLOCA.
5094 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5095 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5096 no longer needed, now that they are done in lisp.h.
5097
5098 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5099
5100 Cleanup string bytes checking.
5101 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5102 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5103 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5104 (check_sblock, compact_small_strings): Simplify.
5105
5106 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5107
5108 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5109 These macros are confusing and no longer need to be defined, as
5110 the enum values now suffice. All uses replaced with definiens.
5111 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5112
5113 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5114
5115 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5116 ($(BLD)/w32console.$(O)): Update dependencies.
5117
5118 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5121 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5122 time. Adjust users.
5123 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5124
5125 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5126
5127 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5128 setting sitelisp (Bug#12010).
5129
5130 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5131
5132 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5133
5134 * w32heap.c (cache_system_info):
5135 * w32.c (sys_rename):
5136 * w32proc.c (find_child_console, sys_kill): All users changed.
5137
5138 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5139
5140 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5141
5142 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5143
5144 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5145
5146 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5147
5148 Cleanup statistics calculation in Fgarbage_collect.
5149 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5150 Fix zombies percentage calculation. Simplify elapsed time calculation.
5151
5152 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5153
5154 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5155 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5156 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5157 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5158 (replace_range, replace_range_2, del_range_2): Change to eassert.
5159 * marker.c (byte_char_debug_check): Adjust style.
5160
5161 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5164 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5165 long-ago-commented-out code that talks about "WIN32".
5166 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5167 All uses changed.
5168
5169 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5170
5171 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5172 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5173 Simplify by using alignof.
5174 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5175 * lisp.h: Include <stdalign.h>.
5176 (GCALIGNMENT): New macro and constant.
5177 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5178 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5179 (stdalign): New macro, if not already defined.
5180
5181 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5182
5183 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5184 * w32inevt.c: Include w32inevt.h.
5185 (w32_read_console_input): New inline function, calls either
5186 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5187 w32_console_unicode_input.
5188 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5189 (w32_kbd_patch_key, key_event): Use the codepage returned by
5190 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5191 (key_event): use uChar.UnicodeChar only if
5192 w32_console_unicode_input is non-zero.
5193
5194 * w32console.c: Include w32heap.h.
5195 <w32_console_unicode_input>: New global variable.
5196 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5197 family of Windows, zero otherwise.
5198
5199 * w32inevt.h: Declare w32_console_unicode_input.
5200
5201 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5202 --without-x. (Bug#11742)
5203
5204 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 Adjust GDB to reflect pvec_type changes (Bug#12036).
5207 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5208 2012-07-04 changes to pseudovector representation.
5209 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5210
5211 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5212
5213 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5214 bus address.
5215 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5216
5217 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5218
5219 * alloc.c (listn): Fix the order the arguments are consed onto the
5220 list.
5221
5222 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5223 enumeration constants, as PURE and HEAP are too general, and clash
5224 with other headers and sources, such as gmalloc.c and the
5225 MS-Windows system headers. All users changed.
5226
5227 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5228
5229 Revert last save_excursion_save and save_excursion_restore changes.
5230 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5231 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5232
5233 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5234
5235 Fix recently-introduced typos in Windows port.
5236 Reported by Martin Rudalics <rudalics@gmx.at>.
5237 * w32.c (init_environment): Replace comma with semicolon.
5238 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5239
5240 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5241
5242 Improve GDB symbol export (Bug#12036).
5243 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5244 arms of an 'if', not using conditional expressions; otherwise GDB
5245 complains about the types in the unevaluated arm when the argument
5246 is an integer literal.
5247 (xgetint): Simplify expression.
5248 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5249 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5250 Zaretskii in <http://bugs.gnu.org/12036#13>.
5251 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5252 needed now that we have gdb_make_enums_visible.
5253 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5254 (enum enum_USE_LSB_TAG):
5255 New enum types, packaging up enums that need to be exported to GDB.
5256
5257 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5258
5259 Utility function to make a list from specified amount of objects.
5260 * lisp.h (enum constype): New datatype.
5261 (listn): New prototype.
5262 * alloc.c (listn): New function.
5263 (Fmemory_use_count, syms_of_alloc): Use it.
5264 * buffer.c (syms_of_buffer): Likewise.
5265 * callint.c (syms_of_callint): Likewise.
5266 * charset.c (define_charset_internal): Likewise.
5267 * coding.c (syms_of_coding): Likewise.
5268 * keymap.c (syms_of_keymap): Likewise.
5269 * search.c (syms_of_search): Likewise.
5270 * syntax.c (syms_of_syntax): Likewise.
5271 * w32.c (init_environment): Likewise.
5272 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5273 * xdisp.c (syms_of_xdisp): Likewise.
5274 * xfns.c (syms_of_xfns): Likewise.
5275
5276 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5277
5278 Fast save_excursion_save and save_excursion_restore.
5279 * lisp.h (struct Lisp_Excursion): New data type.
5280 (PVEC_EXCURSION): New pseudovector type.
5281 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5282 to deal with it. Adjust comments.
5283 (init_marker, attach_marker): New prototype.
5284 (unchain_marker): Adjust prototype.
5285 * marker.c (attach_marker): Change to global.
5286 (init_marker): New function.
5287 * alloc.c (Fmake_marker, build_marker): Use it.
5288 (build_marker): More easserts.
5289 (mark_object): Handle struct Lisp_Excursion.
5290 * editfns.c (save_excursion_save, save_excursion_restore):
5291 Reimplement to use struct Lisp_Excursion. Add comments.
5292
5293 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5294
5295 Fix export of symbols to GDB (Bug#12036).
5296 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5297 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5298 emacs.c, as this is a more-suitable home. Had this been done earlier
5299 the fix for 12036 would have avoided some of the problems noted in
5300 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5301 would have been more obvious.
5302 * emacs.c: Do not include <verify.h>; no longer needed.
5303 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5304 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5305 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5306 Remove; now done in lisp.h.
5307 * lisp.h (PUBLISH_TO_GDB): New macro.
5308 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5309 (DATA_SEG_BITS): Use it.
5310 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5311 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5312 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5313 not be usable in #if. This simplifies things.
5314
5315 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5316
5317 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5318
5319 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5320
5321 Simplify export of symbols to GDB (Bug#12036).
5322 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5323 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5324 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5325 Adjust to changes in lisp.h and emacs.c, by using
5326 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5327 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5328 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5329 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5330 instead of gdb_valbits.
5331 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5332 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5333 instead of gdb_array_mark_flag.
5334 (xboolvector): Get size from $->size, not $->header.size.
5335 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5336 (xreload, hook-run, hookpost-run): Remove.
5337 * emacs.c: Include <verify.h>.
5338 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5339 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5340 Remove.
5341 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5342 (gdb_USE_LSB_TAG): New enum constants.
5343 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5344 Also define these as enum constants, so they're visible to GDB.
5345 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5346 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5347 as constants, so they're visible to GDB.
5348 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5349 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5350 Now enum constants, not macros, so they're visible to GDB.
5351 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5352 more convenient now. All uses changed.
5353 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5354 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5355
5356 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5357
5358 Explicitly free restriction data that are not needed anymore.
5359 * editfns.c (save_restriction_restore): Free restriction data.
5360
5361 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5362
5363 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5364 add argument, tune behavior, and adjust all callers.
5365
5366 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 Use typedef for EMACS_INT, EMACS_UINT.
5369 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5370 than macros. This simplifies debugging in the usual case, since
5371 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5372 and it allows expressions involving EMACS_INT casts.
5373 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5374
5375 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5376
5377 * nsterm.m (ns_read_socket): Return early if there is a modal
5378 window (Bug#12043).
5379
5380 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5381
5382 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5383 that FOCUS-FRAME can be omitted.
5384
5385 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5386
5387 Adjust buffer text indirection counters at the end of Fkill_buffer.
5388 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5389 buffer is definitely dead. This should really fix an issue reported
5390 by Christoph Scholtes again. (Bug#12007).
5391 (init_buffer_once): Initialize indirection counters of
5392 buffer_defaults and buffer_local_symbols (for sanity and safety).
5393
5394 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5395
5396 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5397 and continuation glyphs on tooltip frames, leave them at zero.
5398 Avoids continued lines in tooltips. (Bug#11832)
5399
5400 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5401
5402 Simplify copy_overlay.
5403 * buffer.c (copy_overlay): Simplify. Use build_marker.
5404 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5405
5406 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5407
5408 * print.c (print_object): Don't crash when a frame's name is nil
5409 or invalid. (Bug#12025)
5410
5411 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5412 it signals an error when a tooltip frame is being created.
5413
5414 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 Cleanup miscellaneous objects allocation and initialization.
5417 * alloc.c (allocate_misc): Change to static. Add argument to
5418 specify the subtype. Adjust comment and users.
5419 (build_overlay): New function.
5420 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5421 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5422 (allocate_misc): Remove prototype.
5423 (build_overlay): Add prototype.
5424
5425 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5426
5427 Swap buffer text indirection counters in Fbuffer_swap_text.
5428 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5429 This avoids crash reported by Christoph Scholtes at
5430 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5431
5432 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5433
5434 * nsmenu.m (Popdown_data): New struct.
5435 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5436 free Popdown_data.
5437 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5438 (initWithContentRect): Make imgView and contentView non-static
5439 and autorelease them. Also autorelease img and matrix (Bug#12005).
5440 (dealloc): Remove (Bug#12005).
5441
5442 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Adjust consing_since_gc when objects are explicitly freed.
5445 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5446 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5447 (free_cons, free_misc): Subtract object size from consing_since_gc.
5448
5449 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5450
5451 Simplify and cleanup markers positioning code.
5452 * marker.c (attach_marker): More useful eassert.
5453 (live_buffer, set_marker_internal): New function.
5454 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5455 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5456
5457 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5458
5459 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5460 as it's limited by the amount of memory, not by INT_MAX.
5461
5462 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5463
5464 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5465 in special-event-map. See the discussion at
5466 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5467 for the reasons.
5468
5469 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5470 info.dwItemData. Fixes crashes on 64-bit Windows.
5471 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5472
5473 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5474
5475 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5476 (conversationIdentifier): Return value is NSInteger.
5477 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5478
5479 2012-07-21 Chong Yidong <cyd@gnu.org>
5480
5481 * window.c (decode_any_window): Signal an error if the window is
5482 on a dead frame (Bug#11984).
5483
5484 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5485
5486 Add indirection counting to speed up Fkill_buffer.
5487 * buffer.h (struct buffer): New member.
5488 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5489 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5490 base buffer indirection counter.
5491 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5492 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5493 through buffer list if indirection counter is 0.
5494
5495 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 Extend the value returned by Fgarbage_collect with heap statistics.
5498 * alloc.c (Qheap): New symbol.
5499 (syms_of_alloc): DEFSYM it.
5500 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5501 (Fmemory_free): Remove.
5502 (syms_of_alloc): Don't defsubr it.
5503 * buffer.c (Fcompact_buffer): Remove.
5504 (syms_of_buffer): Don't defsubr it.
5505
5506 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 Make maybe_gc inline.
5509 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5510 * lisp.h (consing_since_gc, gc_relative_threshold)
5511 (memory_full_cons_threshold): Revert declaration.
5512 (maybe_gc): Remove prototype, define as inline.
5513 * alloc.c: Remove old commented-out code.
5514 (consing_since_gc, gc_relative_threshold)
5515 (memory_full_cons_threshold): Revert to global.
5516 (maybe_gc): Remove.
5517
5518 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5519
5520 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5521 * lisp.h (build_unibyte_string): New function.
5522 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5523 * sysdep.c, w32fns.c, xfns.c: Use it.
5524 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5525 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5526 Adjust users accordingly.
5527 * font.h (font_open_by_name): Adjust prototype.
5528
5529 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5530
5531 Cleanup calls to Fgarbage_collect.
5532 * lisp.h (maybe_gc): New prototype.
5533 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5534 Remove declarations.
5535 * alloc.c (maybe_gc): New function.
5536 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5537 Make them static.
5538 * bytecode.c (MAYBE_GC): Use maybe_gc.
5539 * eval.c (eval_sub, Ffuncall): Likewise.
5540 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5541 to avoid dependency from auto-save feature.
5542
5543 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5546 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5547 'for_each_per_buffer_object_at'.
5548 All uses changed. It's better to use upper-case for macros that
5549 cannot be implemented as functions, to give the reader a clue
5550 that they're special.
5551
5552 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5553
5554 * alloc.c (Fgarbage_collect): Tweak docstring.
5555
5556 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5557
5558 Tweak the value returned from Fgarbage_collect again.
5559 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5560 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5561 Adjust documentation.
5562 (total_vector_bytes): Rename to total_vector_slots, adjust
5563 accounting.
5564 (total_free_vector_bytes): Rename to total_free_vector_slots,
5565 adjust accounting.
5566 (Qstring_bytes, Qvector_slots): New symbols.
5567 (syms_of_alloc): DEFSYM them.
5568
5569 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5570
5571 Buffer compaction primitive which may be used from Lisp.
5572 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5573 (syms_of_buffer): Register Fcompact_buffer.
5574 * alloc.c (Fgarbage_collect): Use compact_buffer.
5575 * buffer.h (compact_buffer): New prototype.
5576 (struct buffer_text): New member.
5577
5578 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5579
5580 New macro to iterate over all buffers, miscellaneous cleanups.
5581 * lisp.h (all_buffers): Remove declaration.
5582 * buffer.h (all_buffers): Add declaration, with comment.
5583 (for_each_buffer): New macro.
5584 * alloc.c (Fgarbage_collect, mark_object): Use it.
5585 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5586 (init_buffer): Likewise.
5587 * data.c (Fset_default): Likewise.
5588 * coding.c (code_conversion_restore): Remove redundant check
5589 for dead buffer.
5590 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5591
5592 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5593
5594 Fix bug that created negative-length intervals.
5595 * intervals.c (merge_interval_right, merge_interval_left):
5596 Do not zero out this interval if it is absorbed by its children,
5597 as this interval's total length doesn't change in that case. See
5598 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5599
5600 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5601
5602 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5603 when invoking (make-bool-vector N t) and N is a positive
5604 multiple of 8 -- the last 8 bits were mistakenly cleared.
5605
5606 Remove some struct layout assumptions in bool vectors.
5607 * alloc.c (bool_header_size): New constant.
5608 (header_size, word_size): Move earlier, as they're now used earlier.
5609 Use 'word_size' in a few more places, where it's appropriate.
5610 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5611 padding before the data member of a bool vector.
5612 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5613 than doing the check by hand with an abort ().
5614
5615 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5616
5617 * eval.c (Fdefvar): Don't check constants since we only set the var if
5618 it's not yet defined anyway (bug#11904).
5619
5620 * lisp.h (last_undo_boundary): Declare new var.
5621 * keyboard.c (command_loop_1): Set it.
5622 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5623 were auto-added by the command loop (bug#11774).
5624
5625 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5626
5627 * w32font.c (Qsymbol): Remove local definition.
5628 (syms_of_w32font): Don't DEFSYM it.
5629
5630 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5631
5632 Fix sweep_vectors to handle large bool vectors correctly.
5633 * alloc.c (sweep_vectors): Account total_vector_bytes for
5634 bool vectors larger than VBLOCK_BYTES_MAX.
5635
5636 2012-07-18 Chong Yidong <cyd@gnu.org>
5637
5638 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5639 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5640
5641 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5642
5643 Return more descriptive data from Fgarbage_collect.
5644 Suggested by Stefan Monnier in
5645 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5646 * alloc.c (bounded_number): New function.
5647 (total_buffers, total_vectors): New variable.
5648 (total_string_size): Rename to total_string_bytes, adjust users.
5649 (total_vector_size): Rename to total_vector_bytes, adjust users.
5650 (sweep_vectors): Account total_vectors and total_vector_bytes.
5651 (Fgarbage_collect): New return value. Adjust documentation.
5652 (gc_sweep): Account total_buffers.
5653 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5654 (VECTOR_SIZE): Remove.
5655 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5656 (Qinterval, Qmisc): New symbols.
5657 (syms_of_data): Initialize them.
5658 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5659 (Qcons, Qbuffer): New declarations.
5660
5661 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5662
5663 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5664 Round up, not down. Improve doc.
5665
5666 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5667
5668 Restore old code in allocate_string_data to avoid Faset breakage.
5669 Reported by Julien Danjou <julien@danjou.info> in
5670 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5671 * alloc.c (allocate_string_data): Restore old code with minor
5672 adjustments, fix comment to explain this subtle issue.
5673
5674 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5675
5676 Remove FILE_SYSTEM_CASE.
5677 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5678
5679 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5680 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5681 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5682 call-process-region passes it through expand-file-name.
5683
5684 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5685
5686 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5687
5688 Fix crash when creating indirect buffer (Bug#11917)
5689 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5690 Don't handle unbound variables specially if non-zero.
5691 (Fbuffer_local_variables): Pass zero.
5692 (clone_per_buffer_values): Pass non-zero.
5693
5694 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5695
5696 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5697 to make the loop interruptible.
5698
5699 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5700
5701 * gnutls.c (emacs_gnutls_handshake): Only retry if
5702 GNUTLS_E_INTERRUPTED.
5703
5704 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5705
5706 Cleanup and convert miscellaneous checks to eassert.
5707 * alloc.c (mark_interval): Fix comment, partially rephrase
5708 old comment from intervals.h (see below).
5709 * intervals.c (find_interval, adjust_intervals_for_insertion)
5710 (delete_interval, adjust_intervals_for_deletion)
5711 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5712 Convert to eassert.
5713 (adjust_intervals_for_insertion, make_new_interval):
5714 Remove obsolete and unused code.
5715 * intervals.h (struct interval): Remove obsolete comment.
5716 * textprotp.c (erase_properties): Remove unused code.
5717 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5718 (Fremove_list_of_text_properties): Convert to eassert.
5719
5720 2012-07-17 Chong Yidong <cyd@gnu.org>
5721
5722 * editfns.c (Finsert_char): Doc fix.
5723
5724 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5725
5726 Fix previous change to make Fmemory_free always accurate.
5727 * alloc.c (make_interval): Update total_free_intervals.
5728 (make_float): Likewise for total_free_floats.
5729 (free_cons, Fcons): Likewise for total_free_conses.
5730 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5731 Likewise for total_free_vector_bytes.
5732 (Fmake_symbol): Likewise for total_free_symbols.
5733 (bytes_free): Remove.
5734
5735 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5736
5737 Simple free memory accounting feature.
5738 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5739 (sweep_vectors): Accumulate size of free vectors.
5740 (Fgarbage_collect): Setup bytes_free.
5741 (Fmemory_free): New function.
5742 (syms_of_alloc): Register it.
5743
5744 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5745
5746 Cleanup overlays checking.
5747 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5748 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5749 eassert and OVERLAYP.
5750 (sort_overlays): Change to use OVERLAYP.
5751
5752 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5753
5754 * editfns.c (Finsert_char): Make it interactive, and make the
5755 second arg optional. Copy interactive spec and docstring from
5756 ucs-insert.
5757
5758 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5761 Unlike the other wrapped functions, fabs has an unspecified
5762 effect on errno.
5763
5764 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5765
5766 * nsterm.m (keyDown): Interpret flags without left/right bits
5767 as the left key (Bug#11670).
5768
5769 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5770
5771 Remove empty and useless init functions.
5772 * lisp.h (init_character_once, init_fns, init_image)
5773 (init_filelock, init_sound): Remove prototype.
5774 * character.c (init_character_once): Remove.
5775 * filelock.c (init_filelock): Likewise.
5776 * fns.c (init_fns): Likewise.
5777 * image.c (init_image): Likewise.
5778 * sound.c (init_sound): Likewise.
5779 * emacs.c (main): Adjust accordingly.
5780
5781 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5782
5783 * gtkutil.h: Tiny cleanups.
5784 (use_old_gtk_file_dialog): Remove useless declaration.
5785 (xg_uses_old_file_dialog): Add suggested const attribute.
5786
5787 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5788
5789 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5790 (bidi_paragraph_init): Use it to limit search forward for a strong
5791 directional character in abnormally large paragraphs full of
5792 neutral or weak characters. (Bug#11943)
5793
5794 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5795
5796 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5797 the toolbar (Bug#9451).
5798 (xg_make_tool_item): Give the widget event box a transparent
5799 background.
5800
5801 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5802
5803 Cleanup basic allocation variables and functions.
5804 * alloc.c (ignore_warnings, init_intervals, init_float)
5805 (init_cons, init_symbol, init_marker): Remove.
5806 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5807 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5808 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5809 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5810 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5811 (staticidx, init_alloc_once, init_strings, free_ablock):
5812 Remove redundant initialization.
5813 * fns.c (init_weak_hash_tables): Remove.
5814 * lisp.h (init_weak_hash_tables): Remove prototype.
5815
5816 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5817
5818 Use zero_vector where appropriate.
5819 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5820 accordingly.
5821 * lisp.h (zero_vector): New declaration.
5822 * font.c (null_vector): Remove.
5823 (syms_of_font): Remove initialization and staticpro.
5824 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5825 * keymap.c (Faccessible_keymaps): Likewise.
5826
5827 2012-07-15 Leo Liu <sdl.web@gmail.com>
5828
5829 * fringe.c: Fix typo in comments.
5830
5831 2012-07-14 Leo Liu <sdl.web@gmail.com>
5832
5833 * fringe.c: Add a new bitmap exclamation-mark.
5834
5835 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5836
5837 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5838
5839 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5840 (HAVE_MENUS): Don't define, defined by editing config.in with
5841 msdos/sed2v2.inp.
5842 (GMALLOC_INHIBIT_VALLOC): Don't define.
5843 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5844
5845 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5846
5847 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5848
5849 2012-07-14 Glenn Morris <rgm@gnu.org>
5850
5851 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5852 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5853 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5854
5855 2012-07-13 Glenn Morris <rgm@gnu.org>
5856
5857 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5858
5859 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5860 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5861
5862 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5863
5864 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5865 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5866 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5867 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5868 where appropriate.
5869 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5870 as boolean expression.
5871 (x_set_window_size): Remove unused variable toolbar.
5872 (ns_get_color_default, ns_mod_to_lisp): Remove.
5873 (ns_mouse_position): Remove unused variables xchar and ychar.
5874 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5875 (ns_set_vertical_scroll_bar): Remove unused variable count.
5876 (ns_delete_terminal): Remove unused variable i.
5877 (ns_term_init): Remove unused variables r, g and b.
5878 (mouseDown): Remove unused variable window.
5879 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5880 (initFrameFromEmacs): Remove unused variable vbextra.
5881 (mouseEntered): Remove unused variables p and dpyinfo.
5882 (mouseExited): Remove unused variables p and r.
5883 (ns_define_frame_cursor, ns_clear_frame_area)
5884 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5885 (menuDown): Assign [sender tag] to variable and cast the variable.
5886
5887 * nsterm.h (menuDown): Add id as type to argument sender.
5888 (ns_display_info_for_name): Add Lisp_Object argument.
5889 (ns_term_init): Add Lisp_Object argument.
5890 (ns_map_event_to_object): Add void argument.
5891 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5892 prototype with arguments and only declare if __OBJC__.
5893 (nxatoms_of_nsselect): Add void argument.
5894 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5895 (ns_alloc_autorelease_pool): Add void argument.
5896 (ns_release_autorelease_pool): Add void* argument.
5897 (ns_get_defaults_value): Add const char* argument.
5898
5899 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5900 (initFromContents): Use SSDATA where appropriate.
5901 (ns_update_menubar): Add braces to ambigous if-else.
5902 (initWithTitle): Put () around assignment in if statement.
5903 (ns_menu_show): Remove unused variables window and keymap.
5904 (update_frame_tool_bar): Remove unused variable selected_p.
5905 (initWithContentRect): Remove unused variable this_cmd_name.
5906
5907 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5908 appropriate.
5909 (setXBMColor): Remove unused variable len.
5910 (setPixmapData): Put () around assignment in loop statement.
5911
5912 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5913 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5914 where appropriate.
5915 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5916 around assignment in loop statement.
5917 (nsfont_open): Remove unused variable i.
5918 (nsfont_open): Remove unused variable len.
5919 (nsfont_draw): Remove unused variable cs.
5920
5921 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5922 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5923 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5924 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5925 (Fns_font_name, Fns_perform_service)
5926 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5927 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5928 (ns_set_name): Remove unused variable view.
5929 (x_set_menu_bar_lines): Remove unused variable olines.
5930 (x_set_tool_bar_lines): Remove unused variable root_window.
5931 (Fns_list_colors): Put () around assignment in while statement.
5932 (Fns_perform_service): Remove unused variable len.
5933 (Fns_display_usable_bounds): Remove unused variable top.
5934 (syms_of_nsfns): Remove unused variable i.
5935
5936 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5937 memcpy (Bug#11907).
5938
5939 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5940
5941 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5942 and free it with DestroyExceptionInfo (Bug#11558).
5943
5944 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5945
5946 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5947 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5948 Set here, not in nt/config.nt.
5949
5950 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5951
5952 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5953 cursor overflow into the last glyph on display line when the right
5954 fringe is off. (Bug#11832)
5955
5956 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5957
5958 * xdisp.c (produce_special_glyphs): Now static.
5959 * dispextern.h (produce_special_glyphs): Remove decl.
5960
5961 2012-07-13 Glenn Morris <rgm@gnu.org>
5962
5963 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5964 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5965
5966 * s/usg5-4-common.h (USG, USG5):
5967 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5968 * s/sol2-6.h (SOLARIS2):
5969 * s/irix6-5.h (IRIX6_5):
5970 * s/hpux10-20.h (USG, USG5, HPUX):
5971 * s/gnu-linux.h (USG, GNU_LINUX):
5972 * s/freebsd.h (BSD_SYSTEM):
5973 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5974 * s/cygwin.h (CYGWIN):
5975 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5976 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5977
5978 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5979
5980 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5981
5982 2012-07-13 Glenn Morris <rgm@gnu.org>
5983
5984 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5985
5986 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5987
5988 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5989 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5990
5991 2012-07-12 Glenn Morris <rgm@gnu.org>
5992
5993 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5994
5995 * process.c (init_process_emacs): Rename from init_process.
5996 The old name is also the name of a Mach system call.
5997 * lisp.h, emacs.c: Update for this name change.
5998 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5999 longer needed.
6000
6001 2012-07-12 Eli Zaretskii <eliz@gnu.org>
6002
6003 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6004 memmove call that removes glyphs covered by the left truncation
6005 glyph. Improve commentary.
6006 (display_line): Fix display of continuation glyphs on GUI frames
6007 when the right fringe is turned off and variable-size fonts are
6008 used in the window. Move the code that appends a stretch glyph to
6009 produce_special_glyphs, so that it could be used for truncation
6010 and continuation glyphs alike.
6011 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6012 glyph of a suitably computed width, to align the special glyphs at
6013 the window margin. Code moved from display_line. (Bug#11832)
6014
6015 2012-07-12 Glenn Morris <rgm@gnu.org>
6016
6017 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6018
6019 * s/gnu-linux.h, s/hpux10-20.h:
6020 Do not unconditionally define HAVE_XRMSETDATABASE.
6021
6022 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6023
6024 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6025
6026 Fix typos that broke OS X build.
6027 Reported by Randal L. Schwartz in
6028 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6029 * nsterm.m (ns_timeout): Add missing local decl.
6030 (ns_get_color): snprintf -> sprintf, to fix typo.
6031
6032 2012-07-12 Glenn Morris <rgm@gnu.org>
6033
6034 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6035 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6036 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6037 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6038
6039 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6040 Move PTY_OPEN to configure.
6041
6042 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6043 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6044 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6045
6046 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6047
6048 Use empty_unibyte_string where applicable.
6049 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6050 * lread.c (read1): Likewise.
6051 * xsettings.c (syms_of_xsettings): Likewise.
6052
6053 2012-07-12 Glenn Morris <rgm@gnu.org>
6054
6055 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6056 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6057 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6058 * s/hpux10-20.h (RUN_TIME_REMAP):
6059 * s/bsd-common.h (TABDLY): Move to configure.
6060
6061 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6062
6063 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6064
6065 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6066 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6067
6068 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6069
6070 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6071 * s/template.h: Move NARROWPROTO to configure.
6072
6073 2012-07-11 Glenn Morris <rgm@gnu.org>
6074
6075 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6076 unused since 2011-01-17 change to systty.h.
6077
6078 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6079 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6080 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6081
6082 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6083
6084 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6085
6086 2012-07-11 Glenn Morris <rgm@gnu.org>
6087
6088 * s/darwin.h, s/gnu-linux.h, s/template.h:
6089 Move INTERRUPT_INPUT to configure.
6090
6091 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6092
6093 Minor adjustments to interning code.
6094 * lisp.h (intern, intern_c_string): Redefine as static inline
6095 wrappers for intern_1 and intern_c_string_1, respectively.
6096 (intern_1, intern_c_string_1): Rename prototypes.
6097 * lread.c (intern_1, intern_c_string_1, oblookup):
6098 Simplify Vobarray checking.
6099 * font.c (font_intern_prop): Likewise. Adjust comment.
6100 * w32font.c (intern_font_name): Likewise.
6101
6102 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6103
6104 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6105
6106 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6107 of Fcar/Fcdr if possible.
6108 * font.c (check_otf_features): Likewise.
6109 * fontset.c (Fnew_fontset): Likewise.
6110 * gnutls.c (Fgnutls_boot): Likewise.
6111 * minibuf.c (read_minibuf): Likewise.
6112 * msdos.c (IT_set_frame_parameters): Likewise.
6113 * xmenu.c (Fx_popup_dialog): Likewise.
6114 * w32menu.c (Fx_popup_dialog): Likewise.
6115
6116 2012-07-11 Glenn Morris <rgm@gnu.org>
6117
6118 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6119 since nothing has defined it on these platforms.
6120
6121 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6122 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6123
6124 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6125 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6126 Move CLASH_DETECTION to configure.
6127
6128 * s/gnu.h: Remove file, which is now empty.
6129
6130 * s/gnu.h, s/gnu-linux.h:
6131 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6132
6133 2012-07-11 John Wiegley <johnw@newartisans.com>
6134
6135 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6136 function attribute, so we only use it if it exists in the
6137 compiler.
6138
6139 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6140
6141 Avoid call to strlen in fast_c_string_match_ignore_case.
6142 * search.c (fast_c_string_match_ignore_case): Change to use
6143 length argument. Adjust users accordingly.
6144 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6145
6146 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 Assume mkdir, rmdir.
6149 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6150 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6151
6152 Assume rename.
6153 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6154
6155 Assume perror.
6156 * s/hpux10-20.h (HAVE_PERROR): Remove.
6157 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6158 Remove dummy definition, as this problem was obsolete long ago.
6159
6160 Assume strerror.
6161 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6162
6163 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6164
6165 Avoid calls to strlen in font processing functions.
6166 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6167 (font_open_by_name): Change to use length argument.
6168 Adjust users accordingly.
6169 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6170 Adjust prototypes.
6171 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6172 Change to return ptrdiff_t.
6173 (xfont_list_pattern, xfont_match): Use length returned by
6174 xfont_decode_coding_xlfd.
6175 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6176
6177 2012-07-11 Glenn Morris <rgm@gnu.org>
6178
6179 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6180 Move DONT_REOPEN_PTY to configure.
6181
6182 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6183 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6184
6185 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6186
6187 Remove "#define unix" that is no longer needed (Bug#11905).
6188 * s/aix4-2.h (unix): Remove; no longer needed.
6189
6190 EMACS_TIME simplification (Bug#11875).
6191 This replaces macros (which typically do not work in GDB)
6192 with functions, typedefs and enums, making the code easier to debug.
6193 The functional style also makes code easier to read and maintain.
6194 * systime.h: Include <sys/time.h> on all hosts, not just if
6195 WINDOWSNT, since 'struct timeval' is needed in general.
6196 (EMACS_TIME): Now a typedef, not a macro.
6197 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6198 not macros.
6199 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6200 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6201 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6202 (EMACS_TIME_LE): Now functions, not macros.
6203 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6204 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6205 which are not functions. All uses rewritten to use:
6206 (make_emacs_time): New function.
6207 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6208 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6209 not functions. All uses rewritten to use the following, respectively:
6210 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6211 (add_emacs_time, sub_emacs_time): New functions.
6212 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6213 * fileio.c (Fcopy_file):
6214 * xterm.c (XTflash): Get the current time closer to when it's used.
6215 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6216
6217 * bytecode.c (targets): Suppress -Woverride-init warnings.
6218
6219 Simplify by avoiding confusing use of strncpy etc.
6220 * doc.c (Fsnarf_documentation):
6221 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6222 * frame.c (Fmake_terminal_frame):
6223 * gtkutil.c (get_utf8_string):
6224 * lread.c (openp):
6225 * nsmenu.m (ns_update_menubar):
6226 * regex.c (regerror):
6227 Prefer memcpy to strncpy and strncat when either will do.
6228 * fileio.c (Fsubstitute_in_file_name):
6229 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6230 (menu_separator_name_p):
6231 * nsmenu.m (ns_update_menubar):
6232 Prefer memcmp to strncmp when either will do.
6233 * nsterm.m: Include <ftoastr.h>.
6234 (ns_get_color):
6235 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6236 Prefer snprintf to strncpy.
6237 * nsterm.m (ns_term_init):
6238 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6239 * nsterm.m (ns_term_init):
6240 Avoid the need for strncpy, by using build_string or
6241 make_unibyte_string directly. Use dtoastr, not snprintf.
6242 * process.c (Fmake_network_process): Diagnose service names that
6243 are too long, rather than silently truncating them or creating
6244 non-null-terminated names.
6245 (Fnetwork_interface_info): Likewise, for interface names.
6246 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6247 Prefer sprintf to strncat.
6248 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6249 Prefer vsnprintf to vsprintf + strncpy.
6250
6251 2012-07-10 Glenn Morris <rgm@gnu.org>
6252
6253 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6254 Clarify fallback case.
6255
6256 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6257
6258 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6259 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6260 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6261 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6262 where argument type is known to be a Lisp_Cons.
6263
6264 2012-07-10 Tom Tromey <tromey@redhat.com>
6265
6266 * bytecode.c (BYTE_CODE_THREADED): New macro.
6267 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6268 (enum byte_code_op): New type.
6269 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6270 (exec_byte_code): Use them. Use token threading when applicable.
6271
6272 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6273
6274 Optimize pure C strings initialization.
6275 * lisp.h (make_pure_string): Fix prototype.
6276 (build_pure_c_string): New function, defined as static inline. This
6277 provides a better opportunity to optimize away calls to strlen when
6278 the function is called with compile-time constant argument.
6279 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6280 argument, adjust users accordingly. Use build_pure_c_string where
6281 appropriate.
6282 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6283 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6284 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6285
6286 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6287
6288 Avoid calls to strlen in miscellaneous functions.
6289 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6290 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6291 * lread.c (openp): Likewise.
6292
6293 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6294
6295 Avoid calls to strlen in path processing functions.
6296 * fileio.c (file_name_as_directory): Add comment. Change to add
6297 srclen argument and return the length of result. Adjust users
6298 accordingly.
6299 (directory_file_name): Fix comment. Change to add srclen argument,
6300 swap 1st and 2nd arguments to obey the common convention.
6301 Adjust users accordingly.
6302 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6303
6304 2012-07-10 Glenn Morris <rgm@gnu.org>
6305
6306 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6307 Move PENDING_OUTPUT_COUNT definition to configure.
6308
6309 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6310 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6311 * s/gnu.h (DATA_START): Move definitions to configure.
6312
6313 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6314 We include usg5-4-common.h, which defines them both.
6315
6316 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6317 O_RDONLY already includes it).
6318
6319 Stop ns builds setting the EMACSLOADPATH environment variable.
6320 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6321 Now it does not set EMACSLOADPATH, just returns the load-path string.
6322 * nsterm.h: Update accordingly.
6323 * lread.c [HAVE_NS]: Include nsterm.h.
6324 (init_lread) [HAVE_NS]: Use ns_load_path.
6325 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6326
6327 2012-07-09 Glenn Morris <rgm@gnu.org>
6328
6329 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6330 since the included bsd-common.h does so.
6331
6332 Stop ns builds setting the EMACSPATH environment variable.
6333 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6334 (ns_init_paths): Do not set EMACSPATH.
6335 * nsterm.h (ns_exec_path): Add it.
6336 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6337 Use ns_exec_path.
6338
6339 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6340
6341 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6342
6343 * process.c (wait_reading_process_output): 'waitchannels' was unset
6344 when read_kbd || !NILP (wait_for_cell); fix this.
6345
6346 Add GCC-style 'const' attribute to functions that can use it.
6347 * character.h (char_resolve_modifier_mask):
6348 * keyboard.h (make_ctrl_char):
6349 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6350 (init_character_once, next_almost_prime, init_fns, init_image)
6351 (flush_pending_output, init_sound):
6352 * mem-limits.h (start_of_data):
6353 * menu.h (finish_menu_items):
6354 Add ATTRIBUTE_CONST.
6355 * emacs.c (DEFINE_DUMMY_FUNCTION):
6356 Declare the dummy function with ATTRIBUTE_CONST.
6357 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6358 Add decls with ATTRIBUTE_CONST.
6359
6360 Minor improvements to make_formatted_string.
6361 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6362 where int is good enough, as vsprintf returns an int.
6363 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6364
6365 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6366
6367 Use make_formatted_string to avoid double length calculation.
6368 * lisp.h (make_formatted_string): New prototype.
6369 * alloc.c (make_formatted_string): New function.
6370 * buffer.c (Fgenerate_new_buffer_name): Use it.
6371 * dbusbind.c (syms_of_dbusbind): Likewise.
6372 * editfns.c (Fcurrent_time_zone): Likewise.
6373 * filelock.c (get_boot_time): Likewise.
6374 * frame.c (make_terminal_frame, set_term_frame_name)
6375 (x_report_frame_params): Likewise.
6376 * image.c (gs_load): Likewise.
6377 * minibuf.c (get_minibuffer): Likewise.
6378 * msdos.c (dos_set_window_size): Likewise.
6379 * process.c (make_process): Likewise.
6380 * xdisp.c (ensure_echo_area_buffers): Likewise.
6381 * xsettings.c (apply_xft_settings): Likewise.
6382
6383 2012-07-09 Glenn Morris <rgm@gnu.org>
6384
6385 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6386 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6387 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6388 * nsterm.h (ns_etc_directory): Add it.
6389 * callproc.c [HAVE_NS]: Include nsterm.h.
6390 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6391
6392 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6393
6394 Move marker debugging code under MARKER_DEBUG.
6395 * marker.c (MARKER_DEBUG): Move marker debugging code under
6396 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6397 for bootstrap with --enable-checking (~3x slowdown reported
6398 by Juanma Barranquero <lekktu@gmail.com>).
6399 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6400
6401 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6402
6403 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6404 See <http://bugs.gnu.org/11825#29>.
6405
6406 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6407
6408 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6409 has no font, use the frame's font. (Bug#11813)
6410 (display_line): Add commentary about displaying truncation glyphs
6411 on GUI frames.
6412 (produce_special_glyphs): Move here from term.c.
6413
6414 * term.c (produce_special_glyphs): Move to xdisp.c.
6415
6416 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6417 section.
6418
6419 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6420
6421 * xdisp.c (display_line): Avoid warning about implicit declaration
6422 of FRAME_FONT.
6423
6424 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6425
6426 * lisp.h: Remove empty conditional.
6427
6428 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6429
6430 * lread.c (load_path_check): Now static.
6431
6432 Fix some minor --with-ns problems found by static checking.
6433 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6434 (x_set_font) [!HAVE_X_WINDOWS]:
6435 * image.c (xpm_load_image) [HAVE_NS]:
6436 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6437 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6438 Remove unused local.
6439 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6440 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6441 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6442 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6443 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6444 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6445 Fix pointer signedness problem.
6446 * xfaces.c (FRAME_X_FONT_TABLE):
6447 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6448
6449 2012-07-07 Glenn Morris <rgm@gnu.org>
6450
6451 * lread.c (load_path_check): New function, split from init_lread.
6452 (init_lread): Reorganize. Motivation:
6453 If EMACSLOADPATH is set, check/warn about that rather than the
6454 defaults, which we are not going to use. Hence we can remove
6455 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6456 Don't warn if site-lisp directories are missing.
6457 If not installed, start from a blank load-path, since
6458 PATH_LOADSEARCH refers to the eventual installation directories.
6459
6460 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6461
6462 Support truncation and continuation glyphs on GUI frames, when
6463 fringes are disabled. (Bug#11832)
6464 * xdisp.c (init_iterator): Get dimensions of truncation and
6465 continuation glyphs even if on GUI frames.
6466 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6467 or both, are absent.
6468 (start_display, move_it_in_display_line_to): Handle the case of a
6469 GUI frame without a fringe to display continuation or truncation
6470 glyphs.
6471 (insert_left_trunc_glyphs): Support GUI frames: make sure
6472 truncation glyphs overwrite enough glyphs from the current line to
6473 have sufficient space in pixels.
6474 (display_line): Support truncation and continuation glyphs on GUI
6475 frames. If some spare pixels are left on the line after inserting
6476 the truncation glyphs, fill that space with a stretch glyph of a
6477 suitably computed width.
6478
6479 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6480 produce_glyphs, to support GUI sessions.
6481
6482 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6483
6484 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6485
6486 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6487
6488 Do not require float-time's arg to fit in time_t (Bug#11825).
6489 This works better on hosts where time_t is unsigned, and where
6490 float-time is applied to the (negative) difference between two times.
6491 * editfns.c (decode_time_components): Last arg is now double *,
6492 not int *, and means to store all the result as a double, without
6493 worrying about whether the seconds part fits in time_t.
6494 All callers changed.
6495 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6496 All callers changed.
6497 (Ffloat_time): Do not fail merely because the specified time falls
6498 outside of time_t range.
6499
6500 2012-07-07 Glenn Morris <rgm@gnu.org>
6501
6502 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6503 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6504 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6505
6506 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6507
6508 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6509 Update dependencies.
6510
6511 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6512
6513 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6514
6515 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6516 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6517 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6518 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6519 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6520 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6521
6522 * xfont.c (compare_font_names): Redo to omit the need for casts.
6523
6524 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6525
6526 * xfns.c (Fx_change_window_property): Doc fix.
6527 * w32fns.c (Fx_change_window_property): Doc fix.
6528
6529 * w32fns.c (Fx_window_property): Accept the same arguments as the
6530 X Windows version. Doc fix.
6531 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6532
6533 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6534 Eli Zaretskii <eliz@gnu.org>
6535
6536 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6537 Windows-specific code from nt/config.nt moved here.
6538 Obsolete settings removed.
6539
6540 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 * process.c: Avoid unnecessary calls to gettime.
6543 (wait_reading_process_output): Don't get the time of day
6544 when gobbling data immediately and not waiting, as there's no need
6545 for it in that case. This removes a FIXME.
6546
6547 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6548
6549 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6550 is defined (Bug#11768).
6551
6552 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6553
6554 Fix marker debugging code.
6555 * marker.c (byte_char_debug_check): Do not perform the check
6556 if buffer is not multibyte.
6557 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6558 Call byte_char_debug_check with correct arguments.
6559
6560 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6561
6562 Compile marker debugging code only if ENABLE_CHECKING is defined.
6563 * marker.c (byte_char_debug_check, count_markers):
6564 Use only if ENABLE_CHECKING is defined.
6565 (byte_debug_flag): Remove.
6566 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6567 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6568
6569 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6570
6571 Avoid code repetition in marker-related functions.
6572 * marker.c (attach_marker): New function.
6573 (Fset_marker, set_marker_restricted, set_marker_both)
6574 (set_marker_restricted_both): Use it.
6575 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6576 Consistently rename charno to charpos.
6577 (marker_position): Add eassert.
6578 (marker_byte_position): Convert to eassert.
6579
6580 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6581
6582 Simplify list operations in unchain_overlay and unchain_marker.
6583 * buffer.c (unchain_overlay): Simplify. Add comment.
6584 * marker.c (unchain_marker): Simplify. Fix comments.
6585
6586 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6587
6588 Introduce fast path for the widely used marker operation.
6589 * alloc.c (build_marker): New function.
6590 * lisp.h (build_marker): New prototype.
6591 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6592 * composite.c (autocmp_chars): Likewise.
6593 * editfns.c (buildmark): Remove.
6594 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6595 (save_restriction_save): Use build_marker.
6596 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6597 * window.c (save_window_save): Likewise.
6598
6599 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6600
6601 Do not use Fdelete_overlay in delete_all_overlays
6602 to avoid redundant calls to unchain_overlay.
6603 * buffer.c (drop_overlay): New function.
6604 (delete_all_overlays, Fdelete_overlay): Use it.
6605 * minibuf.c (get_minibuffer): Fix comment.
6606
6607 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6608
6609 Port to OpenBSD 5.1 amd64.
6610 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6611 This is needed for OpenBSD, and should be harmless on all BSD systems.
6612 Also, include <sys/sysctl.h>, as it should be available on all
6613 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6614 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6615 use p_pid member, not kp_proc.pid.
6616
6617 2012-07-06 Glenn Morris <rgm@gnu.org>
6618
6619 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6620
6621 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 More xmalloc and related cleanup.
6624 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6625 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6626 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6627 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6628 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6629 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6630 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6631 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6632 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6633 * xterm.c:
6634 Omit needless casts involving void * pointers and allocation.
6635 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6636 as the former is more robust if P's type is changed.
6637 Prefer xzalloc to xmalloc + memset 0.
6638 Simplify malloc-or-realloc to realloc.
6639 Don't worry about xmalloc returning a null pointer.
6640 Prefer xstrdup to xmalloc + strcpy.
6641 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6642 growing it.
6643 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6644 alloca of a constant.
6645
6646 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6647
6648 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6649 hscroll is larger than the line width. Fixes long and futile
6650 looping inside extend_face_to_end_of_line (on a TTY) producing
6651 glyphs that are not needed and thrown away.
6652
6653 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6654
6655 * marker.c (set_marker_restricted_both): Simplify by using
6656 clip_to_bounds.
6657
6658 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6661
6662 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6663
6664 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6665 not defined (Bug#11768).
6666 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6667 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6668 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6669 followed by gtk_box_set_homogeneous (Bug#11768).
6670 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6671 (update_theme_scrollbar_width, xg_create_scroll_bar):
6672 Use gtk_scrollbar_new (Bug#11768).
6673 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6674 (is_box_type): New function (Bug#11768).
6675 (xg_tool_item_stale_p): Call is_box_type.
6676 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6677 with default display (Bug#11768).
6678
6679 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6680
6681 * xdisp.c (window_hscroll_limited): New function.
6682 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6683 coordinates when window's hscroll is set to insanely large
6684 values. (Bug#11857)
6685
6686 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6687
6688 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6689 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6690
6691 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6692
6693 Cleanup xmalloc.
6694 * lisp.h (xzalloc): New prototype. Omit needless casts.
6695 * alloc.c (xzalloc): New function. Omit needless casts.
6696 * charset.c: Omit needless casts. Convert all calls to
6697 xmalloc with following memset to xzalloc.
6698 * dispnew.c: Likewise.
6699 * fringe.c: Likewise.
6700 * image.c: Likewise.
6701 * sound.c: Likewise.
6702 * term.c: Likewise.
6703 * w32fns.c: Likewise.
6704 * w32font.c: Likewise.
6705 * w32term.c: Likewise.
6706 * xfaces.c: Likewise.
6707 * xfns.c: Likewise.
6708 * xterm.c: Likewise.
6709 * atimer.c: Omit needless casts.
6710 * buffer.c: Likewise.
6711 * callproc.c: Likewise.
6712 * ccl.c: Likewise.
6713 * coding.c: Likewise.
6714 * composite.c: Likewise.
6715 * doc.c: Likewise.
6716 * doprnt.c: Likewise.
6717 * editfns.c: Likewise.
6718 * emacs.c: Likewise.
6719 * eval.c: Likewise.
6720 * filelock.c: Likewise.
6721 * fns.c: Likewise.
6722 * gtkutil.c: Likewise.
6723 * keyboard.c: Likewise.
6724 * lisp.h: Likewise.
6725 * lread.c: Likewise.
6726 * minibuf.c: Likewise.
6727 * msdos.c: Likewise.
6728 * print.c: Likewise.
6729 * process.c: Likewise.
6730 * region-cache.c: Likewise.
6731 * search.c: Likewise.
6732 * sysdep.c: Likewise.
6733 * termcap.c: Likewise.
6734 * terminal.c: Likewise.
6735 * tparam.c: Likewise.
6736 * w16select.c: Likewise.
6737 * w32.c: Likewise.
6738 * w32reg.c: Likewise.
6739 * w32select.c: Likewise.
6740 * w32uniscribe.c: Likewise.
6741 * widget.c: Likewise.
6742 * xdisp.c: Likewise.
6743 * xmenu.c: Likewise.
6744 * xrdb.c: Likewise.
6745 * xselect.c: Likewise.
6746
6747 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 * fileio.c (time_error_value): Check the right error number.
6750 Problem reported by Troels Nielsen in
6751 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6752
6753 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6754
6755 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6756 This should be fixed in a better way; see Eli Zaretskii in
6757 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6758 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6759
6760 * fileio.c (time_error_value): Rename from special_mtime.
6761 The old name's problems were noted by Eli Zaretskii in
6762 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6763
6764 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6765 This variable's comment says Emacs needs at least one GDB-visible
6766 symbol of type enum pvec_type, to work around GDB problems.
6767 The symbol's value doesn't matter.
6768
6769 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6770 that causes compilation to fail on pre-C99 compilers.
6771
6772 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6773
6774 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6775 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6776
6777 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6778
6779 * buffer.c (init_buffer_once): Fix initialization of
6780 headers for buffer_defaults and buffer_local_symbols.
6781 Reported by Juanma Barranquero <lekktu@gmail.com>.
6782
6783 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6784
6785 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6786 * lisp.h (enum pvec_type): Use fewer bits.
6787 (PSEUDOVECTOR_SIZE_BITS): New constant.
6788 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6789 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6790 change in pvec_type.
6791 (PSEUDOVECTOR_TYPEP): New macro.
6792 (TYPED_PSEUDOVECTORP): Use it.
6793 * fns.c (internal_equal): Adapt code to extract pvectype.
6794 * emacs.c (gdb_pvec_type): Update type.
6795 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6796 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6797 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6798 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6799 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6800 abusing vector->header.next.nbytes.
6801 (live_vector_p): Use PVEC_TYPE.
6802 (mark_object): Adapt code to extract pvectype. Use switch.
6803
6804 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6805
6806 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6807 Tighten new eassert a bit.
6808
6809 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6810
6811 Fix compilation with --enable-gcc-warnings and -O1
6812 optimization level.
6813 * doprnt.c (doprnt): Change type of tem to int, initialize
6814 to avoid compiler warning. Add eassert.
6815 * search.c (simple_search): Initialize match_byte to avoid
6816 compiler warning. Add eassert.
6817
6818 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6819
6820 Avoid weird behavior with large horizontal scrolls.
6821 Without this change, for example, large hscroll values would
6822 mess up Emacs's display on Fedora 15 x86, presumably due to
6823 overflows in int calculations in the display code.
6824 Also, if buffers had long lines, Emacs would freeze.
6825 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6826 (set_window_hscroll): New function, containing the old guts of
6827 Fset_window_hscroll. Return the clipped value.
6828 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6829 This avoids the need to check against PTRDIFF_MAX.
6830
6831 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6832
6833 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6834
6835 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6836
6837 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6840 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6841 since GCC 4.4.6 issues a bogus warning for them.
6842
6843 Fix bugs in file timestamp newness comparisons.
6844 * fileio.c (Ffile_newer_than_file_p):
6845 * lread.c (Fload): Use full timestamp resolution of files,
6846 not just the 1-second resolution, so that files that are only
6847 slightly newer still count as newer.
6848 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6849 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6850
6851 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6852
6853 * fileio.c: Improve handling of file time marker. (Bug#11852)
6854 (special_mtime): New function.
6855 (Finsert_file_contents, Fverify_visited_file_modtime):
6856 Use it to set special mtime values consistently.
6857
6858 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6859
6860 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6861 marker for non-existing file. (Bug#11852)
6862
6863 2012-07-03 Glenn Morris <rgm@gnu.org>
6864
6865 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6866 and did not make it into globals.h).
6867
6868 2012-07-03 Tom Tromey <tromey@redhat.com>
6869
6870 * window.c (Fset_window_margins, Fset_window_fringes)
6871 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6872 * textprop.c (Fprevious_property_change): No longer static.
6873 * syntax.c (Fsyntax_table_p): No longer static.
6874 * process.c (Fget_process, Fprocess_datagram_address): No longer
6875 static.
6876 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6877 * keyboard.c (Fcommand_execute): No longer static.
6878 Remove EXFUN.
6879 * insdel.c (Fcombine_after_change_execute): No longer static.
6880 * image.c (Finit_image_library): No longer static.
6881 * fileio.c (Fmake_symbolic_link): No longer static.
6882 * eval.c (Ffetch_bytecode): No longer static.
6883 * editfns.c (Fuser_full_name): No longer static.
6884 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6885 No longer static.
6886 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6887 static.
6888 * dired.c (Ffile_attributes): No longer static.
6889 * composite.c (Fcomposition_get_gstring): No longer static.
6890 * callproc.c (Fgetenv_internal): No longer static.
6891
6892 * ccl.h: Remove EXFUNs.
6893 * buffer.h: Remove EXFUNs.
6894 * dispextern.h: Remove EXFUNs.
6895 * intervals.h: Remove EXFUNs.
6896 * fontset.h: Remove EXFUN.
6897 * font.h: Remove EXFUNs.
6898 * dosfns.c (system_process_attributes): Remove EXFUN.
6899 * keymap.h: Remove EXFUNs.
6900 * lisp.h: Remove EXFUNs.
6901 * w32term.h: Remove EXFUNs.
6902 * window.h: Remove EXFUNs.
6903 * xsettings.h: Remove EXFUN.
6904 * xterm.h: Remove EXFUN.
6905
6906 2012-07-03 Glenn Morris <rgm@gnu.org>
6907
6908 * lisp.h (Frandom): Make it visible to C.
6909 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6910 buffer for invisible buffers. (Bug#1229)
6911
6912 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6913
6914 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6915 values which aren't power of 2.
6916 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6917 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6918 accordingly.
6919
6920 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6921
6922 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6923
6924 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6925
6926 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6927
6928 * alloc.c (allocate_vector_block): Remove redundant
6929 calls to mallopt if DOUG_LEA_MALLOC is defined.
6930 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6931 avoid calls to mallopt if zero_vector is returned.
6932
6933 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6934
6935 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6936 is enabled, avoid dereferencing NULL current_sblock if
6937 running undumped.
6938
6939 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6940
6941 Cleanup basic buffer management.
6942 * buffer.h (struct buffer): Change layout to use generic vector
6943 marking code. Fix some comments. Change type of 'clip_changed'
6944 to bitfield. Remove unused #ifndef old.
6945 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6946 (GET_OVERLAYS_AT): Fix indentation.
6947 (for_each_per_buffer_object_at): New macro.
6948 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6949 (Fbuffer_local_variables): Use it.
6950 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6951 * alloc.c (allocate_buffer): Adjust to match new layout of
6952 struct buffer. Fix comment.
6953 (mark_overlay): New function.
6954 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6955 Lisp area of struct buffer.
6956 (mark_object): Use it. Adjust marking of misc objects
6957 and related comments.
6958
6959 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6962 wrapper that is not needed because the wrapped code is a no-op (zero
6963 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6964 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6965
6966 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6967
6968 * alloc.c (mark_buffer): Simplify. Remove prototype.
6969 (mark_object): Add comment. Reorganize marking of vector-like
6970 objects. Use CHECK_LIVE for all vector-like objects except buffers
6971 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6972 Avoid redundant calls to mark_vectorlike for bool vectors.
6973
6974 2012-06-30 Glenn Morris <rgm@gnu.org>
6975
6976 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6977
6978 * epaths.in (PATH_SITELOADSEARCH): New.
6979 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6980 This is rather than relying on --enable-locallisppath elements
6981 having "site-lisp" in their names. (Bug#10208#25, 11658)
6982
6983 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6984
6985 * w32proc.c (sys_select): Accept and ignore one more argument.
6986
6987 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6988
6989 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6990 (pselect) [!MS_DOS]: Redirect to sys_select.
6991
6992 * sysdep.c: Don't include dos.h and dosfns.h.
6993
6994 * process.c (sys_select):
6995 * msdos.c (sys_select): Accept one more argument and ignore it.
6996
6997 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6998 adapt data types and code to that.
6999
7000 * dosfns.c:
7001 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7002 which clashes with the gnulib function of the same name.
7003
7004 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7005
7006 * font.c (font_style_to_value, font_style_symbolic)
7007 (font_prop_validate_style): Add type checks for values in
7008 font_style_table.
7009
7010 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7011 argument.
7012 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7013 uses.
7014
7015 2012-06-29 Eli Zaretskii <eliz@gnu.org>
7016
7017 * xdisp.c (try_window_id): Undo last change.
7018
7019 * w32.c (getwd): Adjust commentary about startup_dir.
7020 (init_environment): Always call sys_access, even in non-MSVC
7021 builds. Don't chdir to the directory of the Emacs executable.
7022 This undoes code from 1997 which was justified by the need to
7023 "avoid conflicts when removing and renaming directories". But its
7024 downside was that every relative file name was being interpreted
7025 relative to the directory of the Emacs executable, which can never
7026 be TRT. In particular, it broke sys_access when called with
7027 relative file names.
7028 (sys_access): Map GetLastError to errno.
7029
7030 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7031
7032 * window.h (struct window): Change type of 'fringes_outside_margins'
7033 to bitfield. Fix comment. Adjust users accordingly.
7034 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
7035 Adjust comment.
7036 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7037 to ptrdiff_t.
7038
7039 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
7040
7041 * gnutls.c (emacs_gnutls_handshake):
7042 Add QUIT to make the loop interruptible.
7043
7044 2012-06-29 Glenn Morris <rgm@gnu.org>
7045
7046 * charset.c (init_charset): Make lack of etc/charsets fatal.
7047
7048 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7049
7050 * editfns.c (region_limit): Fix type mismatch.
7051
7052 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7053
7054 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7055 undefined. Convert from xassert to eassert.
7056 * nsmenu.m: Convert from xassert to eassert.
7057 * nsterm.m: Likewise.
7058
7059 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7060
7061 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7062
7063 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 Avoid integer overflow on scroll-left and scroll-right.
7066 * window.c (HSCROLL_MAX): New macro.
7067 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7068 overflow when requested scroll falls outside ptrdiff_t range.
7069
7070 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7071
7072 * window.h (struct window): Change type of 'hscroll',
7073 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7074 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7075 Adjust users accordingly.
7076 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7077 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7078 from EMACS_INT to ptrdiff_t.
7079 (make_window): Omit redundant initialization.
7080
7081 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7082
7083 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7084
7085 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7086
7087 * window.h (struct window): Change type of 'use_time' and
7088 'sequence_number' from Lisp_Object to int.
7089 * frame.c (make_frame): Adjust users accordingly.
7090 * print.c (print_object): Likewise.
7091 * window.c (select_window, Fwindow_use_time, make_parent_window)
7092 (make_window): Likewise.
7093
7094 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7095
7096 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7097 enabled with --enable-checking=[all,glyphs] configure option.
7098 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7099 adjust comments accordingly.
7100 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7101 undefined, adjust comments accordingly.
7102 * image.c: Likewise.
7103 * scroll.c: Likewise.
7104 * w32fns.c: Likewise.
7105 * w32term.c: Likewise.
7106 * xdisp.c: Likewise.
7107 * xfaces.c: Likewise.
7108 * xfns.c: Likewise.
7109 * xterm.c: Likewise.
7110
7111 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7112
7113 Generalize run-time debugging checks.
7114 * dispextern.h (XASSERTS): Remove.
7115 * fontset.c (xassert): Remove.
7116 Convert from xassert to eassert.
7117 * alloc.c: Convert from xassert to eassert.
7118 * bidi.c: Likewise.
7119 * dispnew.c: Likewise.
7120 * fns.c: Likewise.
7121 * fringe.c: Likewise.
7122 * ftfont.c: Likewise.
7123 * gtkutil.c: Likewise.
7124 * image.c: Likewise.
7125 * keyboard.c: Likewise.
7126 * menu.c: Likewise.
7127 * process.c: Likewise.
7128 * scroll.c: Likewise.
7129 * sound.c: Likewise.
7130 * term.c: Likewise.
7131 * w32console.c: Likewise.
7132 * w32fns.c: Likewise.
7133 * w32term.c: Likewise.
7134 * window.c: Likewise.
7135 * xdisp.c: Likewise.
7136 * xfaces.c: Likewise.
7137 * xfns.c: Likewise.
7138 * xselect.c: Likewise.
7139 * xterm.c: Likewise.
7140
7141 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7142
7143 * fns.c (maybe_resize_hash_table): Output message when growing the
7144 purify-hashtable.
7145
7146 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7147
7148 * alloc.c (allocate_string_data): Remove dead code.
7149 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7150 avoid GCC warning about unused macro.
7151
7152 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 * alloc.c (allocate_string): Omit intervals initialization.
7155 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7156 as in make_pure_string and make_pure_c_string.
7157
7158 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7159
7160 * alloc.c (allocate_string): Fix last change.
7161
7162 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7163
7164 * alloc.c (allocate_string): Remove two redundant calls
7165 to memset, add explicit initialization where appropriate.
7166
7167 2012-06-27 Glenn Morris <rgm@gnu.org>
7168
7169 * lisp.mk (lisp): Remove paths.elc.
7170
7171 2012-06-27 Chong Yidong <cyd@gnu.org>
7172
7173 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7174
7175 2012-06-26 John Wiegley <johnw@newartisans.com>
7176
7177 * unexmacosx.c (copy_data_segment): Add two section names used
7178 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7179
7180 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7181 when building with Clang.
7182
7183 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7184
7185 * eval.c (Fapply): Allow calling it with a single argument.
7186
7187 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7188
7189 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7190 _stricmp and _strnicmp.
7191 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7192
7193 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7194
7195 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7196 allocated window.
7197 (allocate_process): Likewise for new process.
7198 (allocate_terminal): Change to use offsetof.
7199 (allocate_frame): Likewise.
7200 * frame.c (make_frame): Omit redundant initialization.
7201 * window.c (make_parent_window): Use memset.
7202 (make_window): Omit redundant initialization.
7203 * process.c (make_process): Omit redundant initialization.
7204 * terminal.c (create_terminal): Likewise.
7205
7206 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7207
7208 * term.c (delete_tty): Remove redundant call to memset.
7209
7210 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7211
7212 * alloc.c: Remove build_string.
7213 * lisp.h: Define build_string as static inline. This provides
7214 a better opportunity to optimize away calls to strlen when the
7215 function is called with compile-time constant argument.
7216 * image.c (imagemagick_error): Convert to build_string.
7217 * w32proc.c (sys_spawnve): Likewise.
7218 * xterm.c (x_term_init): Likewise.
7219
7220 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7221
7222 Use sprintf return value instead of invoking strlen on result.
7223 In the old days this wasn't portable, since some sprintf
7224 implementations returned char *. But they died out years ago and
7225 Emacs already assumes sprintf returns int.
7226 Similarly for float_to_string.
7227 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7228 * ccl.c (ccl_driver):
7229 * character.c (string_escape_byte8):
7230 * data.c (Fnumber_to_string):
7231 * doprnt.c (doprnt):
7232 * print.c (print_object):
7233 * xdisp.c (message_dolog):
7234 * xfns.c (syms_of_xfns):
7235 Use sprintf or float_to_string result to avoid need to call strlen.
7236 * data.c (Fnumber_to_string):
7237 Use make_unibyte_string, since the string must be ASCII.
7238 * lisp.h, print.c (float_to_string): Now returns int length.
7239 * term.c (produce_glyphless_glyph):
7240 Use sprintf result rather than recomputing it.
7241
7242 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7243 * Makefile.in (ALL_CFLAGS):
7244 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7245 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7246
7247 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7248
7249 * dispextern.h (xstrcasecmp): Define to library function
7250 strcasecmp if available.
7251 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7252
7253 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7254
7255 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7256 Avoid comma operator.
7257 * menu.c (push_submenu_start, push_submenu_end)
7258 (push_left_right_boundary, push_menu_pane): Likewise.
7259 * msdos.c (dos_rawgetc): Likewise.
7260
7261 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7262
7263 * xfns.c (xic_create_fontsetname): Remove redundant calls
7264 to memset.
7265
7266 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7267
7268 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7269 sprintf already null-terminates its output.
7270
7271 * xfns.c (x_window): Remove redundant cast.
7272
7273 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7274
7275 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7276 `const char *' to `char *' to avoid compiler warning.
7277
7278 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7279
7280 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7281 instead of truncating it to 63 (admittedly a generous limit).
7282
7283 * process.c: Fix spelling and caps in comments.
7284
7285 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7286
7287 * emacs.c (setpgrp): Remove definition, unused.
7288 * sysdep.c (setpgrp): Remove definition, not used in this file.
7289
7290 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7291
7292 * makefile.w32-in: Update dependencies.
7293
7294 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7295
7296 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7297 (SYSTIME_H): Add nt/inc/sys/time.h.
7298
7299 * systime.h [WINDOWSNT]: Include sys/time.h.
7300
7301 * s/ms-w32.h (struct timespec): Definition moved from
7302 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7303
7304 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7305
7306 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7307 * buffer.h (buffer_slot_type_mismatch):
7308 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7309 * eval.c (unwind_to_catch):
7310 * image.c (my_png_error, my_error_exit):
7311 * keyboard.c (quit_throw_to_read_char, user_error)
7312 (Fexit_recursive_edit, Fabort_recursive_edit):
7313 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7314 (wrong_type_argument, buffer_overflow, __executable_start)
7315 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7316 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7317 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7318 (fatal):
7319 (child_setup) [!DOS_NT]:
7320 * lread.c (end_of_file_error, invalid_syntax):
7321 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7322 * puresize.h (pure_write_error):
7323 * search.c (matcher_overflow):
7324 * sound.c (sound_perror, alsa_sound_perror):
7325 * sysdep.c, syssignal.h (croak):
7326 * term.c (maybe_fatal, vfatal):
7327 * textprop.c (text_read_only):
7328 * undo.c (user_error):
7329 * unexmacosx.c (unexec_error):
7330 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7331 Use _Noreturn rather than NO_RETURN.
7332 No need for separate decl merely because of _Noreturn.
7333 * sound.c (sound_warning, parse_sound):
7334 Remove unnecessary forward decls.
7335
7336 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7337
7338 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7339 * lisp.h (WAIT_READING_MAX): New macro.
7340 * dispnew.c (Fsleep_for, sit_for):
7341 * keyboard.c (kbd_buffer_get_event):
7342 * process.c (Faccept_process_output):
7343 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7344 This improves on the previous patch, which introduced a bug
7345 when time_t is unsigned and as wide as intmax_t.
7346 See <http://bugs.gnu.org/9000#51>.
7347
7348 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7349
7350 * dispnew.c (sit_for, Fsleep_for):
7351 * keyboard.c (kbd_buffer_get_event):
7352 * process.c (Faccept_process_output): Avoid compiler warnings when
7353 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7354
7355 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7356
7357 * makefile.w32-in: Update dependencies.
7358
7359 * w32.c (ltime): Add return type and declare static.
7360 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7361
7362 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7363
7364 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7365 Privately reported by Herbert J. Skuhra.
7366 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7367 All uses changed.
7368 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7369 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7370
7371 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7372
7373 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7374 last argument of make_unibyte_string.
7375
7376 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7377 language ID in the event parameters.
7378
7379 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7380 event.code, not the obscure "character set ID".
7381
7382 2012-06-23 Chong Yidong <cyd@gnu.org>
7383
7384 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7385
7386 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7387
7388 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7389 * w32.c (fdutimens): New function.
7390
7391 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7392
7393 * s/ms-w32.h (pselect): Redirect to sys_select.
7394
7395 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7396
7397 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7398 in the logic of incrementing and decrementing the value of
7399 use_relocatable_buffers.
7400
7401 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7402
7403 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7404 Privately reported by Herbert J. Skuhra.
7405 [__FreeBSD__]: Remove "*/" typo after "#include".
7406 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7407 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7408 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7409 Don't assume EMACS_TIME and struct timeval are the same type.
7410
7411 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 Support higher-resolution time stamps (Bug#9000).
7414 The time stamps are only nanosecond-resolution at the C level,
7415 since that's the best that any real-world system supports now.
7416 But they are picosecond-resolution at the Lisp level, as that's
7417 easy, and leaves room for future OS improvements.
7418
7419 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7420 (LIBES): Use it.
7421
7422 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7423 Don't get current time unless it's needed.
7424
7425 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7426 now provides it if it's absent.
7427 (start_atimer): Port to higher-res time stamps.
7428 Check for time stamp overflow. Don't get current time more
7429 often than is needed.
7430
7431 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7432 Include systime.h, not time.h.
7433 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7434
7435 * dired.c: Include stat-time.h.
7436 (Ffile-attributes): File times now have higher resolution.
7437
7438 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7439 (struct image): Timestamp now has higher resolution.
7440
7441 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7442 has at least microseconds now. All uses removed.
7443 (update_frame, update_single_window, update_window, update_frame_1)
7444 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7445 (duration_to_sec_usec): Remove; no longer needed.
7446
7447 * editfns.c (time_overflow): Now extern.
7448 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7449 (float-time, Fformat_time_string, Fcurrent_time_string)
7450 (Fcurrent_time_zone): Accept and generate higher-resolution
7451 time stamps.
7452 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7453 (decode_time_components, lisp_seconds_argument): New functions.
7454 (make_time): Now static.
7455 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7456 Report an error if the time is invalid, rather than having the caller
7457 do that.
7458
7459 * fileio.c: Include <stat-time.h>
7460 (Fcopy_file): Copy higher-resolution time stamps.
7461 Prefer to set the time stamp via a file descriptor if that works.
7462 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7463 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7464 (Fvisited_file_modtime, Fset_visited_file_modtime):
7465 Support higher-resolution time stamps.
7466
7467 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7468
7469 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7470
7471 * image.c (prepare_image_for_display, clear_image_cache)
7472 (lookup_image): Port to higer-resolution time stamps.
7473
7474 * keyboard.c (start_polling, bind_polling_period):
7475 Check for time stamp overflow.
7476 (read_char, kbd_buffer_get_event, timer_start_idle)
7477 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7478 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7479 Port to higher-resolution time stamps. Do not assume time_t is signed.
7480 (decode_timer): New function. Timers are now vectors of length 9,
7481 not 8, to accommodate the picosecond component.
7482 (timer_check_2): Use it.
7483
7484 * nsterm.m (select_timeout, timeval_subtract): Remove.
7485 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7486 as they're a bit more accurate and handle overflow better.
7487 (ns_select): Change prototype to be compatible with pselect.
7488 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7489 * nsterm.h (ns_select): Adjust prototype.
7490
7491 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7492 us-resolution time stamps.
7493 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7494
7495 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7496
7497 * lisp.h (time_overflow): New decl.
7498 (wait_reading_process_output): First arg is now intmax_t, not int,
7499 to accommodate larger waits.
7500
7501 * process.h (struct Lisp_Process.read_output_delay):
7502 Now counts nanoseconds, not microseconds.
7503 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7504 EMACS_HAS_USECS.
7505 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7506 (wait_reading_process_output):
7507 Port to ns-resolution time stamps.
7508 (Faccept_process_output, wait_reading_process_output):
7509 Check for time stamp overflow. Do not assume time_t is signed.
7510 (select_wrapper): Remove; we now use pselect.
7511 (Fprocess_attributes): Now generates ns-resolution time stamps.
7512
7513 * sysdep.c: Include utimens.h. Don't include utime.h
7514 or worry about struct utimbuf; gnulib does that for us now.
7515 (gettimeofday): Remove; gnulib provides a substitute.
7516 (make_timeval): New function.
7517 (set_file_times): Now sets ns-resolution time stamps.
7518 New arg FD; all uses changed.
7519 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7520 (system_process_attributes):
7521 Now returns ns-resolution time stamp. All uses changed.
7522 Check for time stamp overflow.
7523
7524 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7525 provides a substitute now.
7526
7527 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7528 since it guarantees struct timespec.
7529 (EMACS_TIME): Now struct timespec, so that we can support
7530 ns-resolution time stamps.
7531 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7532 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7533 (EMACS_USECS): Remove.
7534 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7535 so multiply the arg by 1000 before storing it.
7536 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7537 New macros.
7538 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7539 Port to ns-resolution time stamps.
7540 (EMACS_TIME_NEG_P): Remove; replaced by....
7541 (EMACS_TIME_SIGN): New macro.
7542 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7543 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7544 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7545 (make_timeval, make_lisp_time, decode_time_components): New decls.
7546 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7547 that it mishandled time_t overflow. You can't compare by subtracting!
7548 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7549 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7550
7551 * term.c: Include <sys/time.h>.
7552 (timeval_to_Time): New function, for proper overflow wraparound.
7553 (term_mouse_position, term_mouse_click): Use it.
7554
7555 * undo.c (record_first_change): Support higher-resolution time stamps
7556 in the undo buffer.
7557 (Fprimitive_undo): Use them when restoring time stamps.
7558
7559 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7560 (w32_get_internal_run_time):
7561 Port to higher-resolution Emacs time stamps.
7562 (ltime): Now accepts single 64-bit integer, as that's more convenient
7563 for callers.
7564
7565 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7566
7567 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7568 for compatibility with pselect. Support ns-resolution time stamps.
7569
7570 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7571
7572 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7573 Check for time stamp overflow, and support ns-resolution time stamps.
7574
7575 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7576 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7577 (timeval_subtract): Remove; no longer needed.
7578 (XTflash, XTring_bell, x_wait_for_event):
7579 Port to ns-resolution time stamps. Don't assume time_t is signed.
7580
7581 2012-06-22 Chong Yidong <cyd@gnu.org>
7582
7583 * xdisp.c (x_consider_frame_title): Revert last change.
7584
7585 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7586
7587 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7588 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7589 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7590 staticidx goes up to 1597 out of 1600 = 0x640.)
7591
7592 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7595 Otherwise, the umask might be mistakenly 0 while handling input signals.
7596
7597 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7598
7599 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7600
7601 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7602
7603 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7604 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7605 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7606 access to `contents' member of Lisp_Vector objects with AREF and ASET
7607 where appropriate.
7608
7609 2012-06-19 Chong Yidong <cyd@gnu.org>
7610
7611 * frame.c (delete_frame): When selecting a frame on a different
7612 text terminal, do not alter the terminal's top-frame.
7613
7614 * xdisp.c (format_mode_line_unwind_data): Record the target
7615 frame's selected window and its terminal's top-frame.
7616 (unwind_format_mode_line): Restore them.
7617 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7618 Callers changed.
7619 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7620 since tty frames can be explicitly named.
7621 (prepare_menu_bars): Likewise.
7622
7623 * term.c (Ftty_top_frame): New function.
7624
7625 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7626
7627 Port byte-code-meter to modern targets.
7628 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7629 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7630 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7631 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7632 (METER_1, METER_2): Simplify.
7633
7634 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7635
7636 * data.c (Fdefalias): Return `symbol' (bug#11686).
7637
7638 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7639
7640 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7641 gets killed during executing of this function (Bug#11665).
7642 Try to always return Qt when the buffer has been actually killed.
7643 (Vkill_buffer_query_functions): In doc-string say that functions
7644 run by this hook should not change the current buffer.
7645
7646 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Fix recently-introduced process.c problems found by static checking.
7649 * process.c (write_queue_push, write_queue_pop, send_process):
7650 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7651 (write_queue_pop): Fix pointer signedness problem.
7652 (send_process): Remove unused local.
7653
7654 2012-06-17 Chong Yidong <cyd@gnu.org>
7655
7656 * xdisp.c (redisplay_internal): No need to redisplay terminal
7657 frames that are not on top.
7658
7659 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7660
7661 * process.c (make_process): Initialize write_queue.
7662 (write_queue_push, write_queue_pop): New functions.
7663 (send_process): Use them to maintain correct ordering of process
7664 writes (Bug#10815).
7665
7666 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7667
7668 * lisp.h (eassert): Assume C89 or later.
7669 This removes the need for CHECK.
7670 (CHECK): Remove. Its comments about always evaluating its
7671 argument were confusing, as 'eassert' typically does not evaluate
7672 its argument.
7673
7674 * coding.c (produce_chars): Use ptrdiff_t, not int.
7675
7676 * xterm.c (x_draw_underwave): Check for integer overflow.
7677 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7678
7679 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7680
7681 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7682 referenced (Bug#11583).
7683
7684 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7685
7686 Implement wave-style variant of underlining.
7687 * dispextern.h (face_underline_type): New enum.
7688 (face): Add field for underline type.
7689 * nsterm.m (ns_draw_underwave): New function.
7690 (ns_draw_text_decoration): Use it.
7691 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7692 New functions.
7693 (x_draw_glyph_string): Use them.
7694 * xfaces.c (Qline, Qwave): New Lisp objects.
7695 (check_lface_attrs, merge_face_ref)
7696 (Finternal_set_lisp_face_attribute, realize_x_face):
7697 Handle wave-style underline face attributes.
7698 * xterm.c (x_draw_underwave): New function.
7699 (x_draw_glyph_string): Use it.
7700
7701 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7702
7703 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7704 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7705 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7706 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7707 ($(BLD)/w32select.$(O)): Update dependencies.
7708
7709 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7710
7711 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7712 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7713 * character.c (_fetch_multibyte_char_p): Remove.
7714 * alloc.c: Include "character.h" before "buffer.h".
7715 * bidi.c: Likewise.
7716 * buffer.c: Likewise.
7717 * bytecode.c: Likewise.
7718 * callint.c: Likewise.
7719 * callproc.c: Likewise.
7720 * casefiddle.c: Likewise.
7721 * casetab.c: Likewise.
7722 * category.c: Likewise.
7723 * cmds.c: Likewise.
7724 * coding.c: Likewise.
7725 * composite.c: Likewise.
7726 * dired.c: Likewise.
7727 * dispnew.c: Likewise.
7728 * doc.c: Likewise.
7729 * dosfns.c: Likewise.
7730 * editfns.c: Likewise.
7731 * emacs.c: Likewise.
7732 * fileio.c: Likewise.
7733 * filelock.c: Likewise.
7734 * font.c: Likewise.
7735 * fontset.c: Likewise.
7736 * fringe.c: Likewise.
7737 * indent.c: Likewise.
7738 * insdel.c: Likewise.
7739 * intervals.c: Likewise.
7740 * keyboard.c: Likewise.
7741 * keymap.c: Likewise.
7742 * lread.c: Likewise.
7743 * macros.c: Likewise.
7744 * marker.c: Likewise.
7745 * minibuf.c: Likewise.
7746 * nsfns.m: Likewise.
7747 * nsmenu.m: Likewise.
7748 * print.c: Likewise.
7749 * process.c: Likewise.
7750 * regex.c: Likewise.
7751 * region-cache.c: Likewise.
7752 * search.c: Likewise.
7753 * syntax.c: Likewise.
7754 * term.c: Likewise.
7755 * textprop.c: Likewise.
7756 * undo.c: Likewise.
7757 * unexsol.c: Likewise.
7758 * w16select.c: Likewise.
7759 * w32fns.c: Likewise.
7760 * w32menu.c: Likewise.
7761 * window.c: Likewise.
7762 * xdisp.c: Likewise.
7763 * xfns.c: Likewise.
7764 * xmenu.c: Likewise.
7765 * xml.c: Likewise.
7766 * xselect.c: Likewise.
7767
7768 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7769
7770 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7771 If all the glyphs of the glyph row came from strings, and we have no
7772 cursor positioning clues, put the cursor on the first glyph of the
7773 row.
7774 (handle_face_prop): Use chunk-relative overlay string index when
7775 indexing into it->string_overlays array. (Bug#11653)
7776 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7777 the rightmost. (Bug#11720)
7778
7779 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7780
7781 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7782 (CATEGORY_MEMBER): Enforce 1/0 value.
7783 * category.c (_temp_category_set): Remove.
7784
7785 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7786
7787 * window.c (Fdelete_other_windows_internal)
7788 (Fdelete_window_internal): Don't access frame's mouse highlight
7789 info of the initial frame. (Bug#11677)
7790
7791 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7792
7793 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7794 Assume USE_2_TAGS_FOR_INTS.
7795 (xreload): Adjust $tagmask width to match recent lisp.h change.
7796
7797 Simplify lisp.h in minor ways that should not affect code.
7798 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7799 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7800 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7801 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7802 (INTTYPEBITS): New macro, for clarity.
7803 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7804 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7805 Simplify now that USE_LSB_TAG is always defined.
7806 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7807 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7808
7809 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7810
7811 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7812
7813 2012-06-13 Glenn Morris <rgm@gnu.org>
7814
7815 * s/bsd-common.h (BSD4_3):
7816 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7817
7818 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7819
7820 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7821 instead of union.
7822 (XLI, XIL): Define.
7823 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7824 Use them.
7825 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7826 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7827 * alloc.c (widen_to_Lisp_Object): Remove.
7828 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7829 * frame.c (delete_frame): Remove outdated comment.
7830 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7831 USE_LISP_UNION_TYPE.
7832 (Fw32_unregister_hot_key): Likewise.
7833 (Fw32_toggle_lock_key): Likewise.
7834 * w32menu.c (add_menu_item): Likewise.
7835 (w32_menu_display_help): Use XIL instead of checking
7836 USE_LISP_UNION_TYPE.
7837 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7838 (init_heap): Likewise.
7839 * w32term.c (w32_read_socket): Update comment.
7840
7841 2012-06-13 Glenn Morris <rgm@gnu.org>
7842
7843 * s/usg5-4-common.h, src/s/unixware.h:
7844 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7845
7846 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7847
7848 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7849
7850 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7851 * alloc.c (make_number) [!defined make_number]:
7852 Remove, as lisp.h always defines this now.
7853 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7854 (roundup_size): Verify that it is a power of 2.
7855 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7856 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7857 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7858 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7859 USE_LSB_TAG now is always defined to be either 0 or 1.
7860 All uses changed.
7861 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7862 code works fine either way, and efficiency is not a concern here,
7863 as the union type is for debugging, not for production.
7864 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7865 Use an inline function on all platforms when using the union type,
7866 since this is simpler and 'static inline' can be used portably
7867 within Emacs now.
7868 (LISP_INITIALLY_ZERO): New macro.
7869 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7870 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7871
7872 2012-06-12 Glenn Morris <rgm@gnu.org>
7873
7874 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7875
7876 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7877
7878 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7879 Move BROKEN_SIGIO to configure.
7880
7881 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7882 Move NO_TERMIO to configure.
7883
7884 2012-06-12 Chong Yidong <cyd@gnu.org>
7885
7886 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7887 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7888 MagickExportImagePixels is undefined.
7889
7890 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * image.c (imagemagick_load_image): Remove unused label.
7893
7894 2012-06-11 Glenn Morris <rgm@gnu.org>
7895
7896 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7897 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7898 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7899 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7900
7901 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7902
7903 * alloc.c (make_byte_code): New function.
7904 (Fmake_byte_code): Use it. Don't purify here.
7905 * lread.c (read1): Use it as well to avoid extra allocation.
7906
7907 2012-06-11 Chong Yidong <cyd@gnu.org>
7908
7909 * image.c (imagemagick_load_image): Implement transparency.
7910
7911 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7912
7913 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7914 account for preceding backslashes. (Bug#11663)
7915
7916 2012-06-09 Chong Yidong <cyd@gnu.org>
7917
7918 * term.c: Support italics in capable terminals (Bug#9652).
7919 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7920 (turn_on_face): Output using TS_enter_italic_mode if available.
7921 Don't handle unused blinking and alt-charset cases.
7922 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7923 and tty_alt_charset_p cases.
7924 (tty_capable_p, init_tty): Support italics.
7925
7926 * termchar.h (struct tty_display_info): Add field for italics.
7927 Remove unused blink field.
7928
7929 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7930 Handle slant.
7931
7932 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7933 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7934 tty_alt_charset_p. Add tty_italic_p.
7935
7936 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7937
7938 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7939 dbus_type_is_basic if available.
7940 (xd_extract_signed, xd_extract_unsigned): Rename from
7941 extract_signed and extract_unsigned, respectively. Adapt callers.
7942
7943 2012-06-09 Chong Yidong <cyd@gnu.org>
7944
7945 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7946
7947 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7948 case (Bug#9752).
7949
7950 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7951
7952 * xdisp.c (vmessage): Treat frame message as multibyte.
7953 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7954 would generate the diagnostic "Making \302\247 buffer-local while
7955 let-bound!".
7956
7957 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7958
7959 * dispnew.c (showing_window_margins_p): Undo last change, which
7960 was done due to an inadvertent commit.
7961 (adjust_frame_glyphs_for_frame_redisplay): Do call
7962 showing_window_margins_p.
7963
7964 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7965
7966 * eval.c (Fmake_var_non_special): New primitive.
7967 (syms_of_eval): Defsubr it.
7968 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7969
7970 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7971
7972 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7973 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7974
7975 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7976
7977 * alloc.c (allocate_vectorlike): Fix last change.
7978
7979 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7980
7981 Block-based vector allocation of small vectors.
7982 * lisp.h (struct vectorlike_header): New field `nbytes',
7983 adjust comment accordingly.
7984 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7985 to denote vector blocks. Adjust users (live_vector_p,
7986 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7987 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7988 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7989 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7990 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7991 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7992 (roundup_size): New constant.
7993 (struct vector_block): New data type.
7994 (vector_blocks, vector_free_lists, zero_vector): New variables.
7995 (all_vectors): Rename to `large_vectors'.
7996 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7997 (sweep_vectors): New functions.
7998 (allocate_vectorlike): Return `zero_vector' as the only vector of
7999 0 items. Allocate new vector from block if vector size is less than
8000 or equal to VBLOCK_BYTES_MAX.
8001 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8002 (init_alloc_once): Add call to init_vectors.
8003
8004 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8005
8006 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8007
8008 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8009
8010 * doprnt.c (doprnt): Truncate multibyte char correctly.
8011 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8012 would mishandle a string argument "Xc" if X was a multibyte
8013 character of length 2: it would truncate after X's first byte
8014 rather than including all of X.
8015
8016 2012-06-06 Chong Yidong <cyd@gnu.org>
8017
8018 * buffer.c (word_wrap): Doc fix.
8019
8020 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8023
8024 2012-06-03 Glenn Morris <rgm@gnu.org>
8025
8026 * xdisp.c (tool-bar-style): Doc fix.
8027
8028 2012-06-03 Ulrich Müller <ulm@gentoo.org>
8029
8030 * Makefile.in (PAXCTL): Define.
8031 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8032 binary via PaX flags if the paxctl utility is available.
8033 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8034 Restore PaX flags to their default. (Bug#11398)
8035
8036 2012-06-03 Chong Yidong <cyd@gnu.org>
8037
8038 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8039 buffer (Bug#11226).
8040
8041 2012-06-03 Chong Yidong <cyd@gnu.org>
8042
8043 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8044 (note_mode_line_or_margin_highlight): If there is no help echo,
8045 use mode-line-default-help-echo. Handle the case where the mouse
8046 position is past the end of the mode line string.
8047
8048 * buffer.c (buffer_local_value_1): New function, split from
8049 Fbuffer_local_value; can return Qunbound.
8050 (Fbuffer_local_value): Use it.
8051 (Vmode_line_format): Docstring tweaks.
8052
8053 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8054
8055 * sysdep.c (system_process_attributes): Improve comment.
8056
8057 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8058
8059 * keyboard.c: Export real-this-command to Elisp.
8060 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8061 and DEFVAR it. Update all users.
8062
8063 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8064
8065 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8066
8067 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8068 Convert pctcpu and pctmem to Lisp float properly.
8069 Let the compiler fold better, as 100.0/0x8000 is exact.
8070
8071 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8072
8073 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8074 cons_block.
8075
8076 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8079
8080 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8081
8082 For a 'struct window', replace some Lisp_Object fields to
8083 bitfields where appropriate, remove unused fields.
8084 * window.h (struct window): Remove unused 'last_mark_x' and
8085 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8086 change its type from Lisp_Object to bitfield.
8087 Change type of 'force_start', 'optional_new_start',
8088 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8089 fields from Lisp_Object to bitfield. Adjust users accordingly.
8090
8091 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8092
8093 Pacify gcc -Wdouble-precision when using Xaw.
8094 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8095 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8096 Use 'float' consistently, rather than 'float' in most places
8097 and 'double' in a couple of places.
8098
8099 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8100
8101 * xdisp.c (handle_stop): Detect whether we have overlay strings
8102 loaded by testing it->current.overlay_string_index to be
8103 non-negative, instead of checking whether n_overlay_strings is
8104 positive. (Bug#11587)
8105
8106 2012-05-31 Chong Yidong <cyd@gnu.org>
8107
8108 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8109
8110 * doc.c (Fsubstitute_command_keys): Doc fix.
8111
8112 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8113
8114 * search.c (search_buffer): Remove calls to
8115 r_alloc_inhibit_buffer_relocation, as it is now called by
8116 maybe_unify_char, which was the cause of relocation of buffer text
8117 in bug#11519.
8118
8119 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8120
8121 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8122 for the duration of call to load_charset, to avoid problems with
8123 callers of maybe_unify_char that access buffer text through C
8124 pointers.
8125
8126 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8127 decrement the inhibition flag, instead of just setting or
8128 resetting it.
8129
8130 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8131
8132 Remove obsolete '#define static' cruft.
8133 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8134 This #undef was "temporary" in 2000; it is no longer needed
8135 now that '#define static' has gone away.
8136 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8137 (gray_bitmap_bits): Remove; no longer needed.
8138 All uses replaced with definiens.
8139 * xterm.c: Include "bitmaps/gray.xbm".
8140
8141 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8142
8143 Clean up __executable_start, monstartup when --enable-profiling.
8144 The following changes affect the code only when profiling.
8145 * dispnew.c (__executable_start): Rename from safe_bcopy.
8146 Define only on platforms that need it.
8147 * emacs.c: Include <sys/gmon.h> when profiling.
8148 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8149 (__executable_start): Remove decl, since lisp.h does it now.
8150 (safe_bcopy): Remove decl; no longer has that name.
8151 (main): Coalesce #if into single bit of code, for simplicity.
8152 Cast pointers to uintptr_t, since standard libraries want integers
8153 and not pointers.
8154 * lisp.h (__executable_start): New decl.
8155
8156 2012-05-31 Glenn Morris <rgm@gnu.org>
8157
8158 * image.c (Fimagemagick_types): Doc fix.
8159
8160 2012-05-30 Jim Meyering <meyering@redhat.com>
8161
8162 * callproc.c (Fcall_process_region): Include directory component
8163 in mkstemp error message (Bug#11586).
8164
8165 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8166
8167 * alloc.c, lisp.h (make_pure_vector): Now static.
8168
8169 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8170
8171 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8172 Move to byte-run.el.
8173 (Fautoload): Do the hash-doc more carefully.
8174 * data.c (Fdefalias): Purify definition, except for keymaps.
8175 (Qdefun): Move from eval.c.
8176 * lisp.h (Qdefun): Remove.
8177 * lread.c (read1): Tiny simplification.
8178
8179 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8180
8181 Do not create empty overlays with the evaporate property (Bug#9642).
8182 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8183 Bug#9642, but explicitly check that the buffer the overlay would
8184 be moved to is live and rearrange lines to make sure that errors
8185 will not put the overlay in an inconsistent state.
8186 (Fdelete_overlay): Cosmetics.
8187
8188 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8189
8190 * w32term.c (my_bring_window_to_top): New function.
8191 (x_raise_frame): Use handle returned by DeferWindowPos, which
8192 could be different from the original one.
8193 Call my_bring_window_to_top instead of my_set_foreground_window.
8194 (Bug#11513)
8195
8196 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8197 by calling BringWindowToTop.
8198
8199 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8200 (WM_EMACS_END): Increase by one.
8201
8202 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8203
8204 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8205 This avoids undefined behavior that might cause the eassert
8206 to not catch an out-of-range value.
8207
8208 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8209
8210 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8211 Update dependencies.
8212
8213 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8214
8215 * bidi.c (bidi_mirror_char): Fix last change.
8216
8217 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8218
8219 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8220 when referring to sectname field in printf format.
8221
8222 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8223
8224 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8225 Only r_alloc_inhibit_buffer_relocation needed to be added;
8226 the others were already declared.
8227
8228 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8229 before checking whether it's out of range. Put the check inside
8230 eassert. See
8231 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8232
8233 2012-05-27 Ken Brown <kbrown@cornell.edu>
8234
8235 * callproc.c (Fcall_process): Restore a line that was accidentally
8236 commented out in the 2011-02-13 change (bug#11547).
8237
8238 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8239
8240 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8241 defined on ralloc.c.
8242
8243 * buffer.c [REL_ALLOC]: Remove prototypes of
8244 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8245 they are now on lisp.h.
8246
8247 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8248
8249 * search.c (search_buffer): Use it to inhibit relocation of buffer
8250 text while re_search_2 is doing its job, because re_search_2 is
8251 passed C pointers to buffer text. (Bug#11519)
8252
8253 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8254 Update value to 24.
8255
8256 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8257 state after an additional call to move_it_in_display_line_to, keep
8258 the values of it->max_ascent and it->max_descent found for the
8259 entire line.
8260 (pos_visible_p): Revert the comparison against bottom_y to what it
8261 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8262 (Bug#11464)
8263
8264 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 Fix coding-related core dumps with gcc -ftrapv.
8267 The code was computing A - B, where A and B are pointers, and B is
8268 random garbage. This can lead to core dumps on platforms that
8269 have special pointer registers, and it also leads to core dumps on
8270 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8271 A - B only when B is initialized properly.
8272 * coding.c (coding_set_source, coding_set_destination): Return void.
8273 (coding_change_source, coding_change_destinations): New functions,
8274 with the old behaviors of coding_set_source and coding_set_destination.
8275 All callers that need an offset changed to use these new functions.
8276
8277 2012-05-26 Glenn Morris <rgm@gnu.org>
8278
8279 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8280
8281 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8282
8283 Extend mouse support on W32 text-mode console.
8284 * xdisp.c (draw_row_with_mouse_face):
8285 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8286
8287 * w32console.c: Include window.h.
8288 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8289 New functions.
8290 (initialize_w32_display): Initialize mouse-highlight data.
8291
8292 * w32inevt.c: Include termchar.h and window.h.
8293 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8294 moves, call note_mouse_highlight. If help_echo changed, call
8295 gen_help_event to produce help-echo message in the echo area.
8296 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8297 highlight info.
8298
8299 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 * lread.c (read1): Simplify slightly to avoid an overflow warning
8302 with GCC 4.7.0 on x86-64.
8303
8304 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8305
8306 * bidi.c (bidi_mirror_char): Revert last change: an int is
8307 definitely wide enough here.
8308
8309 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8310
8311 Fix integer width and related bugs (Bug#9874).
8312 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8313 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8314 (string_bytes, check_sblock, allocate_string_data):
8315 (compact_small_strings, Fmake_bool_vector, make_string)
8316 (make_unibyte_string, make_multibyte_string)
8317 (make_string_from_bytes, make_specified_string)
8318 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8319 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8320 (mark_vectorlike):
8321 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8322 (allocate_pseudovector):
8323 Use int, not EMACS_INT, where int is wide enough.
8324 (inhibit_garbage_collection, Fgarbage_collect):
8325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8326 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8327 int might not be wide enough.
8328 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8329 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8330 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8331 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8332 (bidi_level_of_next_char, bidi_move_to_visually_next):
8333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8334 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8335 (Fkill_buffer, Fset_buffer_major_mode)
8336 (advance_to_char_boundary, Fbuffer_swap_text)
8337 (Fset_buffer_multibyte, overlays_at, overlays_in)
8338 (overlay_touches_p, struct sortvec, record_overlay_string)
8339 (overlay_strings, recenter_overlay_lists)
8340 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8341 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8342 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8343 (Foverlay_recenter, last_overlay_modification_hooks_used)
8344 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8346 (validate_region): Omit unnecessary test for b <= e,
8347 since that's guaranteed by the previous test.
8348 (adjust_overlays_for_delete): Avoid pos + length overflow.
8349 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8350 (report_overlay_modification):
8351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8352 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8353 Omit pointer cast, which isn't needed anyway, and doesn't work
8354 after the EMACS_INT -> ptrdiff_t change.
8355 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8356 * buffer.h: Adjust decls to match defn changes elsewhere.
8357 (struct buffer_text, struct buffer):
8358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8359 Use EMACS_INT, not int, where int might not be wide enough.
8360 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8361 not int, to avoid needless 32-bit limit on 64-bit hosts.
8362 (exec_byte_code): Use tighter memory-full test, one that checks
8363 for alloca overflow. Don't compute the address of the object just
8364 before an array, as that's not portable. Use EMACS_INT, not
8365 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8366 * callint.c (Fcall_interactively):
8367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8368 * callproc.c (call_process_kill, Fcall_process):
8369 Don't assume pid_t fits into an Emacs fixnum.
8370 (call_process_cleanup, Fcall_process, child_setup):
8371 Don't assume pid_t fits into int.
8372 (call_process_cleanup, Fcall_process, delete_temp_file)
8373 (Fcall_process_region):
8374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8375 (Fcall_process): Simplify handling of volatile integers.
8376 Use int, not EMACS_INT, where int will do.
8377 * casefiddle.c (casify_object, casify_region, operate_on_word)
8378 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8379 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8380 (casify_object): Avoid integer overflow when overallocating buffer.
8381 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8382 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8383 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8384 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8385 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8386 integers are now checked earlier. All uses replaced with XINT.
8387 (ccl_driver):
8388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8389 For CCL_MapSingle, check that content and value are in int range.
8390 (ccl_driver, Fregister_code_conversion_map):
8391 Check that Vcode_version_map_vector is a vector.
8392 (resolve_symbol_ccl_program): Check that vector header is in range.
8393 Always copy the vector, so that we can check its contents reliably
8394 now rather than having to recheck each instruction as it's being
8395 executed. Check that vector words fit in 'int'.
8396 (ccl_get_compiled_code, Fregister_ccl_program)
8397 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8398 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8399 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8400 contents are in range.
8401 (Fccl_execute_on_string): Check that status is in range.
8402 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8403 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8404 Accept and return EMACS_INT, not int, because callers can pass values
8405 out of 'int' range.
8406 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8407 (multibyte_chars_in_text, parse_str_as_multibyte)
8408 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8409 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8410 (string_escape_byte8, Fget_byte):
8411 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8412 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8413 avoid mishandling large integers.
8414 * character.h: Adjust decls to match defn changes elsewhere.
8415 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8416 (Ffind_charset_region):
8417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8418 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8419 (load_charset_map_from_vector, Fdefine_charset_internal):
8420 Don't assume fixnum fits in int.
8421 (load_charset_map_from_vector, Fmap_charset_chars):
8422 Remove now-unnecessary CHECK_NATNUMs.
8423 (Fdefine_charset_internal): Check ranges here, more carefully.
8424 Don't rely on undefined behavior with signed left shift overflow.
8425 Don't assume unsigned int fits into fixnum, or that fixnum fits
8426 into unsigned int. Don't require max_code to be a valid fixnum;
8427 that's not true for gb10830 4-byte on a 32-bit host. Allow
8428 invalid_code to be a cons, for the same reason. Require code_offset
8429 to be a character. Avoid int overflow if max_char is close
8430 to INT_MAX.
8431 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8432 this is intended anyway and avoids some undefined behavior.
8433 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8434 INDEX_TO_CODE_POINT, as that's what it expects.
8435 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8436 * charset.h (DECODE_CHAR): Return int, not unsigned;
8437 this is what was intended anyway, and it avoids undefined behavior.
8438 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8439 integer-overflow issues.
8440 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8441 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8442 where the argument is EMACS_INT, and this behavior is not intended.
8443 * chartab.c (Fmake_char_table, Fset_char_table_range)
8444 (uniprop_get_decoder, uniprop_get_encoder):
8445 Don't assume fixnum fits in int.
8446 * cmds.c (move_point): New function, that does the gist of
8447 Fforward_char and Fbackward_char, but does so while checking
8448 for integer overflow more accurately.
8449 (Fforward_char, Fbackward_char): Use it.
8450 (Fforward_line, Fend_of_line, internal_self_insert)
8451 (internal_self_insert):
8452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8453 Fix a FIXME, by checking for integer overflow when calculating
8454 target_clm and actual_clm.
8455 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8456 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8457 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8458 (coding_alloc_by_making_gap, alloc_destination)
8459 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8460 (encode_coding_utf_16, detect_coding_emacs_mule)
8461 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8462 (detect_coding_iso_2022, decode_coding_iso_2022)
8463 (encode_invocation_designation, encode_designation_at_bol)
8464 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8465 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8466 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8467 (encode_coding_ccl, encode_coding_raw_text)
8468 (detect_coding_charset, decode_coding_charset)
8469 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8470 (produce_composition, produce_charset, produce_annotation)
8471 (decode_coding, handle_composition_annotation)
8472 (handle_charset_annotation, consume_chars, decode_coding_gap)
8473 (decode_coding_object, encode_coding_object, detect_coding_system)
8474 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8475 (code_convert_region, code_convert_string)
8476 (Fdefine_coding_system_internal)
8477 (coding_set_source, coding_set_destination):
8478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8479 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8480 (Fdefine_coding_system_internal):
8481 Don't assume fixnums fit in int.
8482 (decode_coding_gap, decode_coding_object, encode_coding_object)
8483 (Fread_coding_system, Fdetect_coding_region)
8484 (Funencodable_char_position, Fcheck_coding_systems_region)
8485 (get_translation, handle_composition_annotation, consume_chars):
8486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8487 (consume_chars): Rewrite to not calculate an address outside buffer.
8488 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8489 Don't access memory outside of the args array.
8490 (Fdefine_coding_system_internal): Check for charset-id overflow.
8491 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8492 result of ENCODE_CHAR.
8493 * coding.h: Adjust decls to match defn changes elsewhere.
8494 (struct coding_system):
8495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8496 * composite.c (get_composition_id, find_composition)
8497 (run_composition_function, update_compositions)
8498 (compose_text, composition_gstring_put_cache)
8499 (composition_gstring_p, composition_gstring_width)
8500 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8501 (composition_compute_stop_pos, composition_reseat_it)
8502 (composition_update_it, struct position_record)
8503 (find_automatic_composition, composition_adjust_point)
8504 (Fcomposition_get_gstring, Ffind_composition_internal):
8505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8506 (update_compositions):
8507 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8508 * composite.h: Adjust decls to match defn changes elsewhere.
8509 (struct composition):
8510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8511 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8512 Do not attempt to compute the address of the object just before a
8513 buffer; this is not portable.
8514 (Faref, Faset):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 (Faset): Use int, not EMACS_INT, where int is wide enough.
8517 (Fstring_to_number): Don't assume fixnums fit in int.
8518 (Frem): Don't assume arg is nonnegative.
8519 * dbusbind.c (xd_append_arg): Check for integers out of range.
8520 (Fdbus_call_method): Don't overflow the timeout int.
8521 (extract_signed, extract_unsigned): New functions.
8522 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8523 (xd_get_connection_references): Return ptrdiff_t, not int.
8524 All uses changed.
8525 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8526 (xd_read_message_1):
8527 Use int, not unsigned, where the dbus API uses int.
8528 (Fdbus_message_internal): Don't overflow mtype.
8529 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8530 * dired.c (directory_files_internal, file_name_completion, scmp)
8531 (file_name_completion_stat):
8532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8533 (file_name_completion): Don't overflow matchcount.
8534 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8535 * dispextern.h: Adjust decls to match defn changes elsewhere.
8536 (struct text_pos, struct glyph, struct bidi_saved_info)
8537 (struct bidi_string_data, struct bidi_it, struct composition_it)
8538 (struct it):
8539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8540 (struct display_pos, struct composition_it, struct it):
8541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8542 * dispnew.c (increment_matrix_positions)
8543 (increment_row_positions, mode_line_string)
8544 (marginal_area_string):
8545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8546 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8548 (duration_to_sec_usec): New function, to check for overflow better.
8549 (Fsleep_for, sit_for): Use it.
8550 * doc.c (get_doc_string, store_function_docstring):
8551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8552 (get_doc_string, Fsnarf_documentation):
8553 Use int, not EMACS_INT, where int is wide enough.
8554 (get_doc_string):
8555 Use SAFE_ALLOCA, not alloca.
8556 Check for overflow when converting EMACS_INT to off_t.
8557 * doprnt.c (doprnt):
8558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8559 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8560 Don't assume uid_t fits into fixnum.
8561 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8562 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8563 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8564 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8565 (general_insert_function)
8566 (Finsert_char, make_buffer_string, make_buffer_string_both)
8567 (update_buffer_properties, Fbuffer_substring)
8568 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8569 (Fsubst_char_in_region, check_translation)
8570 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8571 (transpose_markers, Ftranspose_regions):
8572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8573 (clip_to_bounds): Move to lisp.h as an inline function).
8574 (Fconstrain_to_field): Don't assume integers are nonnegative.
8575 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8576 (Fsubst_char_in_region, Fsave_restriction):
8577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8578 (Femacs_pid): Don't assume pid_t fits into fixnum.
8579 (lo_time): Use int, not EMACS_INT, when int suffices.
8580 (lisp_time_argument): Check for usec out of range.
8581 (Fencode_time): Don't assume fixnum fits in int.
8582 (Fuser_login_name, Fuser_full_name): Signal an error
8583 if a uid argument is out of range, rather than relying on
8584 undefined behavior.
8585 (Fformat_time_string): Remove now-unnecessary check.
8586 lisp_time_argument checks for out-of-range usec now.
8587 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8588 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8589 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8590 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8591 (init_cmdargs, Fdump_emacs):
8592 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8593 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8594 the bottom (typically) 32 bits of the fixnum.
8595 * eval.c (specpdl_size, call_debugger):
8596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8597 (when_entered_debugger, Fbacktrace_debug):
8598 Don't assume fixnum can fit in int.
8599 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8600 the object just before a buffer; this is not portable.
8601 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8602 (grow_specpdl, unbind_to):
8603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8604 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8605 (grow_specpdl): Simplify allocation by using xpalloc.
8606 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8607 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8608 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8611 (a_write, e_write):
8612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8613 (Fcopy_file, non_regular_nbytes, read_non_regular)
8614 (Finsert_file_contents):
8615 Use int, not EMACS_INT, where int is wide enough.
8616 (READ_BUF_SIZE): Verify that it fits in int.
8617 (Finsert_file_contents): Check that counts are in proper range,
8618 rather than assuming fixnums fit into ptrdiff_t etc.
8619 Don't assume fixnums fit into int.
8620 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8621 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8622 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8623 (string_char_to_byte, string_byte_to_char)
8624 (string_make_multibyte, string_to_multibyte)
8625 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8626 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8627 (substring_both, Fdelete, internal_equal, Ffillarray)
8628 (Fclear_string, mapcar1)
8629 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8630 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8631 (larger_vector, make_hash_table, maybe_resize_hash_table)
8632 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8633 (Fmaphash, secure_hash):
8634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8635 (concat): Check for string index and length overflow.
8636 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8637 (Frequire):
8638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8639 (larger_vector): New API (vec, incr_min, size_max) replaces old
8640 one (vec, new_size, init). This catches size overflow.
8641 INIT was removed because it was always Qnil.
8642 All callers changed.
8643 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8644 the upper bound on a hash table index size.
8645 (make_hash_table, maybe_resize_hash_table): Use it.
8646 (secure_hash): Computer start_byte and end_byte only after
8647 they're known to be in ptrdiff_t range.
8648 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8649 (Ffont_get_glyphs, Ffont_at):
8650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8651 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8652 (Flist_fonts, Fopen_font):
8653 Don't assume fixnum can fit in int.
8654 (check_gstring): Don't assume index can fit in int.
8655 (font_match_p): Check that fixnum is a character, not a nonnegative
8656 fixnum, since the later code needs to stuff it into an int.
8657 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8658 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8659 conversion overflow issues.
8660 (Fopen_font): Check for integer out of range.
8661 (Ffont_get_glyphs): Don't assume index can fit in int.
8662 * font.h: Adjust decls to match defn changes elsewhere.
8663 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8664 integer overflow.
8665 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8666 printmax_t, where ptrdiff_t is wide enough.
8667 (Finternal_char_font):
8668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8669 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8670 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8671 (Fset_frame_position, x_set_frame_parameters)
8672 (x_set_line_spacing, x_set_border_width)
8673 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8674 Check that fixnums are in proper range for system types.
8675 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8677 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8678 Use SAFE_ALLOCA_LISP, not alloca.
8679 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8680 intptr_t is wide enough.
8681 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8682 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8683 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8684 Check for fixnum out of range.
8685 * ftfont.c (ftfont_list): Don't assume index fits in int.
8686 Check that fixnums are in proper range for system types.
8687 (ftfont_shape_by_flt):
8688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8689 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8691 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8692 Check that fixnums are in proper range for system types.
8693 * gnutls.h: Adjust decls to match defn changes elsewhere.
8694 * gtkutil.c (xg_dialog_run):
8695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8696 (update_frame_tool_bar):
8697 Check that fixnums are in proper range for system types.
8698 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8699 (lookup_image): Check that fixnums are in range for system types.
8700 * indent.c (last_known_column, last_known_column_point):
8701 (current_column_bol_cache):
8702 (skip_invisible, current_column, check_display_width):
8703 (check_display_width, scan_for_column, current_column_1)
8704 (Findent_to, Fcurrent_indentation, position_indentation)
8705 (indented_beyond_p, Fmove_to_column, compute_motion):
8706 (Fcompute_motion, Fvertical_motion):
8707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8708 (last_known_column_modified): Use EMACS_INT, not int.
8709 (check_display_width):
8710 (Fcompute_motion):
8711 Check that fixnums and floats are in proper range for system types.
8712 (compute_motion): Don't assume index or fixnum fits in int.
8713 (compute_motion, Fcompute_motion):
8714 Use int, not EMACS_INT, when it is wide enough.
8715 (vmotion): Omit local var start_hpos that is always 0; that way
8716 we don't need to worry about overflow in expressions involving it.
8717 * indent.h: Adjust decls to match defn changes elsewhere.
8718 (struct position):
8719 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8720 Use int, not EMACS_INT, where int is wide enough.
8721 Remove unused members ovstring_chars_done and tab_offset;
8722 all uses removed.
8723 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8724 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8725 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8726 (make_gap, copy_text, insert, insert_and_inherit)
8727 (insert_before_markers, insert_before_markers_and_inherit)
8728 (insert_1, count_combining_before, count_combining_after)
8729 (insert_1_both, insert_from_string)
8730 (insert_from_string_before_markers, insert_from_string_1)
8731 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8732 (adjust_after_replace, adjust_after_insert, replace_range)
8733 (replace_range_2, del_range, del_range_1, del_range_byte)
8734 (del_range_both, del_range_2, modify_region)
8735 (prepare_to_modify_buffer, signal_before_change)
8736 (signal_after_change, Fcombine_after_change_execute):
8737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8738 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8739 (balance_an_interval, split_interval_right, split_interval_left)
8740 (find_interval, next_interval, update_interval)
8741 (adjust_intervals_for_insertion, delete_node, delete_interval)
8742 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8743 (static_offset_intervals, offset_intervals)
8744 (merge_interval_right, merge_interval_left, make_new_interval)
8745 (graft_intervals_into_buffer, temp_set_point_both)
8746 (temp_set_point, set_point, adjust_for_invis_intang)
8747 (set_point_both, move_if_not_intangible, get_property_and_range)
8748 (get_local_map, copy_intervals, copy_intervals_to_string)
8749 (compare_string_intervals, set_intervals_multibyte_1):
8750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8751 * intervals.h: Adjust decls to match defn changes elsewhere.
8752 (struct interval):
8753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8754 * keyboard.c (this_command_key_count, this_single_command_key_start)
8755 (before_command_key_count, before_command_echo_length, echo_now)
8756 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8757 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8758 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8759 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8761 (last_non_minibuf_size, last_point_position, echo_truncate)
8762 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8763 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8764 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8765 (stuff_buffered_input):
8766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8767 (last_auto_save, command_loop_1, read_char):
8768 Use EMACS_INT, not int, to avoid integer overflow.
8769 (record_char): Avoid overflow in total_keys computation.
8770 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8771 * keyboard.h: Adjust decls to match defn changes elsewhere.
8772 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8773 (Fkey_description, Fdescribe_vector, Flookup_key):
8774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8775 (click_position): New function, to check that positions are in range.
8776 (Fcurrent_active_maps):
8777 (describe_command):
8778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8779 (Faccessible_keymaps, Fkey_description):
8780 (preferred_sequence_p):
8781 Don't assume fixnum can fit into int.
8782 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8783 Check for integer overflow in size calculations.
8784 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8785 avoid mishandling large integers.
8786 * lisp.h: Adjust decls to match defn changes elsewhere.
8787 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8788 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8789 (struct Lisp_Marker):
8790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8791 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8792 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8793 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8794 All callers changed.
8795 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8796 Assume the arg has valid form, since it always does.
8797 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8798 unsigned integer system type.
8799 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8800 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8801 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8802 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8803 (duration_to_sec_usec): New decl.
8804 * lread.c (read_from_string_index, read_from_string_index_byte)
8805 (read_from_string_limit, readchar, unreadchar, openp)
8806 (read_internal_start, read1, oblookup):
8807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8808 (Fload, readevalloop, Feval_buffer, Feval_region):
8809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8810 (openp): Check for out-of-range argument to 'access'.
8811 (read1): Use int, not EMACS_INT, where int is wide enough.
8812 Don't assume fixnum fits into int.
8813 Fix off-by-one error that can read outside a buffer.
8814 (read_filtered_event): Use duration_to_sec_usec
8815 to do proper overflow checking on durations.
8816 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8817 in size calculation.
8818 (Fexecute_kbd_macro):
8819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8820 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8821 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8822 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8823 (set_marker_both, set_marker_restricted_both, marker_position)
8824 (marker_byte_position, Fbuffer_has_markers_at):
8825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8826 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8827 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8828 It now merely ensures that the menu is large enough, without
8829 necessarily growing it, as this avoids some integer overflow issues.
8830 All callers changed.
8831 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8832 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8833 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8834 Use SAFE_ALLOCA_LISP, not alloca.
8835 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8836 to EMACS_INT. Check that fixnums are in proper range for system types.
8837 * minibuf.c (minibuf_prompt_width, string_to_object)
8838 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8839 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8840 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8841 (get_minibuffer, read_minibuf_unwind):
8842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8843 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8844 this simplifies overflow checking. All callers changed.
8845 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8846 (Ftest_completion):
8847 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8848 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8849 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8850 Check that fixnums are in proper range for system types.
8851 (Fx_create_frame, Fx_show_tip):
8852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8853 * nsfont.m (ns_findfonts, nsfont_list_family):
8854 Don't assume fixnum fits in long.
8855 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8856 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8857 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8858 wide enough.
8859 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8861 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8862 (PRINTDECLARE, PRINTPREPARE):
8863 (strout, print_string):
8864 (print, print_preprocess, print_check_string_charset_prop)
8865 (print_object):
8866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8867 (PRINTDECLARE):
8868 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8870 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8871 (printchar, strout): Use xpalloc to catch size calculation overflow.
8872 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8873 (print_error_message): Use SAFE_ALLOCA, not alloca.
8874 (print_object): Use int, not EMACS_INT, where int is wide enough.
8875 (print_depth, new_backquote_output, print_number_index):
8876 Use ptrdiff_t, not int, where int might not be wide enough.
8877 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8878 (Fset_process_window_size, Fformat_network_address)
8879 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8880 (sigchld_handler):
8881 Check that fixnums are in proper range for system types.
8882 (Fsignal_process): Simplify by avoiding a goto.
8883 Check for process-ids out of pid_t range rather than relying on
8884 undefined behavior.
8885 (process_tick, update_tick): Use EMACS_INT, not int.
8886 (Fformat_network_address, read_process_output, send_process)
8887 (Fprocess_send_region, status_notify):
8888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8889 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8890 (wait_reading_process_output, read_process_output, exec_sentinel):
8891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8892 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8893 (Faccept_process_output): Use duration_to_sec_usec to do proper
8894 overflow checking on durations.
8895 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8896 Don't assume pid_t fits in int.
8897 * process.h (struct Lisp_Process): Members tick and update_tick
8898 are now of type EMACS_INT, not int.
8899 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8900 configured --with-wide-int.
8901 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8902 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8903 * search.c (looking_at_1, string_match_1):
8904 (fast_string_match, fast_c_string_match_ignore_case)
8905 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8906 (scan_newline, find_before_next_newline, search_command)
8907 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8908 (set_search_regs, wordify):
8909 (Freplace_match):
8910 (Fmatch_data):
8911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8912 (string_match_1, search_buffer, set_search_regs):
8913 (Fmatch_data):
8914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8915 (wordify): Check for overflow in size calculation.
8916 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8917 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8918 Check that fixnums are in proper range for system types.
8919 * sound.c (struct sound_device)
8920 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8922 (Fplay_sound_internal):
8923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8924 * syntax.c (struct lisp_parse_state, find_start_modiff)
8925 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8926 (Fparse_partial_sexp):
8927 Don't assume fixnums can fit in int.
8928 (struct lisp_parse_state, find_start_pos, find_start_value)
8929 (find_start_value_byte, find_start_begv)
8930 (update_syntax_table, char_quoted, dec_bytepos)
8931 (find_defun_start, prev_char_comend_first, back_comment):
8932 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8933 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8934 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8935 (Finternal_describe_syntax_value): Check that match_lisp is a
8936 character, not an integer, since the code stuffs it into int.
8937 (scan_words, scan_sexps_forward):
8938 Check that fixnums are in proper range for system types.
8939 (Fforward_word):
8940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8941 (scan_sexps_forward):
8942 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8943 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8944 * syntax.h: Adjust decls to match defn changes elsewhere.
8945 (struct gl_state_s):
8946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8947 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8948 MOST_POSITIVE_FIXNUM.
8949 * sysdep.c (wait_for_termination_1, wait_for_termination)
8950 (interruptible_wait_for_termination, mkdir):
8951 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8952 (emacs_read, emacs_write):
8953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8954 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8955 and double all fit in int.
8956 * term.c (set_tty_color_mode):
8957 Check that fixnums are in proper range for system types.
8958 * termhooks.h (struct input_event):
8959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8960 * textprop.c (validate_interval_range, interval_of)
8961 (Fadd_text_properties, set_text_properties_1)
8962 (Fremove_text_properties, Fremove_list_of_text_properties)
8963 (Ftext_property_any, Ftext_property_not_all)
8964 (copy_text_properties, text_property_list, extend_property_ranges)
8965 (verify_interval_modification):
8966 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8967 (Fnext_single_char_property_change)
8968 (Fprevious_single_char_property_change):
8969 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8970 (copy_text_properties):
8971 Check for integer overflow in index calculation.
8972 * undo.c (last_boundary_position, record_point, record_insert)
8973 (record_delete, record_marker_adjustment, record_change)
8974 (record_property_change):
8975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8976 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8977 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8978 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8979 (Fx_hide_tip, Fx_file_dialog):
8980 * w32menu.c (set_frame_menubar):
8981 Use ptrdiff_t, not int, for consistency with rest of code.
8982 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8983 (select_window, Fdelete_other_windows_internal)
8984 (window_scroll_pixel_based, window_scroll_line_based)
8985 (Frecenter, Fset_window_configuration):
8986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8987 (Fset_window_hscroll, run_window_configuration_change_hook)
8988 (set_window_buffer, temp_output_buffer_show, scroll_command)
8989 (Fscroll_other_window, Frecenter):
8990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8991 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8992 Don't assume fixnum fits in int.
8993 (Fset_window_scroll_bars):
8994 Check that fixnums are in proper range for system types.
8995 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8996 (string_pos, c_string_pos, number_of_chars, init_iterator)
8997 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8998 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8999 (compute_display_string_end, handle_face_prop)
9000 (face_before_or_after_it_pos, handle_invisible_prop)
9001 (handle_display_prop, handle_display_spec, handle_single_display_spec)
9002 (display_prop_intangible_p, string_buffer_position_lim)
9003 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9004 (get_overlay_strings_1, get_overlay_strings)
9005 (iterate_out_of_display_property, forward_to_next_line_start)
9006 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9007 (get_next_display_element, set_iterator_to_next)
9008 (get_visually_first_element, compute_stop_pos_backwards)
9009 (handle_stop_backwards, next_element_from_buffer)
9010 (move_it_in_display_line_to, move_it_in_display_line)
9011 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9012 (add_to_log, message_dolog, message_log_check_duplicate)
9013 (message2, message2_nolog, message3, message3_nolog
9014 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9015 (current_message_1, truncate_echo_area, truncate_message_1)
9016 (set_message, set_message_1, store_mode_line_noprop)
9017 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9018 (text_outside_line_unchanged_p, check_point_in_composition)
9019 (reconsider_clip_changes)
9020 (redisplay_internal, set_cursor_from_row, try_scrolling)
9021 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9022 (redisplay_window, find_last_unchanged_at_beg_row)
9023 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9024 (trailing_whitespace_p, find_row_edges, display_line)
9025 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9026 (display_mode_element, store_mode_line_string)
9027 (pint2str, pint2hrstr, decode_mode_spec)
9028 (display_count_lines, display_string, draw_glyphs)
9029 (x_produce_glyphs, x_insert_glyphs)
9030 (rows_from_pos_range, mouse_face_from_buffer_pos)
9031 (fast_find_string_pos, mouse_face_from_string_pos)
9032 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9034 (safe_call, init_from_display_pos, handle_fontified_prop)
9035 (handle_single_display_spec, load_overlay_strings)
9036 (with_echo_area_buffer, setup_echo_area_for_printing)
9037 (display_echo_area, echo_area_display)
9038 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9039 (update_tool_bar, hscroll_window_tree, redisplay_internal)
9040 (redisplay_window, dump_glyph_row, display_mode_line)
9041 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
9042 (handle_display_spec, display_prop_string_p):
9043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9044 (handle_single_display_spec, build_desired_tool_bar_string)
9045 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9046 (get_specified_cursor_type):
9047 Check that fixnums are in proper range for system types.
9048 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9049 (Flookup_image_map):
9050 Don't assume fixnums fit in int.
9051 (compare_overlay_entries):
9052 Avoid mishandling comparisons due to subtraction overflow.
9053 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9054 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9055 (handle_tool_bar_click):
9056 Use int, not unsigned, since we prefer signed and the signedness
9057 doesn't matter here.
9058 (get_next_display_element, next_element_from_display_vector):
9059 Use int, not EMACS_INT, when int is wide enough.
9060 (start_hourglass): Use duration_to_sec_usec to do proper
9061 overflow checking on durations.
9062 * xfaces.c (Fbitmap_spec_p):
9063 Check that fixnums are in proper range for system types.
9064 (compare_fonts_by_sort_order):
9065 Avoid mishandling comparisons due to subtraction overflow.
9066 (Fx_family_fonts, realize_basic_faces):
9067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9068 (Fx_family_fonts):
9069 Don't assume fixnum fits in int.
9070 Use SAFE_ALLOCA_LISP, not alloca.
9071 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9072 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9073 (face_at_buffer_position, face_for_overlay_string)
9074 (face_at_string_position):
9075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9076 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9077 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9078 (Fx_show_tip):
9079 Check that fixnums are in proper range for system types.
9080 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9081 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9083 (Fx_change_window_property): Don't assume fixnums fit in int.
9084 * xfont.c (xfont_chars_supported):
9085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9086 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9087 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9089 * xml.c (parse_region):
9090 * xrdb.c (magic_file_p):
9091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9092 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9093 (x_get_local_selection, x_reply_selection_request)
9094 (x_handle_selection_request, wait_for_property_change):
9095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9096 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9097 short is wide enough.
9098 (x_send_client_event): Don't assume fixnum fits in int.
9099 * xterm.c (x_x_to_emacs_modifiers):
9100 Don't assume EMACS_INT overflows nicely into int.
9101 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9102 may come from Lisp.
9103 (handle_one_xevent): NATNUMP can eval its arg twice.
9104 (x_connection_closed):
9105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9106 * xterm.h: Adjust decls to match defn changes elsewhere.
9107 (struct scroll_bar): Use struct vectorlike_header
9108 rather than rolling our own approximation.
9109 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9110
9111 2012-05-25 Glenn Morris <rgm@gnu.org>
9112
9113 * lisp.mk (lisp): Update for more files being compiled now.
9114
9115 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9116
9117 * lread.c: Remove `read_pure' which makes no difference.
9118 (read_pure): Remove var.
9119 (unreadpure): Remove function.
9120 (readevalloop): Don't call read_list with -1 flag.
9121 (read1, read_vector): Don't test read_pure any more.
9122 (read_list): Simplify.
9123
9124 * fileio.c, character.h: Minor style tweaks.
9125
9126 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9127
9128 * window.h (clip_changed): Remove useless declaration.
9129
9130 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9131
9132 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9133 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9134
9135 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9136
9137 Remove src/m/*.
9138 This directory predates autoconf and is no longer needed nowadays.
9139 Move its few remaining bits of functionality to where they're needed.
9140 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9141 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9142 * m/template.h: Remove.
9143 * Makefile.in (M_FILE): Remove. All uses removed.
9144 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9145 * lisp.h (USE_LSB_TAG):
9146 * mem-limits.h (EXCEEDS_LISP_PTR):
9147 Use VAL_MAX, not VALBITS, in #if.
9148 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9149 (EMACS_UINT): Define unconditionally now.
9150 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9151 (BITS_PER_EMACS_INT): New constants, replacing
9152 what used to be in config.h, but not useful in #if.
9153 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9154 define them any more.
9155 (VAL_MAX): New macro.
9156 (VALMASK): Use it.
9157 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9158 BITS_PER_EMACS_INT, in #if.
9159 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9160 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9161 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9162 * s/ms-w32.h (DATA_START):
9163 Move here from removed file m/intel386.h.
9164 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9165 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9166
9167 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9168
9169 Assume C89 or later.
9170 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9171 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9172 (xrealloc):
9173 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9174 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9175 * textprop.c, tparam.c (NULL): Remove.
9176 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9177 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9178 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9179 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9180 * xterm.c (input_signal_count): Assume volatile works.
9181
9182 2012-05-21 Ken Brown <kbrown@cornell.edu>
9183
9184 * xgselect.c (xg_select): Fix first argument in call to 'select'
9185 (bug#11508).
9186
9187 2012-05-20 Ken Brown <kbrown@cornell.edu>
9188
9189 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9190 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9191
9192 2012-05-19 Ken Brown <kbrown@cornell.edu>
9193
9194 * xfns.c (x_in_use): Remove `static' qualifier.
9195 * xterm.h (x_in_use): Declare.
9196 * xgselect.c: Include xterm.h.
9197 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9198 and `display_arg' (bug#9754).
9199
9200 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9201
9202 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9203
9204 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9205 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9206
9207 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9208
9209 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9210
9211 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9212 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9213
9214 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9215 reference to image_cache->refcount.
9216 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9217
9218 2012-05-17 Juri Linkov <juri@jurta.org>
9219
9220 * search.c (Fword_search_regexp, Fword_search_backward)
9221 (Fword_search_forward, Fword_search_backward_lax)
9222 (Fword_search_forward_lax): Move functions to isearch.el
9223 (bug#10145, bug#11381).
9224
9225 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9226
9227 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9228
9229 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9230
9231 * lread.c (init_obarray): Declare Qt and Qnil as special.
9232
9233 2012-05-14 Glenn Morris <rgm@gnu.org>
9234
9235 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9236 Put "libexec" before "bin", for the sake of init_callproc_1.
9237
9238 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9239
9240 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9241
9242 * unexaix.c: Port to more-recent AIX compilers.
9243 (report_error, report_error_1, make_hdr, copy_sym)
9244 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9245 Make arguments const char *, not char *, to avoid violations of C
9246 standard and to fix some AIX warnings reported by Gilles Pion.
9247
9248 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9249
9250 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9251 already have overlays loaded.
9252 (handle_single_display_spec): Before returning without displaying
9253 fringe bitmap, synchronize the bidi iterator with the main display
9254 iterator, by calling iterate_out_of_display_property.
9255 (iterate_out_of_display_property): Detect buffer iteration by
9256 testing that it->string is a Lisp string.
9257 (get_next_display_element): When the current object is exhausted,
9258 and there's something on it->stack, call set_iterator_to_next to
9259 proceed with what's on the stack, instead of returning zero.
9260 (set_iterator_to_next): If called at the end of a Lisp string,
9261 proceed to consider_string_end without incrementing string
9262 position. Don't increment display vector index past the end of
9263 the display vector. (Bug#11417)
9264 (pos_visible_p): Don't report a position visible when move_it_to
9265 stopped at the last line of window, which happens to be scanned
9266 backwards by the bidi iteration. (Bug#11464)
9267
9268 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9269
9270 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9271 and right-margin display specs even if the spec is invalid or we
9272 are on a TTY, and thus unable to display on the fringes.
9273 That's because the text with the property will not be displayed anyway,
9274 so we need to signal to the caller that this is a "replacing"
9275 display spec. This fixes display when the spec is invalid or we
9276 are on a TTY.
9277
9278 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9279
9280 * unexaix.c (make_hdr): Fix typo in prototype.
9281 This bug broke the build on AIX. Problem reported by Gilles Pion.
9282
9283 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9284
9285 * keyboard.c (kbd_buffer_get_event): Read special events also in
9286 batch mode. (Bug#11415)
9287
9288 2012-05-12 Glenn Morris <rgm@gnu.org>
9289
9290 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9291
9292 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9293
9294 * lisp.mk (lisp): Add newcomment.elc.
9295
9296 2012-05-12 Glenn Morris <rgm@gnu.org>
9297
9298 * Makefile.in (MKDIR_P): New, set by configure.
9299 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9300
9301 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9302
9303 Remove unused function hourglass_started.
9304 * dispextern.h (hourglass_started):
9305 * w32fns.c (hourglass_started):
9306 * xdisp.c (hourglass_started): Remove.
9307
9308 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9309
9310 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9311 Update dependencies.
9312
9313 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 * xgselect.c (xg_select): Put maxfds+1 into a var.
9316 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9317
9318 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9319
9320 2012-05-10 Dave Abrahams <dave@boostpro.com>
9321
9322 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9323 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9324
9325 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9326
9327 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9328 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9329 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9330 Initialize xd_registered_buses.
9331
9332 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9333
9334 Untag more efficiently if USE_LSB_TAG.
9335 This is based on a proposal by YAMAMOTO Mitsuharu in
9336 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9337 For an admittedly artificial (nth 8000 longlist) benchmark on
9338 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9339 Emacs's overall text size by 1%.
9340 * lisp.h (XUNTAG): New macro.
9341 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9342 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9343 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9344 * eval.c (Fautoload):
9345 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9346 * frame.h (XFRAME): Use XUNTAG.
9347
9348 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9349 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9350 Remove unportable assumptions about print widths of types like
9351 dbus_uint32_t.
9352 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9353 intptr_t when converting between pointer and integer, to avoid GCC
9354 warnings about wrong width.
9355
9356 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9357
9358 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9359 stack for each reader_thread, instead of defaulting to 8MB
9360 determined by the linker. This avoids failures in creating
9361 subprocesses on Windows 7, see the discussion in this thread:
9362 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9363
9364 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9365
9366 Fix up display of the *Minibuf-0* buffer in the mini window.
9367 * keyboard.c (read_char): Don't clear the echo area if there's no
9368 message to clear.
9369 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9370 contents of *Minibuf-0*) if there's no message displayed in its stead.
9371
9372 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9373
9374 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9375 batch mode.
9376
9377 2012-05-06 Chong Yidong <cyd@gnu.org>
9378
9379 * lisp.mk (lisp): Update.
9380
9381 2012-05-05 Jim Meyering <meyering@redhat.com>
9382
9383 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9384
9385 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9386
9387 * data.c (PUT_ERROR): New macro.
9388 (syms_of_data): Use it. Add new error type `user-error'.
9389 * undo.c (user_error): New function.
9390 (Fprimitive_undo): Use it.
9391 * print.c (print_error_message): Adjust print style for `user-error'.
9392 * keyboard.c (user_error): New function.
9393 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9394
9395 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9396
9397 Do not limit current-time-string to years 1000..9999.
9398 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9399 (Fcurrent_time_string): Support any year that is supported by the
9400 underlying localtime representation. Don't use asctime, as it
9401 has undefined behavior for years outside the range -999..9999.
9402
9403 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9404
9405 Fix race conditions involving setenv, gmtime, localtime, asctime.
9406 Without this fix, interrupts could mess up code that uses these
9407 nonreentrant functions, since setting TZ invalidates existing
9408 tm_zone or tzname values, and since most of these functions return
9409 pointers to static storage.
9410 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9411 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9412 Grow the critical sections to include not just invoking
9413 localtime/gmtime, but also accessing these functions' results
9414 including their tm_zone values if any, and any related TZ setting.
9415 (format_time_string): Last arg is now struct tm *, not struct tm **,
9416 so that the struct tm is saved in the critical section.
9417 All callers changed. Simplify allocation of initial buffer, partly
9418 motivated by the fact that memory allocation needs to be outside
9419 the critical section.
9420
9421 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9422
9423 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9424 with RESET_INTERVAL.
9425
9426 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9427 Remove duplicated buffer name initialization.
9428
9429 2012-05-02 Jim Meyering <jim@meyering.net>
9430
9431 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9432
9433 * xfns.c (x_window): Use xstrdup (Bug#11375).
9434
9435 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9436
9437 * xdisp.c (pos_visible_p): If already at a newline from the
9438 display string before the 'while' loop, don't walk back the glyphs
9439 from it3.glyph_row. Solves assertion violation when the display
9440 string begins with a newline (egg.el). (Bug#11367)
9441
9442 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9443
9444 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9445 Move to simple.el.
9446
9447 2012-05-01 Glenn Morris <rgm@gnu.org>
9448
9449 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9450 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9451 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9452 All were removed before 23.1.
9453
9454 * dispnew.c: Remove HAVE_LIBNCURSES test;
9455 it is always true on relevant platforms.
9456
9457 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9458 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9459
9460 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9461
9462 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9463
9464 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9465 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9466 Remove.
9467
9468 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9469
9470 Do not avoid creating empty evaporating overlays (Bug#9642).
9471 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9472 That is, do not delete an evaporating overlay if it becomes
9473 empty after its bounds are adjusted to fit within its buffer.
9474 This fix caused other problems, and I'm reverting it until we get
9475 to the bottom of them.
9476
9477 2012-04-27 Chong Yidong <cyd@gnu.org>
9478
9479 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9480
9481 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9482
9483 * xdisp.c (pos_visible_p): If the window start position is beyond
9484 ZV, start the display from buffer beginning. Prevents assertion
9485 violation in init_iterator when the minibuffer window is scrolled
9486 via the scroll bar.
9487
9488 * window.c (window_scroll_pixel_based): Likewise.
9489
9490 2012-04-27 Chong Yidong <cyd@gnu.org>
9491
9492 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9493
9494 2012-04-27 Glenn Morris <rgm@gnu.org>
9495
9496 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9497 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9498
9499 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9500
9501 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9502 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9503
9504 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9505
9506 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9507 display element, check also the underlying string or buffer
9508 character. (Bug#11341)
9509
9510 * w32menu.c: Include w32heap.h.
9511 (add_menu_item): If the call to AppendMenuW (via
9512 unicode_append_menu) fails, disable Unicode menus only if we are
9513 running on Windows 9X/Me.
9514
9515 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9516
9517 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9518 (xgetint): Add missing shift for LSB tags.
9519
9520 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9521
9522 * keyboard.c (read_char): Don't wipe echo area for select window
9523 events: These might get delayed via `mouse-autoselect-window'
9524 (Bug#11304).
9525
9526 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9527
9528 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9529 manipulation of :loaded-from data.
9530
9531 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9532
9533 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9534 now a cons (bug#11311).
9535
9536 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9537
9538 Do not create empty overlays with the evaporate property (Bug#9642).
9539 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9540 if it becomes empty after its bounds are adjusted to fit within
9541 its buffer. Without this fix, in a nonempty buffer (let ((o
9542 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9543 yields an empty overlay that has the evaporate property, which is
9544 not supposed to happen.
9545
9546 Fix minor GTK3 problems found by static checking.
9547 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9548 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9549 (struct _EmacsFixedClass, emacs_fixed_get_type):
9550 Move decls here from emacsgtkfixed.h, since they needn't be public.
9551 (emacs_fixed_get_type): Now static.
9552 (emacs_fixed_class_init): Omit unused local.
9553 (emacs_fixed_child_type): Remove; unused.
9554 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9555 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9556 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9557 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9558 (EMACS_FIXED_GET_CLASS): Remove; unused.
9559 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9560
9561 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9562 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9563
9564 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9565
9566 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9567 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9568 (__malloc_size_t, __malloc_ptrdiff_t):
9569 Remove. All uses removed, replaced by the definiens if needed,
9570 since we can assume C89 or better now.
9571 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9572 (protect_malloc_state, align, get_contiguous_space)
9573 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9574 (malloc_atfork_handler_child, malloc_enable_thread)
9575 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9576 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9577 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9578 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9579 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9580 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9581 Define using prototypes, not old style.
9582 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9583 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9584 (align): Don't assume that signed integer overflow wraps around.
9585 Omit unused local var.
9586 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9587 (_free_internal_nolock, memalign, mallochook, reallochook):
9588 Omit no-longer-needed casts.
9589 (valloc): Use getpagesize, not __getpagesize.
9590 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9591 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9592
9593 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9594
9595 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9596
9597 Move functions from C to Lisp. Make non-blocking method calls
9598 the default. Implement further D-Bus standard interfaces.
9599
9600 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9601 (QCdbus_request_name_allow_replacement)
9602 (QCdbus_request_name_replace_existing)
9603 (QCdbus_request_name_do_not_queue)
9604 (QCdbus_request_name_reply_primary_owner)
9605 (QCdbus_request_name_reply_in_queue)
9606 (QCdbus_request_name_reply_exists)
9607 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9608 (QCdbus_registered_serial, QCdbus_registered_method)
9609 (QCdbus_registered_signal): New Lisp objects.
9610 (XD_DEBUG_MESSAGE): Use sizeof.
9611 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9612 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9613 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9614 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9615 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9616 (xd_signature, xd_append_arg): Allow float for integer types.
9617 (xd_get_connection_references): New function.
9618 (xd_get_connection_address): Rename from xd_initialize.
9619 Return cached address.
9620 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9621 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9622 level.
9623 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9624 Return number of refcounts.
9625 (Fdbus_get_unique_name): Make stronger parameter check.
9626 (Fdbus_message_internal): New defun.
9627 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9628 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9629 (Fdbus_send_signal, Fdbus_register_service)
9630 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9631 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9632 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9633 (Vdbus_compiled_version, Vdbus_runtime_version)
9634 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9635 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9636 (Vdbus_message_type_signal): New defvars.
9637 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9638 Adapt docstring.
9639
9640 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9641
9642 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9643 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9644 Do not assume ptrdiff_t is the same width as 'int'.
9645
9646 * alloc.c: Handle unusual debugging option combinations.
9647 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9648 since the two debugging options are incompatible.
9649 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9650 is defined.
9651 (mem_init, mem_insert, mem_insert_fixup):
9652 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9653 (NEED_MEM_INSERT): Remove; no longer needed.
9654
9655 2012-04-22 Leo Liu <sdl.web@gmail.com>
9656
9657 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9658
9659 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 * sysdep.c [__FreeBSD__]: Minor cleanups.
9662 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9663 Use Emacs indenting style more consistently. Avoid some casts.
9664 Use 'double' consistently rather than mixing 'float' and 'double'.
9665
9666 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9667
9668 * sysdep.c (list_system_processes, system_process_attributes):
9669 Add implementation for FreeBSD (Bug#5243).
9670
9671 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9672
9673 * lisp.mk (lisp): Update.
9674
9675 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9676
9677 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9678 It is never used otherwise.
9679
9680 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9681
9682 * print.c (print_preprocess): Only check print_depth if print-circle
9683 is nil.
9684 (print_object): Check for cycles even when print-circle is nil and
9685 print-gensym is t, but only check print_depth if print-circle is nil.
9686
9687 2012-04-20 Chong Yidong <cyd@gnu.org>
9688
9689 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9690 set the status to "failed" and ensure that sentinel is run.
9691
9692 2012-04-20 Glenn Morris <rgm@gnu.org>
9693
9694 * process.c (Fset_process_inherit_coding_system_flag)
9695 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9696 (Fmake_network_process, Fmake_serial_process): Doc fix.
9697
9698 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9699
9700 * xdisp.c (string_buffer_position_lim): Limit starting position to
9701 BEGV.
9702 (set_cursor_from_row): If called for a mode-line or header-line
9703 row, return zero immediately.
9704 (try_cursor_movement): If inside continuation line, don't back up
9705 farther than the first row after the header line, if any.
9706 Don't consider the header-line row as "partially visible", even if
9707 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9708
9709 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9710
9711 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9712 (bug#11238).
9713
9714 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9715 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9716
9717 configure: new option --enable-gcc-warnings (Bug#11207)
9718 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9719 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9720 (ALL_CFLAGS): Use new macros rather than old.
9721 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9722 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9723 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9724 -Wunused-result, -Wunused-variable. This should go away once
9725 the Emacs and Gnulib regex code is merged.
9726 (xmalloc, xrealloc): Now static.
9727
9728 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9729
9730 * dired.c (Fsystem_groups): Remove unused local.
9731
9732 2012-04-17 Glenn Morris <rgm@gnu.org>
9733
9734 * dired.c (Fsystem_users): Doc fix.
9735
9736 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9739 (syms_of_dired): Add them.
9740
9741 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9742
9743 Fix minor alloc.c problems found by static checking.
9744 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9745 New extern decls, to avoid calling undeclared functions.
9746 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9747 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9748 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9749 (NEED_MEM_INSERT): New macro.
9750 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9751 Remove one incorrect comment and fix another.
9752
9753 Fix minor ralloc.c problems found by static checking.
9754 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9755 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9756 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9757 (r_alloc_sbrk): Now static.
9758
9759 Improve ralloc.c interface checking.
9760 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9761 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9762 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9763 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9764 [REL_ALLOC]: ... to here, to check interface.
9765 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9766 Remove decls. This fixes an "It stinks!".
9767
9768 * alloc.c (which_symbols): Fix alignment issue / type clash.
9769
9770 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9771
9772 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9773 (struct Lisp_Misc_Any): Likewise.
9774 (struct Lisp_Free): Likewise.
9775 * alloc.c (union aligned_Lisp_Symbol): Define.
9776 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9777 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9778 (union aligned_Lisp_Misc): Define.
9779 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9780 aligned_Lisp_Misc instead of union Lisp_Misc.
9781 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9782
9783 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9784
9785 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9786 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9787 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9788 * s/netbsd.h, s/sol2-6.h:
9789 Remove definition of GC_MARK_STACK, since the default now works.
9790 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9791 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9792 no longer the default.
9793 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9794
9795 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9796
9797 * lread.c (lisp_file_lexically_bound_p):
9798 Fix hang at ";-*-\n" (bug#11238).
9799
9800 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9801
9802 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9803 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9804
9805 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9806
9807 * nsterm.m (constrainFrameRect): Always constrain when there is only
9808 one screen (Bug#10962).
9809
9810 2012-04-13 Ken Brown <kbrown@cornell.edu>
9811
9812 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9813
9814 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9815
9816 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9817
9818 2012-04-11 Daniel Colascione <dancol@dancol.org>
9819
9820 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9821 against is gone. It's better to use vfork now so that when Cygwin
9822 gains a new, working vfork, we use it automatically (bug#10398).
9823
9824 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9825
9826 * window.c (save_window_save): Obey window-point-insertion-type.
9827
9828 2012-04-11 Glenn Morris <rgm@gnu.org>
9829
9830 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9831
9832 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9833
9834 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9835
9836 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9837
9838 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9839 (force_quit_count): New var.
9840 (handle_interrupt): Use it.
9841
9842 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9843
9844 * w32.c (w32_delayed_load): Record the full path of the library
9845 being loaded (bug#10424).
9846
9847 2012-04-09 Glenn Morris <rgm@gnu.org>
9848
9849 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9850 not just in the obarray, before snarfing them. (Bug#11036)
9851
9852 * Makefile.in ($(leimdir)/leim-list.el):
9853 Pass EMACS rather than BUILT_EMACS.
9854
9855 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9856
9857 * process.c (make_process):
9858 * process.h: Add integer `gnutls_handshakes_tried' member to
9859 process struct.
9860
9861 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9862 Add convenience `GNUTLS_LOG2i' macro.
9863
9864 * gnutls.c (gnutls_log_function2i): Convenience log function.
9865 (emacs_gnutls_read): Use new log functions,
9866 `gnutls_handshakes_tried' process member, and
9867 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9868 attempts per process (connection).
9869
9870 2012-04-09 Chong Yidong <cyd@gnu.org>
9871
9872 * eval.c (Fuser_variable_p, user_variable_p_eh)
9873 (lisp_indirect_variable): Functions deleted.
9874 (Fdefvar): Caller changed.
9875
9876 * callint.c (Finteractive, Fcall_interactively):
9877 * minibuf.c (Fread_variable): Callers changed.
9878
9879 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9880
9881 * xdisp.c (set_cursor_from_row): If the display string appears in
9882 the buffer at position that is closer to point than the position
9883 after the display string, display the cursor on the first glyph of
9884 the display string. Fixes cursor display when a 'display' text
9885 property immediately follows invisible text. (Bug#11094)
9886
9887 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9888
9889 composite.c: use 'double' consistently
9890 * composite.c (get_composition_id): Use 'double' consistently
9891 instead of converting 'float' to 'double' and vice versa; this is
9892 easier to understand and avoids a GCC warning.
9893
9894 2012-04-09 Glenn Morris <rgm@gnu.org>
9895
9896 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9897 preparation for dumping it with emacs. (Bug#4789)
9898 (leimdir): New variable.
9899 ($(leimdir)/leim-list.el): New rule.
9900 (emacs$(EXEEXT)): Depend on leim-list.el.
9901
9902 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9903 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9904 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9905
9906 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9907
9908 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9909 proper alignment.
9910
9911 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9912
9913 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9914 Remove unused local variable.
9915
9916 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9917
9918 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9919 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9920 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9921 objects, as mark_maybe_pointer will catch them otherwise.
9922 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9923 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9924
9925 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9926
9927 Fix typo that broke non-Windows builds.
9928 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9929
9930 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9931
9932 Support building on MS-Windows with libxml2.
9933
9934 * makefile.w32-in (OBJ2): Add xml.$(O).
9935 (GLOBAL_SOURCES): Add xml.c.
9936 ($(BLD)/xml.$(O)): New dependency list.
9937
9938 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9939 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9940 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9941 [!WINDOWSNT]: New macros.
9942 (init_libxml2_functions, libxml2_loaded_p): New functions.
9943 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9944 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9945 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9946 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9947 linked in).
9948 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9949 Call init_libxml2_functions before calling libxml2 functions.
9950 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9951
9952 * emacs.c: Don't include libxml/parser.h.
9953 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9954 xmlCleanupParser directly.
9955
9956 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9957
9958 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9959
9960 * indent.c (Fvertical_motion): If there is a display string at
9961 point, use it.vpos to compute how many lines to backtrack after
9962 move_it_to point. (Bug#11133)
9963
9964 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9965
9966 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9967 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9968 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9969 macros related to unification of CJK characters. For the details,
9970 see the discussion following the message here:
9971 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9972
9973 2012-04-04 Chong Yidong <cyd@gnu.org>
9974
9975 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9976
9977 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9978
9979 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9980 instead of alloca. (Bug#11138)
9981
9982 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9983
9984 * w32menu.c (is_simple_dialog): Properly check lisp types.
9985 (Bug#11141)
9986
9987 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9988
9989 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9990 position we get to after a call to move_it_to fails the
9991 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9992 only if we wind up in a string from display property. (Bug#11063)
9993
9994 * window.c (Fdelete_other_windows_internal): Invalidate the row
9995 and column information about mouse highlight, so that redisplay
9996 restores it after reallocating the glyph matrices. (Bug#7464)
9997
9998 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9999 string comes from a `display' text property, use the buffer
10000 position of that property as if we actually saw that position in
10001 the row's glyphs.
10002 (move_it_by_lines): Remove the assertion that
10003 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10004 violated when there's a before-string at the beginning of a line.
10005 (Bug#11063)
10006
10007 2012-03-30 Eli Zaretskii <eliz@gnu.org>
10008
10009 * xdisp.c (append_space_for_newline): If the default face was
10010 remapped, use the remapped face for the appended newline.
10011 (extend_face_to_end_of_line): Use the remapped default face for
10012 extending the face to the end of the line.
10013 (display_line): Call extend_face_to_end_of_line when the default
10014 face was remapped. (Bug#11068)
10015
10016 2012-03-29 Eli Zaretskii <eliz@gnu.org>
10017
10018 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10019
10020 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10021
10022 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10023
10024 2012-03-27 Glenn Morris <rgm@gnu.org>
10025
10026 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10027 Doc fixes.
10028
10029 2012-03-26 Kenichi Handa <handa@m17n.org>
10030
10031 * dispextern.h (struct glyph): Fix previous change. Change the
10032 bit length of glyphless.ch to 25 (Bug#11082).
10033
10034 2012-03-26 Chong Yidong <cyd@gnu.org>
10035
10036 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10037 (command_loop_1): Use it; inhibit selection update for
10038 handle-select-window too (Bug#8996).
10039
10040 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10041
10042 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10043
10044 2012-03-25 Kenichi Handa <handa@m17n.org>
10045
10046 * dispextern.h (struct glyph): Change the bit length of
10047 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10048
10049 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10050
10051 * s/ms-w32.h (tzname): Include time.h before redirecting to
10052 _tzname. Fixes the MSVC build. (Bug#9960)
10053
10054 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10055
10056 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10057 characters.
10058
10059 * xterm.c (XTread_socket): Only modify handling_signal if
10060 !SYNC_INPUT. (Bug#11080)
10061
10062 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10063
10064 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10065 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10066 when fetching a multibyte character consumes more bytes than
10067 CHAR_BYTES returns, due to unification of CJK characters in
10068 string_char. (Bug#11073)
10069
10070 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10071
10072 * process.c (wait_reading_process_output): Handle pty disconnect
10073 by refraining from sending oneself a SIGCHLD (bug#10933).
10074
10075 2012-03-22 Chong Yidong <cyd@gnu.org>
10076
10077 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10078
10079 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10080 Mark string as coming from a prefix property.
10081 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10082 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10083
10084 2012-03-21 Chong Yidong <cyd@gnu.org>
10085
10086 * xfaces.c (Vface_remapping_alist): Doc fix.
10087
10088 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10089
10090 * w32proc.c (Fw32_set_console_codepage)
10091 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10092 Doc fixes.
10093
10094 2012-03-20 Chong Yidong <cyd@gnu.org>
10095
10096 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10097 to reflect default non-nil value of redisplay-dont-pause.
10098
10099 2012-03-19 Kenichi Handa <handa@m17n.org>
10100
10101 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10102 it fit in a valid range (Bug#11003).
10103
10104 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10105
10106 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10107 that is not from display property, accept the row as a "cursor
10108 row" if one of the string's character has a non-nil `cursor'
10109 property. Fixes cursor positioning when there are newlines in
10110 overlay strings, e.g. in icomplete.el. (Bug#11035)
10111
10112 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10113
10114 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10115
10116 2012-03-12 Chong Yidong <cyd@gnu.org>
10117
10118 * eval.c (inhibit_lisp_code): Rename from
10119 inhibit_window_configuration_change_hook; move from window.c.
10120
10121 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10122 * window.c (run_window_configuration_change_hook)
10123 (syms_of_window): Callers changed.
10124
10125 2012-03-11 Chong Yidong <cyd@gnu.org>
10126
10127 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10128
10129 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10130
10131 2012-03-10 Chong Yidong <cyd@gnu.org>
10132
10133 * frame.c (other_visible_frames): Don't assume the selected frame
10134 is visible (Bug#10955).
10135
10136 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10137
10138 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10139
10140 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10141
10142 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10143 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10144 zero (Bug#10954).
10145
10146 2012-03-03 Glenn Morris <rgm@gnu.org>
10147
10148 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10149
10150 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10151
10152 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10153 position past the first glyph_row that ends at ZV. (Bug#10902)
10154 (redisplay_window, next_element_from_string): Fix typos in
10155 comments.
10156 (redisplay_window): Pass to move_it_vertically the margin in
10157 pixels, not in screen lines.
10158
10159 2012-03-02 Glenn Morris <rgm@gnu.org>
10160
10161 * buffer.c (buffer-list-update-hook): Doc fix.
10162
10163 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10164
10165 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10166 push_it before setting up the iterator for the first overlay
10167 string, even if we have an empty string loaded.
10168 (next_overlay_string): If there's an empty string on the iterator
10169 stack, pop the stack. (Bug#10903)
10170
10171 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10174 Suggested by Stefan Monnier in
10175 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10176 * alloc.c (widen_to_Lisp_Object): New static function.
10177 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10178 and widening them to Lisp_Objects. This would work even if
10179 USE_LSB_TAG is defined and wide integers are used, which might
10180 happen in a future version of Emacs.
10181
10182 2012-02-25 Chong Yidong <cyd@gnu.org>
10183
10184 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10185 Doc fix.
10186
10187 * xselect.c (Fx_selection_exists_p): Doc fix.
10188 (x_clipboard_manager_save_all): Print an informative message
10189 before saving to clipboard manager.
10190
10191 2012-02-24 Chong Yidong <cyd@gnu.org>
10192
10193 * keyboard.c (process_special_events): Handle all X selection
10194 requests in kbd_buffer, not just the next one (Bug#8869).
10195
10196 2012-02-23 Chong Yidong <cyd@gnu.org>
10197
10198 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10199 call when setting menu-bar-lines and tool-bar-lines parameters.
10200 (unwind_create_frame_1): New helper function.
10201
10202 * window.c (inhibit_window_configuration_change_hook): New var.
10203 (run_window_configuration_change_hook): Obey it.
10204 (syms_of_window): Initialize it.
10205
10206 2012-02-22 Chong Yidong <cyd@gnu.org>
10207
10208 * xterm.c (x_draw_image_relief): Add missing type check for
10209 Vtool_bar_button_margin (Bug#10743).
10210
10211 2012-02-21 Chong Yidong <cyd@gnu.org>
10212
10213 * fileio.c (Vfile_name_handler_alist): Doc fix.
10214
10215 * buffer.c (Fget_file_buffer): Protect against invalid file
10216 handler return value.
10217
10218 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10221 when computing $valmask.
10222
10223 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10224 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10225 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10226 It's useless in that case, and it can cause problems on hosts
10227 that allocate halves of EMACS_INT values separately.
10228 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10229 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10230 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10231 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10232 it avoids undefined behavior on hosts where shifting right by more
10233 than the word width has undefined behavior.
10234
10235 2012-02-19 Chong Yidong <cyd@gnu.org>
10236
10237 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10238 (Funhandled_file_name_directory, Ffile_name_as_directory)
10239 (Fdirectory_file_name, Fexpand_file_name)
10240 (Fsubstitute_in_file_name): Protect against invalid file handler
10241 return values (Bug#10845).
10242
10243 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10244
10245 * .gdbinit (pitx): Fix incorrect references to fields of the
10246 iterator stack.
10247
10248 2012-02-17 Chong Yidong <cyd@gnu.org>
10249
10250 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10251
10252 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10253
10254 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10255 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10256
10257 2012-02-15 Chong Yidong <cyd@gnu.org>
10258
10259 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10260 marked as special. Also, starting docstrings with * is obsolete.
10261
10262 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10263
10264 * gnutls.c (emacs_gnutls_write): Fix last change.
10265
10266 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10267
10268 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10269 send_process.
10270
10271 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10272
10273 * keymap.c (Fsingle_key_description): Handle char ranges.
10274
10275 2012-02-12 Chong Yidong <cyd@gnu.org>
10276
10277 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10278 as that creates a dangerous corner case.
10279
10280 * window.c (Fdelete_window_internal): Invalidate the mouse
10281 highlight (Bug#9904).
10282
10283 2012-02-12 Glenn Morris <rgm@gnu.org>
10284
10285 * xselect.c (Fx_own_selection_internal)
10286 (Fx_get_selection_internal, Fx_disown_selection_internal)
10287 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10288 * nsselect.m (Fx_own_selection_internal)
10289 (Fx_disown_selection_internal, Fx_selection_exists_p)
10290 (Fx_selection_owner_p, Fx_get_selection_internal):
10291 Sync docs and argument specs with the xselect.c versions.
10292
10293 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10294
10295 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10296
10297 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10298
10299 * w32select.c (Fx_selection_exists_p): Sync doc string and
10300 argument list with xselect.c. (Bug#10783)
10301
10302 * w16select.c (Fx_selection_exists_p): Sync doc string and
10303 argument list with xselect.c. (Bug#10783)
10304
10305 2012-02-10 Glenn Morris <rgm@gnu.org>
10306
10307 * fns.c (Fsecure_hash): Doc fix.
10308
10309 2012-02-09 Kenichi Handa <handa@m17n.org>
10310
10311 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10312
10313 2012-02-07 Chong Yidong <cyd@gnu.org>
10314
10315 * buffer.c (Fbuffer_local_variables)
10316 (buffer_lisp_local_variables): Handle unbound vars correctly;
10317 don't let Qunbound leak into Lisp.
10318
10319 2012-02-07 Glenn Morris <rgm@gnu.org>
10320
10321 * image.c (Fimagemagick_types): Doc fix.
10322
10323 * image.c (imagemagick-render-type): Change it from a lisp object
10324 to an integer. Move the doc here from the lisp manual.
10325 Treat all values not equal to 0 the same.
10326
10327 2012-02-06 Chong Yidong <cyd@gnu.org>
10328
10329 * doc.c (store_function_docstring): Avoid applying docstring of
10330 alias to base function (Bug#2603).
10331
10332 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10333
10334 * .gdbinit (pp1, pv1): Remove redundant defines.
10335 (pr): Use pp.
10336
10337 2012-02-04 Chong Yidong <cyd@gnu.org>
10338
10339 * nsterm.m: Declare a global (Bug#10694).
10340
10341 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10342
10343 * w32.c (get_emacs_configuration_options):
10344 Include --enable-checking, if specified, in the return value.
10345
10346 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10347
10348 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10349 after rounding frame sizes. (Bug#9723)
10350
10351 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10352
10353 * keyboard.c (adjust_point_for_property): Don't position point
10354 before BEGV. (Bug#10696)
10355
10356 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 Handle overflow when computing char display width (Bug#9496).
10359 * character.c (char_width): Return EMACS_INT, not int.
10360 (char_width, c_string_width): Check for overflow when
10361 computing the width; this is possible now that individual
10362 characters can have unbounded width. Problem introduced
10363 by merge from Emacs 23 on 2012-01-19.
10364
10365 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10366
10367 * dbusbind.c (Fdbus_register_method): Mention the return value
10368 :ignore in the docstring.
10369
10370 2012-02-02 Glenn Morris <rgm@gnu.org>
10371
10372 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10373
10374 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10375 Unconditionally set to t. (Bug#10673)
10376 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10377 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10378 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10379
10380 2012-02-02 Kenichi Handa <handa@m17n.org>
10381
10382 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10383 0, do not call append_composite_glyph.
10384
10385 2012-02-02 Kenichi Handa <handa@m17n.org>
10386
10387 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10388 NULL (Bug#6988).
10389 (x_produce_glyphs): If the component of a composition is a null
10390 string, set it->pixel_width to 1 to avoid zero-width glyph.
10391
10392 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10393
10394 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10395 first 2 arguments are identical. This makes inserting large
10396 output from a subprocess an order of magnitude faster on
10397 MS-Windows, where all sbrk'ed memory is always contiguous.
10398
10399 2012-01-31 Glenn Morris <rgm@gnu.org>
10400
10401 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10402 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10403 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10404
10405 2012-01-29 Glenn Morris <rgm@gnu.org>
10406
10407 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10408
10409 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10410
10411 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10412
10413 2012-01-28 Chong Yidong <cyd@gnu.org>
10414
10415 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10416
10417 2012-01-26 Chong Yidong <cyd@gnu.org>
10418
10419 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10420
10421 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10422 repeat counts (Bug#10507).
10423
10424 2012-01-26 Glenn Morris <rgm@gnu.org>
10425
10426 * lread.c (syms_of_lread): Doc fix.
10427
10428 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10429
10430 * coding.c (encode_designation_at_bol): Change return value to
10431 EMACS_INT.
10432
10433 2012-01-25 Chong Yidong <cyd@gnu.org>
10434
10435 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10436
10437 2012-01-21 Chong Yidong <cyd@gnu.org>
10438
10439 * floatfns.c (Fcopysign): Make the second argument non-optional,
10440 since nil is not allowed anyway.
10441
10442 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10443
10444 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10445 (send_process): Likewise.
10446
10447 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10448
10449 * window.c (save_window_save, Fcurrent_window_configuration)
10450 (Vwindow_persistent_parameters): Do not use Qstate.
10451 Rewrite doc-strings.
10452
10453 2012-01-19 Kenichi Handa <handa@m17n.org>
10454
10455 * character.c (char_width): New function.
10456 (Fchar_width, c_string_width, lisp_string_width):
10457 Use char_width (Bug#9496).
10458
10459 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10460
10461 * window.c (Vwindow_persistent_parameters): New variable.
10462 (Fset_window_configuration, save_window_save): Handle persistent
10463 window parameters.
10464
10465 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10466
10467 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10468 thrashing the stack of the thread. (Bug#9087)
10469
10470 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10471
10472 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10473
10474 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10475
10476 * xdisp.c (rows_from_pos_range): Handle the case where the
10477 highlight ends on a newline. (Bug#10464)
10478 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10479 he end column for display of highlight that ends on a newline
10480 before a R2L line.
10481
10482 2012-01-11 Glenn Morris <rgm@gnu.org>
10483
10484 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10485 from load-path also when installation-directory is nil. (Bug#10208)
10486
10487 2012-01-10 Glenn Morris <rgm@gnu.org>
10488
10489 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10490
10491 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10492 Update template values to be closer to their typical values these days.
10493
10494 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10495
10496 * xdisp.c (rows_from_pos_range): Accept additional argument
10497 DISP_STRING, and accept any glyph in a row whose object is that
10498 string as eligible for mouse highlight. Fixes mouse highlight of
10499 display strings from overlays. (Bug#10464)
10500
10501 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10502
10503 emacs: fix an auto-save permissions race condition (Bug#10400)
10504 * fileio.c (auto_saving_dir_umask): New static var.
10505 (Fmake_directory_internal): Use it.
10506 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10507 creating the directory. The old code temporarily assigns
10508 too-generous permissions to the directory.
10509 (do_auto_save_eh): Clear it.
10510 (Fdo_auto_save): Catch all errors, not just file errors, so
10511 that the var is always cleared.
10512
10513 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10514
10515 * search.c (scan_buffer): Pass character positions to
10516 know_region_cache, not byte positions. (Bug#6540)
10517
10518 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10519
10520 * w32.c (sys_rename): Report EXDEV when rename of a directory
10521 fails because the target is on another logical disk. (Bug#10284)
10522
10523 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10524
10525 * xterm.c (x_embed_request_focus): New function.
10526
10527 * xterm.h: Add prototype.
10528
10529 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10530
10531 2012-01-05 Glenn Morris <rgm@gnu.org>
10532
10533 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10534
10535 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10536
10537 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10538 Load gnutls_transport_set_lowat only if GnuTLS version is below
10539 2.11.1.
10540 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10541 GnuTLS versions below 2.11.1.
10542
10543 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10544
10545 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10546 to the doc string advising against its use for altering the way
10547 windows are scrolled.
10548
10549 2011-12-28 Kenichi Handa <handa@m17n.org>
10550
10551 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10552 coding-system ASCII compatible only when it does not produce BOM
10553 on encoding (Bug#10383).
10554
10555 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10556
10557 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10558 can scroll.
10559 (create_and_show_popup_menu): Always use menu_position_func for
10560 Gtk3 (Bug#10361).
10561
10562 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10563
10564 * callint.c (Fcall_interactively): Don't truncate prompt string.
10565
10566 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10567
10568 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10569 property that ends at ZV, so that the bidi iteration could be
10570 resumed from there (after widening). (Bug#10360)
10571
10572 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10573
10574 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10575
10576 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10577
10578 * nsterm.m (x_free_frame_resources):
10579 Release f->output_data.ns->miniimage.
10580 (ns_index_color): Fix indentation. Do not retain
10581 color_table->colors[i].
10582
10583 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10584 before returning.
10585
10586 * nsfns.m (x_set_background_color): Assign return value from
10587 ns_index_color to face-background instead of NSColor*.
10588 (ns_implicitly_set_icon_type): Fix indentation.
10589 Change assignment in for loop to comparison.
10590
10591 * emacs.c (ns_pool): New variable.
10592 (main): Assign ns_pool.
10593 (Fkill_emacs): Call ns_release_autorelease_pool.
10594
10595 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10596 autorelease fdesc, release fdAttrs and tdict.
10597 (ns_get_covering_families): Release charset.
10598 (ns_findfonts): Release NSFontDescriptor created with new.
10599 (ns_uni_to_glyphs): Fix indentation.
10600 (setString): Release attrStr before assigning new value.
10601
10602 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10603
10604 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10605 and NS_IMPL_COCOA.
10606 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10607 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10608
10609 2011-12-18 David Reitter <reitter@cmu.edu>
10610
10611 * nsterm.m (ns_term_init): Subscribe for notifications
10612 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10613 to method trackingNotification in EmacsMenu.
10614
10615 * nsmenu.m (trackingMenu): New variable.
10616 (trackingNotification): New method (from Aquamacs).
10617 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10618 from Aquamacs (Bug#7030).
10619
10620 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10621
10622 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10623 (symbol_to_nsstring): Fix indentation.
10624 (ns_symbol_to_pb): New function.
10625 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10626 (Fns_rotate_cut_buffers_internal): Remove.
10627 (Fns_store_selection_internal): Rename from
10628 Fns_store_cut_buffer_internal.
10629 (ns_get_foreign_selection, Fx_own_selection_internal)
10630 (Fx_disown_selection_internal, Fx_selection_exists_p)
10631 (Fns_get_selection_internal, Fns_store_selection_internal):
10632 Use ns_symbol_to_pb and check if return value is nil.
10633 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10634 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10635 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10636 renamed to Sns_store_selection_internal.
10637 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10638 and remove this function.
10639 (ns_handle_selection_clear): Remove, never used.
10640 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10641 here.
10642
10643 2011-12-17 Ken Brown <kbrown@cornell.edu>
10644
10645 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10646 GID is unknown (Bug#10257).
10647
10648 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10649
10650 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10651 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10652 which caused a build failure on GNU/Linux IA-64. This problem was
10653 introduced by my 2011-10-07 patch.
10654
10655 2011-12-15 Juri Linkov <juri@jurta.org>
10656
10657 * image.c (imagemagick_error): New function. (Bug#10112)
10658 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10659 Use `imagemagick_error' where ImageMagick functions return
10660 `MagickFalse'.
10661 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10662 proper order.
10663
10664 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10665
10666 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10667 fill background (Bug#8992).
10668
10669 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10670
10671 * window.c (Vwindow_combination_resize)
10672 (Vwindow_combination_limit): Use t instead of non-nil in
10673 doc-strings.
10674 (Vrecenter_redisplay): Add first sentence of doc-string on
10675 separate line.
10676 (Frecenter): Fix doc-string typo.
10677
10678 2011-12-11 Kenichi Handa <handa@m17n.org>
10679
10680 * coding.c (Funencodable_char_position): Pay attention to the
10681 buffer text relocation (Bug#9389).
10682
10683 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10684
10685 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10686 gtk_init (Bug#10100).
10687
10688 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10689
10690 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10691 IT->string is nil. (Bug#10263)
10692
10693 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10694
10695 * nsterm.h (x_free_frame_resources): Declare.
10696
10697 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10698 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10699
10700 * nsterm.h (ns_get_defaults_value): Declare.
10701
10702 * nsterm.m (ns_default): Call ns_get_defaults_value.
10703
10704 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10705
10706 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10707 (Bug#10170)
10708
10709 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10710
10711 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10712 that where the value of an _OBJC_* symbol points to is in the .bss
10713 section (Bug#10240).
10714
10715 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10716
10717 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10718 after the loop to call ccl_driver at least once (Bug#8619).
10719
10720 2011-12-08 Kenichi Handa <handa@m17n.org>
10721
10722 * ftfont.c (get_adstyle_property): Fix previous change
10723 (Bug#10233).
10724
10725 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10726
10727 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10728 dirs from the default value of EMACSLOADPATH (bug#10208).
10729
10730 2011-12-07 Glenn Morris <rgm@gnu.org>
10731
10732 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10733 installation and source directories as well. (Bug#10208)
10734
10735 2011-12-06 Chong Yidong <cyd@gnu.org>
10736
10737 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10738
10739 2011-12-06 Glenn Morris <rgm@gnu.org>
10740
10741 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10742 as an error, not just -1. (Bug#10217)
10743
10744 2011-12-05 Chong Yidong <cyd@gnu.org>
10745
10746 * keyboard.c (process_special_events): New function.
10747 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10748
10749 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10750
10751 * coding.c (encode_designation_at_bol): Don't use uninitialized
10752 local variable (Bug#9318).
10753
10754 2011-12-05 Kenichi Handa <handa@m17n.org>
10755
10756 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10757 return Qnil (Bug#8046, Bug#10193).
10758
10759 2011-12-05 Kenichi Handa <handa@m17n.org>
10760
10761 * coding.c (encode_designation_at_bol): New args charbuf_end and
10762 dst. Return the number of produced bytes. Callers changed.
10763 (coding_set_source): Return how many bytes coding->source was
10764 relocated.
10765 (coding_set_destination): Return how many bytes
10766 coding->destination was relocated.
10767 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10768 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10769
10770 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10771
10772 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10773 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10774 macro (Bug#9318).
10775
10776 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10777
10778 The following changes are to fix Bug#9318.
10779
10780 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10781 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10782 (encode_coding_iso_2022, encode_coding_sjis)
10783 (encode_coding_big5, encode_coding_charset): Use the above macros.
10784
10785 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10786
10787 * lisp.h (process_quit_flag): Fix external declaration.
10788
10789 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10790
10791 Don't macro-inline non-performance-critical code.
10792 * eval.c (process_quit_flag): New function.
10793 * lisp.h (QUIT): Use it.
10794
10795 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10796
10797 * nsfns.m (get_geometry_from_preferences): New function.
10798 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10799
10800 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10801
10802 * emacs.c (Qkill_emacs): Define.
10803 (syms_of_emacs): Initialize it.
10804 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10805 Qquit_flag to `kill-emacs' instead.
10806 (quit_throw_to_read_char): Add parameter `from_signal'.
10807 All callers changed. Call Fkill_emacs if requested and safe.
10808 * lisp.h (QUIT): Call Fkill_emacs if requested.
10809
10810 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10811
10812 * widget.c (update_wm_hints): Return if wmshell is null.
10813 (widget_update_wm_size_hints): New function.
10814
10815 * widget.h (widget_update_wm_size_hints): Declare.
10816
10817 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10818 widget_update_wm_size_hints (Bug#10104).
10819
10820 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10821
10822 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10823 before a newline, prepare the bidi iterator for consuming the
10824 newline, and keep the current paragraph direction. (Bug#10183)
10825 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10826
10827 2011-12-02 Juri Linkov <juri@jurta.org>
10828
10829 * search.c (Fword_search_regexp): New Lisp function created from
10830 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10831 (Fword_search_backward, Fword_search_forward)
10832 (Fword_search_backward_lax, Fword_search_forward_lax):
10833 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10834 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10835
10836 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10837
10838 * fileio.c (Finsert_file_contents): Move after-change-function call
10839 to before the "handled:" label, since all "goto handled" appear in
10840 cases where the *-change-functions have already been properly called
10841 (bug#10117).
10842
10843 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10844
10845 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10846 waiting for input. (Bug#10169)
10847
10848 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10849
10850 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10851 verifies glyph row's hash code--we have just reallocated the
10852 glyphs, so their contents can be complete garbage. (Bug#10164)
10853
10854 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10855
10856 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10857
10858 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10859
10860 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10861 attributes are tested _before_ calling verify_row_hash, to protect
10862 against GCC re-ordering of the tests. (Bug#10164)
10863
10864 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10865
10866 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10867
10868 * xterm.c (handle_one_xevent): Only set async_visible and friends
10869 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10870 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10871 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10872
10873 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10876 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10877 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10878 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10879 All uses changed to use GCPRO1 etc.
10880 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10881 Revert to old implementation (i.e., before 2011-03-11).
10882
10883 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10884
10885 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10886 of scroll runs so as to avoid assigning disabled bogus rows and
10887 unnecessary graphics copy operations.
10888
10889 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10890
10891 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10892 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10893 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10894 (malloc, free, realloc, calloc): Redirect to e_* only when
10895 compiling Emacs.
10896
10897 * lisp.h (GCTYPEBITS): Move before first use.
10898 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10899 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10900 this macro definition.
10901
10902 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10903 _MSC_VER.
10904
10905 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10906
10907 * gtkutil.c (xg_create_frame_widgets):
10908 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10909 present with Gtk+ 2.0.
10910
10911 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10912
10913 * fileio.c (Finsert_file_contents): Undo previous change; see
10914 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10915
10916 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 Rename locals to avoid shadowing.
10919 * fileio.c (Finsert_file_contents):
10920 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10921 * process.c (wait_reading_process_output):
10922 Rename inner 'proc' to 'p' to avoid shadowing.
10923 Indent for consistency with usual Emacs style.
10924
10925 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10926
10927 * xdisp.c (redisplay_window): If cursor row is not fully visible
10928 after recentering, and scroll-conservatively is set to a large
10929 number, scroll window by a few more lines to make the cursor fully
10930 visible and out of scroll-margin. (Bug#10105)
10931 (start_display): Don't move to the next line if the display should
10932 start at a newline that is part of a display vector or an overlay
10933 string. (Bug#10119)
10934
10935 2011-11-24 Juri Linkov <juri@jurta.org>
10936
10937 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10938 after the `MagickPingImage' call. (Bug#10112)
10939
10940 2011-11-23 Chong Yidong <cyd@gnu.org>
10941
10942 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10943
10944 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10945
10946 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10947 making another buffer current. (Bug#10114)
10948
10949 2011-11-23 Glenn Morris <rgm@gnu.org>
10950
10951 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10952
10953 2011-11-23 Chong Yidong <cyd@gnu.org>
10954
10955 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10956 using it (Bug#5984).
10957
10958 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10959
10960 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10961 and header-lines, as they don't have one computed for them.
10962 (Bug#10098)
10963
10964 * .gdbinit (prow): Make displayed values more self-explaining.
10965 Add row's hash code.
10966
10967 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10968
10969 * process.c (wait_reading_process_output): Fix asynchrounous
10970 GnuTLS socket handling on some versions of the GnuTLS library.
10971 (wait_reading_process_output): Add comment and URL.
10972
10973 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10974
10975 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10976
10977 2011-11-21 Chong Yidong <cyd@gnu.org>
10978
10979 * window.c (Fnext_window, Fprevious_window): Doc fix.
10980
10981 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10982
10983 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10984
10985 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10986
10987 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10988
10989 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10990
10991 * window.c (Fset_window_combination_limit): Rename argument
10992 STATUS to LIMIT.
10993 (Vwindow_combination_limit): Remove "status" from doc-string.
10994
10995 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10996
10997 * m/ibms390.h: Remove.
10998 * m/ibms390x.h: Don't include "ibms390.h".
10999
11000 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11001
11002 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11003 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11004
11005 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
11006
11007 * casetab.c (Fset_case_table):
11008 * charset.c (Fcharset_after): Fix typos.
11009
11010 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
11011
11012 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11013 Otherwise, valgrind does not work on some platforms.
11014 Problem reported by Andreas Schwab in
11015 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11016 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11017 is set, removing the need for VIRT_ADDRESS_VARIES.
11018 (PURE_P): Use a more-efficient implementation that needs just one
11019 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11020 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11021 to 4 (xorl, subq, cmpq, setbe).
11022 * alloc.c (pure): Always extern now, since that's the
11023 VIRT_ADDR_VARIES behavior.
11024 (PURE_POINTER_P): Use a single comparison, not two, for
11025 consistency with the new puresize.h.
11026 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11027 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11028 Remove VIRT_ADDR_VARIES no longer needed.
11029
11030 2011-11-19 Eli Zaretskii <eliz@gnu.org>
11031
11032 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11033 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11034 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11035 behave as if the cursor position were at the window margin.
11036
11037 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11038 and the cursor position is out of bounds, behave as if the cursor
11039 position were at the window margin. (Bug#10075)
11040
11041 2011-11-18 Chong Yidong <cyd@gnu.org>
11042
11043 * window.c (Fwindow_combination_limit): Make first argument
11044 non-optional, since it is meaningless for live windows like the
11045 selected window.
11046
11047 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11048
11049 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11050
11051 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11052
11053 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11054 (graft_intervals_into_buffer): Simplify.
11055
11056 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11057
11058 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11059 hash values of the two rows.
11060 (copy_row_except_pointers): Preserve the used[] arrays and the
11061 hash values of the two rows. (Bug#10035)
11062 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11063
11064 * xdisp.c (row_hash): New function, body extracted from
11065 compute_line_metrics.
11066 (compute_line_metrics): Call row_hash, instead of computing the
11067 hash code inline.
11068
11069 * dispnew.c (verify_row_hash): Call row_hash for computing the
11070 hash code of a row, instead of duplicating code from xdisp.c.
11071
11072 * dispextern.h (row_hash): Add prototype.
11073
11074 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11075
11076 * frame.c (delete_frame): Don't delete the terminal when the last
11077 X frame is closed if emacs is built with GTK toolkit.
11078
11079 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11080
11081 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11082
11083 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11084
11085 * window.c (Vwindow_splits): Rename to
11086 Vwindow_combination_resize. Suggested by Juri Linkov.
11087 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11088 of Vwindow_splits.
11089
11090 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11091
11092 * nsfns.m (Fns_font_name):
11093 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11094
11095 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11096
11097 * window.h (window): Rename slot "nest" to "combination_limit".
11098 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11099 (Fset_window_nest): Rename to Fset_window_combination_limit.
11100 (Vwindow_nest): Rename to Vwindow_combination_limit.
11101 (recombine_windows, make_parent_window, make_window)
11102 (Fsplit_window_internal, saved_window)
11103 (Fset_window_configuration, save_window_save): Rename all
11104 occurrences of window_nest to window_combination_limit.
11105
11106 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11107
11108 * image.c (imagemagick_load_image): Fix typo.
11109
11110 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11111
11112 * xdisp.c (display_line): Move the call to
11113 highlight_trailing_whitespace before the call to
11114 compute_line_metrics, since the latter needs to see the final
11115 faces of all the glyphs to compute ROW's hash value.
11116 Fixes assertion violations in row_equal_p. (Bug#10035)
11117
11118 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11119
11120 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11121 just return (bug#10044).
11122
11123 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11124
11125 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11126 with user-defined heap size. Bump the default size of the temacs
11127 heap to 27MB, to avoid memory warning when running temacs.
11128 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11129
11130 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11131 current_matrix and desired_matrix. (Bug#9990)
11132 (verify_row_hash) [XASSERTS]: New function.
11133 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11134 that the hash value of glyph rows is correct.
11135
11136 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11137
11138 * window.h (window): Remove splits slot.
11139 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11140 (Fdelete_other_windows_internal, make_parent_window)
11141 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11142 (Fset_window_configuration, save_window_save): Don't deal with
11143 split status of windows.
11144 (saved_window): Remove splits slot.
11145 (Vwindow_splits): Rewrite doc-string.
11146
11147 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11148
11149 * xfns.c (unwind_create_frame):
11150 * nsfns.m (unwind_create_frame):
11151 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11152 Vframe_list (Bug#9999).
11153
11154 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11155
11156 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11157
11158 2011-11-11 Kenichi Handa <handa@m17n.org>
11159
11160 * callproc.c (Fcall_process): Set the member dst_multibyte of
11161 process_coding.
11162
11163 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11164
11165 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11166 avoid a crash (bug#9496).
11167
11168 2011-11-09 Chong Yidong <cyd@gnu.org>
11169
11170 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11171 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11172
11173 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11174
11175 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11176
11177 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 Avoid some portability problems by eschewing 'extern inline' functions.
11180 The trivial performance wins aren't worth the portability hassles; see
11181 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11182 et seq.
11183 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11184 (window_box_width, window_box_left, window_box_left_offset)
11185 (window_box_right, window_box_right_offset): Undo previous change,
11186 by removing the "extern"s.
11187 * intervals.c (adjust_intervals_for_insertion)
11188 (adjust_intervals_for_deletion): Undo previous change,
11189 making these static again.
11190 (offset_intervals, temp_set_point_both, temp_set_point)
11191 (copy_intervals_to_string): No longer inline.
11192 * xdisp.c (window_text_bottom_y, window_box_width)
11193 (window_box_height, window_box_left_offset)
11194 (window_box_right_offset, window_box_left, window_box_right)
11195 (window_box): No longer inline.
11196
11197 2011-11-08 Chong Yidong <cyd@gnu.org>
11198
11199 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11200 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11201 Signal an error if not a live window.
11202 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11203 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11204
11205 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11206
11207 * lisp.h (syms_of_abbrev): Remove declaration.
11208 Reported by CHENG Gao <chenggao@royau.me>.
11209
11210 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11211
11212 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11213 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11214 of temacs in GUI mode.
11215
11216 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11217
11218 * window.h: Declare delete_all_child_windows instead of
11219 delete_all_subwindows.
11220 * window.c (Fwindow_nest, Fset_window_nest)
11221 (Fset_window_new_total, Fset_window_new_normal)
11222 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11223 (delete_all_subwindows): Rename to delete_all_child_windows.
11224 (Fdelete_other_windows_internal, Fset_window_configuration):
11225 Call delete_all_child_windows instead of delete_all_subwindows.
11226 * frame.c (delete_frame): Call delete_all_child_windows instead
11227 of delete_all_subwindows.
11228
11229 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11230
11231 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11232 This is also needed for porting to any host where GC_MARK_STACK is
11233 not GC_MAKE_GCPROS_NOOPS.
11234 (which_symbols): Use it.
11235
11236 2011-11-07 Kenichi Handa <handa@m17n.org>
11237
11238 * coding.c (coding_set_destination): Check coding->src_pos only
11239 when coding->src_object is a buffer (bug#9910).
11240
11241 * process.c (send_process): Set the member src_multibyte of coding
11242 to 0 (bug#9911) when sending a unibyte text.
11243
11244 * callproc.c (Fcall_process): Set the member src_multibyte of
11245 process_coding to 0 (bug#9912).
11246
11247 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11248
11249 * xmenu.c (cleanup_widget_value_tree): New function.
11250 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11251 calling free_menubar_widget_value_tree directly (Bug#9830).
11252
11253 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11254
11255 Fix some portability problems with 'inline'.
11256 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11257 (window_box_width, window_box_left, window_box_left_offset)
11258 (window_box_right, window_box_right_offset): Declare extern.
11259 Otherwise, these inline functions do not conform to C99 and
11260 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11261 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11262 * intervals.c (adjust_intervals_for_insertion)
11263 (adjust_intervals_for_deletion): Now extern, because otherwise the
11264 extern inline functions 'offset_intervals' couldn't refer to it.
11265 (static_offset_intervals): Remove.
11266 (offset_intervals): Rewrite using the old contents of
11267 static_offset_intervals. The old version didn't conform to C99
11268 because an extern inline function contained a reference to an
11269 identifier with static linkage.
11270
11271 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11272
11273 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11274 GC.
11275
11276 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11277
11278 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11279 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11280 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11281 return Qleft_to_right.
11282
11283 2011-11-06 Chong Yidong <cyd@gnu.org>
11284
11285 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11286 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11287 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11288 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11289 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11290 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11291 (Fwindow_vscroll): Doc fix.
11292 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11293 argument, since it makes no sense to pass a live window and for
11294 consistency with window-child.
11295
11296 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11297
11298 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11299 support MSVC.
11300
11301 2011-11-05 Jason Rumney <jasonr@gnu.org>
11302
11303 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11304 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11305 fonts (Bug#6029).
11306 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11307 bitwise arithmetic preventing use of unicode-sip and non-truetype
11308 opentype fonts.
11309
11310 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11311
11312 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11313 "emacs"-only part.
11314
11315 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11316 initialization code to keep similarity to xfns.c after changes
11317 from 2011-11-05.
11318
11319 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11320
11321 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11322 (unwind_create_frame): New function (Bug#9943).
11323 (Fx_create_frame): Restructure code to be more similar to the one in
11324 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11325 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11326 Move terminal->reference_count++ just before making the frame official
11327 (Bug#9943).
11328
11329 * nsterm.m (x_free_frame_resources): New function.
11330 (x_destroy_window): Move code to x_free_frame_resources.
11331
11332 * xfns.c (unwind_create_frame): Fix comment.
11333 (Fx_create_frame, x_create_tip_frame):
11334 Move terminal->reference_count++ just before making the frame
11335 official. Move initialization of image_cache_refcount and
11336 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11337
11338 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11339
11340 Support MSVC build with newer versions of Visual Studio.
11341 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11342 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11343 nt/gmake.defs.
11344
11345 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11346 which are not supported by MSVC.
11347 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11348 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11349 bitfields.
11350 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11351 types in bitfields.
11352 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11353
11354 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11355
11356 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11357
11358 Support MSVC build with newer versions of Visual Studio.
11359 * w32.c: Don't include w32api.h for MSVC.
11360 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11361
11362 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11363 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11364 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11365 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11366 e_* cousins.
11367 (alloca) [_MSC_VER]: Define to _alloca.
11368
11369 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11370
11371 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11372
11373 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11374
11375 * xdisp.c (note_mouse_highlight): If either of
11376 previous/next-single-property-change returns nil, treat that as
11377 the beginning or the end of the buffer. (Bug#9955)
11378
11379 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11380
11381 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11382 label is not null (Bug#9951).
11383 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11384 may be NULL.
11385
11386 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11387
11388 * window.c (Fwindow_body_size): Mention in the doc string that the
11389 return value is in frame's canonical units. (Bug#9949)
11390
11391 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11392
11393 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11394
11395 * w32fns.c (unwind_create_frame): If needed, free the glyph
11396 matrices of the partially constructed frame. (Bug#9943)
11397 * xfns.c (unwind_create_frame): Likewise.
11398
11399 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11400
11401 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11402 Don't stop backward scan on the continuation glyph, even though
11403 its CHARPOS is positive.
11404 (mouse_face_from_buffer_pos, note_mouse_highlight):
11405 Rename cover_string to disp_string.
11406
11407 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11408
11409 * window.c (temp_output_buffer_show): Don't use
11410 Vtemp_buffer_show_specifiers.
11411 (Vtemp_buffer_show_specifiers): Remove unused variable.
11412
11413 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11414
11415 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11416 past the beginning of the current glyph matrix.
11417
11418 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11419
11420 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11421 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11422 HAVE_GTK3 (Bug#9869).
11423
11424 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11425 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11426
11427 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11428
11429 * xterm.c: Declare x_handle_net_wm_state to return int.
11430 (handle_one_xevent): Check if we are iconified but don't have
11431 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11432 (get_current_wm_state): Return non-zero if not hidden,
11433 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11434 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11435 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11436 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11437
11438 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11441 so that this new function doesn't get optimized away by a
11442 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11443
11444 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11445
11446 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11447
11448 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11449
11450 Fix the `xbytecode' command.
11451 * .gdbinit (xprintbytestr): New command.
11452 (xwhichsymbols): Rename from `which'; all callers changed.
11453 (xbytecode): Print the byte-code string as well.
11454
11455 2011-10-29 Kim Storm <storm@cua.dk>
11456
11457 * alloc.c (which_symbols): New function.
11458
11459 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11460
11461 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11462 line. (Bug#9903)
11463
11464 2011-10-29 Glenn Morris <rgm@gnu.org>
11465
11466 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11467 Not clear what it was for, and it causes various bugs. (Bug#9839)
11468
11469 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11470
11471 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11472 possible random value that matches one of those tested as
11473 condition to clear the mouse face.
11474
11475 2011-10-28 Chong Yidong <cyd@gnu.org>
11476
11477 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11478
11479 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11480
11481 * window.c (make_window): Initialize phys_cursor_on_p.
11482
11483 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11484
11485 * lisp.h (struct Lisp_Symbol): Update comments.
11486
11487 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11488
11489 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11490
11491 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11492
11493 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11494 <oslsachem@gmail.com> for helping to debug this.
11495
11496 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11497 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11498 (g_b_init_get_glyph_outline_w): New static variables.
11499 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11500 (GetGlyphOutlineW_Proc): New typedefs.
11501 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11502 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11503 New functions.
11504 (w32font_open_internal, compute_metrics):
11505 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11506 instead of calling the "wide" APIs directly.
11507
11508 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11509
11510 * w32.h (syms_of_w32font): Add prototype.
11511
11512 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11513
11514 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11515 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11516 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11517 (Fmove_to_window_line): Doc fix.
11518
11519 2011-10-27 Chong Yidong <cyd@gnu.org>
11520
11521 * process.c (make_process): Set gnutls_state to NULL.
11522
11523 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11524 non-NULL, regardless of GNUTLS_INITSTAGE.
11525 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11526 an error. Set process slots as soon as we allocate them.
11527
11528 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11529
11530 2011-10-27 Chong Yidong <cyd@gnu.org>
11531
11532 * gnutls.c (emacs_gnutls_deinit): New function.
11533 Deallocate credentials structures as well as calling gnutls_deinit.
11534 (Fgnutls_deinit, Fgnutls_boot): Use it.
11535
11536 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11537 (deactivate_process): Call emacs_gnutls_deinit.
11538
11539 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11540
11541 * image.c (x_create_x_image_and_pixmap):
11542 * w32.c (sys_rename, w32_delayed_load):
11543 * w32font.c (fill_in_logfont):
11544 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11545
11546 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11547
11548 * w32fns.c (w32_default_color_map): New function,
11549 extracted from Fw32_default_color_map.
11550 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11551
11552 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11553
11554 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11555
11556 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11557
11558 * keyboard.c (test_undefined): New function (bug#9751).
11559 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11560
11561 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11562
11563 * sysdep.c (init_sys_modes): Fix the check for the controlling
11564 terminal (Bug#6649).
11565
11566 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11567
11568 * dispextern.h (struct bidi_it): New member next_en_type.
11569
11570 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11571 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11572 current character, check also for next_en_type being WEAK_EN.
11573 (bidi_resolve_weak): Don't enter the expensive loop if the current
11574 position is before next_en_pos. Record the bidi type of the first
11575 non-ET, non-BN character we find, in addition to its position.
11576 (bidi_level_of_next_char): Invalidate next_en_type when
11577 next_en_pos is over-stepped.
11578
11579 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11580
11581 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11582 * editfns.c: Rewrite current-time-zone so that it invokes
11583 the equivalent of (format-time-string "%Z") to get the time zone name.
11584 This fixes a bug when the time zone name contains characters that
11585 need converting from the system time locale to Emacs internal format.
11586 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11587 that patch fixed format-time-string to do the conversion, but
11588 I forgot to fix current-time-zone.
11589 (format_time_string): New function, containing most of
11590 what Fformat_time_string used to contain.
11591 (Fformat_time_string): Rewrite in terms of format_time_string.
11592 This doesn't change this function's behavior.
11593 (current-time-zone): Rewrite to use format_time_string.
11594 This fixes the bug reported by Michael Schierl in
11595 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11596 Jason Rumney's 2007-06-07 change worked around this bug, but
11597 didn't fix it.
11598 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11599
11600 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11601
11602 * xdisp.c (start_display): If the character at POS is displayed
11603 via a display vector, reset IT->current.dpvec_index to zero.
11604 (try_window_reusing_current_matrix): If a line ends in a display
11605 vector or the next line starts in a display vector, continue
11606 redrawing the window even though the character position of
11607 start_row was reached.
11608 (Bug#9771, part 2)
11609
11610 2011-10-18 Chong Yidong <cyd@gnu.org>
11611
11612 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11613 with nobreak-char-display too.
11614
11615 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11616
11617 Fix part 3 of bug#9771.
11618 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11619 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11620 non-neutral characters if the current character is a paragraph
11621 separator (a.k.a. Newline). This avoids running the same
11622 expensive loop twice, once when we consume the preceding newline
11623 and the other time when the line actually needs to be displayed.
11624 Avoid the loop when we see neutrals on the base embedding level
11625 following a character whose directionality is the same as the
11626 paragraph's. This avoids running the expensive loop when a line
11627 ends in a long sequence of neutrals, like control characters.
11628 Add assertion against STRONG_AL type. Slightly rearrange code
11629 that determines the type of a neutral given the first non-neutral
11630 that follows it.
11631 (bidi_level_of_next_char): Set next_en_pos to zero when
11632 invalidating its info.
11633
11634 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11635
11636 * xdisp.c (push_display_prop): Determine whether to record string
11637 or buffer position by IT->string, not by IT->method. Allow
11638 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11639 (move_it_vertically_backward): Don't look for character position
11640 immediately after the newline when in a continuation line.
11641 (Bug#9771, part 1)
11642
11643 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11644
11645 * window.c (coordinates_in_window): Rewrite and delabelize
11646 vertical border check. (Bug#5357) (Bug#9618)
11647
11648 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11649
11650 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11651 errors in XSetWindowBorder (bug#9310).
11652
11653 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11654
11655 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11656 avoid crash when xmalloc overrun checking is enabled.
11657
11658 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11659
11660 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11661 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11662 cursor motion with <left> and <right> arrow keys.
11663
11664 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11665 some callers set that themselves.
11666
11667 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11668
11669 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11670 display string and the previous row comes from the same string and
11671 is empty. (Bug#9739) (Bug#9738)
11672
11673 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11674
11675 * doc.c (get_doc_string): Encode file name (bug#9735).
11676
11677 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11678
11679 * bidi.c (bidi_level_of_next_char):
11680 * xdisp.c (get_visually_first_element): Remove old incorrect
11681 comments regarding the Unicode Line Separator character.
11682
11683 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11684
11685 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11686
11687 * alloc.c (Fgc_status): Do not access beyond zombies array
11688 boundary if nzombies > MAX_ZOMBIES.
11689 * alloc.c (dump_zombies): Add missing format specifier.
11690
11691 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11692
11693 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11694 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11695
11696 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11697 Some packages use them to denote characters with modifiers.
11698
11699 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11700
11701 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11702 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11703 matching a pp-number. Rename parameter var to var1.
11704
11705 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11706
11707 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11708
11709 2011-10-08 Glenn Morris <rgm@gnu.org>
11710
11711 * callint.c (Fcall_interactively): Give a more explicit error for the
11712 'c' case with a non-character input. (Bug#8479)
11713
11714 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11715
11716 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11717 lines.
11718 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11719 lines that are hscrolled on the left.
11720
11721 * dispnew.c (buffer_posn_from_coords): Account for a possible
11722 presence of header-line. (Bug#4426)
11723
11724 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11725
11726 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11727 Don't advertise functionality which we discourage or doesn't work.
11728
11729 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11730
11731 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11732 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11733 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11734 this makes Emacs dump core during garbage collection on rare
11735 occasions. sizeof is obviously inferior to offsetof here, so
11736 stick with offsetof.
11737 (GC_POINTER_ALIGNMENT): New macro.
11738 (mark_memory): Omit 3rd (offset) arg; caller changed.
11739 Don't assume EMACS_INT alignment is the same as pointer alignment.
11740
11741 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11742
11743 * keyboard.c (read_key_sequence_remapped): New var.
11744 (read_key_sequence): Compute remapping in the right buffer.
11745 (command_loop_1): Use read_key_sequence's remapping directly.
11746
11747 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11748
11749 * dired.c (file_name_completion): Don't expand file name.
11750 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11751 before checking file name handler.
11752
11753 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11754 they've been requested explicitly (bug#9591).
11755
11756 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11757
11758 * keymap.c (Fsingle_key_description): Use make_specified_string
11759 instead of build_string to build string from push_key_description.
11760 (Bug#5193)
11761
11762 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11763
11764 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11765 This fixes a Y2038 bug on 64-bit hosts.
11766 * buffer.c (reset_buffer):
11767 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11768 (Fclear_buffer_auto_save_failure):
11769 Use 0, not -1, to represent an unset failure time, since time_t
11770 might not be signed.
11771
11772 Remove dependency on glibc malloc internals.
11773 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11774 Move back here from lisp.h, but with their new implementations.
11775 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11776 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11777 * charset.c (charset_table_init): New static var.
11778 (syms_of_charset): Use it instead of xmalloc. This removes a
11779 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11780 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11781 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11782 Move back to alloc.c.
11783 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11784 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11785
11786 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11787
11788 * nsterm.m (windowDidResize): Call x_set_window_size only when
11789 ns_in_resize is true. Otherwise set pixelwidth/height and
11790 call change_frame_size (Bug#9628).
11791
11792 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11793
11794 Port --enable-checking=all to Fedora 14 x86-64.
11795 * charset.c (syms_of_charset): Also account for glibc malloc's
11796 internal overhead when calculating the initial malloc maximum.
11797
11798 Port --enable-checking=all to Fedora 14 x86.
11799 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11800 Move to lisp.h.
11801 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11802 (overrun_check_realloc, overrun_check_free):
11803 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11804 That way, xmalloc returns a properly-aligned pointer even if
11805 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11806 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11807 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11808 into account when calculating the initial malloc maximum.
11809 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11810 Move here from alloc.c, so that charset.c can use it too.
11811 Properly align; the old code wasn't right for common 32-bit hosts
11812 when configured with --enable-checking=all.
11813 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11814 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11815
11816 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11817
11818 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11819 use EDOM.
11820
11821 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11822
11823 * xdisp.c (compute_display_string_end): If there's no display
11824 string at CHARPOS, return -1.
11825
11826 * bidi.c (bidi_fetch_char): When compute_display_string_end
11827 returns a negative value, treat the character as a normal
11828 character not covered by a display string. (Bug#9624)
11829
11830 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11831
11832 * lread.c (Fread_from_string): Fix typo in docstring.
11833
11834 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11835
11836 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11837 newline, reseat the iterator instead of bidi-iterating there one
11838 character at a time. (Bug#9610)
11839 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11840 TO_CHARPOS if the bidi iterator is at base embedding level.
11841
11842 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11843
11844 * lread.c (readevalloop): Use correct code for NBSP.
11845 (read1): Likewise. (Bug#9608)
11846
11847 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11848
11849 * dbusbind.c (Fdbus_register_signal): When service is not
11850 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11851
11852 2011-09-25 Glenn Morris <rgm@gnu.org>
11853
11854 * buffer.c (truncate-lines): Doc fix.
11855
11856 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11857
11858 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11859 (Fset_window_next_buffers): Doc fix.
11860
11861 2011-09-24 Glenn Morris <rgm@gnu.org>
11862
11863 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11864
11865 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11866
11867 Fix minor problems found by static checking.
11868 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11869 * indent.c (Fvertical_motion): Fix == vs = typo.
11870
11871 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11872
11873 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11874 Default value is now t. Doc fix.
11875
11876 * indent.c (Fvertical_motion): Compute and apply the overshoot
11877 logic when moving up, not only when moving down. Fix the
11878 confusing name and values of the it_overshoot_expected variable;
11879 logic changes accordingly. (Bug#9254) (Bug#9549)
11880
11881 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11882 CHARPOS is covered by a display string which includes newlines.
11883 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11884 is covered by a display string with embedded newlines.
11885
11886 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11887
11888 * dbusbind.c (Fdbus_register_signal): Add match rule to
11889 Vdbus_registered_objects_table. (Bug#9581)
11890 (Fdbus_register_method, Vdbus_registered_objects_table):
11891 Fix docstring.
11892
11893 2011-09-24 Jim Meyering <meyering@redhat.com>
11894
11895 do not ignore write error for any output size
11896 The previous change was incomplete.
11897 While it makes emacs --batch detect the vast majority of stdout
11898 write failures, errors were still ignored whenever the output size is
11899 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11900 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11901 && echo FAIL: ignored write error
11902 FAIL: ignored write error
11903 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11904 && echo FAIL: ignored write error
11905 FAIL: ignored write error
11906 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11907
11908 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11909
11910 * emacs.c (Fkill_emacs): In noninteractive mode exit
11911 non-successfully if a write error occurred on stdout. (Bug#9574)
11912
11913 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11914
11915 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11916 the xassert test.
11917
11918 * dispextern.h (struct it): Update the comment documenting what
11919 can it->OBJECT be.
11920
11921 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11922
11923 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11924 a display string, extend search for cursor position to end of row.
11925 (find_row_edges): If the row ends in a newline from a display
11926 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11927 Handle the case of a display string with multiple newlines.
11928 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11929 non-empty line. Fixes confusing cursor motion with arrow keys at
11930 the beginning of a line that starts with whitespace.
11931
11932 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11933
11934 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11935 (bug#9493).
11936
11937 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11938
11939 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11940 boolean (Bug#9154).
11941
11942 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11943
11944 * xdisp.c (display_line): Record maximum and minimum buffer
11945 positions even if no glyphs were produced (e.g., by a zero-width
11946 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11947 buffer positions that will be removed from the glyph row because
11948 they don't fit.
11949 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11950 column is beyond frame width: don't subtract 1 "pixel" when
11951 computing width of the stretch.
11952 (reseat_at_next_visible_line_start): Undo the change made on
11953 2011-09-17 that saved paragraph information and restored it after
11954 the call to `reseat'. (Bug#9545)
11955
11956 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11957
11958 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11959 and turn window cursor on if cleared (Bug#9415).
11960
11961 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11962
11963 * search.c (boyer_moore): Take unibyte characters from pattern
11964 literally. (Bug#9458)
11965
11966 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11967
11968 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11969
11970 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11971
11972 Fix minor problem found by static checking.
11973 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11974 initialized, to pacify gcc -Wuninitialized.
11975
11976 * fileio.c: Report proper errno when syscall falls.
11977 (Finsert_file_contents): Save and restore errno,
11978 so that report_file_error outputs the correct diagnostic.
11979 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11980
11981 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11982
11983 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11984
11985 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11986
11987 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11988 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11989
11990 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11991
11992 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11993 about the current paragraph and restore it after the call to reseat.
11994
11995 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11996 (bidi_find_paragraph_start): Search back for paragraph beginning
11997 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11998 (bidi_move_to_visually_next): Only trigger paragraph-related
11999 computations when the last character is a newline or at EOB, not
12000 just any NEUTRAL_B. (Bug#9470)
12001
12002 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12003 truncated lines if point is covered by a display string. (Bug#9524)
12004
12005 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12006
12007 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12008 (cons_to_x_long): New function.
12009 (lisp_data_to_selection_data): Use it. Correct the test for
12010 short-versus-long data; it was negated. Break out of vector
12011 loop, for efficiency, when a long datum is discovered.
12012
12013 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12014
12015 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12016
12017 2011-09-16 Eli Zaretskii <eliz@gnu.org>
12018
12019 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12020 GCC PR/17406) by declaring this function with external scope.
12021
12022 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12023
12024 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12025 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12026
12027 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12028
12029 * editfns.c (Fformat): Correctly handle text properties on "%%".
12030
12031 2011-09-15 Eli Zaretskii <eliz@gnu.org>
12032
12033 * xterm.c (x_draw_composite_glyph_string_foreground):
12034 * w32term.c (x_draw_composite_glyph_string_foreground):
12035 * term.c (encode_terminal_code):
12036 * composite.c (composition_update_it, get_composition_id):
12037 * xdisp.c (get_next_display_element)
12038 (fill_composite_glyph_string): Add comments about special meaning
12039 of TAB characters in a composition.
12040
12041 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12042
12043 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12044 This occurs when processing a multibyte format.
12045 Problem reported by Wolfgang Jenker.
12046
12047 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12048
12049 * xdisp.c (try_cursor_movement): Only check for exact match if
12050 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12051
12052 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12053
12054 Remove unused external symbols.
12055 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12056 * xdisp.c (calc_pixel_width_or_height): Now static.
12057 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12058 * indent.c (check_display_width):
12059 * w32term.c: Fix comment to match code.
12060 * xterm.c, xterm.h (x_catching_errors): Remove.
12061
12062 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 * xselect.c: Use signed conversions more consistently (Bug#9498).
12065 (selection_data_to_lisp_data): Assume incoming selection data are
12066 signed integers, not unsigned. This is to be consistent with
12067 outgoing selection data, which was modified to use signed integers
12068 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12069 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12070 expects long, not unsigned long.
12071
12072 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12073
12074 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12075 computation of loop end. Reported by Johan Bockgård
12076 <bojohan@gnu.org>.
12077
12078 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12079
12080 * frame.c (Fother_visible_frames_p): Function deleted.
12081
12082 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12083
12084 * indent.c (compute_motion): Process display vector front to back
12085 rather than the other way around. (Bug#2496)
12086
12087 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12088
12089 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12090
12091 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12092
12093 * minibuf.c (Fread_from_minibuffer): Doc fix.
12094
12095 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12096
12097 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12098 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12099
12100 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12101
12102 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12103 value for non-existent files.
12104
12105 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12106
12107 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12108 set its "size" to -1. This will set the modtime_size field of
12109 the corresponding buffer to -1, which is what
12110 verify-visited-file-modtime expects for files that do not exist.
12111 (Bug#9139)
12112
12113 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12114
12115 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12116 here ...
12117 * lisp.h: ... from here. push_key_description is no longer
12118 defined in keyboard.c, so its declaration should not be in
12119 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12120 logically belongs with push_key_description.
12121
12122 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 * buffer.h: Include <sys/types.h> instead of <time.h>.
12125 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12126 Problem reported by Herbert J. Skuhra.
12127
12128 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12129
12130 * xml.c (parse_region): Make the parsing work for
12131 non-comment-starting XML files again (bug#9144).
12132
12133 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12134
12135 * image.c (gif_load): Fix calculation of bottom and right corner.
12136 (Bug#9468)
12137
12138 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12139
12140 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12141 redisplay in small windows.
12142
12143 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12144
12145 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12146
12147 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12148
12149 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12150 Operate on live windows only.
12151
12152 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12153
12154 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12155
12156 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12157
12158 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12159 only under bidi iteration.
12160
12161 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12162
12163 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12164
12165 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12166
12167 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12168 Without this fix, the command to link temacs failed due to an
12169 undefined symbol __builtin_isnan. This is because
12170 /usr/include/iso/math_c99.h #defines isnan(x) to
12171 __builtin_isnan(x), but the bundled gcc, which identifies itself
12172 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12173 a __builtin_isnan.
12174 * floatfns.c (isnan): #undef, and then #define to a clone of
12175 what's in data.c.
12176 (Fisnan): Always define, since it's always available now.
12177 (syms_of_floatfns): Always define isnan at the Lisp level.
12178
12179 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12180
12181 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12182
12183 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12184
12185 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12186 The previous code assumed that file offsets (off_t values) fit in
12187 EMACS_INT variables, which is not true on typical 32-bit hosts.
12188 The code messed up by falsely reporting buffer overflow in cases
12189 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12190 when "big" contains more than 2**29 bytes, even though this
12191 inserts just one byte and does not overflow the buffer.
12192 (Finsert_file_contents): Store file offsets as off_t
12193 values, not as EMACS_INT values. Check for overflow when
12194 converting between EMACS_INT and off_t. When checking for
12195 buffer overflow or for overlap, take the offsets into account.
12196 Don't use EMACS_INT for small values where int suffices.
12197 When checking for overlap, fix a typo: ZV was used where
12198 ZV_BYTE was intended.
12199 (Fwrite_region): Don't assume off_t fits into 'long'.
12200 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12201
12202 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12203
12204 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12205
12206 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12207
12208 sprintf-related integer and memory overflow issues (Bug#9412).
12209
12210 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12211 (esprintf, exprintf, evxprintf): New functions.
12212 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12213 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12214 (modify_event_symbol): Do not assume that the length of
12215 name_alist_or_stem is safe to alloca and fits in int.
12216 (Fexecute_extended_command): Likewise for function name and binding.
12217 (Frecursion_depth): Wrap around reliably on integer overflow.
12218 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12219 since some callers pass EMACS_INT values.
12220 (Fsingle_key_description): Don't crash if symbol name contains more
12221 than MAX_ALLOCA bytes.
12222 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12223 (get_minibuffer): Arg is now EMACS_INT, not int.
12224 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12225 (esprintf, exprintf, evxprintf): New decls.
12226 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12227
12228 * dbusbind.c (signature_cat): New function.
12229 (xd_signature, Fdbus_register_signal):
12230 Do not overrun buffer; instead, report string overflow.
12231
12232 * dispnew.c (add_window_display_history): Don't overrun buffer.
12233 Truncate instead; this is OK since it's just a log.
12234
12235 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12236 even if the time zone offset is outlandishly large.
12237 Don't mishandle offset == INT_MIN.
12238
12239 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12240 when creating daemon; the previous buffer-overflow check was incorrect.
12241
12242 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12243 which has the guts of the old verror function.
12244
12245 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12246 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12247
12248 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12249 (font_unparse_xlfd): Don't blindly alloca long strings.
12250 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12251 fits in int, when using sprintf. Use single snprintf to count
12252 length of string rather than counting it via multiple sprintfs;
12253 that's simpler and more reliable.
12254 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12255 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12256 sprintf, in case result does not fit in int.
12257
12258 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12259 (fontset_from_font): Print it.
12260
12261 * frame.c (tty_frame_count): Now printmax_t, not int.
12262 (make_terminal_frame, set_term_frame_name): Print it.
12263 (x_report_frame_params): In X, window IDs are unsigned long,
12264 not signed long, so print them as unsigned.
12265 (validate_x_resource_name): Check for implausibly long names,
12266 and don't assume name length fits in 'int'.
12267 (x_get_resource_string): Don't blindly alloca invocation name;
12268 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12269 not fit in int.
12270
12271 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12272 (xg_check_special_colors, xg_set_geometry):
12273 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12274
12275 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12276 Use esprintf, not sprintf, in case result does not fit in int.
12277
12278 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12279 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12280 it as a large positive number.
12281 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12282 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12283
12284 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12285 in case result does not fit in int.
12286
12287 * print.c (float_to_string): Detect width overflow more reliably.
12288 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12289 buffer overrun. Don't assume list length fits in 'int'. Treat
12290 print length of 0 as 0, not as infinity; to be consistent with other
12291 uses of print length in this function. Don't overflow print length
12292 index. Don't assume hash table size fits in 'long', or that
12293 vectorlike size fits in 'unsigned long'.
12294
12295 * process.c (make_process): Use printmax_t, not int, to format
12296 process-name gensyms.
12297
12298 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12299
12300 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12301 to avoid potential buffer overrun.
12302
12303 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12304 if X resource line is longer than 512 bytes.
12305
12306 * xfns.c (x_window): Make sprintf buffer a bit bigger
12307 to avoid potential buffer overrun.
12308
12309 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12310
12311 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12312
12313 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12314
12315 Integer overflow fixes for scrolling, etc.
12316 Without these, Emacs silently mishandles large integers sometimes.
12317 For example, "C-u 4294967297 M-x recenter" was treated as if
12318 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12319
12320 * xdisp.c (try_window_id): Check Emacs fixnum range before
12321 converting to 'int'.
12322
12323 * window.c (window_scroll_line_based, Frecenter):
12324 Check that an Emacs fixnum is in range before assigning it to 'int'.
12325 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12326 values converted from Emacs fixnums.
12327 (Frecenter): Don't wrap around a line count if it is out of 'int'
12328 range; instead, treat it as an extreme value.
12329 (Fset_window_configuration, compare_window_configurations):
12330 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12331
12332 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12333 that can exceed INT_MAX. Check that EMACS_INT value is in range
12334 before assigning it to the (possibly-narrower) index.
12335 (match_limit): Don't assume that a fixnum can fit in 'int'.
12336
12337 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12338 exceed INT_MAX.
12339
12340 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12341 (Fvertical_motion): Don't wrap around LINES values that don't fit
12342 in 'int'. Instead, treat them as extreme values. This is good
12343 enough for windows, which can't have more than INT_MAX lines anyway.
12344
12345 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12346
12347 * Require libxml/parser.h to avoid compilation warning.
12348
12349 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12350
12351 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12352 since this reportedly can destroy thread storage.
12353
12354 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12355
12356 * syntax.c (find_defun_start): Update all cache variables if
12357 exiting early (Bug#9401).
12358
12359 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12360
12361 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12362
12363 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12364 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12365 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12366
12367 * term.c (tty_append_glyph): New function.
12368 (produce_stretch_glyph): Static function and its prototype deleted.
12369
12370 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12371 Add prototypes.
12372
12373 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12374
12375 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12376 when checking :margin (Bug#9390).
12377 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12378 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12379 so that the name doesn't mislead. All uses changed.
12380
12381 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12382
12383 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12384 set_tty_hooks.
12385
12386 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12387
12388 * xdisp.c (move_it_to): Don't bail out early when reaching
12389 position beyond to_charpos, if we are scanning backwards.
12390 (move_it_vertically_backward): When DY == 0, make sure we get to
12391 the first character in the line after the newline.
12392
12393 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12394
12395 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12396 (ccl_driver): Do not generate an out-of-range pointer.
12397 (Fccl_execute_on_string): Remove unnecessary check for
12398 integer overflow, noted by Stefan Monnier in
12399 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12400 Remove a FIXME that didn't need fixing.
12401 Simplify the newly-introduced buffer reallocation code.
12402
12403 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12404
12405 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12406
12407 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12408
12409 Integer and memory overflow issues (Bug#9196).
12410
12411 * doc.c (get_doc_string): Rework so that
12412 get_doc_string_buffer_size is the actual buffer size, rather than
12413 being 1 less than the actual buffer size; this makes xpalloc more
12414 convenient.
12415
12416 * image.c (x_allocate_bitmap_record, cache_image):
12417 * xselect.c (Fx_register_dnd_atom):
12418 Simplify previous changes by using xpalloc.
12419
12420 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12421 since either will do and ptrdiff_t is convenient with xpalloc.
12422
12423 * charset.c (charset_table_size)
12424 (struct charset_sort_data.priority): Now ptrdiff_t.
12425 (charset_compare): Don't overflow if priorities differ greatly.
12426 (Fsort_charsets): Don't assume list length fits in int.
12427 Check for size-calculation overflow when allocating sort data.
12428 (syms_of_charset): Allocate an initial charset table that is
12429 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12430
12431 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12432
12433 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12434 The actual value is always <= INT_MAX, and leaving it unsigned made
12435 overflow checking harder.
12436
12437 * dispextern.h (struct glyph_matrix.rows_allocated)
12438 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12439 with xpalloc. The values are still always <= INT_MAX.
12440
12441 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12442
12443 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12444 (SAFE_NALLOCA): New macro.
12445
12446 * region-cache.c (struct boundary.pos, find_cache_boundary)
12447 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12448 (set_cache_region, invalidate_region_cache)
12449 (revalidate_region_cache, know_region_cache, region_cache_forward)
12450 (region_cache_backward, pp_cache):
12451 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12452 so that ptrdiff_t * can be passed to xpalloc.
12453 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12454 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12455 (pp_cache): Don't assume cache_len fits in int.
12456 * region-cache.h: Adjust extern decls to match.
12457
12458 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12459 EMACS_INT, since either will do, for xpalloc.
12460
12461 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12462 (xnmalloc, xnrealloc, xpalloc): New functions.
12463
12464 * bidi.c (bidi_shelve_header_size): New constant.
12465 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12466 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12467
12468 * bidi.c (bidi_cache_shrink):
12469 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12470 (overlay_strings):
12471 Don't update size of array until after memory allocation succeeds,
12472 because xmalloc/xrealloc may not return.
12473 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12474 now that we have proper integer overflow checking.
12475 (record_overlay_string, overlay_strings): Catch overflows when
12476 calculating size of overlay_str_buf.
12477
12478 * callproc.c (Fcall_process): Check for size overflow when
12479 calculating size of args2.
12480 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12481 Normally we prefer signed values, but sticking with ptrdiff_t would
12482 require adding more-complicated checks.
12483
12484 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12485 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12486 Redo buffer-overflow calculations to avoid integer overflow.
12487 Add a FIXME comment where memory seems to be over-allocated.
12488
12489 * character.c (Fstring): Check for size-calculation overflow.
12490
12491 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12492 unnecessary integer overflow. Check for size overflow.
12493 (encode_coding_object): Don't update size until xmalloc succeeds.
12494
12495 * composite.c (get_composition_id): Check for overflow in glyph
12496 length calculations.
12497
12498 Integer and memory overflow fixes for display code.
12499 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12500 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12501 (scrolling_window): Check for overflow in size calculations.
12502 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12503 Don't assume glyph table len fits in int.
12504 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12505 (row_table_size): Now ptrdiff_t, not int.
12506 (scrolling_window): Avoid overflow in size calculations.
12507 Don't update size until allocation succeeds.
12508 * fns.c (concat): Check for overflow in size calculations.
12509 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12510 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12511 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12512
12513 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12514 (get_doc_string): Check for size calculation overflow.
12515 Don't update size until allocation succeeds.
12516 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12517 EMACS_INT, where ptrdiff_t will do.
12518 (Fsubstitute_command_keys): Check for string overflow.
12519
12520 * editfns.c (set_time_zone_rule): Don't assume environment length
12521 fits in int.
12522 (message_length): Now ptrdiff_t, not int.
12523 (Fmessage_box): Don't update size until allocation succeeds.
12524 Don't assume message length fits in int.
12525 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12526
12527 * emacs.c (main): Do not reallocate argv, since there is a null at
12528 the end that can be overwritten, and this way there's no need to
12529 worry about size-calculation overflow.
12530 (sort_args): Check for size-calculation overflow.
12531
12532 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12533 alloc succeeds.
12534 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12535
12536 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12537 (x_set_scroll_bar_width, x_figure_window_size):
12538 Check for integer overflow.
12539 (x_set_alpha): Do not assume XINT fits in int.
12540
12541 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12542 This is for the members text_lines, text_cols, total_lines, total_cols,
12543 where the system imposes an 'int' limit.
12544
12545 * fringe.c (Fdefine_fringe_bitmap):
12546 Don't update size until alloc works.
12547
12548 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12549 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12550
12551 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12552 Check for size-calculation overflow.
12553 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12554 do, as we prefer signed integers.
12555 (id_to_widget.max_size, id_to_widget.used)
12556 (xg_store_widget_in_map, xg_remove_widget_from_map)
12557 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12558 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12559 Use and return ptrdiff_t, not int.
12560 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12561 * gtkutil.h: Change prototypes to match the above.
12562
12563 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12564 are duplicate now that they've been promoted to lisp.h.
12565 (x_allocate_bitmap_record, x_alloc_image_color)
12566 (make_image_cache, cache_image, xpm_load):
12567 Don't update size until alloc is done.
12568 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12569 (x_detect_edges):
12570 Check for size calculation overflow.
12571 (ct_colors_allocated_max): New constant.
12572 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12573 overflow.
12574
12575 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12576 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12577 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12578 Use ptrdiff_t, not int, to count maps.
12579 (read_char_minibuf_menu_prompt): Check for overflow in size
12580 calculations. Don't update size until allocation succeeds.
12581 Redo calculations to avoid overflow.
12582 * keyboard.h: Change prototypes to match the above.
12583
12584 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12585 to count maps.
12586 (current_minor_maps): Check for size calculation overflow.
12587 * keymap.h: Change prototypes to match the above.
12588
12589 * lread.c (read1, init_obarray): Don't update size until alloc done.
12590
12591 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12592 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12593
12594 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12595 Now ptrdiff_t, not int.
12596 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12597 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12598
12599 * process.c (Fnetwork_interface_list): Check for overflow
12600 in size calculation.
12601
12602 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12603
12604 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12605 overflow. Don't bother calling xmalloc when xrealloc will do.
12606
12607 * search.c (Freplace_match): Check for size calculation overflow.
12608 (Fset_match_data): Don't assume list lengths fit in 'int'.
12609
12610 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12611 for command line length. Do not attempt to address one before the
12612 beginning of an array, as that's not portable.
12613
12614 * term.c (max_frame_lines): Remove; unused.
12615 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12616 not int.
12617 (encode_terminal_code, calculate_costs): Check for size
12618 calculation overflow.
12619 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12620 table lengths and related sizes. Don't update size until alloc
12621 done. Redo calculations to avoid overflow.
12622 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12623
12624 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12625 subtracting pointers.
12626 (gobble_line): Check for overflow more carefully. Don't update size
12627 until alloc done.
12628
12629 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12630 Don't update size until alloc done.
12631 Redo size calculations to avoid overflow.
12632 Check for size calculation overflow.
12633 (main) [DEBUG]: Fix typo in invoking tparam1.
12634
12635 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12636 Use ptrdiff_t, not int, for sizes.
12637 (store_mode_line_noprop_char): Don't update size until alloc done.
12638
12639 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12640 Use ptrdiff_t, not int, for sizes.
12641 (Finternal_make_lisp_face, cache_face):
12642 Check for size calculation overflow.
12643 (cache_face): Treat size calculation overflows as if they were
12644 memory exhaustion (the usual treatment), rather than aborting.
12645
12646 * xfns.c (x_encode_text, x_set_name_internal)
12647 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12648 sizes, since they can exceed INT_MAX in size. Check for size
12649 calculation overflow.
12650
12651 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12652 (xg_select): Check for size calculation overflow.
12653 Don't update size until alloc done.
12654
12655 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12656 as sprintf is limited to int lengths.
12657
12658 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12659 (X_LONG_MIN): New macros.
12660 Use them to make the following changes clearer.
12661 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12662 This change doesn't affect the value now, but it may help remind
12663 future maintainers not to raise the value too much later.
12664 (SELECTION_QUANTUM): Remove, replacing with ...
12665 (selection_quantum): ... new function, which avoids overflow.
12666 All uses changed.
12667 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12668 assumption that selection length fits in 'int'.
12669 (x_reply_selection_request, x_handle_selection_request)
12670 (x_get_window_property, receive_incremental_selection)
12671 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12672 (lisp_data_to_selection_data, clean_local_selection_data):
12673 Use ptrdiff_t, not int, to record length of selection.
12674 (x_reply_selection_request, x_get_window_property)
12675 (receive_incremental_selection, x_property_data_to_lisp):
12676 Redo calculations to avoid overflow.
12677 (x_reply_selection_request): When sending hint, ceiling it at
12678 X_LONG_MAX rather than relying on wraparound overflow to send
12679 something.
12680 (x_get_window_property, receive_incremental_selection)
12681 (lisp_data_to_selection_data, x_property_data_to_lisp):
12682 Check for size-calculation overflow.
12683 (x_get_window_property, receive_incremental_selection)
12684 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12685 Don't store size until memory allocation succeeds.
12686 (x_get_window_property): Plug memory leak on memory exhaustion.
12687 Don't double-block input; malloc is safe here. Don't assume 2**34
12688 - 4 fits in unsigned long. Add an xassert to check
12689 XGetWindowProperty overflow. Be more careful about overflow
12690 calculations, and distinguish size from memory overflow better.
12691 (receive_incremental_selection): When tracing, don't assume
12692 unsigned int is less than INT_MAX.
12693 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12694 harmful) conversions of unsigned short to int.
12695 (lisp_data_to_selection_data): Don't assume that integers
12696 in the range -65535 through -1 fit in an X unsigned short.
12697 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12698 result parameters unless successful. Rely on cons_to_unsigned
12699 to report problems with elements; the old code wasn't right anyway.
12700 (x_check_property_data): Check for int overflow; we cannot use
12701 a wider type due to X limits.
12702 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12703
12704 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12705
12706 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12707 (x_term_init): Check for size calculation overflow.
12708 (x_color_cells): Don't store size until memory allocation succeeds.
12709 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12710 Don't assume alloca size is less than MAX_ALLOCA.
12711 (x_term_init): Don't assume length fits in int (sprintf is limited
12712 to int size).
12713
12714 Use ptrdiff_t for composition IDs.
12715 * character.c (lisp_string_width):
12716 * composite.c (composition_table_size, n_compositions)
12717 (get_composition_id, composition_gstring_from_id):
12718 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12719 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12720 * window.c (Frecenter):
12721 Use ptrdiff_t, not int, for composition IDs.
12722 * composite.c (get_composition_id): Check for integer overflow.
12723 * composite.h: Adjust prototypes to match the above changes.
12724
12725 Use ptrdiff_t for hash table indexes.
12726 * category.c (hash_get_category_set):
12727 * ccl.c (ccl_driver):
12728 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12729 * coding.c (coding_system_charset_list, detect_coding_system):
12730 * coding.h (struct coding_system.id):
12731 * composite.c (get_composition_id, gstring_lookup_cache):
12732 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12733 * image.c (xpm_get_color_table_h):
12734 * lisp.h (hash_lookup, hash_put):
12735 * minibuf.c (Ftest_completion):
12736 Use ptrdiff_t for hash table indexes, not int (which is too
12737 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12738 32-bit --with-wide-int hosts).
12739
12740 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12741 Add a FIXME comment about memory leaks.
12742 (syms_of_charset): Don't assume xmalloc returns.
12743
12744 Don't assume that stated character widths fit in int.
12745 * character.c (Fchar_width, c_string_width, lisp_string_width):
12746 * character.h (CHAR_WIDTH):
12747 * indent.c (MULTIBYTE_BYTES_WIDTH):
12748 Use sanitize_char_width to avoid undefined and/or bad behavior
12749 with outlandish widths.
12750 * character.h (sanitize_tab_width): Rename from sanitize_width,
12751 now that we have two such functions. All uses changed.
12752 (sanitize_char_width): New inline function.
12753
12754 Don't assume that tab-width fits in int.
12755 * character.h (sanitize_width): New inline function.
12756 (SANE_TAB_WIDTH): New macro.
12757 (ASCII_CHAR_WIDTH): Use it.
12758 * indent.c (sane_tab_width): Remove. All uses replaced by
12759 SANE_TAB_WIDTH (current_buffer).
12760 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12761
12762 * fileio.c: Integer overflow issues with file modes.
12763 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12764
12765 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12766 Remove unreachable code.
12767 (read_hex, load_charset_map_from_file): Check for integer overflow.
12768
12769 * xterm.c: Don't go over XClientMessageEvent limit.
12770 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12771 (x_send_scroll_bar_event): Likewise. Check that the size does not
12772 exceed limits imposed by XClientMessageEvent, as well as the usual
12773 ptrdiff_t and size_t limits.
12774
12775 * keyboard.c: Overflow, signedness and related fixes.
12776 (make_lispy_movement): Use same integer type in forward decl
12777 that is used in the definition.
12778 (read_key_sequence, keyremap_step):
12779 Change bufsize argument back to int, undoing my 2011-03-30 change.
12780 We prefer signed types, and int is wide enough here.
12781 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12782 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12783 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12784 length, not size_t. Use ptrdiff_t for index, not int.
12785 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12786 possibility of integer overflow.
12787
12788 Overflow, signedness and related fixes for images.
12789
12790 * dispextern.h (struct it.stack[0].u.image.image_id)
12791 (struct_it.image_id, struct image.id, struct image_cache.size)
12792 (struct image_cache.used, struct image_cache.ref_count):
12793 * gtkutil.c (update_frame_tool_bar):
12794 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12795 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12796 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12797 * nsmenu.m (update_frame_tool_bar):
12798 * xdisp.c (calc_pixel_width_or_height):
12799 * xfns.c (image_cache_refcount):
12800 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12801 on typical 64-bit hosts.
12802
12803 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12804 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12805 Omit unnecessary casts to int.
12806 (parse_image_spec): Check that integers fall into 'int' range
12807 when the callers expect that.
12808 (image_ascent): Redo ascent calculation to avoid int overflow.
12809 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12810 (lookup_image): Remove unnecessary tests.
12811 (xbm_image_p): Locals are now of int, not EMACS_INT,
12812 since parse_image_check makes sure they fit into int.
12813 (png_load, gif_load, svg_load_image):
12814 Prefer int to unsigned where either will do.
12815 (tiff_handler): New function, combining the cores of the
12816 old tiff_error_handler and tiff_warning_handler.
12817 This function is rewritten to use vsnprintf and thereby avoid
12818 stack buffer overflows. It uses only the features of vsnprintf
12819 that are common to both POSIX and native Microsoft.
12820 (tiff_error_handler, tiff_warning_handler): Use it.
12821 (tiff_load, gif_load, imagemagick_load_image):
12822 Don't assume :index value fits in 'int'.
12823 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12824 (imagemagick_load_image): Check that crop parameters fit into
12825 the integer types that MagickCropImage accepts. Don't assume
12826 Vimagemagick_render_type has a nonnegative value. Don't assume
12827 size_t fits in 'long'.
12828 (gs_load): Use printmax_t to print the widest integers possible.
12829 Check for integer overflow when computing image height and width.
12830
12831 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12832
12833 * xdisp.c (redisplay_window): Don't force window start if point
12834 will be invisible in the resulting window. (Bug#9324)
12835
12836 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12837
12838 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12839 the display spec is of the form `(space ...)'.
12840 (handle_display_spec): Return the value returned by
12841 handle_single_display_spec, not just 1 or zero.
12842 (handle_single_display_spec): If the display spec is of the form
12843 `(space ...)', and specifies display in the text area, return 2
12844 rather than 1.
12845 (try_cursor_movement): Check for the need to scroll more
12846 accurately, and prefer exact match for point under bidi.
12847 Don't advance `row' beyond the last row of the window.
12848
12849 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12850 into disp_prop; all users changed.
12851
12852 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12853 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12854 for the text covered by the display property.
12855
12856 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12857
12858 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12859 Change return value to nil.
12860 (Frecord_buffer): Delete unused function.
12861
12862 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12863
12864 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12865 buffers, return left-to-right.
12866 (set_cursor_from_row): Consider candidate row a win if its glyph
12867 represents a newline and point is on that newline. Fixes cursor
12868 positioning on the newline at EOL of R2L text within L2R
12869 paragraph, and vice versa.
12870 (try_cursor_movement): Check continued rows, in addition to
12871 continuation rows. Fixes unwarranted scroll when point enters a
12872 continued line of R2L text within an L2R paragraph, or vice versa.
12873 (cursor_row_p): Consider the case of point being equal to
12874 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12875 from the end of a short line to the beginning of a continued line
12876 of R2L text within L2R paragraph.
12877 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12878 composed characters.
12879
12880 * bidi.c (bidi_check_type): Use xassert.
12881 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12882 members.
12883
12884 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12885
12886 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12887 a character.
12888
12889 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12890
12891 * nsfont.m (ns_otf_to_script): Fix typo.
12892
12893 2011-08-22 Kenichi Handa <handa@m17n.org>
12894
12895 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12896 extra slot even if the purpose is char-code-property-table.
12897
12898 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12899
12900 * xdisp.c (redisplay_window): When computing centering_position,
12901 account for the height of the header line. (Bug#8874)
12902
12903 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12904 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12905 candidate is selected by the mouse, and that candidate has a
12906 composed character under the mouse.
12907
12908 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12909 coordinates reported by pos-visible-in-window-p for a composed
12910 character in column zero.
12911
12912 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12913
12914 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12915
12916 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12917
12918 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12919 consider it a hit if to_charpos is anywhere in the range of the
12920 composed buffer positions.
12921
12922 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12923
12924 * image.c (gif_load): Don't assume that each subimage has the same
12925 dimensions as the base image. Handle disposal method that is
12926 "undefined" by the gif spec (Bug#9335).
12927
12928 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12929
12930 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12931 (Fcondition_case): Document `debug' symbol in error handler.
12932
12933 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12934
12935 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12936 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12937 from an Org mode buffer to a Speedbar frame.
12938
12939 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12940 a composition, take its buffer position from IT->cmp_it.charpos.
12941 Fixes cursor positioning at the beginning of a line that begins
12942 with a composed character.
12943
12944 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12945
12946 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12947 character bidirectional type, use STRONG_L instead. Fixes crashes
12948 in a buffer produced by `describe-categories'.
12949
12950 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12951 members before the level stack, so they would be saved and
12952 restored when copying iterator state. Fixes incorrect reordering
12953 around TABs covered by display properties.
12954
12955 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12956
12957 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12958
12959 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12960
12961 * eval.c (internal_condition_case, internal_condition_case_1)
12962 (internal_condition_case_2, internal_condition_case_n):
12963 Remove unnecessary aborts (Bug#9081).
12964
12965 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12966
12967 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12968 has no `load' handler, try opening the file locally. (Bug#9311)
12969
12970 2011-08-16 Ken Brown <kbrown@cornell.edu>
12971
12972 * gmalloc.c: Expand comment.
12973
12974 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12975
12976 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12977 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12978
12979 2011-08-16 Ken Brown <kbrown@cornell.edu>
12980
12981 Fix memory allocation problems in Cygwin build (Bug#9273).
12982
12983 * unexcw.c ( __malloc_initialized): Declare external variable.
12984 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12985
12986 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12987 New variables.
12988 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12989 dumped emacs.
12990 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12991 in the static heap.
12992 [CYGWIN] (special_realloc): New function.
12993 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12994 requests to realloc storage in the static heap.
12995
12996 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12997
12998 * bidi.c (bidi_initialize): Remove unused local.
12999
13000 2011-08-15 Eli Zaretskii <eliz@gnu.org>
13001
13002 * bidimirror.h:
13003 * biditype.h: Remove file.
13004 * makefile.w32-in ($(BLD)/bidi.$(O)):
13005 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
13006
13007 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13008
13009 * chartab.c: Improve commentary for the uniprop_table API.
13010
13011 * bidi.c (bidi_paragraph_init): Support zero value of
13012 bidi_ignore_explicit_marks_for_paragraph_level.
13013 (bidi_initialize): Use uniprop_table instead of including
13014 biditype.h and bidimirror.h.
13015
13016 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13017 coordinates of the iterator when restoring from ppos_it.
13018 (Bug#9296)
13019
13020 2011-08-14 Kenichi Handa <handa@m17n.org>
13021
13022 * process.c (create_process): Call setup_process_coding_systems
13023 after the pid of the process is set to -1 (Bug#8162).
13024
13025 2011-08-14 Eli Zaretskii <eliz@gnu.org>
13026
13027 * xdisp.c (move_it_in_display_line_to): Don't invoke
13028 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13029 ppos_it. Fixes vertical cursor motion when line beginning is
13030 covered by an image. (Bug#9296)
13031
13032 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13033
13034 * nsterm.h (ns_run_ascript): Declare.
13035 (NSAPP_DATA2_RUNASSCRIPT): Define.
13036
13037 * nsfns.m (as_script, as_result, as_status): New static variables.
13038 (ns_run_ascript): New function.
13039 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
13040 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13041 the event loop. Get status from as_status (Bug#7276).
13042
13043 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13044 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13045 the event loop (Bug#7276).
13046
13047 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13048
13049 * gnutls.c (QCgnutls_bootprop_priority)
13050 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13051 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13052 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13053 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13054 (QCgnutls_bootprop_verify_hostname_error)
13055 (QCgnutls_bootprop_callbacks_verify): Rename from
13056 Qgnutls_bootprop_..., all uses changed.
13057
13058 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13059 uses changed.
13060
13061 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13062
13063 * xfaces.c (Qframe_set_background_mode): Now static.
13064 * dispextern.h (Qframe_set_background_mode): Remove decl.
13065
13066 * process.c (Fnetwork_interface_info): Declare local only if needed.
13067
13068 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13069
13070 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13071 (Fnetwork_interface_list): Allocate in increments of bytes instead
13072 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13073 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13074 sockaddr.
13075 (struct ifflag_def): notrailers is smart on OSX.
13076 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13077 Get hardware address with getifaddrs if available.
13078
13079 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13080
13081 * xdisp.c (iterate_out_of_display_property): xassert that
13082 IT->position is set to within IT->object's boundaries. Break from
13083 the loop as soon as EOB is reached; avoids infloops in redisplay
13084 when IT->position is set up wrongly due to some bug.
13085 Set IT->current to match the bidi iterator unconditionally.
13086 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13087 entry. Force push_it to save on the stack the current
13088 buffer/string position, to be restored by pop_it. Fix flags in
13089 the iterator structure wrt the object coming from a display
13090 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13091 properties. (Bug#9284)
13092
13093 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13094
13095 * fontset.c (fontset_get_font_group): Add proper type checks.
13096 (Bug#9172)
13097
13098 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13099
13100 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13101 and LC_VERSION_MIN_MACOSX.
13102 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13103 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13104
13105 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13106
13107 * xdisp.c (forward_to_next_line_start): Allow to use the
13108 no-display-properties-and-no-overlays under bidi display.
13109 Set disp_pos in the bidi iterator to avoid searches for display
13110 properties and overlays.
13111
13112 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13113
13114 * editfns.c (Fset_time_zone_rule): Document relationship with the
13115 setenv function.
13116
13117 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13118 the font entity extracted from the cache (Bug#8109).
13119
13120 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13121
13122 * composite.c (autocmp_chars): Don't reset point. That is done by
13123 restore_point_unwind (Bug#5984).
13124
13125 2011-08-07 Juri Linkov <juri@jurta.org>
13126
13127 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13128 to show the arg `TIME' instead of `TIMEVAL'.
13129
13130 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13131
13132 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13133 display property strides EOL and includes a newline, as in
13134 longlines-mode. (Bug#9254)
13135 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13136 word-wrap under bidirectional display. (Bug#9224)
13137
13138 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13139 is non-zero, even if the data buffer is NULL. Fixes a crash in
13140 vertical-motion with longlines-mode. (Bug#9254)
13141
13142 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13143
13144 * bidi.c <bidi_cache_total_alloc>: Now static.
13145 (bidi_initialize): Initialize bidi_cache_total_alloc.
13146
13147 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13148 cache. (Bug#9221)
13149
13150 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13151 amount allocated this far in `bidi_cache_total_alloc'.
13152 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13153 non-zero, only free the data buffer without restoring the cache
13154 contents. All callers changed.
13155
13156 * dispextern.h (bidi_unshelve_cache): Update prototype.
13157
13158 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13159 (move_it_in_display_line, move_it_to)
13160 (move_it_vertically_backward, move_it_by_lines): Replace the call
13161 to xfree to an equivalent call to bidi_unshelve_cache.
13162 (move_it_in_display_line_to): Fix logic of returning
13163 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13164
13165 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13166
13167 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13168 came from a string character with a `cursor' property. (Bug#9229)
13169
13170 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13171
13172 * Makefile.in (LIB_PTHREAD): New variable.
13173 (LIBES): Add LIB_PTHREAD (Bug#9216).
13174
13175 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13176 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13177
13178 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13179
13180 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13181
13182 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13183
13184 * xterm.c (x_find_topmost_parent): New function.
13185 (x_set_frame_alpha): Find topmost parent window with
13186 x_find_topmost_parent and set the property there also (bug#9181).
13187 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13188
13189 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13190
13191 * callproc.c (Fcall_process): Avoid vfork clobbering
13192 the local vars buffer, coding_systems, current_dir.
13193
13194 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13195
13196 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13197
13198 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13199
13200 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13201 so that it is not optimized away.
13202
13203 * xdisp.c (compute_display_string_pos): Remove unused local.
13204
13205 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13206
13207 Fix slow cursor motion and scrolling in large buffers with
13208 selective display, like Org Mode buffers. (Bug#9218)
13209
13210 * dispextern.h (struct bidi_it): New member disp_prop_p.
13211
13212 * xdisp.c: Remove one-slot cache of display string positions.
13213 (compute_display_string_pos): Accept an additional argument
13214 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13215 for a display string or property. If found, set DISP_PROP_P
13216 non-zero.
13217
13218 * bidi.c (bidi_fetch_char): Accept an additional argument
13219 DISP_PROP_P, and pass it to compute_display_string_pos.
13220 Only handle text covered by a display string if DISP_PROP_P is returned
13221 non-zero. All callers of bidi_fetch_char changed.
13222
13223 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13224
13225 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13226
13227 2010-12-03 Don March <don@ohspite.net>
13228
13229 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13230 last character M-[char] is translated to ESC [char] (bug#7541).
13231
13232 2011-08-02 Kenichi Handa <handa@m17n.org>
13233
13234 * lisp.h (uniprop_table): Extern it.
13235
13236 * chartab.c (uniprop_table): Make it non-static.
13237
13238 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13239
13240 * xdisp.c (forward_to_next_line_start): Accept additional argument
13241 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13242 on the newline.
13243 (reseat_at_next_visible_line_start): Use the bidi iterator state
13244 returned by forward_to_next_line_start to restore the state of
13245 it->bidi_it after backing up to previous newline. (Bug#9212)
13246
13247 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13248
13249 * regex.c (re_comp): Protoize.
13250 (re_exec): Fix return type.
13251 (regexec): Fix type of `ret'. (Bug#9203)
13252
13253 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13254
13255 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13256 This is needed if max-image-size is a floating-point number.
13257
13258 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13259
13260 * print.c (print_object): Print empty symbol as ##.
13261
13262 * lread.c (read1): Read ## as empty symbol.
13263
13264 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13265
13266 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13267 setting frame foreground color (Bug#9175).
13268 (x_set_background_color): Likewise.
13269
13270 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13271 contents (Bug#9176).
13272 (EmacsTooltip -init): Remove bezels and add shadows to
13273 tooltip windows.
13274
13275 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13276 or scroll bar (Bug#8470).
13277
13278 * nsfont.m (nsfont_open): Remove assignment to voffset and
13279 unnecessary vars hshink, expand, hd, full_height, min_height.
13280 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13281
13282 * nsterm.h (nsfont_info): Remove voffset field.
13283
13284 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13285
13286 Implement strike-through and overline on NextStep (Bug#8863).
13287
13288 * nsfont.m (nsfont_open): Use underline position provided by font,
13289 instead of hard-coded value of 2.
13290 (nsfont_draw): Call ns_draw_text_decoration instead.
13291
13292 * nsterm.h: Add declaration for ns_draw_text_decoration.
13293
13294 * nsterm.m (ns_draw_text_decoration): New function for drawing
13295 underline, overline, and strike-through.
13296 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13297 ns_draw_text_decoration. Change treatment of cursor drawing to
13298 accommodate underlining, etc.
13299
13300 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13301
13302 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13303 default.
13304
13305 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13306
13307 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13308 Without this fix, if a signal arrives just after memory fills up,
13309 'malloc' might be invoked reentrantly.
13310
13311 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13312 In other words, assume that every image size is allowed, on non-X
13313 hosts. This assumption is probably wrong, but it lets Emacs compile.
13314
13315 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13316
13317 * regex.c (re_iswctype): Convert return values to boolean.
13318
13319 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13320
13321 * xdisp.c (compute_display_string_pos): Don't use cached display
13322 string position if the buffer had its restriction changed.
13323 (Bug#9184)
13324
13325 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13326
13327 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13328
13329 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13330
13331 Integer signedness and overflow and related fixes. (Bug#9079)
13332
13333 * bidi.c: Integer size and overflow fixes.
13334 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13335 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13336 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13337 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13338 (bidi_find_other_level_edge):
13339 Use ptrdiff_t instead of EMACS_INT where either will do.
13340 This works better on 32-bit hosts configured --with-wide-int.
13341 (bidi_cache_ensure_space): Check for size-calculation overflow.
13342 Use % rather than repeated addition, for better worst-case speed.
13343 Don't set bidi_cache_size until after xrealloc returns, because it
13344 might not return.
13345 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13346 (bidi_cache_ensure_space): Also check that the bidi cache size
13347 does not exceed that of the largest Lisp string or buffer. See Eli
13348 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13349
13350 * alloc.c (__malloc_size_t): Remove.
13351 All uses replaced by size_t. See Andreas Schwab's note
13352 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13353
13354 * image.c: Improve checking for integer overflow.
13355 (check_image_size): Assume that f is nonnull, since
13356 it is always nonnull in practice. This is one less thing to
13357 worry about when checking for integer overflow later.
13358 (x_check_image_size): New function, which checks for integer
13359 overflow issues inside X.
13360 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13361 This removes the need for a memory_full check.
13362 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13363 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13364 (xbm_read_bitmap_data): Change locals back to 'int', since
13365 their values must fit in 'int'.
13366 (xpm_load_image, png_load, tiff_load):
13367 Invoke x_create_x_image_and_pixmap earlier,
13368 to avoid much needless work if the image is too large.
13369 (tiff_load): Treat overly large images as if
13370 x_create_x_image_and_pixmap failed, not as malloc failures.
13371 (gs_load): Use x_check_image_size.
13372
13373 * gtkutil.c: Omit integer casts.
13374 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13375 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13376
13377 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13378
13379 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13380 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13381 would wrongly return t on a 64-bit host.
13382
13383 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13384 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13385 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13386 and therefore cause GCC to emit a bogus diagnostic in some cases.
13387
13388 * image.c: Integer signedness and overflow and related fixes.
13389 This is not an exhaustive set of fixes, but it's time to
13390 record what I've got.
13391 (lookup_pixel_color, check_image_size): Remove redundant decls.
13392 (check_image_size): Don't assume that arbitrary EMACS_INT values
13393 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13394 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13395 (tiff_load, imagemagick_load_image):
13396 Check for overflow in size calculations.
13397 (x_create_x_image_and_pixmap): Remove unnecessary test for
13398 xmalloc returning NULL; that can't happen.
13399 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13400 (xpm_color_bucket): Use better integer hashing function.
13401 (xpm_cache_color): Don't possibly over-allocate memory.
13402 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13403 (gif_memory_source):
13404 Use ptrdiff_t, not int or size_t, to record sizes.
13405 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13406 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13407 either works, as we prefer signed integers.
13408 (tiff_read_from_memory, tiff_write_from_memory):
13409 Return tsize_t, not size_t, since that's what the TIFF API wants.
13410 (tiff_read_from_memory): Don't fail simply because the read would
13411 go past EOF; instead, return a short read.
13412 (tiff_load): Omit no-longer-needed casts.
13413 (Fimagemagick_types): Don't assume size fits into 'int'.
13414
13415 Improve hashing quality when configured --with-wide-int.
13416 * fns.c (hash_string): New function, taken from sxhash_string.
13417 Do not discard information about ASCII character case; this
13418 discarding is no longer needed.
13419 (sxhash-string): Use it. Change sig to match it. Caller changed.
13420 * lisp.h: Declare it.
13421 * lread.c (hash_string): Remove, since we now use fns.c's version.
13422 The fns.c version returns a wider integer if --with-wide-int is
13423 specified, so this should help the quality of the hashing a bit.
13424
13425 * emacs.c: Integer overflow minor fix.
13426 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13427 Define only if GNU_LINUX.
13428 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13429
13430 * dispnew.c: Integer signedness and overflow fixes.
13431 Remove unnecessary forward decls, that were a maintenance hassle.
13432 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13433 All uses changed.
13434 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13435 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13436 (prepare_desired_row, line_draw_cost):
13437 Use int, not unsigned, where either works.
13438 (save_current_matrix, restore_current_matrix):
13439 Use ptrdiff_t, not size_t, where either works.
13440 (init_display): Check for overflow more accurately, and without
13441 relying on undefined behavior.
13442
13443 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13444 Remove, replacing with the new symbols in lisp.h. All uses changed.
13445 * fileio.c (make_temp_name):
13446 * filelock.c (lock_file_1, lock_file):
13447 * xdisp.c (message_dolog):
13448 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13449 Use pMd etc. instead.
13450 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13451 replacing the pWIDE etc. symbols removed from editfns.c.
13452
13453 * keyboard.h (num_input_events): Now uintmax_t.
13454 This is (very slightly) less likely to mess up due to wraparound.
13455 All uses changed.
13456
13457 * buffer.c: Integer signedness fixes.
13458 (alloc_buffer_text, enlarge_buffer_text):
13459 Use ptrdiff_t rather than size_t when either will do, as we prefer
13460 signed integers.
13461
13462 * alloc.c: Integer signedness and overflow fixes.
13463 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13464 (__malloc_size_t): Default to size_t, not to int.
13465 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13466 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13467 Prefer ptrdiff_t to size_t when either would do, as we prefer
13468 signed integers.
13469 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13470 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13471 Now const. Initialize with values that are in range even if char
13472 is signed.
13473 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13474 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13475 These functions do the right thing with sizes > 2**32.
13476 (check_depth): Now ptrdiff_t, not int.
13477 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13478 Adjust to new way of storing sizes. Check for size overflow bugs
13479 in rest of code.
13480 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13481 slightly wrong anyway, as it missed one instance of
13482 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13483 (refill_memory_reserve): Omit needless cast to size_t.
13484 (mark_object_loop_halt): Mark as externally visible.
13485
13486 * xselect.c: Integer signedness and overflow fixes.
13487 (Fx_register_dnd_atom, x_handle_dnd_message):
13488 Use ptrdiff_t, not size_t, since we prefer signed.
13489 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13490 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13491 x_dnd_atoms_size and x_dnd_atoms_length.
13492
13493 * doprnt.c: Prefer signed to unsigned when either works.
13494 * eval.c (verror):
13495 * doprnt.c (doprnt):
13496 * lisp.h (doprnt):
13497 * xdisp.c (vmessage):
13498 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13499 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13500 prefer signed arithmetic to avoid comparison confusion.
13501 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13502 but is a bit tricky.
13503
13504 Assume freestanding C89 headers, string.h, stdlib.h.
13505 * data.c, doprnt.c, floatfns.c, print.c:
13506 Include float.h unconditionally.
13507 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13508 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13509 * regex.c: Likewise for stddef.h, string.h.
13510 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13511 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13512 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13513 (STDC_HEADERS): Remove obsolete defines.
13514 * sysdep.c: Include limits.h unconditionally.
13515
13516 Assume support for memcmp, memcpy, memmove, memset.
13517 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13518 * regex.c (memcmp, memcpy):
13519 Remove; we assume C89 now.
13520
13521 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13522 (__malloc_safe_bcopy): Remove; no longer needed.
13523
13524 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13525 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13526 well either way, and we prefer signed to unsigned.
13527
13528 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13529
13530 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13531 closes the connection while we're reading (bug#9182).
13532
13533 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13534
13535 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13536 are specified (Bug#9168).
13537
13538 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13539
13540 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13541 Found by GCC static checking and --with-wide-int on a 32-bit host.
13542
13543 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13544
13545 * xdisp.c (compute_display_string_pos): Fix logic of caching
13546 previous display string position. Initialize cached_prev_pos to
13547 -1. Fixes slow-down at the beginning of a buffer.
13548
13549 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13550
13551 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13552 for attrs[LFACE_FONTSET_INDEX].
13553
13554 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13555
13556 * xml.c (parse_region): Remove unused local
13557 that was recently introduced.
13558
13559 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13560
13561 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13562 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13563
13564 * xdisp.c (move_it_in_display_line_to): Record the best matching
13565 position for TO_CHARPOS while scanning the line, and restore it on
13566 exit if none of the characters scanned was an exact match.
13567 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13568 when exact match is impossible due to invisible text, and the
13569 lines are truncated.
13570
13571 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13572
13573 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13574 for OSX >= 10.7.
13575
13576 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13577
13578 Fix a significant slow-down of cursor motion with C-n, C-p,
13579 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13580 auto-repeat under bidi redisplay in fontified buffers.
13581 * xdisp.c (compute_stop_pos_backwards): New function.
13582 (next_element_from_buffer): Call compute_stop_pos_backwards to
13583 find a suitable prev_stop when we find ourselves before
13584 base_level_stop.
13585 (reseat): Don't look for prev_stop, as that could mean a very long
13586 run.
13587 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13588 <cached_disp_overlay_modiff>: Cache for last found display string
13589 position.
13590 (compute_display_string_pos): Return the cached position if asked
13591 about the same buffer in the same area of character positions, and
13592 the buffer wasn't changed since the time the display string
13593 position was cached.
13594
13595 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13596
13597 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13598 is an integer, which is important for empty lines. (Bug#9149)
13599
13600 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13601
13602 * frame.c (Fmodify_frame_parameters): In tty case, update the
13603 default face if necessary (Bug#4238).
13604
13605 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13606
13607 * editfns.c (Fstring_to_char): No need to explain what a character
13608 is in the docstring (Bug#6576).
13609
13610 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13611
13612 * xml.c (parse_region): Make sure we always return a tree.
13613
13614 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13615
13616 * xml.c (parse_region): If a document contains only comments,
13617 return that, too.
13618
13619 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13620
13621 * xml.c (make_dom): Return comments, too.
13622
13623 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13624
13625 Port to OpenBSD.
13626 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13627 and the surrounding thread.
13628 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13629 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13630 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13631 timer goes off.
13632 * s/openbsd.h (BROKEN_SIGIO): Define.
13633 * unexelf.c (unexec) [__OpenBSD__]:
13634 Don't update the .mdebug section of the Alpha COFF symbol table.
13635
13636 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13637
13638 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13639 (bug#8460).
13640
13641 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13642
13643 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13644 This fixes some race conditions on the permissions of any newly
13645 created file.
13646
13647 * alloc.c (valid_pointer_p): Use pipe, not open.
13648 This fixes some permissions issues when debugging.
13649
13650 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13651 If fchown fails to set both uid and gid, try to set just gid,
13652 as that is sometimes allowed. Adjust the file's mode to eliminate
13653 setuid or setgid bits that are inappropriate if fchown fails.
13654
13655 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13656
13657 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13658 to compare Lisp_Objects.
13659 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13660 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13661 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13662
13663 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13664
13665 * lread.c (read_integer): Unread even EOF character.
13666 (read1): Likewise. Properly record start position of symbol.
13667
13668 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13669 symbol character follows.
13670
13671 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13672
13673 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13674 This works around a problem with the previous change to Fcopy_file.
13675 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13676 and without this change, GCC might complain about discarding
13677 fchown's return value.
13678
13679 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13680
13681 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13682
13683 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13684
13685 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13686
13687 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13688
13689 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13690 it's used from the C level.
13691
13692 * process.c: Use the same condition for POLL_FOR_INPUT in both
13693 keyboard.c and process.c (bug#1858).
13694
13695 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13696
13697 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13698 (Fgnutls_boot): Use it.
13699
13700 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13701
13702 * doc.c (Fsubstitute_command_keys): Revert last change.
13703
13704 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13705
13706 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13707 quotes the next character, and doesn't affect other longer
13708 sequences (bug#8935).
13709
13710 * lread.c (syms_of_lread): Clarify that is isn't only
13711 `eval-buffer' and `eval-defun' that's affected by
13712 `lexical-binding' (bug#8460).
13713
13714 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13715
13716 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13717 bidi redisplay when a line includes both an image and is truncated.
13718
13719 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13720
13721 Fix minor problems found by static checking.
13722 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13723 (elsz): Now a signed constant, not a size_t var. We prefer signed
13724 types to unsigned, to avoid integer comparison confusion. Without
13725 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13726 "cannot optimize loop, the loop counter may overflow", a symptom
13727 of the confusion.
13728 * indent.c (Fvertical_motion): Mark locals as initialized.
13729 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13730
13731 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13732
13733 * search.c (Fre_search_backward): Mention `case-fold-search' in
13734 all the re_search_* functions (bug#8138).
13735
13736 * keyboard.c (Fopen_dribble_file): Document when the file is
13737 closed (bug#8056).
13738
13739 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13740
13741 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13742 bidi_cache_idx.
13743
13744 Support bidi reordering of display and overlay strings.
13745 * xdisp.c (compute_display_string_pos)
13746 (compute_display_string_end): Accept additional argument STRING.
13747 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13748 (reseat_to_string): Initialize bidi_it->string.s and
13749 bidi_it->string.schars.
13750 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13751 NULL (avoids a crash in bidi_paragraph_init).
13752 Initialize itb.string.lstring.
13753 (init_iterator): Call bidi_init_it only of a valid
13754 buffer position was specified. Initialize paragraph_embedding to
13755 L2R.
13756 (reseat_to_string): Initialize the bidi iterator.
13757 (display_string): If we need to ignore text properties of
13758 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13759 original value of -1 will not work with bidi.)
13760 (compute_display_string_pos): First arg is now struct
13761 `text_pos *'; all callers changed. Support display properties on
13762 Lisp strings.
13763 (compute_display_string_end): Support display properties on Lisp
13764 strings.
13765 (init_iterator, reseat_1, reseat_to_string): Initialize the
13766 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13767 when iterating on a string not from display properties).
13768 (compute_display_string_pos, compute_display_string_end):
13769 Fix calculation of the object to scan. Fixes an error when using
13770 arrow keys.
13771 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13772 base_level_stop; instead, set base_level_stop to BEGV.
13773 Fixes crashes in vertical-motion.
13774 (next_element_from_buffer): Improve commentary for when
13775 the iterator is before prev_stop.
13776 (init_iterator): Initialize bidi_p from the default value of
13777 bidi-display-reordering, not from buffer-local value. Use the
13778 buffer-local value only if initializing for buffer iteration.
13779 (handle_invisible_prop): Support invisible properties on strings
13780 that are being bidi-reordered.
13781 (set_iterator_to_next): Support bidi reordering of C strings and
13782 Lisp strings.
13783 (next_element_from_string): Support bidi reordering of Lisp
13784 strings.
13785 (handle_stop_backwards): Support Lisp strings as well.
13786 (display_string): Support display of R2L glyph rows.
13787 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13788 (init_iterator): Don't initialize it->bidi_p for strings
13789 here.
13790 (reseat_to_string): Initialize it->bidi_p for strings here.
13791 (next_element_from_string, next_element_from_c_string)
13792 (next_element_from_buffer): Add xassert's for correspondence
13793 between IT's object being iterated and it->bidi_it.string
13794 structure.
13795 (face_before_or_after_it_pos): Support bidi iteration.
13796 (next_element_from_c_string): Handle the case of the first string
13797 character that is not the first one in the visual order.
13798 (get_visually_first_element): New function, refactored from common
13799 parts of next_element_from_buffer, next_element_from_string, and
13800 next_element_from_c_string.
13801 (tool_bar_lines_needed, redisplay_tool_bar)
13802 (display_menu_bar): Force left-to-right direction. Add a FIXME
13803 comment for making that be controlled by a user option.
13804 (push_it, pop_it): Save and restore the state of the
13805 bidi iterator. Save and restore the bidi_p flag.
13806 (pop_it): Iterate out of display property for string iteration as
13807 well.
13808 (iterate_out_of_display_property): Support iteration over strings.
13809 (handle_single_display_spec): Set up it->bidi_it for iteration
13810 over a display string, and call bidi_init_it.
13811 (handle_single_display_spec, next_overlay_string)
13812 (get_overlay_strings_1, push_display_prop): Set up the bidi
13813 iterator for displaying display or overlay strings.
13814 (forward_to_next_line_start): Don't use the shortcut if
13815 bidi-iterating.
13816 (back_to_previous_visible_line_start): If handle_display_prop
13817 pushed the iterator stack, restore the internal state of the bidi
13818 iterator by calling bidi_pop_it same number of times.
13819 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13820 and we are bidi-iterating, don't decrement the iterator position;
13821 instead, set the first_elt flag in the bidi iterator, to produce
13822 the same effect.
13823 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13824 (push_display_prop): xassert that we are iterating a buffer.
13825 (push_it, pop_it): Save and restore paragraph_embedding member.
13826 (handle_single_display_spec, next_overlay_string)
13827 (get_overlay_strings_1, reseat_1, reseat_to_string)
13828 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13829 correctly. Don't assume unibyte strings are not bidi-reordered.
13830 (compute_display_string_pos)
13831 (compute_display_string_end): Fix handling the case of C string.
13832 (push_it, pop_it): Save and restore from_disp_prop_p.
13833 (handle_single_display_spec, push_display_prop): Set the
13834 from_disp_prop_p flag.
13835 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13836 (pop_it): Call iterate_out_of_display_property only if we are
13837 popping after iteration over a string that came from a display
13838 property. Fix a typo in popping stretch info. Add an assertion
13839 for verifying that the iterator position is in sync with the bidi
13840 iterator.
13841 (handle_single_display_spec, get_overlay_strings_1)
13842 (push_display_prop): Fix initialization of paragraph direction for
13843 string when that of the parent object is not yet determined.
13844 (reseat_1): Call bidi_init_it to resync the bidi
13845 iterator with IT's position. (Bug#7616)
13846 (find_row_edges): If ROW->start.pos gives position
13847 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13848 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13849 Reset the from_disp_prop_p flag.
13850 (SAVE_IT, RESTORE_IT): New macros.
13851 (pos_visible_p, face_before_or_after_it_pos)
13852 (back_to_previous_visible_line_start)
13853 (move_it_in_display_line_to, move_it_in_display_line)
13854 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13855 (try_scrolling, redisplay_window, display_line): Use them when
13856 saving a temporary copy of the iterator and restoring it back.
13857 (back_to_previous_visible_line_start, reseat_1)
13858 (init_iterator): Empty the bidi cache "stack".
13859 (move_it_in_display_line_to): If iterator ended up at
13860 EOL, but we never saw any buffer positions smaller than
13861 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13862 motion in bidi-reordered lines.
13863 (move_it_in_display_line_to): Record prev_method and prev_pos
13864 immediately before the call to set_iterator_to_next. Fixes cursor
13865 motion in bidi-reordered lines with stretch glyphs and strings
13866 displayed in margins. (Bug#8133) (Bug#8867)
13867 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13868 TO_CHARPOS.
13869 (pos_visible_p): Support positions in bidi-reordered lines.
13870 Save and restore bidi cache.
13871
13872 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13873 (bidi_paragraph_info): Delete unused struct.
13874 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13875 (bidi_cache_start): New variable.
13876 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13877 to zero.
13878 (bidi_cache_fetch_state, bidi_cache_search)
13879 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13880 (bidi_cache_find, bidi_peek_at_next_level)
13881 (bidi_level_of_next_char, bidi_find_other_level_edge)
13882 (bidi_move_to_visually_next): Compare cache index with
13883 bidi_cache_start rather than with zero.
13884 (bidi_fetch_char): Accept new argument STRING; all callers
13885 changed. Support iteration over a string. Support strings with
13886 display properties. Support unibyte strings. Fix the type of
13887 `len' according to what STRING_CHAR_AND_LENGTH expects.
13888 (bidi_paragraph_init, bidi_resolve_explicit_1)
13889 (bidi_resolve_explicit, bidi_resolve_weak)
13890 (bidi_level_of_next_char, bidi_move_to_visually_next):
13891 Support iteration over a string.
13892 (bidi_set_sor_type, bidi_resolve_explicit_1)
13893 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13894 can now be zero (for strings); special values 0 and -1 were
13895 changed to -1 and -2, respectively.
13896 (bidi_char_at_pos): New function.
13897 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13898 Call it instead of FETCH_MULTIBYTE_CHAR.
13899 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13900 initialized to valid values.
13901 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13902 values.
13903 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13904 the test for valid cached positions. Fix the logic for looking up
13905 the sentinel state in the cache. GCPRO the Lisp string we are
13906 iterating.
13907 (bidi_push_it, bidi_pop_it): New functions.
13908 (bidi_initialize): Initialize the bidi cache start stack pointer.
13909 (bidi_cache_ensure_space): New function, refactored from part of
13910 bidi_cache_iterator_state. Don't assume the required size is just
13911 one BIDI_CACHE_CHUNK away.
13912 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13913 (bidi_count_bytes, bidi_char_at_pos): New functions.
13914 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13915 always valid if bidi_cache_idx is valid.
13916 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13917 is valid if it's going to be used.
13918 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13919 (bidi_cache_fetch_state, bidi_cache_search)
13920 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13921 (bidi_cache_iterator_state, bidi_cache_find)
13922 (bidi_find_other_level_edge, bidi_cache_start_stack):
13923 All variables related to cache indices are now EMACS_INT.
13924
13925 * dispextern.h (struct bidi_string_data): New structure.
13926 (struct bidi_it): New member `string'. Make flag members be 1-bit
13927 fields, and put them last in the struct.
13928 (compute_display_string_pos, compute_display_string_end):
13929 Update prototypes.
13930 (bidi_push_it, bidi_pop_it): Add prototypes.
13931 (struct iterator_stack_entry): New members bidi_p,
13932 paragraph_embedding, and from_disp_prop_p.
13933 (struct it): Member bidi_p is now a bit field 1 bit wide.
13934 (bidi_shelve_cache, bidi_unshelve_cache):
13935 Declare prototypes.
13936
13937 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13938 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13939 and vector-like objects.
13940
13941 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13942 cache around display iteration.
13943
13944 * window.c (Fwindow_end, window_scroll_pixel_based)
13945 (displayed_window_lines, Frecenter): Save and restore the bidi
13946 cache around display iteration.
13947
13948 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13949
13950 * editfns.c (Fdelete_region): Clarify the use of the named
13951 parameters (bug#6788).
13952
13953 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13954
13955 * indent.c (Fvertical_motion): Set and restore w->pointm when
13956 saving and restoring the window's buffer (Bug#9006).
13957
13958 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13959
13960 * editfns.c (Fstring_to_char): Clarify just what is returned
13961 (bug#6576). Text by Eli Zaretskii.
13962
13963 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13964
13965 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13966
13967 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13968
13969 * buffer.c (mmap_find): Fix a typo.
13970
13971 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13972
13973 Fix execution of x selection hooks.
13974 * xselect.c (Qx_lost_selection_functions)
13975 (Qx_sent_selection_functions): New vars.
13976 (syms_of_xselect): DEFSYM them.
13977 (x_handle_selection_request): Pass Qx_sent_selection_functions
13978 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13979 (x_handle_selection_clear,x_clear_frame_selections):
13980 Pass Qx_lost_selection_functions rather than
13981 Vx_lost_selection_functions to Frun_hook_with_args.
13982
13983 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13984
13985 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13986 The old code sometimes used this field without initializing it.
13987
13988 * alloc.c (gc_sweep): Don't read past end of array.
13989 In theory, the old code could also have corrupted Emacs internals,
13990 though it'd be very unlikely.
13991
13992 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13993
13994 * character.c (Fcharacterp): Don't advertise optional ignored
13995 argument. (Bug#4026)
13996
13997 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13998
13999 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14000 key" (bug#4257).
14001
14002 * window.c (Fset_window_start): Doc fix (bug#4199).
14003 (Fset_window_hscroll): Ditto.
14004
14005 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14006
14007 Fix minor new problems caught by GCC 4.6.1.
14008 * term.c (init_tty): Remove unused local.
14009 * xsettings.c (store_monospaced_changed): Define this function only
14010 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
14011 not used otherwise.
14012
14013 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
14014
14015 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14016
14017 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14018
14019 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14020 are the mini-buffer and the echo area (bug#3320).
14021
14022 * term.c (init_tty): Remove support for supdup, c10 and perq
14023 terminals, which are no longer supported (bug#1482).
14024
14025 2011-07-10 Johan Bockgård <bojohan@gnu.org>
14026
14027 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14028
14029 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14030
14031 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14032 for non-popups (Bug#3642).
14033
14034 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14035
14036 * alloc.c (reset_malloc_hooks): Protoize.
14037 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
14038 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14039 * cm.c (losecursor): Likewise.
14040 * data.c (fmod): Likewise.
14041 * dispnew.c (swap_glyphs_in_rows): Likewise.
14042 * emacs.c (memory_warning_signal): Likewise.
14043 * floatfns.c (float_error): Likewise.
14044 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14045 (otf_open, font_otf_capability, generate_otf_features)
14046 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14047 Likewise.
14048 * image.c (pbm_read_file): Likewise.
14049 * indent.c (string_display_width): Likewise.
14050 * intervals.c (check_for_interval, search_for_interval)
14051 (inc_interval_count, count_intervals, root_interval)
14052 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14053 * lread.c (defalias): Likewise.
14054 * ralloc.c (r_alloc_check): Likewise.
14055 * regex.c (set_image_of_range_1, set_image_of_range)
14056 (regex_grow_registers): Likewise.
14057 * sysdep.c (strerror): Likewise.
14058 * termcap.c (valid_filename_p, tprint, main): Likewise.
14059 * tparam.c (main): Likewise.
14060 * unexhp9k800.c (run_time_remap, save_data_space)
14061 (update_file_ptrs, read_header, write_header, calculate_checksum)
14062 (copy_file, copy_rest, display_header): Likewise.
14063 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14064 Likewise.
14065 * xdisp.c (check_it): Likewise.
14066 * xfaces.c (register_color, unregister_color, unregister_colors):
14067 Likewise.
14068 * xfns.c (print_fontset_result): Likewise.
14069 * xrdb.c (member, fatal, main): Likewise.
14070
14071 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14072
14073 Fix minor problems found by static checking (Bug#9031).
14074 * chartab.c (char_table_set_range, map_sub_char_table):
14075 Remove unused locals.
14076 (uniprop_table): Now static.
14077 * composite.c (_work_char): Remove unused static var.
14078
14079 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14080
14081 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14082
14083 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14084
14085 * gtkutil.c (qttip_cb): Remove code without function.
14086
14087 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14088
14089 * w32.c (pthread_sigmask): New stub.
14090
14091 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14092
14093 Use pthread_sigmask, not sigprocmask (Bug#9010).
14094 sigprocmask is portable only for single-threaded applications, and
14095 Emacs can be multi-threaded when it uses GTK.
14096 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14097 (LIBES): Use it.
14098 * callproc.c (Fcall_process):
14099 * process.c (create_process):
14100 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14101 Use pthread_sigmask, not sigprocmask.
14102
14103 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14104
14105 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14106 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14107 wrong (Bug#8591).
14108
14109 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14110
14111 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14112 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14113 (xg_hide_tooltip): Fix comment.
14114
14115 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14116 in registerServicesMenuSendTypes.
14117 (validRequestorForSendType): Don't check ns_return_types.
14118
14119 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14120 ns_return_type.
14121
14122 2011-07-08 Jason Rumney <jasonr@gnu.org>
14123
14124 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14125 SH_SHOW for hidden windows (Bug#5482).
14126
14127 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14128 frame struct members of non-existent frames (Bug#6284).
14129
14130 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14131
14132 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14133 variable firstTime not needed on OSX >= 10.6.
14134 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14135 >= 10.5. Use setKnobProportion, setDoubleValue.
14136
14137 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14138 (MAC_OS_X_VERSION_10_5): Define if not defined.
14139 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14140 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14141 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14142
14143 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14144 cString and lossyCString on OSX >= 10.4.
14145
14146 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14147 sizeToFit on OSX >= 10.2.
14148
14149 * nsimage.m (allocInitFromFile): Don't use deprecated method
14150 bestRepresentationForDevice on OSX >= 10.6.
14151
14152 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14153 to avoid warning.
14154
14155 * emacs.c: Declare unexec_init_emacs_zone.
14156
14157 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14158
14159 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14160
14161 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14162 on svcsMenu (Bug#8842).
14163
14164 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14165 ns_return_types.
14166 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14167
14168 * nsterm.m (QUTF8_STRING): Declare.
14169 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14170 (validRequestorForSendType): Return type is (id).
14171 Change indexOfObjectIdenticalTo to indexOfObject.
14172 Check if we have local selection before returning self (Bug#8842).
14173 (writeSelectionToPasteboard): Put local selection into paste board
14174 if we have a local selection (Bug#8842).
14175 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14176
14177 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14178 (ns_get_local_selection): Declare.
14179
14180 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14181
14182 * keymap.c (describe_map_tree): Don't insert a double newline at
14183 the end of the buffer (bug#1169) and return whether we inserted
14184 something.
14185
14186 * callint.c (Fcall_interactively): Change "reading args" to
14187 "providing args" to try to clarify what it does (bug#1010).
14188
14189 2011-07-07 Kenichi Handa <handa@m17n.org>
14190
14191 * composite.c (composition_compute_stop_pos): Ignore a static
14192 composition starting before CHARPOS (Bug#8915).
14193
14194 * xdisp.c (handle_composition_prop): Likewise.
14195
14196 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14197
14198 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14199 (Bug#9015)
14200
14201 2011-07-07 Kenichi Handa <handa@m17n.org>
14202
14203 * character.h (unicode_category_t): New enum type.
14204
14205 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14206 (Qchar_code_property_table): New variable.
14207 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14208 (UNIPROP_COMPRESSED_FORM_P): New macros.
14209 (char_table_ascii): Uncompress the compressed values.
14210 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14211 Uncompress the compressed values.
14212 (sub_char_table_ref_and_range): Likewise.
14213 (char_table_ref_and_range): Uncompress the compressed values.
14214 (sub_char_table_set): New arg is_uniprop. Callers changed.
14215 Uncompress the compressed values.
14216 (sub_char_table_set_range): Args changed. Callers changed.
14217 (char_table_set_range): Adjuted for the above change.
14218 (map_sub_char_table): Delete args default_val and parent. Add arg
14219 top. Give decoded values to a Lisp function.
14220 (map_char_table): Adjust for the above change. Give decoded
14221 values to a Lisp function. Gcpro more variables.
14222 (uniprop_table_uncompress)
14223 (uniprop_decode_value_run_length): New functions.
14224 (uniprop_decoder, uniprop_decoder_count): New variables.
14225 (uniprop_get_decoder, uniprop_encode_value_character)
14226 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14227 New functions.
14228 (uniprop_encoder, uniprop_encoder_count): New variables.
14229 (uniprop_get_encoder, uniprop_table)
14230 (Funicode_property_table_internal, Fget_unicode_property_internal)
14231 (Fput_unicode_property_internal): New functions.
14232 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14233 Sunicode_property_table_internal, Sget_unicode_property_internal,
14234 and Sput_unicode_property_internal. Defvar_lisp
14235 char-code-property-alist.
14236
14237 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14238 Vunicode_category_table.
14239
14240 * font.c (font_range): Adjust for the change of
14241 Vunicode_category_table.
14242
14243 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14244
14245 * m/iris4d.h: Remove file, move contents ...
14246 * s/irix6-5.h: ... here.
14247
14248 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14249
14250 Remove unportable assumption about struct layout (Bug#8884).
14251 * alloc.c (mark_buffer):
14252 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14253 (clone_per_buffer_values): Don't assume that
14254 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14255 This isn't true in general, and it's particularly not true
14256 if Emacs is configured with --with-wide-int.
14257 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14258 New macros, used in the buffer.c change.
14259
14260 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14261
14262 * xsettings.c: Use both GConf and GSettings if both are available.
14263 (store_config_changed_event): Add comment.
14264 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14265 (store_tool_bar_style_changed): New functions.
14266 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14267 (struct xsettings): Move font inside HAVE_XFT.
14268 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14269 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14270 Move inside HAVE_XFT.
14271 (something_changed_gsettingsCB): Rename from something_changedCB.
14272 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14273 also.
14274 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14275 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14276 (something_changed_gconfCB): Rename from something_changedCB.
14277 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14278 (parse_settings): Move check for font inside HAVE_XFT.
14279 (read_settings, apply_xft_settings): Add comment.
14280 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14281 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14282 call store_font_name_changed.
14283 (xft_settings_event): Add comment.
14284 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14285 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14286 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14287 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14288 (xsettings_initialize): Call init_gsettings last.
14289 (xsettings_get_system_font, xsettings_get_system_normal_font):
14290 Add comment.
14291
14292 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14293
14294 Random fixes. E.g., (random) never returned negative values.
14295 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14296 subseconds part to the entropy, as that's a bit more random.
14297 Prefer signed to unsigned, since the signedness doesn't matter and
14298 in general we prefer signed. When given a limit, use a
14299 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14300 latter isn't right if USE_2_TAGS_FOR_INTS.
14301 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14302 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14303
14304 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14305
14306 * textprop.c (text_property_stickiness):
14307 Obey Vtext_property_default_nonsticky.
14308 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14309 * w32fns.c (syms_of_w32fns):
14310 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14311
14312 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14313
14314 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14315 This is more efficient than Ffile_directory_p and avoids a minor race.
14316
14317 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14318
14319 * buffer.c (Foverlay_put): Say what the return value is
14320 (bug#7835).
14321
14322 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14323 is a directory before asking whether to use the file name
14324 (bug#7564).
14325 (barf_or_query_if_file_exists): Make the "File is a directory"
14326 error be more correct.
14327
14328 * fns.c (Frequire): Remove the mention of the .gz files, since
14329 that's installation-specific, but keep the mention of
14330 `get-load-suffixes'.
14331
14332 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14333
14334 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14335 Report string overflow if the output is too long.
14336
14337 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14338
14339 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14340 (syms_of_gnutls): Remove duplicate DEFSYM for
14341 Qgnutls_bootprop_verify_hostname_error, an error for
14342 Qgnutls_bootprop_verify_error (which is no longer used).
14343
14344 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14345 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14346 Also (re)move comments that are misplaced or no longer relevant.
14347
14348 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14349
14350 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14351
14352 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14353
14354 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14355 and background color parameters if they have been changed.
14356
14357 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14358
14359 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14360
14361 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14362
14363 * xsettings.c (SYSTEM_FONT): Define only when used.
14364 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14365
14366 * keymap.c (access_keymap_1): Now static.
14367
14368 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14369
14370 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14371 leave any prefix arg for the up event (Bug#1586).
14372
14373 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14374
14375 * lread.c (syms_of_lread): Mention single symbols defined by
14376 `defvar' or `defconst' (bug#7154).
14377
14378 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14379 (Frequire): Mention get-load-suffixes.
14380
14381 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14382
14383 * window.h (window): Remove clone_number slot.
14384 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14385 Remove.
14386 (make_parent_window, make_window, saved_window)
14387 (Fset_window_configuration, save_window_save): Don't deal with
14388 clone numbers.
14389 * buffer.c (Qclone_number): Remove declaration.
14390 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14391
14392 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14393
14394 Add multiple inheritance to keymaps.
14395 * keymap.c (Fmake_composed_keymap): New function.
14396 (Fset_keymap_parent): Simplify.
14397 (fix_submap_inheritance): Remove.
14398 (access_keymap_1): New function extracted from access_keymap to handle
14399 embedded parents and handle lists of maps.
14400 (access_keymap): Use it.
14401 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14402 (Fcopy_keymap): Handle embedded parents.
14403 (Fcommand_remapping, define_as_prefix): Simplify.
14404 (Fkey_binding): Simplify.
14405 (syms_of_keymap): Move minibuffer-local-completion-map,
14406 minibuffer-local-filename-completion-map,
14407 minibuffer-local-must-match-map, and
14408 minibuffer-local-filename-must-match-map to Elisp.
14409 (syms_of_keymap): Defsubr make-composed-keymap.
14410 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14411 (parse_menu_item): Trivial simplification.
14412
14413 2011-07-01 Glenn Morris <rgm@gnu.org>
14414
14415 * Makefile.in (SETTINGS_LIBS): Fix typo.
14416
14417 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14418
14419 * coding.c (Fencode_coding_string): Record the last coding system
14420 used, as the function doc string says (bug#8738).
14421
14422 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14423
14424 * xsettings.c (store_monospaced_changed): Take new font as arg and
14425 check for change against current_mono_font.
14426 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14427 (emacs_settings_constructor, emacs_settings_get_property)
14428 (emacs_settings_set_property, emacs_settings_class_init)
14429 (emacs_settings_init, gsettings_obj): Remove.
14430 (something_changedCB): New function for HAVE_GSETTINGS.
14431 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14432 with value as argument.
14433 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14434 g_settings_new (Bug#8967). Do not create gsettings_obj.
14435 Remove calls to g_settings_bind. Connect something_changedCB to
14436 "changed".
14437
14438 * xgselect.c: Add defined (HAVE_GSETTINGS).
14439 (xgselect_initialize): Ditto.
14440
14441 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14442 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14443 xg_select.
14444
14445 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14446
14447 * eval.c (struct backtrace): Simplify and port the data structure.
14448 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14449 signed bit field, as this assumption is not portable and it makes
14450 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14451 "char debug_on_exit : 1" as this is not portable either; instead,
14452 use the portable "unsigned int debug_on_exit : 1". Remove unused
14453 member evalargs. Remove obsolete comments about cc bombing out.
14454
14455 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14456
14457 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14458 Let HAVE_GSETTINGS override HAVE_GCONF.
14459 (store_monospaced_changed): New function.
14460 (EMACS_SETTINGS): A new type derived from GObject to handle
14461 GSettings notifications.
14462 (emacs_settings_constructor, emacs_settings_get_property)
14463 (emacs_settings_set_property, emacs_settings_class_init):
14464 New functions.
14465 (gsettings_client, gsettings_obj): New variables.
14466 (GSETTINGS_SCHEMA): New define.
14467 (something_changedCB): Call store_monospaced_changed.
14468 (init_gsettings): New function.
14469 (xsettings_initialize): Call init_gsettings.
14470 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14471 to NULL.
14472
14473 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14474 GCONF_CFLAGS/LIBS.
14475
14476 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14477
14478 * window.c (resize_root_window, grow_mini_window)
14479 (shrink_mini_window): Rename Qresize_root_window to
14480 Qwindow_resize_root_window and Qresize_root_window_vertically to
14481 Qwindow_resize_root_window_vertically.
14482
14483 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14484
14485 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14486
14487 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14488
14489 * makefile.w32-in: Redesign dependencies so they reflect more
14490 clearly which files are directly included by each source file,
14491 and not through other includes.
14492
14493 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14494
14495 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14496 (sort_overlays, overlay_strings): When an overlay's clone number
14497 matches the window's clone number process the overlay even if
14498 the overlay's window property doesn't match the current window.
14499
14500 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14501 (Fwindow_hchild): Rename to Fwindow_left_child.
14502 (Fwindow_next): Rename to Fwindow_next_sibling.
14503 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14504 (resize_window_check): Rename to window_resize_check.
14505 (resize_window_apply): Rename to window_resize_apply.
14506 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14507 (Fdelete_other_windows_internal, resize_frame_windows)
14508 (Fsplit_window_internal, Fdelete_window_internal)
14509 (grow_mini_window, shrink_mini_window)
14510 (Fresize_mini_window_internal): Fix callers accordingly.
14511
14512 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14513
14514 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14515 (emacs_fixed_set_min_size): Remove.
14516 (emacs_fixed_new): Take frame as argument.
14517
14518 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14519 (_EmacsFixedPrivate): Remove minwidth/height.
14520 Add struct frame *f.
14521 (emacs_fixed_init): Initialize priv->f.
14522 (get_parent_class, emacs_fixed_set_min_size): Remove.
14523 (emacs_fixed_new): Set priv->f to argument.
14524 (emacs_fixed_get_preferred_width)
14525 (emacs_fixed_get_preferred_height): Use min_width/height from
14526 frames size_hint to set minimum and natural (Bug#8919).
14527 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14528 and use min_width/height from frames size_hint to set
14529 min_width/height (Bug#8919).
14530
14531 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14532 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14533 Fix indentation.
14534
14535 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14536
14537 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14538 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14539 called at ZV.
14540
14541 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14542
14543 * process.c (wait_reading_process_output): Bypass select if
14544 waiting for a cell while ignoring keyboard input, and input is
14545 pending. Suggested by Jan Djärv (Bug#8869).
14546
14547 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14548
14549 Use gnulib's dup2 module instead of rolling our own.
14550 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14551
14552 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14553
14554 * dispnew.c (scrolling_window): Before scrolling, turn off a
14555 mouse-highlight in the window being scrolled.
14556
14557 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14558
14559 Move DEFSYM to lisp.h and use everywhere.
14560
14561 * character.h (DEFSYM): Move declaration...
14562 * lisp.h (DEFSYM): ...here.
14563
14564 * gnutls.c:
14565 * minibuf.c:
14566 * w32menu.c:
14567 * w32proc.c:
14568 * w32select.c: Don't include character.h.
14569
14570 * alloc.c (syms_of_alloc):
14571 * buffer.c (syms_of_buffer):
14572 * bytecode.c (syms_of_bytecode):
14573 * callint.c (syms_of_callint):
14574 * casefiddle.c (syms_of_casefiddle):
14575 * casetab.c (init_casetab_once):
14576 * category.c (init_category_once, syms_of_category):
14577 * ccl.c (syms_of_ccl):
14578 * cmds.c (syms_of_cmds):
14579 * composite.c (syms_of_composite):
14580 * dbusbind.c (syms_of_dbusbind):
14581 * dired.c (syms_of_dired):
14582 * dispnew.c (syms_of_display):
14583 * doc.c (syms_of_doc):
14584 * editfns.c (syms_of_editfns):
14585 * emacs.c (syms_of_emacs):
14586 * eval.c (syms_of_eval):
14587 * fileio.c (syms_of_fileio):
14588 * fns.c (syms_of_fns):
14589 * frame.c (syms_of_frame):
14590 * fringe.c (syms_of_fringe):
14591 * insdel.c (syms_of_insdel):
14592 * keymap.c (syms_of_keymap):
14593 * lread.c (init_obarray, syms_of_lread):
14594 * macros.c (syms_of_macros):
14595 * msdos.c (syms_of_msdos):
14596 * print.c (syms_of_print):
14597 * process.c (syms_of_process):
14598 * search.c (syms_of_search):
14599 * sound.c (syms_of_sound):
14600 * syntax.c (init_syntax_once, syms_of_syntax):
14601 * terminal.c (syms_of_terminal):
14602 * textprop.c (syms_of_textprop):
14603 * undo.c (syms_of_undo):
14604 * w32.c (globals_of_w32):
14605 * window.c (syms_of_window):
14606 * xdisp.c (syms_of_xdisp):
14607 * xfaces.c (syms_of_xfaces):
14608 * xfns.c (syms_of_xfns):
14609 * xmenu.c (syms_of_xmenu):
14610 * xsettings.c (syms_of_xsettings):
14611 * xterm.c (syms_of_xterm): Use DEFSYM.
14612
14613 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14614
14615 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14616
14617 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14618
14619 Integer and buffer overflow fixes (Bug#8873).
14620
14621 * print.c (printchar, strout): Check for string overflow.
14622 (PRINTPREPARE, printchar, strout):
14623 Don't set size unless allocation succeeds.
14624
14625 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14626 for sizes. Check for string overflow more accurately.
14627 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14628
14629 * macros.c: Integer and buffer overflow fixes.
14630 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14631 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14632 Use ptrdiff_t, not int, for sizes.
14633 Don't increment bufsize until after realloc succeeds.
14634 Check for size-calculation overflow.
14635 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14636
14637 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14638
14639 * lread.c: Integer overflow fixes.
14640 (read_integer): Radix is now EMACS_INT, not int,
14641 to improve quality of diagnostics for out-of-range radices.
14642 Calculate buffer size correctly for out-of-range radices.
14643 (read1): Check for integer overflow in radices, and in
14644 read-circle numbers.
14645 (read_escape): Avoid int overflow.
14646 (Fload, openp, read_buffer_size, read1)
14647 (substitute_object_recurse, read_vector, read_list, map_obarray):
14648 Use ptrdiff_t, not int, for sizes.
14649 (read1): Use EMACS_INT, not int, for sizes.
14650 Check for size overflow.
14651
14652 * image.c (cache_image): Check for size arithmetic overflow.
14653
14654 * lread.c: Integer overflow issues.
14655 (saved_doc_string_size, saved_doc_string_length)
14656 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14657 Now ptrdiff_t, not int.
14658 (read1): Don't assume doc string length fits in int. Check for
14659 out-of-range doc string lengths.
14660 (read_list): Don't assume file position fits in int.
14661 (read_escape): Check for hex character overflow.
14662
14663 2011-06-22 Leo Liu <sdl.web@gmail.com>
14664
14665 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14666 Move to minibuffer.el.
14667
14668 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14669
14670 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14671 The following patches are for when GLYPH_DEBUG && !XASSERT.
14672 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14673 * dispnew.c (flush_stdout):
14674 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14675 Mark as externally visible.
14676 * dispnew.c (check_window_matrix_pointers): Now static.
14677 * dispnew.c (window_to_frame_vpos):
14678 * xfns.c (unwind_create_frame):
14679 * xterm.c (x_check_font): Remove unused local.
14680 * scroll.c (CHECK_BOUNDS):
14681 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14682 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14683 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14684 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14685 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14686 Now static.
14687 (debug_method_add): Use va_list and vsprintf rather than relying
14688 on undefined behavior with wrong number of arguments.
14689 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14690 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14691 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14692 since we're not interested in debugging glyphs with old libraries.
14693 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14694 GCC 4.6.0's static checking.
14695
14696 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14697
14698 Integer overflow and signedness fixes (Bug#8873).
14699 A few related buffer overrun fixes, too.
14700
14701 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14702
14703 * dispextern.h (struct face.stipple):
14704 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14705 (x_bitmap_mask, x_allocate_bitmap_record)
14706 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14707 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14708 (x_create_bitmap_from_xpm_data):
14709 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14710 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14711 (.bitmaps_last):
14712 * xfaces.c (load_pixmap):
14713 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14714 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14715 (.bitmaps_last, struct x_output.icon_bitmap):
14716 Use ptrdiff_t, not int, for bitmap indexes.
14717 (x_allocate_bitmap_record): Check for size overflow.
14718 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14719
14720 Use ptrdiff_t, not int, for overlay counts.
14721 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14722 * editfns.c (overlays_around, get_pos_property):
14723 * textprop.c (get_char_property_and_overlay):
14724 * xdisp.c (next_overlay_change, note_mouse_highlight):
14725 * xfaces.c (face_at_buffer_position):
14726 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14727 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14728 (Fnext_overlay_change, Fprevious_overlay_change)
14729 (mouse_face_overlay_overlaps, Foverlays_in):
14730 Use ptrdiff_t, not int, for sizes.
14731 (overlays_at, overlays_in): Check for size-calculation overflow.
14732
14733 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14734
14735 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14736 (x_session_initialize): Do not assume string length fits in int.
14737
14738 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14739 This is unlikely, but can occur if DPI is outlandish.
14740
14741 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14742 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14743
14744 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14745 * xrdb.c (magic_file_p, search_magic_path):
14746 Omit last arg SUFFIX; it was always 0. All callers changed.
14747 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14748
14749 * xfont.c (xfont_match): Avoid need for strlen.
14750
14751 * xfns.c: Don't assume strlen fits in int.
14752 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14753
14754 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14755 not unsigned long, as we prefer signed integers. All callers changed.
14756 Detect integer overflow in repeat count.
14757 (message_dolog): Don't assume print length fits in 39 bytes.
14758 (display_mode_element): Don't assume strlen fits in int.
14759
14760 * termcap.c: Don't assume sizes fit in int and never overflow.
14761 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14762 (gobble_line): Check for size-calculation overflow.
14763
14764 * minibuf.c (Fread_buffer):
14765 * lread.c (intern, intern_c_string):
14766 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14767 Don't assume string length fits in int.
14768
14769 * keyboard.c (parse_tool_bar_item):
14770 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14771
14772 * font.c: Don't assume string length fits in int.
14773 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14774 Use ptrdiff_t, not int.
14775 (font_intern_prop): Don't assume string length fits in int.
14776 Don't assume integer property fits in fixnum.
14777 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14778
14779 * filelock.c: Fix some buffer overrun and integer overflow issues.
14780 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14781 Reformulate so as not to need the command string.
14782 Invoke gzip -cd rather than gunzip, as it's more portable.
14783 (lock_info_type, lock_file_1, lock_file):
14784 Don't assume pid_t and time_t fit in unsigned long.
14785 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14786 (current_lock_owner): Prefer signed type for sizes.
14787 Use memcpy, not strncpy, where memcpy is what is really wanted.
14788 Don't assume (via atoi) that time_t and pid_t fit in int.
14789 Check for time_t and/or pid_t out of range, e.g., via a network share.
14790 Don't alloca where an auto var works fine.
14791
14792 * fileio.c: Fix some integer overflow issues.
14793 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14794 Don't assume string length fits in int.
14795 (directory_file_name): Don't assume string length fits in long.
14796 (make_temp_name): Don't assume pid fits in int, or that its print
14797 length is less than 20.
14798
14799 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14800
14801 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14802
14803 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14804
14805 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14806 We prefer signed integers, even for size calculations.
14807
14808 * emacs.c: Don't assume string length fits in 'int'.
14809 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14810 (main): Don't invoke strlen when not needed.
14811
14812 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14813 (XD_DEBUG_MESSAGE): Don't waste a byte.
14814
14815 * callproc.c (getenv_internal_1, getenv_internal)
14816 (Fgetenv_internal):
14817 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14818
14819 * lread.c (invalid_syntax): Omit length argument.
14820 All uses changed. This doesn't fix a bug, but it simplifies the
14821 code away from its former Hollerith-constant appearance, and it's
14822 one less 'int' to worry about when looking at integer-overflow issues.
14823 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14824
14825 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14826 This didn't break anything, but it didn't help either.
14827 It's confusing to put a bogus integer in a place where the actual
14828 value does not matter.
14829 (LIST_END_P): Remove unused macro and its bogus comment.
14830 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14831
14832 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14833 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14834 implementation.
14835 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14836 We prefer signed types, and the value cannot exceed the EMACS_INT
14837 range anyway (because otherwise the length would not be representable).
14838 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14839 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14840 This avoids a GCC warning when WIDE_EMACS_INT.
14841
14842 * indent.c (sane_tab_width): New function.
14843 (current_column, scan_for_column, Findent_to, position_indentation)
14844 (compute_motion): Use it. This is just for clarity.
14845 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14846
14847 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14848
14849 * lisp.h (lint_assume): New macro.
14850 * composite.c (composition_gstring_put_cache):
14851 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14852
14853 * editfns.c, insdel.c:
14854 Omit unnecessary forward decls, to simplify future changes.
14855
14856 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14857
14858 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14859
14860 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14861 Use much-faster test for byte-length change.
14862 Don't assume string byte-length fits in 'int'.
14863 Check that character arg fits in 'int'.
14864 (mapcar1): Declare byte as byte, for clarity.
14865
14866 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14867
14868 * fns.c (concat): Catch string overflow earlier.
14869 Do not rely on integer wraparound.
14870
14871 * dispextern.h (struct it.overlay_strings_charpos)
14872 (struct it.selective): Now EMACS_INT, not int.
14873 * xdisp.c (forward_to_next_line_start)
14874 (back_to_previous_visible_line_start)
14875 (reseat_at_next_visible_line_start, next_element_from_buffer):
14876 Don't arbitrarily truncate the value of 'selective' to int.
14877
14878 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14879
14880 * composite.c: Don't truncate sizes to 'int'.
14881 (composition_gstring_p, composition_reseat_it)
14882 (composition_adjust_point): Use EMACS_INT, not int.
14883 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14884 not EMACS_UINT, for indexes.
14885
14886 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14887
14888 * buffer.c: Include <verify.h>.
14889 (struct sortvec.priority, struct sortstr.priority):
14890 Now EMACS_INT, not int.
14891 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14892 (struct sortstr.size, record_overlay_string)
14893 (struct sortstrlist.size, struct sortlist.used):
14894 Don't truncate size to int.
14895 (record_overlay_string): Check for size-calculation overflow.
14896 (init_buffer_once): Check at compile-time, not run-time.
14897
14898 2011-06-22 Jim Meyering <meyering@redhat.com>
14899
14900 Don't leak an XBM-image-sized buffer
14901 * image.c (xbm_load): Free the image buffer after using it.
14902
14903 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14904
14905 Port to Sun C.
14906 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14907 that Sun C diagnosed.
14908 * fns.c (secure_hash): Fix pointer signedness issue.
14909 * intervals.c (static_offset_intervals): New function.
14910 (offset_intervals): Use it.
14911
14912 2011-06-21 Leo Liu <sdl.web@gmail.com>
14913
14914 * deps.mk (fns.o):
14915 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14916 sha512.h.
14917
14918 * fns.c (secure_hash): Rename from crypto_hash_function and change
14919 the first arg to accept symbols.
14920 (Fsecure_hash): New primitive.
14921 (syms_of_fns): New symbols.
14922
14923 2011-06-20 Deniz Dogan <deniz@dogan.se>
14924
14925 * process.c (Fset_process_buffer): Clarify return value in
14926 docstring.
14927
14928 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14929
14930 * dispnew.c (add_window_display_history): Use BVAR.
14931
14932 * xdisp.c (debug_method_add): Use BVAR.
14933 (check_window_end, dump_glyph_matrix, dump_glyph)
14934 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14935
14936 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14937 Likewise.
14938
14939 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14940 check till after the cache is created in init_frame_faces.
14941
14942 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14943
14944 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14945
14946 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14947
14948 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14949 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14950 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14951
14952 Improve buffer-overflow checking (Bug#8873).
14953 * fileio.c (Finsert_file_contents):
14954 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14955 Remove the old (too-loose) buffer overflow checks.
14956 They weren't needed, since make_gap checks for buffer overflow.
14957 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14958 The old code merely checked for Emacs fixnum overflow, and relied
14959 on undefined (wraparound) behavior. The new code avoids undefined
14960 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14961
14962 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14963 Tune. Don't use wider integers than needed. Don't use alloca.
14964 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14965
14966 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14967
14968 * insdel.c, lisp.h (buffer_overflow): New function.
14969 (insert_from_buffer_1, replace_range, replace_range_2):
14970 * insdel.c (make_gap_larger):
14971 * editfns.c (Finsert_char):
14972 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14973
14974 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14975
14976 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14977
14978 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14979
14980 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14981 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14982
14983 * fileio.c: Don't assume EMACS_INT fits in off_t.
14984 (emacs_lseek): New static function.
14985 (Finsert_file_contents, Fwrite_region): Use it.
14986 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14987
14988 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14989
14990 * fns.c: Don't overflow int when computing a list length.
14991 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14992 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14993 truncation on 64-bit hosts. Check for QUIT every
14994 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14995 faster and is responsive enough.
14996 (Flength): Report an error instead of overflowing an integer.
14997 (Fsafe_length): Return a float if the value is not representable
14998 as a fixnum. This shouldn't happen except in contrived situations.
14999 (Fnthcdr, Fsort): Don't assume list length fits in int.
15000 (Fcopy_sequence): Don't assume vector length fits in int.
15001
15002 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15003 (header_size, word_size): New constants.
15004 (allocate_vectorlike): Don't check size overflow here.
15005 (allocate_vector): Check it here instead, since this is the only
15006 caller of allocate_vectorlike that could cause overflow.
15007 Check that the new vector's length is representable as a fixnum.
15008
15009 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15010 The previous code was bogus. For example, next_almost_prime (32)
15011 returned 39, which is undesirable as it is a multiple of 3; and
15012 next_almost_prime (24) returned 25, which is a multiple of 5 so
15013 why was the code bothering to check for multiples of 7?
15014
15015 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15016
15017 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15018
15019 Variadic C functions now count arguments with ptrdiff_t.
15020 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15021 Back then I didn't know that the Emacs coding style prefers signed int.
15022 Also, in the meantime I found a few more instances where arguments
15023 were being counted with int, which may truncate counts on 64-bit
15024 machines, or EMACS_INT, which may be unnecessarily wide.
15025 * lisp.h (struct Lisp_Subr.function.aMANY)
15026 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15027 Arg counts are now ptrdiff_t, not size_t.
15028 All variadic functions and their callers changed accordingly.
15029 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15030 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15031 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15032 * callint.c (Fcall_interactively): Check arg count for overflow,
15033 to avoid potential buffer overrun. Use signed char, not 'int',
15034 for 'varies' array, so that we needn't bother to check its size
15035 calculation for overflow.
15036 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15037 * eval.c (apply_lambda):
15038 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15039 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15040 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15041
15042 * callint.c (Fcall_interactively): Don't use index var as event count.
15043
15044 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15045 * mem-limits.h (SIZE): Remove; no longer used.
15046
15047 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15048
15049 Remove unnecessary casts.
15050 * xterm.c (x_term_init):
15051 * xfns.c (x_set_border_pixel):
15052 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15053 These aren't needed now that we assume ANSI C.
15054
15055 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15056 It's more likely to cause problems (due to unsigned overflow)
15057 than to cure them.
15058
15059 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15060
15061 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15062
15063 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15064
15065 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15066
15067 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15068
15069 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15070
15071 GLYPH_CODE_FACE returns EMACS_INT, not int.
15072 * dispextern.h (merge_faces):
15073 * xfaces.c (merge_faces):
15074 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15075 Don't assume EMACS_INT fits in int.
15076
15077 * character.h (CHAR_VALID_P): Remove unused parameter.
15078 * fontset.c, lisp.h, xdisp.c: All uses changed.
15079
15080 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15081
15082 * fns.c (concat): Minor tuning based on overflow analysis.
15083 This doesn't fix any bugs. Use int to hold character, instead
15084 of constantly refetching from Emacs object. Use XFASTINT, not
15085 XINT, for value known to be a character. Don't bother comparing
15086 a single byte to 0400, as it's always less.
15087
15088 * floatfns.c (Fexpt):
15089 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15090
15091 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15092 for characters.
15093
15094 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15095
15096 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15097 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15098 incorrectly succeed when S was a string, because 4294967386 was
15099 truncated before it was used.
15100
15101 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15102 Otherwise, an out-of-range integer could cause undefined behavior
15103 on a 64-bit host.
15104
15105 * composite.c: Use int, not EMACS_INT, for characters.
15106 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15107 EMACS_INT, for values that are known to be in character range.
15108 This doesn't fix any bugs but is the usual style inside Emacs and
15109 may generate better code on 32-bit machines.
15110
15111 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15112 This is for reasons similar to the recent CHAR_STRING fix.
15113 * charset.c (Fencode_char): Check that character arg is actually
15114 a character. Pass an int to ENCODE_CHAR.
15115 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15116 wider than 'int', as a compile-time check to prevent future regressions
15117 in this area.
15118
15119 * character.c (char_string): Remove unnecessary casts.
15120
15121 Make sure a 64-bit char is never passed to CHAR_STRING.
15122 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15123 by silently ignoring the top 32 bits, allowing some values
15124 that were far too large to be valid characters.
15125 * character.h: Include <verify.h>.
15126 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15127 arguments are no wider than unsigned, as a compile-time check
15128 to prevent future regressions in this area.
15129 * data.c (Faset):
15130 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15131 (Fsubst_char_in_region):
15132 * fns.c (concat):
15133 * xdisp.c (decode_mode_spec_coding):
15134 Adjust to CHAR_STRING's new requirement.
15135 * editfns.c (Finsert_char, Fsubst_char_in_region):
15136 * fns.c (concat): Check that character args are actually
15137 characters. Without this test, these functions did the wrong
15138 thing with wildly out-of-range values on 64-bit hosts.
15139
15140 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15141 These casts should not be needed on 32-bit hosts, either.
15142 * keyboard.c (read_char):
15143 * lread.c (Fload): Remove casts to unsigned.
15144
15145 * lisp.h (UNSIGNED_CMP): New macro.
15146 This fixes comparison bugs on 64-bit hosts.
15147 (ASCII_CHAR_P): Use it.
15148 * casefiddle.c (casify_object):
15149 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15150 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15151 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15152 * dispextern.h (FACE_FROM_ID):
15153 * keyboard.c (read_char): Use UNSIGNED_CMP.
15154
15155 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15156 not to EMACS_INT, to avoid GCC warning.
15157
15158 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15159
15160 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15161 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15162 isn't needed on 32-bit machines.
15163
15164 * buffer.c (Fgenerate_new_buffer_name):
15165 Use EMACS_INT for count, not int.
15166 (advance_to_char_boundary): Return EMACS_INT, not int.
15167
15168 * data.c (Qcompiled_function): Now static.
15169
15170 * window.c (window_body_lines): Now static.
15171
15172 * image.c (gif_load): Rename local to avoid shadowing.
15173
15174 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15175 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15176 * alloc.c (make_save_value): Integer argument is now of type
15177 ptrdiff_t, not int.
15178 (mark_object): Use ptrdiff_t, not int.
15179 * lisp.h (pD): New macro.
15180 * print.c (print_object): Use it.
15181
15182 * alloc.c: Use EMACS_INT, not int, to count objects.
15183 (total_conses, total_markers, total_symbols, total_vector_size)
15184 (total_free_conses, total_free_markers, total_free_symbols)
15185 (total_free_floats, total_floats, total_free_intervals)
15186 (total_intervals, total_strings, total_free_strings):
15187 Now EMACS_INT, not int. All uses changed.
15188 (Fgarbage_collect): Compute overall total using a double, so that
15189 integer overflow is less likely to be a problem. Check for overflow
15190 when converting back to an integer.
15191 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15192 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15193 These were 'int' variables that could overflow on 64-bit hosts;
15194 they were never used, so remove them instead of repairing them.
15195 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15196 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15197 Previously, this ceilinged at INT_MAX, but that doesn't work on
15198 64-bit machines.
15199 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15200
15201 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15202 (allocate_vectorlike): Check for ptrdiff_t overflow.
15203 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15204 when a (possibly-narrower) signed value would do just as well.
15205 We prefer using signed arithmetic, to avoid comparison confusion.
15206
15207 * alloc.c: Catch some string size overflows that we were missing.
15208 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15209 for convenience in STRING_BYTES_MAX.
15210 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15211 The definition here is exact; the one in lisp.h was approximate.
15212 (allocate_string_data): Check for string overflow. This catches
15213 some instances we weren't catching before. Also, it catches
15214 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15215 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15216 and ptrdiff_t and EMACS_INT are both 64 bits.
15217
15218 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15219 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15220 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15221
15222 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15223
15224 * alloc.c (Fmake_string): Check for out-of-range init.
15225
15226 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15227
15228 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15229
15230 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15231
15232 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15233 xg_get_default_scrollbar_width.
15234
15235 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15236 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15237 (style_changed_cb): Call update_theme_scrollbar_width and call
15238 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15239 all frames (Bug#8505).
15240 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15241 Call gtk_window_set_resizable if HAVE_GTK3.
15242 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15243 and height if HAVE_GTK3 (Bug#8505).
15244 (scroll_bar_width_for_theme): New variable.
15245 (update_theme_scrollbar_width): New function.
15246 (xg_get_default_scrollbar_width): Move code to
15247 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15248 (xg_initialize): Call update_theme_scrollbar_width.
15249
15250 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15251
15252 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15253
15254 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15255
15256 * frame.c (make_frame): Call other_buffer_safely instead of
15257 other_buffer.
15258
15259 * window.c (temp_output_buffer_show): Call display_buffer with
15260 second argument Vtemp_buffer_show_specifiers and reset latter
15261 immediately after the call.
15262 (Vtemp_buffer_show_specifiers): New variable.
15263 (auto_window_vscroll_p, next_screen_context_lines)
15264 (Vscroll_preserve_screen_position): Remove leading asterisks from
15265 doc-strings.
15266
15267 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15268
15269 Fix minor problems found by GCC 4.6.0 static checking.
15270 * buffer.c (Qclone_number): Remove for now, as it's unused.
15271 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15272 (record_buffer): Remove unused local.
15273 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15274 (set_frame_buffer_list): Remove; unused.
15275 * frame.h (other_visible_frames): Remove decl.
15276 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15277 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15278 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15279 if HAVE_GPM.
15280 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15281 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15282 Define only if HAVE_GPM.
15283 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15284 (update_hints_inhibit): Remove; never set. All uses removed.
15285 * widgetprv.h (emacsFrameClassRec): Remove decl.
15286 * window.c (delete_deletable_window): Now returns void, since it
15287 wasn't returning anything.
15288 (compare_window_configurations): Remove unused locals.
15289 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15290 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15291 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15292 the same widths as pointers. This follows up on the 2011-05-06 patch.
15293 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15294 * xterm.h: Likewise.
15295 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15296
15297 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15298
15299 * makefile.w32-in: Update dependencies.
15300 (LISP_H): Add lib/intprops.h.
15301
15302 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15303
15304 * image.c (gif_load): Add animation frame delay to the metadata.
15305 (syms_of_image): Use DEFSYM. New symbol `delay'.
15306
15307 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15308
15309 * window.c (delete_deletable_window): Re-add.
15310 (Fset_window_configuration): Rewrite to handle dead buffers and
15311 consequently deletable windows.
15312 (window_tree, Fwindow_tree): Remove. Supply functionality in
15313 window.el.
15314 (compare_window_configurations): Simplify code.
15315
15316 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15317
15318 * image.c (imagemagick_load_image): Fix type mismatch.
15319 (Fimagemagick_types): Likewise.
15320
15321 * window.h (replace_buffer_in_windows): Declare.
15322
15323 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15324
15325 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15326 Qclone_number. Remove external declaration of Qdelete_window.
15327 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15328 code.
15329 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15330 Run Qbuffer_list_update_hook if allowed.
15331 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15332 buffer list implementation.
15333 (other_buffer_safely): New function.
15334 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15335 calls to replace_buffer_in_windows and
15336 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15337 if allowed.
15338 (record_buffer): Inhibit quitting and rewrite using quittable
15339 functions. Run Qbuffer_list_update_hook if allowed.
15340 (Frecord_buffer, Funrecord_buffer): New functions.
15341 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15342 Move switch-to-buffer to window.el.
15343 (bury-buffer): Move to window.el.
15344 (Vbuffer_list_update_hook): New variable.
15345
15346 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15347 section.
15348
15349 * window.h (resize_frame_windows): Move up in code.
15350 (Fwindow_frame): Remove EXFUN.
15351 (replace_buffer_in_all_windows): Remove prototype.
15352 (replace_buffer_in_windows_safely): Add prototype.
15353
15354 * window.c: Declare Qdelete_window static again. Move down
15355 declaration of select_count.
15356 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15357 (Fother_window): Move to window.el.
15358 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15359 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15360 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15361 window.el.
15362 (replace_buffer_in_windows): Implement by calling
15363 Qreplace_buffer_in_windows.
15364 (replace_buffer_in_all_windows): Remove with some functionality
15365 moved into replace_buffer_in_windows_safely.
15366 (replace_buffer_in_windows_safely): New function.
15367 (select_window_norecord, select_frame_norecord): Move in front
15368 of run_window_configuration_change_hook. Remove now obsolete
15369 declarations.
15370 (Fset_window_buffer): Rewrite doc-string.
15371 Call Qrecord_window_buffer.
15372 (keys_of_window): Move binding for other-window to window.el.
15373
15374 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15375
15376 * dispextern.h (struct image): Replace data member, whose int_val
15377 and ptr_val fields were not used by anything, with a single
15378 lisp_val object.
15379
15380 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15381 (gif_clear_image, gif_load, imagemagick_load_image)
15382 (gs_clear_image, gs_load): Callers changed.
15383
15384 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15385
15386 * buffer.h: Include <time.h>, for time_t.
15387 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15388
15389 Fix minor problems found by static checking.
15390
15391 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15392
15393 Make identifiers static if they are not used in other modules.
15394 * data.c (Qcompiled_function, Qframe, Qvector):
15395 * image.c (QimageMagick, Qsvg):
15396 * minibuf.c (Qmetadata):
15397 * window.c (resize_window_check, resize_root_window): Now static.
15398 * window.h (resize_window_check, resize_root_window): Remove decls.
15399
15400 * window.c (window_deletion_count, delete_deletable_window):
15401 Remove; unused.
15402 (window_body_lines): Now static.
15403 (Fdelete_other_windows_internal): Mark vars as initialized.
15404 Make sure 'resize_failed' is initialized.
15405 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15406 (resize_window_apply): Remove unused local.
15407 * window.h (delete_deletable_window): Remove decl.
15408
15409 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15410 (imagemagick_load_image): Fix pointer signedness problem by changing
15411 last arg from unsigned char * to char *. All uses changed.
15412 Also, fix a local for similar reasons.
15413 Remove unused locals. Remove locals to avoid shadowing.
15414 (fn_rsvg_handle_free): Remove; unused.
15415 (svg_load, svg_load_image): Fix pointer signedness problem.
15416 (imagemagick_load_image): Don't use garbage pointer image_wand.
15417
15418 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15419
15420 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15421
15422 * image.c (gif_load): Fix omitted cast error introduced by
15423 2011-06-06 change.
15424
15425 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15426
15427 * window.h (resize_proportionally, orig_total_lines)
15428 (orig_top_line): Remove from window structure.
15429 (set_window_height, set_window_width, change_window_heights)
15430 (Fdelete_window): Remove prototypes.
15431 (resize_frame_windows): Remove duplicate declaration.
15432
15433 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15434
15435 * window.h (resize_frame_windows, resize_window_check)
15436 (delete_deletable_window, resize_root_window)
15437 (resize_frame_windows): Declare prototypes.
15438
15439 * window.c (resize_window_apply): Make definition be "static" to
15440 match the prototype.
15441
15442 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15443
15444 * window.c: Remove declarations of Qwindow_size_fixed,
15445 window_min_size_1, window_min_size_2, window_min_size,
15446 size_window, window_fixed_size_p, enlarge_window, delete_window.
15447 Remove static from declaration of Qdelete_window, it's
15448 temporarily needed by Fbury_buffer.
15449 (replace_window): Don't assign orig_top_line and
15450 orig_total_lines.
15451 (Fdelete_window, delete_window): Remove. Window deletion is
15452 handled by window.el.
15453 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15454 Replace Fdelete_window calls with calls to Qdelete_window.
15455 (Fdelete_other_windows): Remove. Deleting other windows is
15456 handled by window.el.
15457 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15458 handled in window.el.
15459 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15460 Window minimum sizes are handled in window.el.
15461 (shrink_windows, size_window, set_window_height)
15462 (set_window_width, change_window_heights, window_height)
15463 (window_width, CURBEG, CURSIZE, enlarge_window)
15464 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15465 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15466 handled in window.el.
15467 (make_dummy_parent): Rename to make_parent_window and give it a
15468 second argument horflag.
15469 (make_window): Don't set resize_proportionally any more.
15470 (Fsplit_window): Remove. Windows are split in window.el.
15471 (save_restore_action, save_restore_orig_size)
15472 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15473 Resize mini windows in window.el.
15474 (grow_mini_window, shrink_mini_window): Implement by calling
15475 Qresize_root_window_vertically, resize_window_check and
15476 resize_window_apply.
15477 (saved_window, Fset_window_configuration, save_window_save):
15478 Do not handle orig_top_line, orig_total_lines, and
15479 resize_proportionally.
15480 (window_min_height, window_min_width): Move to window.el.
15481 (keys_of_window): Move bindings for delete-other-windows,
15482 split-window, delete-window and enlarge-window to window.el.
15483
15484 * buffer.c: Temporarily extern Qdelete_window.
15485 (Fbury_buffer): Temporarily call Qdelete_window instead of
15486 Fdelete_window (Fbury_buffer will move to window.el soon).
15487
15488 * frame.c (set_menu_bar_lines_1): Remove code handling
15489 orig_top_line and orig_total_lines.
15490
15491 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15492 set_window_height but set heights directly.
15493 (change_frame_size_1): Use resize_frame_windows.
15494
15495 * xdisp.c (init_xdisp): Don't use set_window_height but set
15496 heights directly.
15497
15498 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15499 Use resize_frame_windows instead of change_window_heights and run
15500 run_window_configuration_change_hook.
15501
15502 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15503 instead of change_window_heights and run
15504 run_window_configuration_change_hook.
15505
15506 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15507
15508 * window.c (replace_window): Rename second argument REPLACEMENT to
15509 NEW. New third argument SETFLAG. Rewrite.
15510 (delete_window, make_dummy_parent): Call replace_window with
15511 third argument 1.
15512 (window_list_1): Move down in code.
15513 (run_window_configuration_change_hook): Move set_buffer part
15514 before select_frame_norecord part in order to unwind correctly.
15515 Rename count1 to count.
15516 (recombine_windows, delete_deletable_window, resize_root_window)
15517 (Fdelete_other_windows_internal)
15518 (Frun_window_configuration_change_hook, make_parent_window)
15519 (resize_window_check, resize_window_apply, Fresize_window_apply)
15520 (resize_frame_windows, Fsplit_window_internal)
15521 (Fdelete_window_internal, Fresize_mini_window_internal):
15522 New functions.
15523 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15524
15525 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15526
15527 * window.h (window): Add some new members to window structure -
15528 normal_lines, normal_cols, new_total, new_normal, clone_number,
15529 splits, nest, prev_buffers, next_buffers.
15530 (WINDOW_TOTAL_SIZE): Move here from window.c.
15531 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15532
15533 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15534 Remove.
15535 (make_dummy_parent): Set new members of windows structure.
15536 (make_window): Move down in code. Handle new members of window
15537 structure.
15538 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15539 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15540 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15541 (Fset_window_prev_buffers, Fwindow_next_buffers)
15542 (Fset_window_next_buffers, Fset_window_clone_number):
15543 New functions.
15544 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15545 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15546 Doc-string fixes.
15547 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15548 Argument WINDOW can be now internal window too.
15549 (Fwindow_use_time): Move up in code.
15550 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15551 Rewrite doc-string.
15552 (Fset_window_configuration, saved_window)
15553 (Fcurrent_window_configuration, save_window_save): Handle new
15554 members of window structure.
15555 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15556 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15557 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15558 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15559 Qget_mru_window, Qresize_root_window,
15560 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15561 Qauto_buffer_name; staticpro them.
15562
15563 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15564
15565 * window.c (Fwindow_total_size, Fwindow_left_column)
15566 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15567 (Fwindow_list_1): New functions.
15568 (window_box_text_cols): Replace with window_body_cols.
15569 (Fwindow_width, Fscroll_left, Fscroll_right):
15570 Use window_body_cols instead of window_box_text_cols.
15571 (delete_window, Fset_window_configuration):
15572 Call delete_all_subwindows with window as argument.
15573 (delete_all_subwindows): Take a window as argument and not a
15574 structure. Rewrite.
15575 (window_loop): Remove handling of GET_LRU_WINDOW and
15576 GET_LARGEST_WINDOW.
15577 (Fget_lru_window, Fget_largest_window): Move to window.el.
15578
15579 * window.h: Extern window_body_cols instead of
15580 window_box_text_cols. delete_all_subwindows now takes a
15581 Lisp_Object as argument.
15582
15583 * indent.c (compute_motion, Fcompute_motion):
15584 Use window_body_cols instead of window_box_text_cols.
15585
15586 * frame.c (delete_frame): Call delete_all_subwindows with root
15587 window as argument.
15588
15589 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15590
15591 * fns.c (Fputhash): Document return value.
15592
15593 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15594
15595 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15596
15597 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15598
15599 Cons<->int and similar integer overflow fixes (Bug#8794).
15600
15601 Check for overflow when converting integer to cons and back.
15602 * charset.c (Fdefine_charset_internal, Fdecode_char):
15603 Use cons_to_unsigned to catch overflow.
15604 (Fencode_char): Use INTEGER_TO_CONS.
15605 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15606 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15607 * data.c (long_to_cons, cons_to_long): Remove.
15608 (cons_to_unsigned, cons_to_signed): New functions.
15609 These signal an error for invalid or out-of-range values.
15610 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15611 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15612 * font.c (Ffont_variation_glyphs):
15613 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15614 * lisp.h: Include <intprops.h>.
15615 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15616 (cons_to_signed, cons_to_unsigned): New decls.
15617 (long_to_cons, cons_to_long): Remove decls.
15618 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15619 (Fprimitive_undo): Use CONS_TO_INTEGER.
15620 * xfns.c (Fx_window_property): Likewise.
15621 * xselect.c: Include <limits.h>.
15622 (x_own_selection, selection_data_to_lisp_data):
15623 Use INTEGER_TO_CONS.
15624 (x_handle_selection_request, x_handle_selection_clear)
15625 (x_get_foreign_selection, Fx_disown_selection_internal)
15626 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15627 (lisp_data_to_selection_data): Use cons_to_unsigned.
15628 (x_fill_property_data): Use cons_to_signed.
15629 Report values out of range.
15630
15631 Check for buffer and string overflow more precisely.
15632 * buffer.h (BUF_BYTES_MAX): New macro.
15633 * lisp.h (STRING_BYTES_MAX): New macro.
15634 * alloc.c (Fmake_string):
15635 * character.c (string_escape_byte8):
15636 * coding.c (coding_alloc_by_realloc):
15637 * doprnt.c (doprnt):
15638 * editfns.c (Fformat):
15639 * eval.c (verror):
15640 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15641 since they may not be the same number.
15642 * editfns.c (Finsert_char):
15643 * fileio.c (Finsert_file_contents):
15644 Likewise for BUF_BYTES_MAX.
15645
15646 * image.c: Use ptrdiff_t, not int, for sizes.
15647 (slurp_file): Switch from int to ptrdiff_t.
15648 All uses changed.
15649 (slurp_file): Check that file size fits in both size_t (for
15650 malloc) and ptrdiff_t (for sanity and safety).
15651
15652 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15653 if b->modtime has its maximal value.
15654
15655 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15656
15657 Don't assume time_t can fit into int.
15658 * buffer.h (struct buffer.modtime): Now time_t, not int.
15659 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15660 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15661
15662 Minor fixes for signed vs unsigned integers.
15663 * character.h (MAYBE_UNIFY_CHAR):
15664 * charset.c (maybe_unify_char):
15665 * keyboard.c (read_char, reorder_modifiers):
15666 XINT -> XFASTINT, since the integer must be nonnegative.
15667 * ftfont.c (ftfont_spec_pattern):
15668 * keymap.c (access_keymap, silly_event_symbol_error):
15669 XUINT -> XFASTINT, since the integer must be nonnegative.
15670 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15671 since it makes no difference and we prefer signed.
15672 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15673 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15674 nonnegative.
15675
15676 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15677
15678 * window.h (Fwindow_frame): Declare.
15679
15680 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15681
15682 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15683 (SPARE_MEMORY): Always define.
15684 (LARGE_REQUEST): Remove.
15685 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15686
15687 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15688
15689 * lisp.h: Move EXFUNS for Fframe_root_window,
15690 Fframe_first_window and Fset_frame_selected_window to window.h.
15691
15692 * window.h: Move EXFUNS for Fframe_root_window,
15693 Fframe_first_window and Fset_frame_selected_window here from
15694 lisp.h.
15695
15696 * frame.c (Fwindow_frame, Fframe_first_window)
15697 (Fframe_root_window, Fframe_selected_window)
15698 (Fset_frame_selected_window): Move to window.c.
15699 (Factive_minibuffer_window): Move to minibuf.c.
15700 (Fother_visible_frames_p): New function.
15701
15702 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15703
15704 * window.c (decode_window, decode_any_window): Move up in code.
15705 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15706 (inhibit_frame_unsplittable): Remove unused variable.
15707 (Fwindow_buffer): Move up and rewrite doc-string.
15708 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15709 (Fwindow_prev): New functions.
15710 (Fwindow_frame): Move here from frame.c. Accept any window as
15711 argument.
15712 (Fframe_root_window, Fframe_first_window)
15713 (Fframe_selected_window): Move here from frame.c. Accept frame
15714 or arbitrary window as argument. Update doc-strings.
15715 (Fminibuffer_window): Move up in code.
15716 (Fwindow_minibuffer_p): Move up in code and simplify.
15717 (Fset_frame_selected_window): Move here from frame.c.
15718 Marginal rewrite.
15719 (Fselected_window, select_window, Fselect_window): Move up in
15720 code. Minor doc-string fixes.
15721
15722 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15723
15724 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15725 Do not assume that spare memory exists; that assumption is valid
15726 only if SYSTEM_MALLOC.
15727 (LARGE_REQUEST): New macro, so that the issue of large requests
15728 is separated from the issue of spare memory.
15729
15730 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15731
15732 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15733 format. (Bug#8806)
15734
15735 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15736
15737 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15738 before statements.
15739
15740 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15741
15742 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15743
15744 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15745
15746 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15747 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15748
15749 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15750
15751 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15752
15753 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15754
15755 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15756 (x_clipboard_manager_save): Add return value.
15757 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15758 New error handlers.
15759 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15760 Obey Vx_select_enable_clipboard_manager. Catch errors in
15761 x_clipboard_manager_save (Bug#8779).
15762 (Vx_select_enable_clipboard_manager): New variable.
15763 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15764
15765 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15766
15767 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15768
15769 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15770
15771 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15772 in the current matrix if keep_current_p is non-zero.
15773
15774 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15775
15776 * bidi.c (bidi_level_of_next_char): Fix last change.
15777
15778 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15779
15780 Support bidi reordering of text covered by display properties.
15781
15782 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15783 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15784 (bidi_cache_search, bidi_cache_iterator_state)
15785 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15786 (bidi_level_of_next_char, bidi_move_to_visually_next):
15787 Support character positions inside a run of characters covered by a
15788 display string.
15789 (bidi_paragraph_init, bidi_resolve_explicit_1)
15790 (bidi_level_of_next_char): Call bidi_fetch_char and
15791 bidi_fetch_char_advance instead of FETCH_CHAR and
15792 FETCH_CHAR_ADVANCE.
15793 (bidi_init_it): Initialize new members.
15794 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15795 definitions.
15796 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15797 instead of using explicit *_CHAR codes.
15798 (bidi_resolve_explicit, bidi_resolve_weak):
15799 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15800 bidirectional text is supported only in multibyte buffers.
15801 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15802 it to initialize the frame_window_p member of struct bidi_it.
15803 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15804 (bidi_resolve_explicit, bidi_resolve_weak)
15805 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15806 bidi_it->nchars is non-positive.
15807 (bidi_level_of_next_char): Don't try to lookup the cache for the
15808 next/previous character if nothing is cached there yet, or if we
15809 were just reseat()'ed to a new position.
15810
15811 * xdisp.c (set_cursor_from_row): Set start and stop points
15812 according to the row's direction when priming the loop that looks
15813 for the glyph on which to display cursor.
15814 (single_display_spec_intangible_p): Function deleted.
15815 (display_prop_intangible_p): Reimplement to call
15816 handle_display_spec instead of single_display_spec_intangible_p.
15817 Accept 3 additional arguments needed by handle_display_spec.
15818 This fixes incorrect cursor motion across display property with complex
15819 values: lists, `(when COND...)' forms, etc.
15820 (single_display_spec_string_p): Support property values that are
15821 lists with the argument STRING its top-level element.
15822 (display_prop_string_p): Fix the condition for processing a
15823 property that is a list to be consistent with handle_display_spec.
15824 (handle_display_spec): New function, refactored from the
15825 last portion of handle_display_prop.
15826 (compute_display_string_pos): Accept additional argument
15827 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15828 value of a `display' property is a "replacing spec".
15829 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15830 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15831 the display property, but just return a value indicating whether
15832 the display property will replace the characters it covers.
15833 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15834 frame_window_p members of struct bidi_it.
15835 (compute_display_string_pos, compute_display_string_end):
15836 New functions.
15837 (push_it): Accept second argument POSITION, where pop_it should
15838 jump to continue iteration.
15839 (reseat_1): Initialize bidi_it.disp_pos.
15840
15841 * keyboard.c (adjust_point_for_property): Adjust the call to
15842 display_prop_intangible_p to its new signature.
15843
15844 * dispextern.h (struct bidi_it): New member frame_window_p.
15845 (bidi_init_it): Update prototypes.
15846 (display_prop_intangible_p): Update prototype.
15847 (compute_display_string_pos, compute_display_string_end):
15848 Declare prototypes.
15849 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15850 EMACS_INT.
15851
15852 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15853
15854 Malloc failure behavior now depends on size of allocation.
15855 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15856 * lisp.h: Change signatures accordingly.
15857 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15858 All callers changed. (Bug#8762)
15859
15860 * gnutls.c: Use Emacs's memory allocators.
15861 Without this change, the gnutls library would invoke malloc etc.
15862 directly, which causes problems on non-SYNC_INPUT hosts, and which
15863 runs afoul of improving memory_full behavior. (Bug#8761)
15864 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15865 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15866 xfree instead of the default malloc, realloc, free.
15867 (Fgnutls_boot): No need to check for memory allocation failure,
15868 since xmalloc does that for us.
15869
15870 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15871 * category.c (hash_get_category_set):
15872 * ccl.c (ccl_driver):
15873 * charset.c (Fdefine_charset_internal):
15874 * charset.h (struct charset.hash_index):
15875 * composite.c (get_composition_id, gstring_lookup_cache)
15876 (composition_gstring_put_cache):
15877 * composite.h (struct composition.hash_index):
15878 * dispextern.h (struct image.hash):
15879 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15880 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15881 (hashfn_equal, hashfn_user_defined, make_hash_table)
15882 (maybe_resize_hash_table, hash_lookup, hash_put)
15883 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15884 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15885 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15886 * image.c (make_image, search_image_cache, lookup_image)
15887 (xpm_put_color_table_h):
15888 * lisp.h (struct Lisp_Hash_Table):
15889 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15890 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15891 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15892 * alloc.c (allocate_vectorlike):
15893 Check for overflow in vector size calculations.
15894 * ccl.c (ccl_driver):
15895 Check for overflow when converting EMACS_INT to int.
15896 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15897 need to be updated by these changes.
15898 * fns.c (make_hash_table, maybe_resize_hash_table):
15899 Check for integer overflow with large hash tables.
15900 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15901 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15902 (SXHASH_REDUCE): New macro.
15903 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15904 Use it instead of discarding useful hash info with large hash values.
15905 (sxhash_float): New function.
15906 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15907 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15908 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15909 Rewrite to use FIXNUM_BITS, as this simplifies things.
15910 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15911 Adjust signatures to match updated version of code.
15912 (consing_since_gc): Now EMACS_INT, since a single hash table can
15913 use more than INT_MAX bytes.
15914
15915 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15916
15917 Make it possible to build with GCC-4.6+ -O2 -flto.
15918
15919 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15920
15921 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15922
15923 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15924 Call minibuffer-inactive-mode.
15925
15926 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15927
15928 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15929 Update dependencies.
15930
15931 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15932
15933 * data.c (init_data): Remove code for UTS, this system is not
15934 supported anymore.
15935
15936 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15937
15938 Don't force ./temacs to start in terminal mode.
15939
15940 * frame.c (make_initial_frame): Initialize faces in all cases, not
15941 only when CANNOT_DUMP is defined.
15942 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15943
15944 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15945
15946 * dispnew.c (add_window_display_history): Use const for the string
15947 pointer. Remove declaration, not needed.
15948
15949 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15950
15951 Use 'inline', not 'INLINE'.
15952 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15953 * alloc.c, fontset.c (INLINE): Remove.
15954 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15955 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15956 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15957 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15958 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15959
15960 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15961
15962 Make it possible to run ./temacs.
15963
15964 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15965 syms_of_callproc does the same thing. Remove test for
15966 "initialized", do it in the caller.
15967 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15968
15969 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15970
15971 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15972 (read_minibuf): Use get_minibuffer.
15973 (syms_of_minibuf): Use DEFSYM.
15974 (Qmetadata): New var.
15975 * data.c (Qbuffer): Don't make it static.
15976 (syms_of_data): Use DEFSYM.
15977
15978 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15979
15980 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15981 (CCL_CODE_MIN): New macro.
15982
15983 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15984
15985 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15986
15987 * eval.c (Qdebug): Now static.
15988 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15989 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15990 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15991
15992 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15993
15994 * image.c: Various fixes to ImageMagick code comments.
15995 (Fimagemagick_types): Doc fix.
15996
15997 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15998
15999 Minor fixes prompted by GCC 4.6.0 warnings.
16000
16001 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16002
16003 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16004 (x_clipboard_manager_save_all): Move extern decl to ...
16005 * xterm.h: ... here, so that it can be checked for consistency.
16006
16007 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
16008
16009 * xselect.c (x_clipboard_manager_save_frame)
16010 (x_clipboard_manager_save_all): New functions.
16011 (Fx_clipboard_manager_save): Lisp function deleted.
16012
16013 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16014 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16015
16016 * xterm.h: Update prototype.
16017
16018 2011-05-28 William Xu <william.xwl@gmail.com>
16019
16020 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16021 exiting (Bug#8239).
16022
16023 2011-05-28 Jim Meyering <meyering@redhat.com>
16024
16025 Avoid a sign-extension bug in crypto_hash_function.
16026 * fns.c (to_uchar): Define.
16027 (crypto_hash_function): Use it to convert some newly-signed
16028 variables to unsigned, to avoid sign-extension bugs. For example,
16029 without this change, (md5 "truc") would evaluate to
16030 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16031 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
16032 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
16033
16034 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16035
16036 Integer overflow fixes.
16037
16038 * dbusbind.c: Serial number integer overflow fixes.
16039 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
16040 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16041 to hold a serial number that is too large for a fixnum.
16042 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16043 Check for serial numbers out of range. Decode any serial number
16044 that was so large that it became a float. (Bug#8722)
16045
16046 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16047 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16048 Use XFASTINT rather than XUINT when numbers are nonnegative.
16049 (xd_append_arg, Fdbus_method_return_internal):
16050 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16051 arguments, check that Lisp number is nonnegative, rather than
16052 silently wrapping negative numbers around. (Bug#8722)
16053 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16054 (Bug#8722)
16055
16056 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16057
16058 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16059
16060 ccl: Add integer overflow checks.
16061 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16062 (IN_INT_RANGE): New macros.
16063 (ccl_driver): Use them to check for integer overflow when
16064 decoding a CCL program. Many of the new checks are whether XINT (x)
16065 fits in int; it doesn't always, on 64-bit hosts. The new version
16066 doesn't catch all possible integer overflows, but it's an
16067 improvement. (Bug#8719)
16068
16069 * alloc.c (make_event_array): Use XINT, not XUINT.
16070 There's no need for unsigned here.
16071
16072 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16073 This follows up to the 2011-05-06 change that substituted uintptr_t
16074 for EMACS_INT. This case wasn't caught back then.
16075
16076 Rework Fformat to avoid integer overflow issues.
16077 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16078 now (part of C89). Include <verify.h>.
16079 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16080 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16081 (Fformat): Avoid the prepass trying to compute sizes; it was only
16082 approximate and thus did not catch overflow reliably. Instead, walk
16083 through the format just once, formatting and computing sizes as we go,
16084 checking for integer overflow at every step, and allocating a larger
16085 buffer as needed. Keep track separately whether the format is
16086 multibyte. Keep only the most-recently calculated precision, rather
16087 than them all. Record whether each argument has been converted to
16088 string. Use EMACS_INT, not int, for byte and char and arg counts.
16089 Support field widths and precisions larger than INT_MAX. Avoid
16090 sprintf's undefined behavior with conversion specifications such as %#d
16091 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16092 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16093 formatting out-of-range floating point numbers with int
16094 formats. (Bug#8668)
16095
16096 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16097
16098 * data.c: Avoid integer truncation in expressions involving floats.
16099 * data.c: Include <intprops.h>.
16100 (arith_driver): When there's an integer overflow in an expression
16101 involving floating point, convert the integers to floating point
16102 so that the resulting value does not suffer from catastrophic
16103 integer truncation. For example, on a 64-bit host (* 4
16104 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16105 Do not rely on undefined behavior after integer overflow.
16106
16107 merge count_size_as_multibyte, parse_str_to_multibyte
16108 * character.c, character.h (count_size_as_multibyte):
16109 Rename from parse_str_to_multibyte; all uses changed.
16110 Check for integer overflow.
16111 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16112 since it's now a duplicate of the other. This is more of
16113 a character than a buffer op, so better that it's in character.c.
16114 * fns.c, print.c: Adjust to above changes.
16115
16116 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16117
16118 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16119
16120 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16121
16122 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16123 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16124 (x_clipboard_manager_save): Now static.
16125 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16126
16127 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16128 (crypto_hash_function): Now static.
16129 Fix pointer signedness problems. Avoid unnecessary initializations.
16130
16131 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16132
16133 * termhooks.h (Vselection_alist): Make it terminal-local.
16134
16135 * terminal.c (create_terminal): Initialize it.
16136
16137 * xselect.c: Support for clipboard managers.
16138 (Vselection_alist): Move to termhooks.h as terminal-local var.
16139 (LOCAL_SELECTION): New macro.
16140 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16141 (symbol_to_x_atom): Remove gratuitous arg.
16142 (x_handle_selection_request, lisp_data_to_selection_data)
16143 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16144 (x_own_selection, x_get_local_selection, x_convert_selection):
16145 New arg, specifying work frame. Use terminal-local Vselection_alist.
16146 (some_frame_on_display): Delete unused function.
16147 (Fx_own_selection_internal, Fx_get_selection_internal)
16148 (Fx_disown_selection_internal, Fx_selection_owner_p)
16149 (Fx_selection_exists_p): New optional frame arg.
16150 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16151 (x_handle_selection_clear): Don't treat other terminals with the
16152 same keyboard specially. Use the terminal-local Vselection_alist.
16153 (x_clear_frame_selections): Use Frun_hook_with_args.
16154
16155 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16156
16157 * xterm.h: Add support for those atoms.
16158
16159 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16160
16161 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16162 (converted_selections, conversion_fail_tag): New global variables.
16163 (x_selection_request_lisp_error): Free the above.
16164 (x_get_local_selection): Remove unnecessary code.
16165 (x_reply_selection_request): Args changed; handle arbitrary array
16166 of converted selections stored in converted_selections.
16167 Separate the XChangeProperty and SelectionNotify steps.
16168 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16169 (x_convert_selection): New function.
16170 (x_handle_selection_event): Simplify.
16171 (x_get_foreign_selection): Don't ignore incoming requests while
16172 waiting for an answer; this will fail when we implement
16173 SAVE_TARGETS, and seems unnecessary anyway.
16174 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16175 (Vx_sent_selection_functions): Doc fix.
16176
16177 2011-05-26 Leo Liu <sdl.web@gmail.com>
16178
16179 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16180
16181 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16182
16183 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16184
16185 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16186 for fringe update if it has periodic bitmap.
16187 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16188 and fringe_bitmap_periodic_p.
16189
16190 * fringe.c (get_fringe_bitmap_data): New function.
16191 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16192 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16193 row. Mark glyph row for fringe update if periodicity changed.
16194
16195 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16196 for fringe update unless it has periodic bitmap.
16197
16198 2011-05-25 Kenichi Handa <handa@m17n.org>
16199
16200 * xdisp.c (get_next_display_element): Set correct it->face_id for
16201 a static composition.
16202
16203 2011-05-24 Leo Liu <sdl.web@gmail.com>
16204
16205 * deps.mk (fns.o):
16206 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16207
16208 * fns.c (crypto_hash_function, Fsha1): New function.
16209 (Fmd5): Use crypto_hash_function.
16210 (syms_of_fns): Add Ssha1.
16211
16212 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16213
16214 * gnutls.c: Remove unused macros.
16215 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16216 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16217 Remove macros that are defined and never used.
16218 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16219
16220 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16221
16222 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16223 (Fx_get_selection_internal): Minor cleanup.
16224 (Fx_own_selection_internal): Rename arguments for consistency with
16225 select.el.
16226
16227 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16228
16229 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16230
16231 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16232
16233 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16234
16235 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16236
16237 * dispnew.c (scrolling_window): Don't exclude the case that the
16238 last enabled row in the desired matrix touches the bottom boundary.
16239
16240 2011-05-21 Glenn Morris <rgm@gnu.org>
16241
16242 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16243 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16244 and add some more files.
16245
16246 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16247
16248 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16249 report_file_error introduced by the change from 2011-05-07.
16250
16251 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16252
16253 * systime.h (Time): Define only if emacs is defined.
16254 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16255 where the include path doesn't have X11/X.h by default. See
16256 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16257
16258 2011-05-20 Kenichi Handa <handa@m17n.org>
16259
16260 * composite.c (find_automatic_composition): Fix previous change.
16261
16262 2011-05-20 Glenn Morris <rgm@gnu.org>
16263
16264 * lisp.mk: New file, split from Makefile.in.
16265 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16266 (shortlisp): Remove.
16267 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16268
16269 2011-05-19 Glenn Morris <rgm@gnu.org>
16270
16271 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16272 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16273 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16274 (lisp): Set the order to that of loadup.el.
16275 (shortlisp): Make it a copy of $lisp.
16276 (SOME_MACHINE_LISP): Remove.
16277 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16278 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16279
16280 2011-05-18 Kenichi Handa <handa@m17n.org>
16281
16282 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16283 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16284 (find_automatic_composition): Mostly rewrite for efficiency.
16285
16286 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16287
16288 * makefile.w32-in: Update dependencies.
16289
16290 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16291
16292 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16293 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16294
16295 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16296
16297 Fix some integer overflow issues, such as string length overflow.
16298
16299 * insdel.c (count_size_as_multibyte): Check for string overflow.
16300
16301 * character.c (lisp_string_width): Check for string overflow.
16302 Use EMACS_INT, not int, for string indexes and lengths; in
16303 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16304 the resulting string length overflows an EMACS_INT; instead,
16305 report a string overflow if no precision given. When checking for
16306 precision exhaustion, use a check that cannot possibly have
16307 integer overflow. (Bug#8675)
16308 * character.h (lisp_string_width): Adjust to new signature.
16309
16310 * alloc.c (string_overflow): New function.
16311 (Fmake_string): Use it. This doesn't change behavior, but saves
16312 a few bytes and will simplify future changes.
16313 * character.c (string_escape_byte8): Likewise.
16314 * lisp.h (string_overflow): New decl.
16315
16316 Fixups, following up to the user-interface timestamp change.
16317 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16318 for UI timestamps, instead of unsigned long.
16319 * msdos.c (mouse_get_pos): Likewise.
16320 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16321 * w32gui.h (Time): Define by including "systime.h" rather than by
16322 declaring it ourselves. (Bug#8664)
16323
16324 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16325 * image.c (clear_image_cache): Likewise.
16326
16327 * term.c (term_mouse_position): Don't assume time_t wraparound.
16328
16329 Be more systematic about user-interface timestamps.
16330 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16331 and sometimes 'EMACS_UINT', to represent these timestamps.
16332 This change causes it to use 'Time' uniformly, as that's what X uses.
16333 This makes the code easier to follow, and makes it easier to catch
16334 integer overflow bugs such as Bug#8664.
16335 * frame.c (Fmouse_position, Fmouse_pixel_position):
16336 Use Time, not unsigned long, for user-interface timestamps.
16337 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16338 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16339 * keyboard.h (last_event_timestamp): Likewise.
16340 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16341 * menu.h (xmenu_show): Likewise.
16342 * term.c (term_mouse_position): Likewise.
16343 * termhooks.h (struct input_event.timestamp): Likewise.
16344 (struct terminal.mouse_position_hook): Likewise.
16345 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16346 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16347 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16348 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16349 what it was before.
16350 * menu.h, termhooks.h: Include "systime.h", for Time.
16351
16352 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16353 Don't assume that the difference between two unsigned long values
16354 can fit into an integer. At this point, we know button_down_time
16355 <= event->timestamp, so the difference must be nonnegative, so
16356 there's no need to cast the result if double-click-time is
16357 nonnegative, as it should be; check that it's nonnegative, just in
16358 case. This bug is triggered when events are more than 2**31 ms
16359 apart (about 25 days). (Bug#8664)
16360
16361 * xselect.c (last_event_timestamp): Remove duplicate decl.
16362 (x_own_selection): Remove needless cast to unsigned long.
16363
16364 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16365 that always fit in int. Use a sentinel instead of a counter, to
16366 avoid a temp and to allay GCC's concerns about possible int overflow.
16367 * frame.h (struct frame): Use int for menu_bar_items_used
16368 instead of EMACS_INT, since it always fits in int.
16369
16370 * menu.c (grow_menu_items): Check for int overflow.
16371
16372 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16373
16374 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16375 Before, the code was not consistent. These values cannot exceed
16376 2**31 - 1 so there's no need to make them unsigned.
16377 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16378 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16379 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16380 as modifiers.
16381 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16382
16383 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16384 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16385 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16386 presumably because the widths might not match.
16387
16388 * window.c (size_window): Avoid needless test at loop start.
16389
16390 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16391
16392 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16393
16394 2011-05-12 Drew Adams <drew.adams@oracle.com>
16395
16396 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16397
16398 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16399
16400 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16401 `width' to `bar_area_x' and `bar_area_width', respectively.
16402 (x_scroll_run): Take account of fringe background extension.
16403
16404 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16405 Rename local vars `left' and `width' to `bar_area_x' and
16406 `bar_area_width', respectively.
16407 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16408 background extension.
16409
16410 2011-05-10 Jim Meyering <meyering@redhat.com>
16411
16412 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16413
16414 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16415
16416 * image.c (Finit_image_library): Return t for built-in image types,
16417 like pbm and xbm. (Bug#8640)
16418
16419 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16420
16421 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16422
16423 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16424
16425 * w32console.c (Fset_screen_color): Doc fix.
16426 (Fget_screen_color): New function.
16427 (syms_of_ntterm): Defsubr it.
16428
16429 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16430 unlink the temporary file if Fcall_process didn't create it in the
16431 first place.
16432 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16433 child process will be redirected to a file specified with `:file'.
16434 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16435 cue to call_process_cleanup not to close that handle.
16436
16437 2011-05-07 Ben Key <bkey76@gmail.com>
16438
16439 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16440 one of two shell specific rules, either bootstrap-temacs-CMD or
16441 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16442 to the previous implementation of the bootstrap-temacs rule.
16443 The bootstrap-temacs-CMD rule is similar to the previous
16444 implementation of the bootstrap-temacs rule except that it
16445 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16446 variable.
16447
16448 These changes, along with some changes to nt/configure.bat,
16449 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16450 earlier fix to add support for --cflags and --ldflags options
16451 that include quotes so that it works whether make uses cmd or
16452 sh as the shell.
16453
16454 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16455
16456 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16457 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16458 is a constant.
16459 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16460 a string. Handle both cases.
16461 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16462 (Fdbus_register_method): Use Qinvalid_function.
16463
16464 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16465
16466 * makefile.w32-in: Update dependencies.
16467 (LISP_H): Add inttypes.h and stdin.h.
16468 (PROCESS_H): Add unistd.h.
16469
16470 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16471
16472 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16473 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16474
16475 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16476
16477 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16478
16479 * term.c (vfatal): Remove stray call to va_end.
16480 It's not needed and the C Standard doesn't allow it here anyway.
16481
16482 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16483 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16484
16485 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16486 bytes.
16487
16488 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16489
16490 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16491
16492 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16493
16494 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16495
16496 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16497
16498 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16499 * charset.c (Fdefine_charset_internal): Don't initialize
16500 charset.code_space[15]. The value was garbage, on hosts with
16501 32-bit int (Bug#8600).
16502
16503 * lread.c (read_integer): Be more consistent with string-to-number.
16504 Use string_to_number to do the actual conversion; this avoids
16505 rounding errors and fixes some other screwups. Without this fix,
16506 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16507 (digit_to_number): Move earlier, for benefit of read_integer.
16508 Return -1 if the digit is out of range for the base, -2 if it is
16509 not a digit in any supported base. (Bug#8602)
16510
16511 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16512
16513 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16514 to match comment at start of function. This also removes a
16515 GCC warning about overflow in a 32+64-bit port.
16516
16517 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16518
16519 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16520 Reported by Stefan Monnier in
16521 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16522 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16523 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16524
16525 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16526 (EMACS_UINTPTR): Likewise, with uintptr_t.
16527
16528 * lisp.h: Prefer 64-bit EMACS_INT if available.
16529 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16530 on 32-bit hosts that have 64-bit int, so that they can access
16531 large files.
16532 However, temporarily disable this change unless the temporary
16533 symbol WIDE_EMACS_INT is defined.
16534
16535 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16536
16537 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16538 This removes an assumption that EMACS_INT and long are the same
16539 width as pointers. The assumption is true for Emacs porting targets
16540 now, but we want to make other targets possible.
16541 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16542 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16543 In the rest of the code, change types of integers that hold casted
16544 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16545 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16546 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16547 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16548 No need to cast type when ORing.
16549 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16550 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16551 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16552 assume EMACS_INT is the same width as char *.
16553 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16554 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16555 Remove no-longer-needed casts.
16556 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16557 (xg_tool_bar_help_callback, xg_make_tool_item):
16558 Use EMACS_INTPTR to hold an integer
16559 that will be cast to void *; this can avoid a GCC warning
16560 if EMACS_INT is not the same width as void *.
16561 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16562 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16563 (current_message_1, set_message_1):
16564 Use a local to convert to proper width without a cast.
16565 * xmenu.c (dialog_selection_callback): Likewise.
16566
16567 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16568 Also, don't assume VALBITS / RAND_BITS is less than 5,
16569 and don't rely on undefined behavior when shifting a 1 left into
16570 the sign bit.
16571 * lisp.h (get_random): Change signature to match.
16572
16573 * lread.c (hash_string): Use size_t, not int, for hash computation.
16574 Normally we prefer signed values; but hashing is special, because
16575 it's better to use unsigned division on hash table sizes so that
16576 the remainder is nonnegative. Also, size_t is the natural width
16577 for hashing into memory. The previous code used 'int', which doesn't
16578 retain enough info to hash well into very large tables.
16579 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16580
16581 * dbusbind.c: Don't possibly lose pointer info when converting.
16582 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16583 Use XPNTR rather than XHASH, so that the high-order bits of
16584 the pointer aren't lost when converting through void *.
16585
16586 * eval.c (Fautoload): Don't double-shift a pointer.
16587
16588 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16589
16590 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16591
16592 * gnutls.c (DEF_GNUTLS_FN):
16593 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16594
16595 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16596
16597 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16598 marker. (Bug#8610)
16599
16600 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16601
16602 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16603 New version that can reserve upto 2GB of heap space.
16604
16605 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16606
16607 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16608
16609 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16610
16611 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16612 `gnutls_certificate_set_x509_key_file'.
16613
16614 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16615
16616 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16617 Update dependencies.
16618
16619 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16620
16621 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16622 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16623 Remove unused parameter `fildes'.
16624 * process.c (read_process_output, send_process): Don't pass it.
16625
16626 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16627
16628 Fix previous change: the library cache is defined in w32.c.
16629 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16630 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16631
16632 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16633
16634 Implement dynamic loading of GnuTLS on Windows.
16635
16636 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16637 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16638 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16639 Declare.
16640
16641 * gnutls.c (Qgnutls_dll): Define.
16642 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16643 (gnutls_*): Declare function pointers.
16644 (init_gnutls_functions): New function to initialize function pointers.
16645 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16646 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16647 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16648 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16649 (emacs_gnutls_write, emacs_gnutls_read)
16650 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16651 (Fgnutls_available_p): New function.
16652 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16653 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16654 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16655
16656 * image.c: Include w32.h.
16657 (Vimage_type_cache): Delete.
16658 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16659 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16660 (w32_delayed_load): Move to w32.c.
16661
16662 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16663
16664 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16665 (w32_delayed_load): Move from image.c. When loading a library, record
16666 its filename in the :loaded-from property of the library id.
16667 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16668 Initialize and staticpro them.
16669 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16670
16671 * process.c: Include lisp.h before w32.h, not after.
16672 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16673 instead of gnutls_record_check_pending.
16674
16675 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16676
16677 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16678
16679 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16680 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16681 as passed in.
16682
16683 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16684
16685 * xterm.c (x_set_frame_alpha): Do not set property on anything
16686 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16687
16688 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16689
16690 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16691
16692 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16693
16694 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16695 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16696 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16697 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16698 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16699 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16700 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16701 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16702 (Qgnutls_bootprop_callbacks_verify): Make static.
16703
16704 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16705
16706 * callproc.c: Indentation fixup.
16707
16708 * sysdep.c (wait_for_termination_1): Make static.
16709 (wait_for_termination, interruptible_wait_for_termination):
16710 Move after wait_for_termination_1.
16711
16712 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16713
16714 * sysdep.c (interruptible_wait_for_termination): New function
16715 which is like wait_for_termination, but allows keyboard
16716 interruptions.
16717
16718 * callproc.c (Fcall_process): Add (:file "file") as an option for
16719 the STDOUT buffer.
16720 (Fcall_process_region): Ditto.
16721
16722 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16723
16724 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16725 rather than `XVECTOR (FOO)->size'.
16726
16727 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16728 inttypes.h, as a gnulib replacement is used if it not available in
16729 system headers.
16730
16731 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16732
16733 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16734 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16735 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16736
16737 * coding.c (coding_alloc_by_realloc): Error out if destination
16738 will grow beyond MOST_POSITIVE_FIXNUM.
16739 (decode_coding_emacs_mule): Abort if there isn't enough place in
16740 charbuf for the composition carryover bytes. Reserve an extra
16741 space for up to 2 characters produced in a loop.
16742 (decode_coding_iso_2022): Abort if there isn't enough place in
16743 charbuf for the composition carryover bytes.
16744
16745 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16746
16747 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16748 aborting when %lld or %lll format is passed.
16749 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16750 %llo or %llx format is passed. (Bug#8545)
16751
16752 * window.c (window_scroll_line_based): Use a marker instead of
16753 simple variables to record original value of point. (Bug#7952)
16754
16755 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16756 produced by %s or %c overflows available buffer space. (Bug#8545)
16757
16758 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16759
16760 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16761 (SIZE_MAX): Move defn after all includes, as they might #define it.
16762
16763 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16764
16765 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16766
16767 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16768
16769 * keyboard.c (Qdelayed_warnings_hook): Define.
16770 (command_loop_1): Run `delayed-warnings-hook'
16771 if Vdelayed_warnings_list is non-nil.
16772 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16773 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16774
16775 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16776
16777 * doprnt.c (doprnt): Don't return value smaller than the buffer
16778 size if the message was truncated. (Bug#8545).
16779
16780 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16781
16782 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16783 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16784
16785 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16786
16787 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16788
16789 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16790
16791 * makefile.w32-in: Update dependencies.
16792
16793 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16794
16795 Improve `doprnt' and its usage. (Bug#8545)
16796 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16797 `format_end'. Remove support for %l as a conversion specifier.
16798 Don't use xrealloc. Improve diagnostics when the %l size modifier
16799 is used. Update the commentary.
16800
16801 * eval.c (verror): Simplify calculation of size_t.
16802
16803 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16804 messages.
16805
16806 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16807
16808 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16809 change.
16810
16811 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16812
16813 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16814 This makes this file independent of the recent pseudovector change.
16815
16816 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16817
16818 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16819
16820 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16821 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16822 Remove unused local.
16823 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16824
16825 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16826 GCC 4.6.0 optimizes based on type-based alias analysis.
16827 For example, if b is of type struct buffer * and v of type struct
16828 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16829 != &v->size, and therefore "v->size = 1; b->size = 2; return
16830 v->size;" must therefore return 1. This assumption is incorrect
16831 for Emacs, since it type-puns struct Lisp_Vector * with many other
16832 types. To fix this problem, this patch adds a new type struct
16833 vectorlike_header that documents the constraints on layout of vectors
16834 and pseudovectors, and helps optimizing compilers not get fooled
16835 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16836 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16837 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16838 the size member.
16839 (XSETPVECTYPE): Rewrite in terms of new macro.
16840 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16841 This is a bit clearer, and further avoids the possibility of
16842 undesirable aliasing.
16843 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16844 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16845 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16846 since Lisp_Subr is a special case (no "next" field).
16847 (ASIZE): Now uses header.size rather than size.
16848 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16849 to avoid the hassle of writing XVECTOR (foo)->header.size.
16850 (struct vectorlike_header): New type.
16851 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16852 object, to help avoid aliasing.
16853 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16854 (SUBRP): Likewise, since Lisp_Subr is a special case.
16855 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16856 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16857 (struct Lisp_Hash_Table): Combine first two members into a single
16858 struct vectorlike_header member. All uses of "size" and "next" members
16859 changed to be "header.size" and "header.next".
16860 * buffer.h (struct buffer): Likewise.
16861 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16862 * frame.h (struct frame): Likewise.
16863 * process.h (struct Lisp_Process): Likewise.
16864 * termhooks.h (struct terminal): Likewise.
16865 * window.c (struct save_window_data, struct saved_window): Likewise.
16866 * window.h (struct window): Likewise.
16867 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16868 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16869 * buffer.c (init_buffer_once): Likewise.
16870 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16871 special case.
16872 * process.c (Fformat_network_address): Use local var for size,
16873 for brevity.
16874
16875 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16876
16877 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16878 * data.c (atof): Remove decl; no longer used or needed.
16879 (digit_to_number): Move to lread.c.
16880 (Fstring_to_number): Use new string_to_number function, to be
16881 consistent with how the Lisp reader treats infinities and NaNs.
16882 Do not assume that floating-point numbers represent EMACS_INT
16883 without losing information; this is not true on most 64-bit hosts.
16884 Avoid double-rounding errors, by insisting on integers when
16885 parsing non-base-10 numbers, as the documentation specifies.
16886 * lisp.h (string_to_number): New decl, replacing ...
16887 (isfloat_string): Remove.
16888 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16889 (read1): Do not accept +. and -. as integers; this
16890 appears to have been a coding error. Similarly, do not accept
16891 strings like +-1e0 as floating point numbers. Do not report
16892 overflow for integer overflows unless the base is not 10 which
16893 means we have no simple and reliable way to continue.
16894 Break out the floating-point parsing into a new
16895 function string_to_number, so that Fstring_to_number parses
16896 floating point numbers consistently with the Lisp reader.
16897 (digit_to_number): Move here from data.c. Make it static inline.
16898 (E_CHAR, EXP_INT): Remove, replacing with ...
16899 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16900 (string_to_number): New function, replacing isfloat_string.
16901 This function checks for valid syntax and produces the resulting
16902 Lisp float number too. Rework it so that string-to-number
16903 no longer mishandles examples like "1.0e+". Use strtoumax,
16904 so that overflow for non-base-10 numbers is reported only when
16905 there's no portable and simple way to convert to floating point.
16906
16907 * textprop.c (set_text_properties_1): Rewrite for clarity,
16908 and to avoid GCC warning about integer overflow.
16909
16910 * intervals.h (struct interval): Use EMACS_INT for members
16911 where EMACS_UINT might cause problems. See
16912 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16913 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16914 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16915 All uses changed.
16916 (offset_intervals): Tell GCC not to worry about length overflow
16917 when negating a negative length.
16918
16919 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16920 (overrun_check_free): Likewise.
16921
16922 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16923 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16924 word size.
16925
16926 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16927 (gnutls_make_error): Rename local to avoid shadowing.
16928 (gnutls_emacs_global_deinit): ifdef out; not used.
16929 (Fgnutls_boot): Use const for pointer to readonly storage.
16930 Comment out unused local. Fix pointer signedness problems.
16931
16932 * lread.c (openp): Don't stuff size_t into an 'int'.
16933 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16934 about possible signed overflow.
16935
16936 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16937 (GDK_KEY_g): Don't define if already defined.
16938 (xg_prepare_tooltip): Avoid pointer signedness problem.
16939 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16940
16941 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16942 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16943
16944 * xfns.c (Fx_window_property): Simplify a bit,
16945 to make a bit faster and to avoid GCC 4.6.0 warning.
16946 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16947
16948 * fns.c (internal_equal): Don't assume size_t fits in int.
16949
16950 * alloc.c (compact_small_strings): Tighten assertion a little.
16951
16952 Replace pEd with more-general pI, and fix some printf arg casts.
16953 * lisp.h (pI): New macro, generalizing old pEd macro to other
16954 conversion specifiers. For example, use "...%"pI"d..." rather
16955 than "...%"pEd"...".
16956 (pEd): Remove. All uses replaced with similar uses of pI.
16957 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16958 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16959 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16960 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16961 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16962 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16963 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16964 64-bit hosts.
16965 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16966 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16967 * print.c (safe_debug_print, print_object): Likewise.
16968 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16969 to int.
16970 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16971 avoiding the 0 flag, which is not portable.
16972 * process.c (Fmake_network_process): Use pI to avoid cast.
16973 * region-cache.c (pp_cache): Likewise.
16974 * xdisp.c (decode_mode_spec): Likewise.
16975 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16976 behavior on 64-bit hosts with printf arg.
16977 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16978 (x_stop_queuing_selection_requests): Likewise.
16979 (x_get_window_property): Don't truncate byte count to an 'int'
16980 when tracing.
16981
16982 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16983 here, since it parses constructs like leading '-' and spaces,
16984 which are not wanted; and it overflows with large numbers.
16985 Instead, simply match F[0-9]+, which is what is wanted anyway.
16986
16987 * alloc.c: Remove unportable assumptions about struct layout.
16988 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16989 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16990 (allocate_vectorlike, make_pure_vector): Use the new macros,
16991 plus offsetof, to remove unportable assumptions about struct layout.
16992 These assumptions hold on all porting targets that I know of, but
16993 they are not guaranteed, they're easy to remove, and removing them
16994 makes further changes easier.
16995
16996 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16997 This doesn't fix a bug but makes the code clearer.
16998 (string_overrun_cookie): Now const. Use initializers that
16999 don't formally overflow signed char, to avoid warnings.
17000 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17001 can cause Emacs to crash when string overrun checking is enabled.
17002 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17003 multiple of sizeof (EMACS_INT); it need not be, if
17004 alignof(EMACS_INT) < sizeof (EMACS_INT).
17005 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
17006
17007 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
17008
17009 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17010
17011 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17012
17013 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
17014 supposed to be handshaking. (Bug#8556)
17015 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17016
17017 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
17018
17019 * lisp.h (Qdebug): List symbol.
17020 * eval.c (Qdebug): Restore global linkage.
17021 * keyboard.c (debug-on-event): New variable.
17022 (handle_user_signal): Break into debugger when debug-on-event
17023 matches the current signal symbol.
17024
17025 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17026
17027 * alloc.c (check_sblock, check_string_bytes)
17028 (check_string_free_list): Convert to standard C.
17029
17030 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17031
17032 * w32.c (emacs_gnutls_push): Fix typo.
17033
17034 2011-04-25 Eli Zaretskii <eliz@gnu.org>
17035
17036 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17037 "cast to pointer from integer of different size".
17038
17039 Improve doprnt and its use in verror. (Bug#8545)
17040 * doprnt.c (doprnt): Document the set of format control sequences
17041 supported by the function. Use SAFE_ALLOCA instead of always
17042 using `alloca'.
17043
17044 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17045 is one byte too soon. Don't use xrealloc; instead xfree and
17046 xmalloc anew.
17047
17048 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17049
17050 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17051 callbacks stage.
17052
17053 * gnutls.c: Renamed global_initialized to
17054 gnutls_global_initialized. Added internals for the
17055 :verify-hostname-error, :verify-error, and :verify-flags
17056 parameters of `gnutls-boot' and documented those parameters in the
17057 docstring. Start callback support.
17058 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17059 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17060 on error. Return error code.
17061 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17062 (emacs_gnutls_read): Likewise.
17063 (Fgnutls_boot): Return handshake error code.
17064 (emacs_gnutls_handle_error): New function.
17065 (wsaerror_to_errno): Likewise.
17066
17067 * w32.h (emacs_gnutls_pull): Add prototype.
17068 (emacs_gnutls_push): Likewise.
17069
17070 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17071 (emacs_gnutls_push): Likewise.
17072
17073 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17074
17075 * process.c (wait_reading_process_output): Check if GnuTLS
17076 buffered some data internally if no FDs are set for TLS
17077 connections.
17078
17079 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17080 (LIBS): Link to USER_LIBS.
17081 ($(BLD)/gnutls.$(0)): New target.
17082
17083 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17084
17085 * xdisp.c (handle_single_display_spec): Rename the
17086 display_replaced_before_p argument into display_replaced_p, to
17087 make it consistent with the commentary. Fix typos in the
17088 commentary.
17089
17090 * textprop.c (syms_of_textprop): Remove dead code.
17091 (copy_text_properties): Delete obsolete commentary about an
17092 interface that was deleted long ago. Fix typos in the description
17093 of arguments.
17094
17095 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17096 to changes in oldXMenu/XMenu.h from 2011-04-16.
17097 <menu_help_message, prev_menu_help_message>: Constify.
17098 (IT_menu_make_room): menu->help_text is now `const char **';
17099 adjust.
17100
17101 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17102 to changes in oldXMenu/XMenu.h from 2011-04-16.
17103 (struct XMenu): Declare `help_text' `const char **'.
17104
17105 * xfaces.c <Qunspecified>: Make extern again.
17106
17107 * syntax.c: Include sys/types.h before including regex.h, as
17108 required by POSIX.
17109
17110 * doc.c (get_doc_string): Improve the format passed to `error'.
17111
17112 * doprnt.c (doprnt): Improve commentary.
17113
17114 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17115
17116 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17117 them with etags.
17118
17119 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17120 changes in globals.h immediately force recompilation.
17121 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17122 $(CURDIR)/s/ms-w32.h.
17123 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17124
17125 * character.c (Fchar_direction): Function deleted.
17126 (syms_of_character): Don't defsubr it.
17127 <char-direction-table>: Deleted.
17128
17129 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17130
17131 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17132 * doprnt.c: Include limits.h.
17133 (SIZE_MAX): New macro.
17134 (doprnt): Return a size_t value. 2nd arg is now size_t.
17135 Many local variables are now size_t instead of int or unsigned.
17136 Improve overflow protection. Support `l' modifier for integer
17137 conversions. Support %l conversion. Don't assume an EMACS_INT
17138 argument for integer conversions and for %c.
17139
17140 * lisp.h (doprnt): Restore prototype.
17141
17142 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17143 $(SRC)/character.h.
17144
17145 * Makefile.in (base_obj): Add back doprnt.o.
17146
17147 * deps.mk (doprnt.o): Add back prerequisites.
17148 (callint.o): Depend on character.h.
17149
17150 * eval.c (internal_lisp_condition_case): Include the handler
17151 representation in the error message.
17152 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17153 when breaking from the loop.
17154
17155 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17156
17157 * callint.c (Fcall_interactively): When displaying error message
17158 about invalid control letter, pass the character's codepoint, not
17159 a pointer to its multibyte form. Improve display of the character
17160 in octal and display also its hex code.
17161
17162 * character.c (char_string): Use %x to display the (unsigned)
17163 codepoint of an invalid character, to avoid displaying a bogus
17164 negative value.
17165
17166 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17167 `error', not SYMBOL_NAME itself.
17168
17169 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17170 character arguments to `error'.
17171
17172 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17173 to `error' in error message about FINAL_CHAR argument. Make sure
17174 FINAL_CHAR is a character, and use %c when it is passed as
17175 argument to `error'.
17176
17177 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17178
17179 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17180
17181 * w32.c: Include <time.h>.
17182 (sys_localtime): New function.
17183
17184 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17185
17186 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17187
17188 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17189
17190 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17191
17192 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17193 zombies (Bug#8467).
17194
17195 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17196
17197 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17198 gl_state.e_property when gl_state.object is Qt.
17199
17200 * insdel.c (make_gap_larger): Remove limitation of buffer size
17201 to <= INT_MAX.
17202
17203 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17204
17205 * xdisp.c (lookup_glyphless_char_display)
17206 (produce_glyphless_glyph): Handle cons cell entry in
17207 glyphless-char-display.
17208 (Vglyphless_char_display): Document it.
17209
17210 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17211 glyphless-char-display.
17212
17213 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17214
17215 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17216
17217 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17218
17219 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17220 definition for no-X builds.
17221
17222 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17223
17224 Static checks with GCC 4.6.0 and non-default toolkits.
17225
17226 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17227
17228 * process.c (keyboard_bit_set): Define only if SIGIO.
17229 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17230 (send_process): Repair possible setjmp clobbering.
17231
17232 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17233
17234 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17235
17236 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17237
17238 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17239 Define only if needed.
17240
17241 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17242 by pacifying GCC about it. Maybe it's time to retire it?
17243 * xfaces.c (USG, __TIMEVAL__): Likewise.
17244
17245 * dispextern.h (struct redisplay_interface): Rename param
17246 to avoid shadowing.
17247 * termhooks.h (struct terminal): Likewise.
17248 * xterm.c (xembed_send_message): Likewise.
17249
17250 * insdel.c (make_gap_smaller): Define only if
17251 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17252
17253 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17254 it.
17255
17256 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17257 so that we aren't warned about unused symbols.
17258
17259 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17260
17261 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17262
17263 * xfns.c (x_real_positions): Mark locals as initialized.
17264
17265 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17266
17267 * xterm.c: Fix problems found by static analysis with other toolkits.
17268 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17269 (x_dispatch_event): Declare static if USE_GTK, and
17270 define if USE_GTK || USE_X_TOOLKIT.
17271 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17272 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17273 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17274 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17275
17276 * xmenu.c (menu_help_callback): Pointer type fixes.
17277 Use const pointers when pointing at readonly data. Avoid pointer
17278 signedness clashes.
17279 (FALSE): Remove unused macro.
17280 (update_frame_menubar): Remove unused decl.
17281
17282 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17283
17284 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17285 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17286 (single_menu_item): Rename local to avoid shadowing.
17287
17288 * keyboard.c (make_lispy_event): Remove unused local var.
17289
17290 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17291 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17292
17293 * bitmaps: Change bitmaps from unsigned char back to the X11
17294 compatible char. Avoid the old compiler warnings about
17295 out-of-range initializers by using, for example, '\xab' rather
17296 than 0xab.
17297
17298 * xgselect.c (xgselect_initialize): Check vs interface
17299 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17300
17301 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17302
17303 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17304 to read-only memory.
17305
17306 * fns.c (vector): Remove; this old hack is no longer needed.
17307
17308 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17309 Remove unused var.
17310 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17311
17312 * xrdb.c (x_load_resources): Omit unused local.
17313
17314 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17315 (x_window): Rename locals to avoid shadowing.
17316 (USG): Use the kludged USG macro, to pacify gcc.
17317
17318 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17319 (x_term_init): Remove local to avoid shadowing.
17320
17321 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17322
17323 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17324 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17325
17326 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17327
17328 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17329
17330 Fix regex.c, syntax.c and friends for buffers > 2GB.
17331 * syntax.h (struct gl_state_s): Declare character position members
17332 EMACS_INT.
17333
17334 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17335
17336 * textprop.c (verify_interval_modification, interval_of):
17337 Declare arguments EMACS_INT.
17338
17339 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17340 EMACS_INT.
17341
17342 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17343
17344 * indent.c (Fvertical_motion): Local variable it_start is now
17345 EMACS_INT.
17346
17347 * regex.c (re_match, re_match_2, re_match_2_internal)
17348 (bcmp_translate, regcomp, regexec, print_double_string)
17349 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17350 (re_compile_pattern, re_exec): Declare arguments and local
17351 variables `size_t' and `ssize_t' and return values `regoff_t', as
17352 appropriate.
17353 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17354 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17355 <compile_stack_type>: `size' and `avail' are now `size_t'.
17356
17357 * regex.h <regoff_t>: Use ssize_t, not int.
17358 (re_search, re_search_2, re_match, re_match_2): Arguments that
17359 specify buffer/string position and length are now ssize_t and
17360 size_t. Return type is regoff_t.
17361
17362 2011-04-16 Ben Key <bkey76@gmail.com>
17363
17364 * nsfont.m: Fixed bugs in ns_get_family and
17365 ns_descriptor_to_entity that were caused by using free to
17366 deallocate memory blocks that were allocated by xmalloc (via
17367 xstrdup). This caused Emacs to crash when compiled with
17368 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17369 --enable-checking=xmallocoverrun). xfree is now used to
17370 deallocate these memory blocks.
17371
17372 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17373
17374 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17375
17376 emacs_write: Accept and return EMACS_INT for sizes.
17377 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17378 et seq.
17379 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17380 Accept and return EMACS_INT.
17381 (emacs_gnutls_write): Return the number of bytes written on
17382 partial writes.
17383 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17384 (emacs_read, emacs_write): Remove check for negative size, as the
17385 Emacs source code has been audited now.
17386 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17387 (emacs_read, emacs_write): Use it.
17388 * process.c (send_process): Adjust to the new signatures of
17389 emacs_write and emacs_gnutls_write. Do not attempt to store
17390 a byte offset into an 'int'; it might overflow.
17391 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17392
17393 * sound.c: Don't assume sizes fit in 'int'.
17394 (struct sound_device.period_size, alsa_period_size):
17395 Return EMACS_INT, not int.
17396 (struct sound_device.write, vox_write, alsa_write):
17397 Accept EMACS_INT, not int.
17398 (wav_play, au_play): Use EMACS_INT to store sizes and to
17399 record read return values.
17400
17401 2011-04-15 Ben Key <bkey76@gmail.com>
17402
17403 * keyboard.c (Qundefined): Don't declare static since it is used
17404 in nsfns.m.
17405 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17406 static since they are used in nsfont.m.
17407
17408 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17409
17410 * process.c (Qprocessp): Don't declare static.
17411 * lisp.h (Qprocessp): Declare again.
17412
17413 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17414
17415 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17416
17417 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17418
17419 Improve C-level modularity by making more things 'static'.
17420
17421 Don't publish debugger-only interfaces to other modules.
17422 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17423 (verify_bytepos, count_markers): Move decls to the only modules
17424 that need them.
17425 * region-cache.h (pp_cache): Likewise.
17426 * window.h (check_all_windows): Likewise.
17427 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17428
17429 * sysdep.c (croak): Now static, if
17430 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17431 * syssignal.h (croak): Declare only if not static.
17432
17433 * alloc.c (refill_memory_reserve): Now static if
17434 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17435 * lisp.h (refill_memory_reserve): Declare only if not static.
17436
17437 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17438 Define only if USE_LUCID.
17439
17440 * xrdb.c (x_customization_string, x_rm_string): Now static.
17441
17442 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17443 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17444
17445 * xdisp.c (draw_row_with_mouse_face): Now static.
17446 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17447
17448 * window.h (check_all_windows): Mark externally visible.
17449
17450 * window.c (window_deletion_count): Now static.
17451
17452 * undo.c: Make symbols static if they're not exported.
17453 (last_undo_buffer, last_boundary_position, pending_boundary):
17454 Now static.
17455
17456 * textprop.c (interval_insert_behind_hooks): Now static.
17457 (interval_insert_in_front_hooks): Likewise.
17458
17459 * term.c: Make symbols static if they're not exported.
17460 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17461 (max_frame_lines, tty_set_terminal_modes):
17462 (tty_reset_terminal_modes, tty_turn_off_highlight):
17463 (get_tty_terminal): Now static.
17464 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17465 * termhooks.h (term_mouse_moveto): Do not declare if
17466 HAVE_WINDOW_SYSTEM.
17467 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17468 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17469
17470 * sysdep.c: Make symbols static if they're not exported.
17471 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17472 Now static.
17473 (sigprocmask_set, full_mask): Remove; unused.
17474 (wait_debugging): Mark as visible.
17475 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17476 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17477
17478 * syntax.c (syntax_temp): Define only if !__GNUC__.
17479
17480 * sound.c (current_sound_device, current_sound): Now static.
17481
17482 * search.c (searchbufs, searchbuf_head): Now static.
17483
17484 * scroll.c (scroll_cost): Remove; unused.
17485 * dispextern.h (scroll_cost): Remove decl.
17486
17487 * region-cache.h (pp_cache): Mark as externally visible.
17488
17489 * process.c: Make symbols static if they're not exported.
17490 (process_tick, update_tick, create_process, chan_process):
17491 (Vprocess_alist, proc_buffered_char, datagram_access):
17492 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17493 (deactivate_process): Mark defn as static, as well as decl.
17494 * lisp.h (create_process): Remove decl.
17495 * process.h (chan_process, Vprocess_alist): Remove decls.
17496
17497 * print.c: Make symbols static if they're not exported.
17498 (print_depth, new_backquote_output, being_printed, print_buffer):
17499 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17500 (print_interval, print_number_index, initial_stderr_stream):
17501 Now static.
17502 * lisp.h (Fprinc): Remove decl.
17503 (debug_output_compilation_hack): Mark as externally visible.
17504
17505 * sysdep.c (croak): Move decl from here to syssignal.h.
17506 * syssignal.h (croak): Put it here, so the API can be checked when
17507 'croak' is called from dissociate_if_controlling_tty.
17508
17509 * minibuf.c: Make symbols static if they're not exported.
17510 (minibuf_save_list, choose_minibuf_frame): Now static.
17511 * lisp.h (choose_minibuf_frame): Remove decl.
17512
17513 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17514
17515 * lread.c: Make symbols static if they're not exported.
17516 (read_objects, initial_obarray, oblookup_last_bucket_number):
17517 Now static.
17518 (make_symbol): Remove; unused.
17519 * lisp.h (initial_obarray, make_symbol): Remove decls.
17520
17521 * keyboard.c: Make symbols static if they're not exported.
17522 (single_kboard, recent_keys_index, total_keys, recent_keys):
17523 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17524 (this_single_command_key_start, echoing, last_auto_save):
17525 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17526 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17527 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17528 (Vlispy_mouse_stem, double_click_count):
17529 Now static.
17530 (force_auto_save_soon): Define only if SIGDANGER.
17531 (ignore_mouse_drag_p): Now static if
17532 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17533 (print_help): Remove; unused.
17534 (stop_character, last_timer_event): Mark as externally visible.
17535 * keyboard.h (ignore_mouse_drag_p): Declare only if
17536 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17537 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17538 * lisp.h (echoing): Remove decl.
17539 (force_auto_save_soon): Declare only if SIGDANGER.
17540 * xdisp.c (redisplay_window): Simplify code, to make it more
17541 obvious that ignore_mouse_drag_p is not accessed if !defined
17542 USE_GTK && !defined HAVE_NS.
17543
17544 * intervals.c: Make symbols static if they're not exported.
17545 (merge_properties_sticky, merge_interval_right, delete_interval):
17546 Now static.
17547 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17548
17549 * insdel.c: Make symbols static if they're not exported.
17550 However, leave prepare_to_modify_buffer alone. It's never
17551 called from outside this function, but that appears to be a bug.
17552 (combine_after_change_list, combine_after_change_buffer):
17553 (adjust_after_replace, signal_before_change): Now static.
17554 (adjust_after_replace_noundo): Remove; unused.
17555 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17556 (signal_before_change): Remove decls.
17557
17558 * indent.c (val_compute_motion, val_vmotion): Now static.
17559
17560 * image.c: Make symbols static if they're not exported.
17561 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17562 if USE_GTK.
17563 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17564 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17565
17566 * fringe.c (standard_bitmaps): Now static.
17567 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17568
17569 * frame.c: Make symbols static if they're not exported.
17570 (x_report_frame_params, make_terminal_frame): Now static.
17571 (get_frame_param): Now static, unless HAVE_NS.
17572 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17573 (x_get_resource_string): Remove; not used.
17574 * frame.h (make_terminal_frame, x_report_frame_params):
17575 (x_get_resource_string); Remove decls.
17576 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17577 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17578
17579 * font.c, fontset.c: Make symbols static if they're not exported.
17580 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17581 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17582 * font.c (font_close_object): Now static.
17583 * font.h (font_close_object): Remove.
17584 * fontset.c (FONTSET_OBJLIST): Remove.
17585 (free_realized_fontset) #if-0 the body, which does nothing.
17586 (face_suitable_for_char_p): #if-0, as it's never called.
17587 * fontset.h (face_suitable_for_char_p): Remove decl.
17588 * xfaces.c (face_at_string_position):
17589 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17590 since 0 is always ASCII.
17591
17592 * fns.c (weak_hash_tables): Now static.
17593
17594 * fileio.c: Make symbols static if they're not exported.
17595 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17596 (Vwrite_region_annotation_buffers): Now static.
17597
17598 * eval.c: Make symbols static if they're not exported.
17599 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17600 * lisp.h (backtrace_list): Remove decl.
17601
17602 * emacs.c: Make symbols static if they're not exported.
17603 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17604 (fatal_error_code, fatal_error_signal_hook, standard_args):
17605 Now static.
17606 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17607 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17608 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17609 * lisp.h (fatal_error_signal_hook): Remove decl.
17610 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17611
17612 * editfns.c: Move a (normally-unused) function to its only use.
17613 * editfns.c, lisp.h (get_operating_system_release): Remove.
17614 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17615 worth the hassle of breaking this out.
17616
17617 * xterm.c: Make symbols static if they're not exported.
17618 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17619 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17620 (x_destroy_window, x_delete_display):
17621 Now static.
17622 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17623 (x_mouse_leave): Remove; unused.
17624 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17625 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17626 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17627 Remove decls.
17628 (x_mouse_leave): Declare only if WINDOWSNT.
17629 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17630 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17631 USE_X_TOOLKIT.
17632
17633 * ftxfont.c: Make symbols static if they're not exported.
17634 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17635 HAVE_FREETYPE.
17636 * font.h (ftxfont_driver): Likewise.
17637
17638 * xfns.c: Make symbols static if they're not exported.
17639 (x_last_font_name, x_display_info_for_name):
17640 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17641 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17642 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17643 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17644 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17645 (last_show_tip_args): Now static.
17646 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17647 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17648 (x_screen_planes): Remove; unused.
17649 * dispextern.h (x_screen_planes): Remove decl.
17650
17651 * dispnew.c: Make symbols static if they're not exported.
17652 * dispextern.h (redraw_garbaged_frames, scrolling):
17653 (increment_row_positions): Remove.
17654 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17655 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17656 Now static.
17657 (redraw_garbaged_frames): Remove; unused.
17658
17659 * xfaces.c: Make symbols static if they're not exported.
17660 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17661 Remove decls.
17662 * xterm.h (defined_color): Remove decls.
17663 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17664 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17665 (menu_face_changed_default, defined_color, free_realized_face):
17666 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17667 (ascii_face_of_lisp_face): Remove; unused.
17668
17669 * xdisp.c: Make symbols static if they're not exported.
17670 * dispextern.h (scratch_glyph_row, window_box_edges):
17671 (glyph_to_pixel_coords, set_cursor_from_row):
17672 (get_next_display_element, set_iterator_to_next):
17673 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17674 (show_mouse_face): Remove decls
17675 * frame.h (message_buf_print): Likewise.
17676 * lisp.h (pop_message, set_message, check_point_in_composition):
17677 Likewise.
17678 * xterm.h (set_vertical_scroll_bar): Likewise.
17679 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17680 (message_buf_print, scratch_glyph_row, displayed_buffer):
17681 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17682 (get_next_display_element, show_mouse_face, window_box_edges):
17683 (frame_to_window_pixel_xy, check_point_in_composition):
17684 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17685 (glyph_to_pixel_coords): Remove; unused.
17686
17687 * dired.c (file_name_completion): Now static.
17688
17689 * dbusbind.c (xd_in_read_queued_messages): Now static.
17690
17691 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17692 * data.c (circular_list_error): Remove.
17693
17694 * commands.h (last_point_position, last_point_position_buffer):
17695 (last_point_position_window): Remove decls.
17696 * keyboard.c: Make these variables static.
17697
17698 * coding.h (coding, code_convert_region, encode_coding_gap):
17699 Remove decls.
17700 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17701 (iso_code_class, detect_coding, code_convert_region): Now static.
17702 (encode_coding_gap): Remove; unused.
17703
17704 * chartab.c (chartab_chars, chartab_bits): Now static.
17705
17706 * charset.h (charset_iso_8859_1): Remove decl.
17707 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17708 Now static.
17709
17710 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17711 * ccl.c (Vccl_program_table): Now static.
17712 (check_ccl_update): Remove; unused.
17713
17714 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17715 * category.h: ... from here.
17716 * category.c (check_category_table, set_category_set): Now static.
17717
17718 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17719 * lisp.h: Remove these decls.
17720
17721 * buffer.c (buffer_count): Remove unused var.
17722
17723 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17724 so that it's not optimized away.
17725 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17726 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17727 exported only to the debugger.
17728
17729 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17730 * atimer.h (run_all_atimers): Remove; not exported.
17731
17732 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17733 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17734 was inaccessible from Lisp.
17735 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17736 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17737
17738 alloc.c: Import and export fewer symbols, and remove unused items.
17739 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17740 is defined.
17741 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17742 it's not optimized away by whole-program optimization.
17743 (message_enable_multibyte, free_misc): Remove.
17744 (catchlist, handlerlist, mark_backtrace):
17745 Declare only if BYTE_MARK_STACK.
17746 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17747 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17748 (message_enable_multibyte): Remove decl.
17749 (free_misc, interval_free_list, float_block, float_block_index):
17750 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17751 (cons_free_list, last_marked_index):
17752 Now static.
17753 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17754 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17755 (mark_backtrace): Define only if BYTE_MARK_STACK.
17756 * xdisp.c (message_enable_multibyte): Now static.
17757
17758 Declare Lisp_Object Q* variables to be 'static' if not exported.
17759 This makes it easier for human readers (and static analyzers)
17760 to see whether these variables are used from other modules.
17761 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17762 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17763 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17764 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17765 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17766 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17767 * xmenu.c, xselect.c:
17768 Declare Q* vars static if they are not used in other modules.
17769 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17770 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17771 Remove decls of unexported vars.
17772 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17773
17774 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17775
17776 Make Emacs functions such as Fatom 'static' by default.
17777 This makes it easier for human readers (and static analyzers)
17778 to see whether these functions can be called from other modules.
17779 DEFUN now defines a static function. To make the function external
17780 so that it can be used in other C modules, use the new macro DEFUE.
17781 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17782 (Finit_image_library):
17783 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17784 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17785 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17786 Remove decls, since these functions are now static.
17787 (Funintern, Fget_internal_run_time): New decls, since these functions
17788 were already external.
17789
17790 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17791 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17792 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17793 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17794 * keyboard.c, keymap.c, lread.c:
17795 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17796 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17797 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17798 Mark functions with DEFUE instead of DEFUN,
17799 if they are used in other modules.
17800 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17801 decls for now-static functions.
17802 * buffer.h (Fdelete_overlay): Remove decl.
17803 * callproc.c (Fgetenv_internal): Mark as internal.
17804 * composite.c (Fremove_list_of_text_properties): Remove decl.
17805 (Fcomposition_get_gstring): New forward static decl.
17806 * composite.h (Fcomposite_get_gstring): Remove decl.
17807 * dired.c (Ffile_attributes): New forward static decl.
17808 * doc.c (Fdocumntation_property): New forward static decl.
17809 * eval.c (Ffetch_bytecode): New forward static decl.
17810 (Funintern): Remove extern decl; now in .h file where it belongs.
17811 * fileio.c (Fmake_symbolic_link): New forward static decl.
17812 * image.c (Finit_image_library): New forward static decl.
17813 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17814 * intervals.h (Fprevious_property_change):
17815 (Fremove_list_of_text_properties): Remove decls.
17816 * keyboard.c (Fthis_command_keys): Remove decl.
17817 (Fcommand_execute): New forward static decl.
17818 * keymap.c (Flookup_key): New forward static decl.
17819 (Fcopy_keymap): Now static.
17820 * keymap.h (Flookup_key): Remove decl.
17821 * process.c (Fget_process): New forward static decl.
17822 (Fprocess_datagram_address): Mark as internal.
17823 * syntax.c (Fsyntax_table_p): New forward static decl.
17824 (skip_chars): Remove duplicate decl.
17825 * textprop.c (Fprevious_property_change): New forward static decl.
17826 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17827 Now internal.
17828 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17829 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17830
17831 * editfns.c (Fformat): Remove unreachable code.
17832
17833 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17834
17835 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17836 change. (Bug#8496)
17837
17838 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17839
17840 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17841 when at ZV. (Bug#8487)
17842
17843 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17844
17845 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17846 (Bug#8437)
17847 * keyboard.c (parse_tool_bar_item): Likewise.
17848 * sound.c (sound_cleanup, alsa_close): Likewise.
17849 * termcap.c (tgetent): Likewise.
17850 * xfns.c (x_default_font_parameter): Likewise.
17851 * xsettings.c (read_and_apply_settings): Likewise.
17852
17853 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17854 (overrun_check_free): Protoize.
17855
17856 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17857
17858 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17859 since callers should never pass a negative size.
17860 Change the signature to match that of plain 'read' and 'write'; see
17861 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17862 * lisp.h: Update prototypes of emacs_write and emacs_read.
17863
17864 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17865
17866 * xdisp.c (redisplay_window): Don't try to determine the character
17867 position of the scroll margin if the window start point w->startp
17868 is outside the buffer's accessible region. (Bug#8468)
17869
17870 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17871
17872 Fix write-region and its subroutines for buffers > 2GB.
17873 * fileio.c (a_write, e_write): Modify declaration of arguments and
17874 local variables to support buffers larger than 2GB.
17875 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17876
17877 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17878 argument, local variables, and return value.
17879
17880 * lisp.h: Update prototypes of emacs_write and emacs_read.
17881
17882 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17883
17884 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17885
17886 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17887
17888 Fix more problems found by GCC 4.6.0's static checks.
17889
17890 * xdisp.c (vmessage): Use a better test for character truncation.
17891
17892 * charset.c (load_charset_map): <, not <=, for optimization,
17893 and to avoid potential problems with integer overflow.
17894 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17895 * casetab.c (set_identity, shuffle): Likewise.
17896 * editfns.c (Fformat): Likewise.
17897 * syntax.c (skip_chars): Likewise.
17898
17899 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17900 This also lets GCC 4.6.0 generate slightly better loop code.
17901
17902 * callint.c (Fcall_interactively): <, not <=, for optimization.
17903 (Fcall_interactively): Count the number of arguments produced,
17904 not the number of arguments given. This is simpler and lets GCC
17905 4.6.0 generate slightly better code.
17906
17907 * ftfont.c: Distingish more carefully between FcChar8 and char.
17908 The previous code passed unsigned char * to a functions like
17909 strlen and xstrcasecmp that expect char *, which does not
17910 conform to the C standard.
17911 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17912 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17913 char * when the C standard requires it.
17914
17915 * keyboard.c (read_char): Remove unused var.
17916
17917 * eval.c: Port to Windows vsnprintf (Bug#8435).
17918 Include <limits.h>.
17919 (SIZE_MAX): Define if the headers do not.
17920 (verror): Do not give up if vsnprintf returns a negative count.
17921 Instead, grow the buffer. This ports to Windows vsnprintf, which
17922 does not conform to C99. Problem reported by Eli Zaretskii.
17923 Also, simplify the allocation scheme, by avoiding the need for
17924 calling realloc, and removing the ALLOCATED variable.
17925
17926 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17927
17928 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17929 But keep the doprint source code for now, as we might revamp it
17930 and use it again (Bug#8435).
17931 * lisp.h (doprnt): Remove.
17932 * Makefile.in (base_obj): Remove doprnt.o.
17933 * deps.mk (doprnt.o): Remove.
17934
17935 error: Print 32- and 64-bit integers portably (Bug#8435).
17936 Without this change, on typical 64-bit hosts error ("...%d...", N)
17937 was used to print both 32- and 64-bit integers N, which relied on
17938 undefined behavior.
17939 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17940 * lisp.h (error, verror): Mark as printf-like functions.
17941 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17942 Report overflow in size calculations when allocating printf buffer.
17943 Do not truncate output string at its first null byte.
17944 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17945 Truncate the output at a character boundary, since vsnprintf does not
17946 do that.
17947 * charset.c (check_iso_charset_parameter): Convert internal
17948 character to string before calling 'error', since %c now has the
17949 printf meaning.
17950 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17951 overflow when computing char to be passed to 'error'. Do not
17952 pass Lisp_Object to 'error'; pass the integer instead.
17953 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17954 formatted with plain %d.
17955
17956 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17957
17958 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17959
17960 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17961
17962 * xterm.c (x_catch_errors): Remove duplicate declaration.
17963
17964 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17965
17966 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17967
17968 2011-04-10 Jim Meyering <meyering@redhat.com>
17969
17970 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17971 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17972 return ssize_t not "int", and use size_t as the buffer length.
17973 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17974 * gnutls.h: Update declarations.
17975 * process.c (read_process_output): Use ssize_t, to match.
17976 (send_process): Likewise.
17977
17978 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17979
17980 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17981
17982 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17983
17984 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17985 Use unsigned char, to match FcChar8 type definition.
17986
17987 * xterm.c (handle_one_xevent):
17988 * xmenu.c (create_and_show_popup_menu):
17989 * xselect.c (x_decline_selection_request)
17990 (x_reply_selection_request): Avoid type-punned deref of X events.
17991
17992 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17993
17994 Fix some uses of `int' instead of EMACS_INT.
17995 * search.c (string_match_1, fast_string_match)
17996 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17997 (scan_buffer, find_next_newline_no_quit)
17998 (find_before_next_newline, search_command, Freplace_match)
17999 (Fmatch_data): Make some `int' variables be EMACS_INT.
18000
18001 * xdisp.c (display_count_lines): 3rd argument and return value now
18002 EMACS_INT. All callers changed.
18003 (pint2hrstr): Last argument is now EMACS_INT.
18004
18005 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18006 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18007 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18008 (decode_coding_utf_16, decode_coding_emacs_mule)
18009 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18010 (decode_coding_ccl, decode_coding_charset)
18011 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18012 (decode_coding_iso_2022, decode_coding_emacs_mule)
18013 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18014 <char_offset, last_offset>: Declare EMACS_INT.
18015 (encode_coding_utf_8, encode_coding_utf_16)
18016 (encode_coding_emacs_mule, encode_invocation_designation)
18017 (encode_designation_at_bol, encode_coding_iso_2022)
18018 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18019 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18020 Declare EMACS_INT.
18021 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18022 (encode_invocation_designation): Last argument P_NCHARS is now
18023 EMACS_INT.
18024 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18025 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18026
18027 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18028 All users changed.
18029
18030 * ccl.c (Fccl_execute_on_string): Declare some variables
18031 EMACS_INT.
18032
18033 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
18034
18035 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18036
18037 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18038
18039 * process.c (Fformat_network_address): Doc fix.
18040
18041 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18042
18043 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18044
18045 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18046
18047 * keyboard.c (read_char): Call Lisp function help-form-show,
18048 instead of using internal_with_output_to_temp_buffer.
18049 (Qhelp_form_show): New var.
18050 (syms_of_keyboard): Use DEFSYM macro.
18051
18052 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18053
18054 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18055
18056 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18057
18058 * process.c (Flist_processes): Remove to Lisp.
18059 (list_processes_1): Delete.
18060
18061 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18062
18063 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18064
18065 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18066
18067 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18068
18069 Fix more problems found by GCC 4.6.0's static checks.
18070
18071 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18072
18073 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18074
18075 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18076
18077 * xdisp.c (vmessage): Mark as a printf-like function.
18078
18079 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18080
18081 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18082
18083 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18084 printf-like functions.
18085 (tiff_load): Add casts to remove these marks before passing them
18086 to system-supplied API.
18087
18088 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18089
18090 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18091 This avoids several warnings with gcc -Wstrict-overflow.
18092 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18093 directly, rather than having caller test rule sign. This avoids
18094 some unnecessary tests.
18095 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18096 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18097 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18098
18099 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18100 (xfont_open): Avoid unnecessary tests.
18101
18102 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18103
18104 * composite.h, composite.c (composition_gstring_put_cache):
18105 Use EMACS_INT, not int, for length.
18106
18107 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18108 breaking out part of COMPOSITION_DECODE_RULE.
18109 (COMPOSITION_DECODE_RULE): Use it.
18110 * composite.c (get_composition_id): Remove unused local vars,
18111 by using the new macro.
18112
18113 * textprop.c (set_text_properties_1): Change while to do-while,
18114 since the condition is always true at first.
18115
18116 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18117 (interval_deletion_adjustment): Return unsigned value.
18118 All uses changed.
18119
18120 * process.c (list_processes_1, create_pty, read_process_output):
18121 (exec_sentinel): Remove vars that were set but not used.
18122 (create_pty): Remove unnecessary "volatile"s.
18123 (Fnetwork_interface_info): Avoid possibility of int overflow.
18124 (read_process_output): Do adaptive read buffering even if carryover.
18125 (read_process_output): Simplify nbytes computation if buffered.
18126
18127 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18128
18129 * syntax.c (scan_words): Remove var that was set but not used.
18130 (update_syntax_table): Use unsigned instead of int.
18131
18132 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18133 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18134 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18135
18136 * print.c (print_error_message): Avoid int overflow.
18137
18138 * font.c (font_list_entities): Redo for clarity,
18139 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18140
18141 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18142 (font_score): Avoid potential overflow in diff calculation.
18143
18144 * fns.c (substring_both): Remove var that is set but not used.
18145 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18146
18147 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18148
18149 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18150 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18151 can always succeed if overflow has undefined behavior.
18152
18153 * search.c (boyer_moore, wordify): Remove vars set but not used.
18154 (wordify): Omit three unnecessary tests.
18155
18156 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18157 All callers changed. This avoids the need for an unused var.
18158
18159 * casefiddle.c (casify_region): Remove var that is set but not used.
18160
18161 * dired.c (file_name_completion): Remove var that is set but not used.
18162
18163 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18164
18165 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18166 (Finsert_file_contents): Remove unnecessary code checking fd.
18167
18168 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18169 Check for integer overflow on size calculations.
18170
18171 * buffer.c (Fprevious_overlay_change): Remove var that is set
18172 but not used.
18173
18174 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18175 Remove vars that are set but not used.
18176 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18177 (timer_check_2): Mark vars as initialized.
18178
18179 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18180
18181 * image.c (lookup_image): Remove var that is set but not used.
18182 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18183
18184 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18185 that are set but not used.
18186
18187 * xfns.c (make_invisible_cursor): Don't return garbage
18188 if XCreateBitmapFromData fails (Bug#8410).
18189
18190 * xselect.c (x_get_local_selection, x_handle_property_notify):
18191 Remove vars that are set but not used.
18192
18193 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18194 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18195
18196 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18197 Remove var that is set but not used.
18198 (scroll_bar_windows_size): Now size_t, not int.
18199 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18200 Check for overflow.
18201
18202 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18203 (map_tty_color) [!defined MSDOS]: Likewise.
18204
18205 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18206
18207 * coding.c: Remove vars that are set but not used.
18208 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18209 All callers changed.
18210 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18211 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18212 (decode_coding_charset): Remove vars that are set but not used.
18213
18214 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18215 that is set but not used.
18216
18217 * print.c (print_object): Remove var that is set but not used.
18218
18219 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18220 The gnulib version avoids calling malloc in the usual case,
18221 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18222 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18223 * filelock.c (current_lock_owner): Likewise.
18224 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18225 * sysdep.c: Include allocator.h, careadlinkat.h.
18226 (emacs_no_realloc_allocator): New static constant.
18227 (emacs_readlink): New function.
18228 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18229 ../lib/careadlinkat.h.
18230
18231 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18232
18233 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18234 first non-nil return value).
18235
18236 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18237
18238 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18239 if not defined (Bug#8403).
18240
18241 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18242
18243 * xdisp.c (display_count_lines): Remove parameter `start',
18244 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18245 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18246 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18247 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18248 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18249 and thereabouts. All callers changed.
18250 (get_per_char_metric): Remove parameter `f', unused since
18251 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18252
18253 2011-04-02 Jim Meyering <meyering@redhat.com>
18254
18255 do not dereference NULL upon failed strdup
18256 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18257 (ns_get_family): Likewise.
18258
18259 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18260
18261 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18262
18263 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18264
18265 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18266 later (Bug#8403).
18267
18268 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18269
18270 Add lexical binding.
18271
18272 * window.c (Ftemp_output_buffer_show): New fun.
18273 (Fsave_window_excursion):
18274 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18275
18276 * lread.c (lisp_file_lexically_bound_p): New function.
18277 (Fload): Bind Qlexical_binding.
18278 (readevalloop): Remove `evalfun' arg.
18279 Bind Qinternal_interpreter_environment.
18280 (Feval_buffer): Bind Qlexical_binding.
18281 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18282 Mark as dynamic.
18283 (syms_of_lread): Declare `lexical-binding'.
18284
18285 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18286
18287 * keyboard.c (eval_dyn): New fun.
18288 (menu_item_eval_property): Use it.
18289
18290 * image.c (parse_image_spec): Use Ffunctionp.
18291
18292 * fns.c (concat, mapcar1): Accept byte-code-functions.
18293
18294 * eval.c (Fsetq): Handle lexical vars.
18295 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18296 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18297 (FletX, Flet): Obey lexical binding.
18298 (Fcommandp): Handle closures.
18299 (Feval): New `lexical' arg.
18300 (eval_sub): New function extracted from Feval. Use it almost
18301 everywhere where Feval was used. Look up vars in lexical env.
18302 Handle closures.
18303 (Ffunctionp): Move from subr.el.
18304 (Ffuncall): Handle closures.
18305 (apply_lambda): Remove `eval_flags'.
18306 (funcall_lambda): Handle closures and new byte-code-functions.
18307 (Fspecial_variable_p): New function.
18308 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18309 but without exporting it to Lisp.
18310
18311 * doc.c (Fdocumentation, store_function_docstring):
18312 * data.c (Finteractive_form): Handle closures.
18313
18314 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18315 interactive spec.
18316
18317 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18318 New byte-codes.
18319 (exec_byte_code): New function extracted from Fbyte_code to handle new
18320 calling convention for byte-code-functions. Add new byte-codes.
18321
18322 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18323
18324 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18325
18326 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18327
18328 * xdisp.c (redisplay_internal): Fix prototype.
18329
18330 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18331
18332 * xdisp.c (SCROLL_LIMIT): New macro.
18333 (try_scrolling): Use it when setting scroll_limit.
18334 Limit scrolling to 100 screen lines.
18335 (redisplay_window): Even when falling back on "recentering",
18336 position point in the window according to scroll-conservatively,
18337 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18338
18339 (try_scrolling): When point is above the window, allow searching
18340 as far as scroll_max, or one screenful, to compute vertical
18341 distance from PT to the scroll margin position. This prevents
18342 try_scrolling from unnecessarily failing when
18343 scroll-conservatively is set to a value slightly larger than the
18344 window height. Clean up the case of PT below the margin at bottom
18345 of window: scroll_max can no longer be INT_MAX. When aggressive
18346 scrolling is in use, don't let point enter the opposite scroll
18347 margin as result of the scroll.
18348 (syms_of_xdisp) <scroll-conservatively>: Document the
18349 threshold of 100 lines for never-recentering scrolling.
18350
18351 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18352
18353 * dispextern.h (move_it_by_lines):
18354 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18355 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18356 (message_log_check_duplicate): Remove parameters `prev_bol' and
18357 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18358 (redisplay_internal): Remove parameter `preserve_echo_area',
18359 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18360
18361 * indent.c (Fvertical_motion):
18362 * window.c (window_scroll_pixel_based, Frecenter):
18363 Don't pass `need_y_p' to `move_it_by_lines'.
18364
18365 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18366
18367 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18368 steal a few bits to be more compact.
18369 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18370 Remove unneeded casts.
18371
18372 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18373
18374 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18375
18376 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18377 binding" message (bug#7967).
18378
18379 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18380
18381 Fix more problems found by GCC 4.6.0's static checks.
18382
18383 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18384 Remove unused local var.
18385
18386 * editfns.c (Fmessage_box): Remove unused local var.
18387
18388 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18389 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18390 Omit unused local vars.
18391 * window.c (shrink_windows): Omit unused local var.
18392 * menu.c (digest_single_submenu): Omit unused local var.
18393 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18394 Omit unused local var.
18395
18396 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18397 Don't assume string length fits in int.
18398 (keyremap_step, read_key_sequence): Use size_t for sizes.
18399 (read_key_sequence): Don't check last_real_key_start redundantly.
18400
18401 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18402 instead of alloca (Bug#8344).
18403
18404 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18405 (Fbacktrace_frame): Don't assume nframes fits in int.
18406
18407 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18408
18409 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18410 concerns.
18411
18412 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18413
18414 * cm.c (calccost): Turn while-do into do-while, for clarity.
18415
18416 * keyboard.c (syms_of_keyboard): Use the same style as later
18417 in this function when indexing through an array. This also
18418 works around GCC bug 48267.
18419
18420 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18421
18422 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18423
18424 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18425 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18426
18427 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18428 This avoids undefined behavior on integer overflow, and is a bit
18429 more convenient anyway since it is compared to a size_t variable.
18430
18431 Variadic C functions now count arguments with size_t, not int.
18432 This avoids an unnecessary limitation on 64-bit machines, which
18433 caused (substring ...) to crash on large vectors (Bug#8344).
18434 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18435 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18436 All variadic functions and their callers changed accordingly.
18437 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18438 * data.c (arith_driver, float_arith_driver): Likewise.
18439 * editfns.c (general_insert_function): Likewise.
18440 * eval.c (struct backtrace.nargs, interactive_p)
18441 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18442 (funcall_lambda, mark_backtrace): Likewise.
18443 * fns.c (concat): Likewise.
18444 * frame.c (x_set_frame_parameters): Likewise.
18445 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18446 0 if not found, not -1. All callers changed.
18447
18448 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18449 (stack_copy_size): Now size_t, not int.
18450 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18451
18452 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18453
18454 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18455 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18456 All callers changed.
18457
18458 * lisp.h (multibyte_char_to_unibyte):
18459 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18460 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18461 * character.h (CHAR_TO_BYTE8):
18462 * cmds.c (internal_self_insert):
18463 * editfns.c (general_insert_function):
18464 * keymap.c (push_key_description):
18465 * search.c (Freplace_match):
18466 * xdisp.c (message_dolog, set_message_1): All callers changed.
18467
18468 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18469
18470 * keyboard.c (safe_run_hook_funcall): New function.
18471 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18472 don't set the hook to nil, but remove the offending function instead.
18473 (Qcommand_hook_internal): Remove, unused.
18474 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18475 Vcommand_hook_internal.
18476
18477 * eval.c (enum run_hooks_condition): Remove.
18478 (funcall_nil, funcall_not): New functions.
18479 (run_hook_with_args): Call each function through a `funcall' argument.
18480 Remove `cond' argument, now redundant.
18481 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18482 (Frun_hook_with_args_until_failure): Adjust accordingly.
18483 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18484
18485 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18486
18487 * dispextern.h (string_buffer_position): Remove declaration.
18488
18489 * print.c (strout): Remove parameter `multibyte', unused since
18490 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18491
18492 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18493 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18494 All callers changed.
18495
18496 * w32.c (_wsa_errlist): Use braces for struct initializers.
18497
18498 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18499 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18500 All callers changed.
18501 (string_buffer_position): Likewise. Also, make static (it's never
18502 used outside xdisp.c).
18503 (cursor_row_p): Remove parameter `w', unused since
18504 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18505 (decode_mode_spec): Remove parameter `precision', introduced during
18506 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18507 All callers changed.
18508
18509 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18510
18511 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18512
18513 2011-03-27 Anders Lindgren <andlind@gmail.com>
18514
18515 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18516 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18517 (ns_update_auto_hide_menu_bar): New functions.
18518 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18519 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18520 ns_constrain_all_frames.
18521 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18522 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18523
18524 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18525
18526 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18527
18528 2011-03-27 Glenn Morris <rgm@gnu.org>
18529
18530 * syssignal.h: Replace RETSIGTYPE with void.
18531 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18532 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18533 Replace SIGTYPE with void everywhere.
18534 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18535 * s/template.h (SIGTYPE): Remove commented out definition.
18536
18537 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18538
18539 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18540 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18541
18542 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18543
18544 * w32.c (read_unc_volume): Use parameter `henum', instead of
18545 global variable `wget_enum_handle'.
18546
18547 * keymap.c (describe_vector): Remove parameters `indices' and
18548 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18549 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18550
18551 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18552
18553 * keyboard.c (timer_check): Remove parameter `do_it_now',
18554 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18555 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18556 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18557
18558 * keyboard.c (read_char):
18559 * w32menu.c (w32_menu_display_help):
18560 * xmenu.c (show_help_event, menu_help_callback):
18561 Adjust calls to `show_help_echo'.
18562
18563 * gtkutil.c (xg_maybe_add_timer):
18564 * keyboard.c (readable_events):
18565 * process.c (wait_reading_process_output):
18566 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18567
18568 * insdel.c (adjust_markers_gap_motion):
18569 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18570 (gap_left, gap_right): Don't call it.
18571
18572 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18573
18574 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18575 incurred during fontification.
18576
18577 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18578
18579 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18580 (DEFVAR_PER_BUFFER): Don't pass it.
18581
18582 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18583 (scrolling_window): Don't pass it.
18584
18585 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18586
18587 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18588
18589 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18590 and `suffix'.
18591 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18592 of variables specific to SELinux and computation of `encoded_absname'.
18593
18594 * image.c (XPutPixel): Remove unused variable `height'.
18595
18596 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18597
18598 * unexw32.c (get_section_info): Remove unused variable `section'.
18599
18600 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18601 (system_process_attributes): Remove unused variable `sess'.
18602 (sys_read): Remove unused variable `err'.
18603
18604 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18605 (w32_wnd_proc): Remove unused variable `isdead'.
18606 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18607 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18608 (x_create_tip_frame): Remove unused variable `tem'.
18609
18610 * w32inevt.c (w32_console_read_socket):
18611 Remove unused variable `no_events'.
18612
18613 * w32term.c (x_draw_composite_glyph_string_foreground):
18614 Remove unused variable `width'.
18615
18616 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18617
18618 * w32term.c (x_set_glyph_string_clipping):
18619 Don't pass uninitialized region to CombineRgn.
18620
18621 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18622
18623 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18624 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18625 (Fx_close_connection): Remove unused variable `i'.
18626
18627 * w32font.c (w32font_draw): Return number of glyphs.
18628 (w32font_open_internal): Remove unused variable `i'.
18629 (w32font_driver): Add missing initializer.
18630
18631 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18632 (fill_in_menu): Remove unused variable `items_added'.
18633
18634 * w32term.c (last_mouse_press_frame): Remove static global variable.
18635 (w32_clip_to_row): Remove unused variable `f'.
18636 (x_delete_terminal): Remove unused variable `i'.
18637
18638 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18639 (NOTHING): Remove unused static global variable.
18640 (uniscribe_check_otf): Remove unused variable `table'.
18641 (uniscribe_font_driver): Add missing initializers.
18642
18643 2011-03-23 Julien Danjou <julien@danjou.info>
18644
18645 * term.c (Fsuspend_tty, Fresume_tty):
18646 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18647 * window.c (temp_output_buffer_show):
18648 * insdel.c (signal_before_change):
18649 * frame.c (Fhandle_switch_frame):
18650 * fileio.c (Fdo_auto_save):
18651 * emacs.c (Fkill_emacs):
18652 * editfns.c (save_excursion_restore):
18653 * cmds.c (internal_self_insert):
18654 * callint.c (Fcall_interactively):
18655 * buffer.c (Fkill_all_local_variables):
18656 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18657 Use Frun_hooks.
18658 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18659 unconditionally since it does the check itself.
18660
18661 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18662
18663 Fix more problems found by GCC 4.5.2's static checks.
18664
18665 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18666 the first time through the loop, since we know p0 < p1 then.
18667 This also avoids a gcc -Wstrict-overflow warning.
18668
18669 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18670 leading to a memory leak, possible in functions like
18671 load_charset_map_from_file that can allocate an unbounded number
18672 of objects (Bug#8318).
18673
18674 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18675 that could (at least in theory) be that large.
18676
18677 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18678 This is less likely to overflow, and avoids undefined behavior if
18679 overflow does occur. All callers changed. Use strtoul to scan
18680 for the unsigned long integer.
18681 (pint2hrstr): Simplify and tune code slightly.
18682 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18683
18684 * scroll.c (do_scrolling): Work around GCC bug 48228.
18685 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18686
18687 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18688 This also avoids a warning with gcc -Wstrict-overflow.
18689 (validate_x_resource_name): Simplify count usage.
18690 This also avoids a warning with gcc -Wstrict-overflow.
18691
18692 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18693 fail (Bug#8306).
18694
18695 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18696
18697 * process.c (Fmake_network_process): Use socklen_t, not int,
18698 where POSIX says socklen_t is required in portable programs.
18699 This fixes a porting bug on hosts like 64-bit HP-UX, where
18700 socklen_t is wider than int (Bug#8277).
18701 (Fmake_network_process, server_accept_connection):
18702 (wait_reading_process_output, read_process_output):
18703 Likewise.
18704
18705 * process.c: Rename or move locals to avoid shadowing.
18706 (list_processes_1, Fmake_network_process):
18707 (read_process_output_error_handler, exec_sentinel_error_handler):
18708 Rename or move locals.
18709 (Fmake_network_process): Define label "retry_connect" only if needed.
18710 (Fnetwork_interface_info): Fix pointer signedness.
18711 (process_send_signal): Add cast to avoid pointer signedness problem.
18712 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18713 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18714
18715 Make tparam.h and terminfo.c consistent.
18716 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18717 Include tparam.h instead, since it declares them.
18718 * cm.h (PC): Remove extern decl; tparam.h now does this.
18719 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18720 * terminfo.c: Include tparam.h, to check interfaces.
18721 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18722 (tparam): Adjust signature to match interface in tparam.h;
18723 this removes some undefined behavior. Check that outstring and len
18724 are zero, which they always are with Emacs.
18725 * tparam.h (PC, BC, UP): New extern decls.
18726
18727 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18728 (xftfont_open): Rename locals to avoid shadowing.
18729
18730 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18731 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18732 (OTF_TAG_SYM): Omit macro if not needed.
18733 (ftfont_list): Remove unused local.
18734 (get_adstyle_property, ftfont_pattern_entity):
18735 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18736 Rename locals to avoid shadowing.
18737
18738 * xfont.c (xfont_list_family): Mark var as initialized.
18739
18740 * xml.c (make_dom): Now static.
18741
18742 * composite.c (composition_compute_stop_pos): Rename local to
18743 avoid shadowing.
18744 (composition_reseat_it): Remove unused locals.
18745 (find_automatic_composition, composition_adjust_point): Likewise.
18746 (composition_update_it): Mark var as initialized.
18747 (find_automatic_composition): Mark vars as initialized,
18748 with a FIXME (Bug#8290).
18749
18750 character.h: Rename locals to avoid shadowing.
18751 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18752 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18753 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18754 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18755 to avoid shadowing.
18756
18757 * textprop.c (property_change_between_p): Remove; unused.
18758
18759 * intervals.c (interval_start_pos): Now static.
18760
18761 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18762
18763 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18764 Rename locals to avoid shadowing.
18765
18766 * sound.c (wav_play, au_play, Fplay_sound_internal):
18767 Fix pointer signedness.
18768 (alsa_choose_format): Remove unused local var.
18769 (wav_play): Initialize a variable to 0, to prevent undefined
18770 behavior (Bug#8278).
18771
18772 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18773
18774 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18775
18776 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18777 clobbering (Bug#8298).
18778 * sysdep.c (sys_subshell): Likewise.
18779 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18780
18781 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18782 This should get cleaned up, so that child_setup has the
18783 same signature on all platforms.
18784
18785 * callproc.c (call_process_cleanup): Now static.
18786 (relocate_fd): Rename locals to avoid shadowing.
18787
18788 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18789
18790 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18791 not to be necessary, and produces flickering.
18792
18793 2011-03-20 Glenn Morris <rgm@gnu.org>
18794
18795 * config.in: Remove file.
18796
18797 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18798
18799 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18800 are now in src/globals.h.
18801 (syms_of_minibuf): Remove spurious & from previous change.
18802
18803 2011-03-20 Leo Liu <sdl.web@gmail.com>
18804
18805 * minibuf.c (completing-read-function): New variable.
18806 (completing-read-default): Rename from completing-read.
18807 (completing-read): Call completing-read-function.
18808
18809 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18810
18811 * xfaces.c (Fx_load_color_file):
18812 Read color file from absolute filename (bug#8250).
18813
18814 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18815
18816 * makefile.w32-in: Update dependencies.
18817
18818 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18819
18820 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18821
18822 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18823
18824 Fix more problems found by GCC 4.5.2's static checks.
18825
18826 * process.c (make_serial_process_unwind, send_process_trap):
18827 (sigchld_handler): Now static.
18828
18829 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18830 That way, the code declares only the vars that it needs.
18831 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18832 * s/cygwin.h (PTY_ITERATION): Likewise.
18833 * s/darwin.h (PTY_ITERATION): Likewise.
18834 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18835
18836 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18837 * process.c (allocate_pty): Don't declare stb unless it's needed.
18838
18839 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18840 (CONSTANTLIM): Remove; unused.
18841 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18842 Define only if needed.
18843
18844 * unexelf.c (unexec): Name an expression,
18845 to avoid gcc -Wbad-function-cast warning.
18846 Use a different way to cause a compilation error if anyone uses
18847 n rather than nn, a way that does not involve shadowing.
18848 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18849
18850 * deps.mk (unexalpha.o): Remove; unused.
18851
18852 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18853 * unexec.h: New file.
18854 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18855 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18856 Depend on unexec.h.
18857 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18858 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18859 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18860 Change as necessary to match prototype in unexec.h.
18861
18862 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18863 shadowing.
18864 (back_comment, skip_chars): Mark vars as initialized.
18865
18866 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18867 Rename locals to avoid shadowing.
18868
18869 * lread.c (read1): Rewrite so as not to use empty "else".
18870 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18871
18872 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18873
18874 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18875 warning when compiling print.c.
18876
18877 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18878 instead of using an uninitialized var.
18879 (font_sort_entities): Mark var as initialized.
18880
18881 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18882
18883 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18884 pointers to constants.
18885 (font_parse_fcname): Remove unused vars.
18886 (font_delete_unmatched): Now static.
18887 (font_get_spec): Remove; unused.
18888 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18889 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18890 Rename or move locals to avoid shadowing.
18891
18892 * fns.c (require_nesting_list, require_unwind): Now static.
18893 (Ffillarray): Rename locals to avoid shadowing.
18894
18895 * floatfns.c (domain_error2): Define only if needed.
18896 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18897
18898 * alloc.c (mark_backtrace): Move decl from here ...
18899 * lisp.h: ... to here, so that it can be checked.
18900
18901 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18902 (Fdefvar): Rewrite so as not to use empty "else".
18903 (lisp_indirect_variable): Name an expression,
18904 to avoid gcc -Wbad-function-cast warning.
18905 (Fdefvar): Rename locals to avoid shadowing.
18906
18907 * callint.c (quotify_arg, quotify_args): Now static.
18908 (Fcall_interactively): Rename locals to avoid shadowing.
18909 Use const pointer when appropriate.
18910
18911 * lisp.h (get_system_name, get_operating_system_release):
18912 Move decls here, to check interfaces.
18913 * process.c (get_operating_system_release): Move decl to lisp.h.
18914 * xrdb.c (get_system_name): Likewise.
18915 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18916 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18917 some of which prompt warnings from gcc -Wbad-function-cast.
18918 (Fformat_time_string, Fencode_time, Finsert_char):
18919 (Ftranslate_region_internal, Fformat):
18920 Rename or remove local vars to avoid shadowing.
18921 (Ftranslate_region_internal): Mark var as initialized.
18922
18923 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18924 avoid shadowing.
18925
18926 * lisp.h (eassert): Check that the argument compiles, even if
18927 ENABLE_CHECKING is not defined.
18928
18929 * data.c (Findirect_variable): Name an expression, to avoid
18930 gcc -Wbad-function-cast warning.
18931 (default_value, arithcompare, arith_driver, arith_error): Now static.
18932 (store_symval_forwarding): Rename local to avoid shadowing.
18933 (Fmake_variable_buffer_local, Fmake_local_variable):
18934 Mark variables as initialized.
18935 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18936
18937 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18938 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18939 Rename locals to avoid shadowing.
18940 (mark_stack): Move local variables into the #ifdef region where
18941 they're used.
18942 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18943 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18944 needed otherwise.
18945 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18946 (GC_STRING_CHARS): Remove; not used.
18947 (Fmemory_limit): Cast sbrk's returned value to char *.
18948
18949 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18950 avoids undefined behavior in theory.
18951
18952 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18953
18954 Use functions, not macros, for up- and down-casing (Bug#8254).
18955 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18956 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18957 to use the following functions instead of these macros.
18958 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18959 EMACS_INT, since callers assume the returned value fits in int.
18960 (upcase1): Likewise, for UPCASE_TABLE.
18961 (uppercasep, lowercasep, upcase): New static inline functions.
18962 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18963 the race-condition problem in the old DOWNCASE.
18964
18965 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18966 Rename locals to avoid shadowing.
18967 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18968 (regex_compile, re_search_2, re_match_2_internal):
18969 Remove unused local vars.
18970 (FREE_VAR): Rewrite so as not to use empty "else",
18971 which gcc can warn about.
18972 (regex_compile, re_match_2_internal): Mark locals as initialized.
18973 (RETALLOC_IF): Define only if needed.
18974 (WORDCHAR_P): Likewise. This one is never needed, but is used
18975 only in a comment talking about a compiler bug, so put inside
18976 the #if 0 of that comment.
18977 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18978 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18979 Remove; unused.
18980
18981 * search.c (boyer_moore): Rename locals to avoid shadowing.
18982 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18983 (PREV_CHAR_BOUNDARY): Likewise.
18984
18985 * search.c (simple_search): Remove unused var.
18986
18987 * dired.c (compile_pattern): Move decl from here ...
18988 * lisp.h: ... to here, so that it can be checked.
18989 (struct re_registers): New forward decl.
18990
18991 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18992
18993 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18994 All uses changed.
18995 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18996 Rename locals to avoid shadowing.
18997 (Fvertical_motion): Mark locals as initialized.
18998
18999 * casefiddle.c (casify_object, casify_region): Now static.
19000 (casify_region): Mark local as initialized.
19001
19002 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19003
19004 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19005 New macros, so that the caller can use some names other than
19006 gcpro1, gcpro2, etc.
19007 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19008 of the new macros.
19009 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19010 argument, for consistency with GCPRO2_VAR, etc: it is now the
19011 prefix of the variable, not the variable itself. All uses
19012 changed.
19013 * dired.c (directory_files_internal, file_name_completion):
19014 Rename locals to avoid shadowing.
19015
19016 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19017 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19018 dired.c's scmp function, had undefined behavior.
19019 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19020 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19021 * buffer.h: ... to here, because these macros use current_buffer,
19022 and the new implementation with inline functions needs to have
19023 current_buffer in scope now, rather than later when the macros
19024 are used.
19025 (downcase, upcase1): New static inline functions.
19026 (DOWNCASE, UPCASE1): Reimplement using these functions.
19027 This avoids undefined behavior in expressions like
19028 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19029 from race conditions in accessing the global variables
19030 case_temp1 and case_temp2.
19031 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19032 * lisp.h (case_temp1, case_temp2): Remove their decls.
19033 * character.h (ASCII_CHAR_P): Move from here ...
19034 * lisp.h: ... to here, so that the inline functions mentioned
19035 above can use them.
19036
19037 * dired.c (directory_files_internal_unwind): Now static.
19038
19039 * fileio.c (file_name_as_directory, directory_file_name):
19040 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19041 Now static.
19042 (file_name_as_directory): Use const pointers when appropriate.
19043 (Fexpand_file_name): Likewise. In particular, newdir might
19044 point at constant storage, so make it a const pointer.
19045 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19046 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19047 signedness issues.
19048 (Fset_file_times, Finsert_file_contents, auto_save_error):
19049 Rename locals to avoid shadowing.
19050
19051 * minibuf.c (choose_minibuf_frame_1): Now static.
19052 (Ftry_completion, Fall_completions): Rename or remove locals
19053 to avoid shadowing.
19054
19055 * marker.c (bytepos_to_charpos): Remove; unused.
19056
19057 * lisp.h (verify_bytepos, count_markers): New decls,
19058 so that gcc does not warn that these functions aren't declared.
19059
19060 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19061 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19062 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19063 (copy_text): Remove unused local var.
19064
19065 * filelock.c (within_one_second): Now static.
19066 (lock_file_1): Rename local to avoid shadowing.
19067
19068 * buffer.c (fix_overlays_before): Mark locals as initialized.
19069 (fix_start_end_in_overlays): Likewise. This function should be
19070 simplified by using pointers-to-pointers, but that's a different
19071 matter.
19072 (switch_to_buffer_1): Now static.
19073 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19074 (report_overlay_modification): Rename locals to avoid shadowing.
19075
19076 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19077 Fix pointer signedness issue.
19078 (sys_subshell): Mark local as volatile if checking for lint,
19079 to suppress a gcc -Wclobbered warning that does not seem to be right.
19080 (MAXPATHLEN): Define only if needed.
19081
19082 * process.c (serial_open, serial_configure): Move decls from here ...
19083 * systty.h: ... to here, so that they can be checked.
19084
19085 * fns.c (get_random, seed_random): Move extern decls from here ...
19086 * lisp.h: ... to here, so that they can be checked.
19087
19088 * sysdep.c (reset_io): Now static.
19089 (wait_for_termination_signal): Remove; unused.
19090
19091 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19092 (copy_keymap_item, append_key, push_text_char_description):
19093 Now static.
19094 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19095 (DENSE_TABLE_SIZE): Remove; unused.
19096 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19097 (describe_map_tree):
19098 Rename locals to avoid shadowing.
19099
19100 * keyboard.c: Declare functions static if they are not used elsewhere.
19101 (echo_char, echo_dash, cmd_error, top_level_2):
19102 (poll_for_input, handle_async_input): Now static.
19103 (read_char, kbd_buffer_get_event, make_lispy_position):
19104 (make_lispy_event, make_lispy_movement, apply_modifiers):
19105 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19106 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19107 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19108 (read_key_sequence, read_char): Mark locals as initialized.
19109 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19110
19111 * keyboard.h (make_ctrl_char): New decl.
19112 (mark_kboards): Move decl here ...
19113 * alloc.c (mark_kboards): ... from here.
19114
19115 * lisp.h (force_auto_save_soon): New decl.
19116
19117 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19118 (DEFINE_DUMMY_FUNCTION): New macro.
19119 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19120 Use it.
19121 (main): Add casts to avoid warnings
19122 if GCC considers string literals to be constants.
19123
19124 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19125
19126 * dbusbind.c: Pointer signedness fixes.
19127 (xd_signature, xd_append_arg, xd_initialize):
19128 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19129 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19130 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19131 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19132
19133 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19134 if GCC considers string literals to be constants.
19135 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19136
19137 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19138
19139 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19140 (print_preprocess, print_object): New macro to fix last change.
19141
19142 * print.c (print_preprocess): Don't forget font objects.
19143
19144 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19145
19146 * emacs.c (USAGE3): Doc fixes.
19147
19148 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19149
19150 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19151 structure.
19152
19153 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19154
19155 * lisp.h (VWindow_system, Qfile_name_history):
19156 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19157 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19158 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19159
19160 * w32select.c: Don't #include "keyboard.h".
19161 (run_protected): Add extern declaration for waiting_for_input.
19162
19163 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19164 * w32console.c (detect_input_pending, read_input_pending)
19165 (encode_terminal_code):
19166 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19167 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19168 (w32_system_caret_y, Qfile_name_history):
19169 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19170 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19171 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19172 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19173 * w32proc.c (Qlocal, report_file_error):
19174 * w32term.c (Vwindow_system, updating_frame):
19175 * w32uniscribe.c (initialized, uniscribe_font_driver):
19176 Remove unneeded extern declarations.
19177
19178 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19179
19180 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19181
19182 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19183
19184 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19185 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19186 These macros can no longer be used for assignment.
19187
19188 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19189 Assign struct members directly, instead of using BUF_BEGV etc.
19190 (record_buffer_markers, fetch_buffer_markers): New functions for
19191 recording and fetching special buffer markers.
19192 (set_buffer_internal_1, set_buffer_temp): Use them.
19193
19194 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19195
19196 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19197
19198 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19199 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19200
19201 * xdisp.c (hscroll_window_tree):
19202 (reconsider_clip_changes): Use PT instead of BUF_PT.
19203
19204 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19205
19206 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19207 $(EMACS_ROOT)/lib/intprops.h.
19208
19209 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19210
19211 Fix more problems found by GCC 4.5.2's static checks.
19212
19213 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19214 to unsigned char * to avoid compiler diagnostic.
19215 (xg_free_frame_widgets): Make it clear that a local variable is
19216 needed only if USE_GTK_TOOLTIP.
19217 (gdk_window_get_screen): Make it clear that this macro is needed
19218 only if USE_GTK_TOOLTIP.
19219 (int_gtk_range_get_value): New function, which avoids a diagnostic
19220 from gcc -Wbad-function-cast.
19221 (xg_set_toolkit_scroll_bar_thumb): Use it.
19222 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19223 diagnostic from gcc -Wbad-function-cast.
19224 (get_utf8_string, xg_get_file_with_chooser):
19225 Rename locals to avoid shadowing.
19226 (create_dialog): Move locals to avoid shadowing.
19227
19228 * xgselect.c (xg_select): Remove unused var.
19229
19230 * image.c (four_corners_best): Mark locals as initialized.
19231 (gif_load): Initialize transparent_p to zero (Bug#8238).
19232 Mark another local as initialized.
19233 (my_png_error, my_error_exit): Mark with NO_RETURN.
19234
19235 * image.c (clear_image_cache): Now static.
19236 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19237 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19238 (x_edge_detection): Remove unnecessary cast that
19239 gcc -Wbad-function-cast diagnoses.
19240 (gif_load): Fix pointer signedness.
19241 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19242 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19243
19244 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19245
19246 Improve quality of tests for time stamp overflow.
19247 For example, without this patch (encode-time 0 0 0 1 1
19248 1152921504606846976) returns the obviously-bogus value (-948597
19249 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19250 reports time overflow. See
19251 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19252 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19253 * editfns.c: Include limits.h and intprops.h.
19254 (TIME_T_MIN, TIME_T_MAX): New macros.
19255 (time_overflow): Move earlier, to before first use.
19256 (hi_time, lo_time): New functions, for an accurate test for
19257 out-of-range times.
19258 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19259 (Fget_internal_run_time): Don't assume time_t fits in int.
19260 (make_time): Use list2 instead of Fcons twice.
19261 (Fdecode_time): More accurate test for out-of-range times.
19262 (check_tm_member): New function.
19263 (Fencode_time): Use it, to test for out-of-range times.
19264 (lisp_time_argument): Don't rely on undefined left-shift and
19265 right-shift behavior when checking for time stamp overflow.
19266
19267 * editfns.c (time_overflow): New function, refactoring common code.
19268 (Fformat_time_string, Fdecode_time, Fencode_time):
19269 (Fcurrent_time_string): Use it.
19270
19271 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19272 * dired.c (make_time): Move to ...
19273 * editfns.c (make_time): ... here.
19274 * systime.h: Note the move.
19275
19276 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19277
19278 * fringe.c (update_window_fringes): Remove unused variables.
19279
19280 * unexmacosx.c (copy_data_segment): Also copy __got section.
19281 (Bug#8223)
19282
19283 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19284
19285 * termcap.c [MSDOS]: Include "msdos.h".
19286 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19287 Constify `char *' arguments and their references according to
19288 prototypes in tparam.h.
19289
19290 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19291
19292 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19293 Adapt all references accordingly.
19294
19295 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19296
19297 2011-03-11 Tom Tromey <tromey@redhat.com>
19298
19299 * buffer.c (syms_of_buffer): Remove obsolete comment.
19300
19301 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19302
19303 * termhooks.h (encode_terminal_code): Declare prototype.
19304
19305 * msdos.c (encode_terminal_code): Don't declare prototype.
19306
19307 * term.c (encode_terminal_code): Now external again, used by
19308 w32console.c and msdos.c.
19309
19310 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19311 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19312
19313 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19314
19315 Fix some minor problems found by GCC 4.5.2's static checks.
19316
19317 * fringe.c (update_window_fringes): Mark locals as initialized
19318 (Bug#8227).
19319 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19320
19321 * alloc.c (mark_fringe_data): Move decl from here ...
19322 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19323 to check its interface.
19324 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19325
19326 * fontset.c (free_realized_fontset): Now static.
19327 (Fset_fontset_font): Rename local to avoid shadowing.
19328 (fontset_font): Mark local as initialized.
19329 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19330
19331 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19332
19333 * xselect.c (x_disown_buffer_selections): Remove; not used.
19334 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19335 (x_own_selection, Fx_disown_selection_internal): Rename locals
19336 to avoid shadowing.
19337 (x_handle_dnd_message): Remove local to avoid shadowing.
19338
19339 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19340 so that the caller can use some name other than gcpro1.
19341 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19342 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19343 (Fx_backspace_delete_keys_p):
19344 Use them to avoid shadowing, and rename vars to avoid shadowing.
19345 (x_decode_color, x_set_name, x_window): Now static.
19346 (Fx_create_frame): Add braces to silence GCC warning.
19347 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19348 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19349 Remove unused locals.
19350 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19351 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19352 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19353 macros.
19354
19355 * xterm.h (x_mouse_leave): New decl.
19356
19357 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19358 Remove unused functions.
19359 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19360 (x_calc_absolute_position): Now static.
19361 (XTread_socket): Don't define label "out" unless it's used.
19362 Don't declare local "event" unless it's used.
19363 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19364 unless they are used.
19365 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19366 (x_fatal_error_signal): Remove; not used.
19367 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19368 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19369 (x_error_catcher, x_connection_closed, x_error_handler):
19370 (x_error_quitter, xembed_send_message, x_iconify_frame):
19371 (my_log_handler): Rename locals to avoid shadowing.
19372 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19373 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19374
19375 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19376 Rename or move locals to avoid shadowing.
19377 (tty_defined_color, merge_face_heights): Now static.
19378 (free_realized_faces_for_fontset): Remove; not used.
19379 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19380 does not deduce is never used uninitialized.
19381 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19382 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19383
19384 * terminal.c (store_terminal_param): Now static.
19385
19386 * xmenu.c (menu_highlight_callback): Now static.
19387 (set_frame_menubar): Remove unused local.
19388 (xmenu_show): Rename parameter to avoid shadowing.
19389 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19390 since they might point to immutable storage.
19391 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19392 since it's unused otherwise.
19393
19394 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19395 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19396 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19397 avoids a gcc -Wuninitialized diagnostic.
19398 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19399 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19400 does not deduce are never used uninitialized.
19401
19402 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19403
19404 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19405 * window.c (window_loop, size_window):
19406 (run_window_configuration_change_hook, enlarge_window): Likewise.
19407
19408 * window.c (display_buffer): Now static.
19409 (size_window): Mark variables that gcc -Wuninitialized
19410 does not deduce are never used uninitialized.
19411 * window.h (check_all_windows): New decl, to forestall
19412 gcc -Wmissing-prototypes diagnostic.
19413 * dispextern.h (bidi_dump_cached_states): Likewise.
19414
19415 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19416 shadowing.
19417 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19418 Include <limits.h>.
19419 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19420 and to avoid gcc -Wuninitialized warning.
19421 (load_charset_map): Mark variables that gcc -Wuninitialized
19422 does not deduce are never used uninitialized.
19423 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19424
19425 * coding.c (coding_set_source, coding_set_destination):
19426 Use "else { /* comment */ }" rather than "else /* comment */;"
19427 for clarity, and to avoid gcc -Wempty-body warning.
19428 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19429 a block, when the outer 'i' will do.
19430 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19431 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19432 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19433 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19434 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19435 Rename locals to avoid shadowing.
19436 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19437 * coding.c (emacs_mule_char, encode_invocation_designation):
19438 Now static, since they're not used elsewhere.
19439 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19440 (decode_coding_object, encode_coding_object, detect_coding_system):
19441 (decode_coding_emacs_mule): Mark variables that gcc
19442 -Wuninitialized does not deduce are never used uninitialized.
19443 (detect_coding_iso_2022): Initialize a local variable that might
19444 be used uninitialized. Leave a FIXME because it's not clear that
19445 this initialization is needed. (Bug#8211)
19446 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19447 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19448 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19449 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19450 Remove unused macros.
19451
19452 * category.c (hash_get_category_set): Remove unused local var.
19453 (copy_category_table): Now static, since it's not used elsewhere.
19454 * character.c (string_count_byte8): Likewise.
19455
19456 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19457 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19458
19459 * chartab.c (copy_sub_char_table): Now static, since it's not used
19460 elsewhere.
19461 (sub_char_table_ref_and_range, char_table_ref_and_range):
19462 Rename locals to avoid shadowing.
19463 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19464
19465 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19466 (BIDI_BOB): Remove unused macro.
19467
19468 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19469 deduce are never used uninitialized.
19470 * term.c (encode_terminal_code): Likewise.
19471
19472 * term.c (encode_terminal_code): Now static. Remove unused local.
19473
19474 * tparam.h: New file.
19475 * term.c, tparam.h: Include it.
19476 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19477 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19478 Move these decls to tparam.h, and make them agree with what
19479 is actually in tparam.c. The previous trick of using incompatible
19480 decls in different modules does not conform to the C standard.
19481 All callers of tparam changed to use tparam's actual API.
19482 * tparam.c (tparam1, tparam, tgoto):
19483 Use const pointers where appropriate.
19484
19485 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19486 * cm.h (struct cm): Likewise.
19487 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19488 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19489 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19490 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19491 (turn_on_face, init_tty): Likewise.
19492 * termchar.h (struct tty_display_info): Likewise.
19493
19494 * term.c (term_mouse_position): Rename local to avoid shadowing.
19495
19496 * alloc.c (mark_ttys): Move decl from here ...
19497 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19498
19499 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19500
19501 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19502
19503 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19504
19505 * search.c (compile_pattern_1): Remove argument regp, unused since
19506 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19507 (compile_pattern): Don't pass it.
19508
19509 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19510
19511 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19512 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19513 for ! HAVE_GTK3.
19514 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19515
19516 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19517
19518 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19519 gdk_window_get_screen, gdk_window_get_geometry,
19520 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19521 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19522 (xg_get_pixbuf_from_pixmap): New function.
19523 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19524 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19525 Call xg_get_pixbuf_from_pixmap instead of
19526 gdk_pixbuf_get_from_drawable.
19527 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19528 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19529 (xg_check_special_colors): Use GtkStyleContext and its functions
19530 for HAVE_GTK3.
19531 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19532 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19533 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19534 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19535 Call gtk_widget_get_preferred_size.
19536 (xg_frame_resized): gdk_window_get_geometry only takes 5
19537 parameters.
19538 (xg_win_to_widget, xg_event_is_for_menubar):
19539 Call gdk_x11_window_lookup_for_display.
19540 (xg_set_widget_bg): New function.
19541 (delete_cb): New function.
19542 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19543 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19544 (xg_set_background_color): Call xg_set_widget_bg.
19545 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19546 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19547 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19548 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19549 if ! HAVE_GTK3.
19550 (update_frame_tool_bar): Call gtk_widget_hide.
19551 (xg_initialize): Use GDK_KEY_g.
19552
19553 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19554 if ! HAVE_GTK3
19555 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19556
19557 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19558 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19559 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19560
19561 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19562
19563 * w32xfns.c (select_palette): Check success of RealizePalette against
19564 GDI_ERROR, not zero.
19565
19566 See ChangeLog.11 for earlier changes.
19567
19568 ;; Local Variables:
19569 ;; coding: utf-8
19570 ;; End:
19571
19572 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19573
19574 This file is part of GNU Emacs.
19575
19576 GNU Emacs is free software: you can redistribute it and/or modify
19577 it under the terms of the GNU General Public License as published by
19578 the Free Software Foundation, either version 3 of the License, or
19579 (at your option) any later version.
19580
19581 GNU Emacs is distributed in the hope that it will be useful,
19582 but WITHOUT ANY WARRANTY; without even the implied warranty of
19583 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19584 GNU General Public License for more details.
19585
19586 You should have received a copy of the GNU General Public License
19587 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.